Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..
507 views

FTP script gives unexpected pointer error

Jump to solution

Hi,

I am writing a script to test ftp services, and I am trying to write a script for sftp traffic. I creted an ftp script, and the only code in it is this:

    int ftp;

   ftp_logon_ex(&ftp,
                 "FTP",
                 "URL=ftps://user@testserver",
                 "ClientPassword=zzzzzzzzzzz",
                 "AUTH SSL=TRUE",
                 LAST );

 

But compiling gives the error:

type error in argument 1 to `ftp_logon_ex'; found `pointer to pointer to int' expected `pointer to pointer to unsigned int'

Can somebody explain what I am doing wrong here?

Tags (2)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: FTP script gives unexpected pointer error

Jump to solution

You can remove the typedef, because it is part of the mic_ftp.h.

You change the line:

int ftp;

by

FTP ftp;

Now the error should be gone.

Note that this is rather basic C-programming: Reading the API help (Function Reference), using the includes etc. It might help your productivity to improve your C programming skills.

Signature:
Reward community members who take time to respond and help.

View solution in original post

4 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: FTP script gives unexpected pointer error

Jump to solution

In the documentation (12.55) of the function ftp_logon_ex() is the first argument declared as 'FTP *ppftp'.

You used in your code 'int ftp' try to replace it with 'FTP ftp'. When the FTP type is not declared add to your globals.h (or put it at top of vuser_init.c) the line:

typedef unsigned int *FTP;

It declares the type 'FTP' as a pointer to an 'unsigned int'

Note:

When you start with an FTP recording script you should have a Extra File named globals.h with the line

#include "mic_ftp.h"

This should take care of the FTP type definition.

 

Signature:
Reward community members who take time to respond and help.
0 Likes
Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..

Re: FTP script gives unexpected pointer error

Jump to solution

So my globals.h looks like this now:

#ifndef _GLOBALS_H 
#define _GLOBALS_H

#include "mic_ftp.h"

typedef unsigned int *FTP;

#endif // _GLOBALS_H  

 

But what do I change in the action? I do not completely understand what you mean there. 

 

 

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: FTP script gives unexpected pointer error

Jump to solution

You can remove the typedef, because it is part of the mic_ftp.h.

You change the line:

int ftp;

by

FTP ftp;

Now the error should be gone.

Note that this is rather basic C-programming: Reading the API help (Function Reference), using the includes etc. It might help your productivity to improve your C programming skills.

Signature:
Reward community members who take time to respond and help.

View solution in original post

Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..

Re: FTP script gives unexpected pointer error

Jump to solution

Hi, yes , that is it, Thanks!

I use mostly the Tru client protocols because it fits better with pour applications, and I am putting most effort into learning javascript right now. So my C programming is unfortunately not that developed. But I appreciate your help a lot here!

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.