Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
242 user(s) are online (153 user(s) are browsing Forums)

Members: 0
Guests: 242

more...

Headlines

 
  Register To Post  

need help to deal with old commodore and amitcp network calls
Home away from home
Home away from home


See User information
@All
Porting now ftp library for dopus5, and while all objects compiles, i still fail on linking with bunch of undefs to amitcp_* function calls, and to as225_* function calls. First i want to build os3 version, and later native ones.

There is their header where they define/pragma those calls:

#ifndef AD_INTERNET_EXTERN_H
#define AD_INTERNET_EXTERN_H

/* AS225 */

int as225_accept (intstruct sockaddr *, int *);
int as225_bind (intstruct sockaddr *, int );
void as225_cleanup_sockets void ) ;
int as225_connect (intstruct sockaddr *, int);
struct hostent *as225_gethostbyname char * );
int as225_gethostname (char *, int);
struct servent *as225_getservbyname char *, char * );
struct servent *as225_getservbyport intchar * );
int as225_getsockname intstruct sockaddr *, int * );
u_long as225_inet_addr char * );
int as225_listen (int int);
int as225_recv(intchar *, intint );
int as225_selectwait (intfd_set *, fd_set *, fd_set *, struct timeval *, long *);
int as225_send (intchar *, intint );
int as225_setsockoptintintintchar *, int );
ULONG as225_setup_sockets UWORDint * );
int as225_shutdown (intint);
int as225_socketintintint );

#pragma libcall SocketBase as225_setup_sockets 1e 8102
#pragma libcall SocketBase as225_cleanup_sockets 24 0
#pragma libcall SocketBase as225_socket 2a 21003
#pragma libcall SocketBase as225_s_close 30 001
#pragma libcall SocketBase as225_gethostname 72 0802
#pragma libcall SocketBase as225_gethostbyname 8a 801
#pragma libcall SocketBase as225_inet_addr 96 901
#pragma libcall SocketBase as225_accept ba 98003
#pragma libcall SocketBase as225_bind c0 19003
#pragma libcall SocketBase as225_connect c6 19003
#pragma libcall SocketBase as225_listen d2 1002
#pragma libcall SocketBase as225_recv d8 218004
#pragma libcall SocketBase as225_selectwait f0 21A98006
#pragma libcall SocketBase as225_send f6 918004
#pragma libcall SocketBase as225_shutdown 108 1002
#pragma libcall SocketBase as225_setsockopt 10e 3821005
#pragma libcall SocketBase as225_getservbyname 168 9802
#pragma libcall SocketBase as225_getservbyport 16e 8002
#pragma libcall SocketBase as225_getsockname 19e 98003

/* AMITCTP */

LONG amitcp_Accept(LONG sstruct sockaddr *addrLONG *addrlen);
LONG amitcp_Bind(LONG s,  struct sockaddr *nameLONG namelen);
LONG amitcp_CloseSocket(LONG d);
LONG amitcp_Connect(LONG s,  struct sockaddr *nameLONG namelen);
struct hostent  *amitcp_GetHostByNameUBYTE *name);
LONG amitcp_GetHostName(STRPTR hostnameLONG size);          /* V3 */
struct servent  *amitcp_GetServByNameUBYTE *name,  UBYTE *proto);
struct servent  *amitcp_GetServByPortLONG,  UBYTE *proto);
LONG amitcp_GetSockName(LONG sstruct sockaddr *nameLONG *namelen);
ULONG amitcp_Inet_AddrUBYTE *);
LONG amitcp_Listen(LONG sLONG backlog);
LONG amitcp_Recv(LONG sUBYTE *bufLONG lenLONG flags);    /* V3 */
LONG amitcp_Send(LONG s,  UBYTE *msgLONG lenLONG flags);
LONG amitcp_SetErrnoPtr(void *errno_pLONG size);
LONG amitcp_SetSockOpt(LONG sLONG levelLONG optname,
        const 
void *optvalLONG optlen);
LONG amitcp_Socket(LONG domainLONG typeLONG protocol);
LONG amitcp_Shutdown(LONG sLONG how);
LONG amitcp_WaitSelect(LONG nfdsfd_set *readfdsfd_set *writefdsfd_set *exeptfds,
        
struct timeval *timeoutULONG *maskp);
        
#pragma libcall SocketBase amitcp_Socket 1E 21003
#pragma libcall SocketBase amitcp_Bind 24 18003
#pragma libcall SocketBase amitcp_Listen 2A 1002
#pragma libcall SocketBase amitcp_Accept 30 98003
#pragma libcall SocketBase amitcp_Connect 36 18003
#pragma libcall SocketBase amitcp_Send 42 218004
#pragma libcall SocketBase amitcp_Recv 4E 218004
#pragma libcall SocketBase amitcp_Shutdown 54 1002
#pragma libcall SocketBase amitcp_SetSockOpt 5A 3821005
#pragma libcall SocketBase amitcp_GetSockName 66 98003
#pragma libcall SocketBase amitcp_CloseSocket 78 001
#pragma libcall SocketBase amitcp_WaitSelect 7E 1BA98006
#pragma libcall SocketBase amitcp_SetErrnoPtr A8 0802
#pragma libcall SocketBase amitcp_Inet_Addr B4 801
#pragma libcall SocketBase amitcp_GetHostByName D2 801
#pragma libcall SocketBase amitcp_GetServByName EA 9802
#pragma libcall SocketBase amitcp_GetServByPort F0 8002
#pragma libcall SocketBase amitcp_GetHostName 11A 0802

/* GENERIC */

int accept (intstruct sockaddr *, int *);
int bind (intstruct sockaddr *, int );
void cleanup_sockets void ) ;
int connect (intstruct sockaddr *, int);
struct hostent *gethostbyname char * );
int gethostname (char *, int);
struct servent *getservbyname char *, char * );
struct servent *getservbyport intchar * );
int getsockname intstruct sockaddr *, int * );
u_long inet_addr char * );
int listen (int int);
int recv(intchar *, intint );
int s_close ( int ) ;
int selectwait (intfd_set *, fd_set *, fd_set *, struct timeval *, long *);
int send (intchar *, intint );
ULONG setup_sockets UWORDint * );
int shutdown (intint);
int socketintintint );

#endif


That kind of info which i only get from Itix for now:

Quote:

as225_#? functions is IIRC this old and obsolete Commodore networking library which was replaced by superior bsdsocket.library by 3rd party vendors. We can drop it.

amitcp_#? prefixed calls are just standard bsdsocket.library calls that were prefixed with "amitcp_" and words in function names were changed to start with uppercase letters. Remove this prefix and then change names to lower case except incalls which were added for Amiga only: CloseSocket(), WaitSelect() and SetErrnoPtr().


So, that what i do:

1. I removed all pragma libcall parts
2. add #include <sys/socket.h> and removed generic protos (as they will conflict with sys/socket.h)

And that what i have on linking:

ftp_lister.o(.text+0x138a): In function `ftplister_cleanup':
ftp_lister.c:1232: undefined reference to 
`as225_cleanup_sockets'
ftp_lister.o(.text+0x1410): In function `ftplister_init'
:
ftp_lister.c:1264undefined reference to `amitcp_SetErrnoPtr'
ftp_lister.o(.text+0x1422):ftp_lister.c:1264: undefined reference to 
`as225_setup_sockets'
ftp.o(.text+0x640): In function `_ftp'
:
ftp.c:340undefined reference to `amitcp_Send'
ftp.o(.text+0x652):ftp.c:340: undefined reference to 
`as225_send'
ftp.o(.text+0x7f0): In function `ftp_abor'
:
ftp.c:438undefined reference to `amitcp_Send'
ftp.o(.text+0x806):ftp.c:438: undefined reference to 
`as225_send'
ftp.o(.text+0x836):ftp.c:441: undefined reference to `amitcp_Send'
ftp.o(.text+0x84e):ftp.c:441undefined reference to `as225_send'
ftp.o(.text+0x892):ftp.c:448: undefined reference to 
`amitcp_Send'
ftp.o(.text+0x8a8):ftp.c:448: undefined reference to `as225_send'
ftp.o(.text+0x93e): In function `opendataconn':
ftp.c:473: undefined reference to 
`amitcp_Socket'
ftp.o(.text+0x950):ftp.c:473: undefined reference to `as225_socket'
ftp.o(.text+0x9a2):ftp.c:488undefined reference to `amitcp_Connect'
ftp.o(.text+0x9bc):ftp.c:488: undefined reference to 
`as225_connect'
ftp.o(.text+0x9d8):ftp.c:497: undefined reference to `as225_s_close'
ftp.o(.text+0xa04):ftp.c:510undefined reference to `amitcp_GetSockName'
ftp.o(.text+0xa1a):ftp.c:510: undefined reference to 
`as225_getsockname'
ftp.o(.text+0xa36):ftp.c:515: undefined reference to `amitcp_Bind'
ftp.o(.text+0xa50):ftp.c:515undefined reference to `as225_bind'
ftp.o(.text+0xa6e):ftp.c:518: undefined reference to 
`amitcp_GetSockName'
ftp.o(.text+0xa86):ftp.c:518: undefined reference to `as225_getsockname'
ftp.o(.text+0xaa0):ftp.c:520undefined reference to `amitcp_Listen'
ftp.o(.text+0xab4):ftp.c:520: undefined reference to 
`as225_listen'
ftp.o(.text+0xb22):ftp.c:547: undefined reference to `amitcp_CloseSocket'
ftp.o(.text+0xb2c):ftp.c:547undefined reference to `as225_s_close'
ftp.o(.text+0xb9c): In function 
`dataconna':
ftp.c:591: undefined reference to `amitcp_SetSockOpt'
ftp.o(.text+0xbb6):ftp.c:591undefined reference to `as225_setsockopt'
ftp.o(.text+0xbd6):ftp.c:596: undefined reference to 
`amitcp_SetSockOpt'
ftp.o(.text+0xbee):ftp.c:596: undefined reference to `as225_setsockopt'
ftp.o(.text+0xc5c):ftp.c:627undefined reference to `amitcp_Accept'
ftp.o(.text+0xc6e):ftp.c:627: undefined reference to 
`as225_accept'
ftp.o(.text+0xc82):ftp.c:629: undefined reference to `amitcp_CloseSocket'
ftp.o(.text+0xc8c):ftp.c:629undefined reference to `as225_s_close'
ftp.o(.text+0xfcc): In function 
`get':
ftp.c:814: undefined reference to `amitcp_WaitSelect'
ftp.o(.text+0xff2):ftp.c:814undefined reference to `as225_selectwait'
ftp.o(.text+0x1020):ftp.c:820: undefined reference to 
`amitcp_Recv'
ftp.o(.text+0x1032):ftp.c:820: undefined reference to `as225_recv'
ftp.o(.text+0x112c):ftp.c:884undefined reference to `amitcp_CloseSocket'
ftp.o(.text+0x1136):ftp.c:884: undefined reference to 
`as225_s_close'
ftp.o(.text+0x1284): In function `iread'
:
ftp.c:957undefined reference to `amitcp_WaitSelect'
ftp.o(.text+0x12a8):ftp.c:957: undefined reference to 
`as225_selectwait'
ftp.o(.text+0x12e2):ftp.c:966: undefined reference to `amitcp_Recv'
ftp.o(.text+0x12f8):ftp.c:966undefined reference to `as225_recv'
ftp.o(.text+0x152a): In function 
`sgetc':
ftp.c:1132: undefined reference to `amitcp_WaitSelect'
ftp.o(.text+0x1544):ftp.c:1132undefined reference to `as225_selectwait'
ftp.o(.text+0x159e):ftp.c:1150: undefined reference to 
`amitcp_Recv'
ftp.o(.text+0x15b2):ftp.c:1150: undefined reference to `as225_recv'
ftp.o(.text+0x1744): In function `list':
ftp.c:1293: undefined reference to 
`amitcp_CloseSocket'
ftp.o(.text+0x174e):ftp.c:1293: undefined reference to `as225_s_close'
ftp.o(.text+0x1994): In function `put':
ftp.c:1410: undefined reference to 
`amitcp_WaitSelect'
ftp.o(.text+0x19b8):ftp.c:1410: undefined reference to `as225_selectwait'
ftp.o(.text+0x1a04):ftp.c:1416undefined reference to `amitcp_Send'
ftp.o(.text+0x1a14):ftp.c:1416: undefined reference to 
`as225_send'
ftp.o(.text+0x1af4):ftp.c:1468: undefined reference to `amitcp_CloseSocket'
ftp.o(.text+0x1afe):ftp.c:1468undefined reference to `as225_s_close'
ftp.o(.text+0x1b7c): In function 
`gethost':
ftp.c:1498: undefined reference to `amitcp_Inet_Addr'
ftp.o(.text+0x1b86):ftp.c:1498undefined reference to `as225_inet_addr'
ftp.o(.text+0x1ba6):ftp.c:1506: undefined reference to 
`amitcp_GetHostByName'
ftp.o(.text+0x1bb0):ftp.c:1506: undefined reference to `as225_gethostbyname'
ftp.o(.text+0x1c9e): In function `connect_host':
ftp.c:1552: undefined reference to 
`amitcp_GetServByName'
ftp.o(.text+0x1cae):ftp.c:1552: undefined reference to `as225_getservbyname'
ftp.o(.text+0x1cd8):ftp.c:1562undefined reference to `amitcp_Socket'
ftp.o(.text+0x1cec):ftp.c:1562: undefined reference to 
`as225_socket'
ftp.o(.text+0x1d0c):ftp.c:1568: undefined reference to `amitcp_Connect'
ftp.o(.text+0x1d26):ftp.c:1568undefined reference to `as225_connect'
ftp.o(.text+0x1d48):ftp.c:1573: undefined reference to 
`amitcp_GetSockName'
ftp.o(.text+0x1d66):ftp.c:1573: undefined reference to `as225_getsockname'
ftp.o(.text+0x1d94):ftp.c:1580undefined reference to `amitcp_SetSockOpt'
ftp.o(.text+0x1dae):ftp.c:1580: undefined reference to 
`as225_setsockopt'
ftp.o(.text+0x1e10):ftp.c:1602: undefined reference to `amitcp_CloseSocket'
ftp.o(.text+0x1e1c):ftp.c:1602undefined reference to `as225_s_close'
ftp.o(.text+0x1ed0): In function 
`disconnect_host':
ftp.c:1655: undefined reference to `amitcp_CloseSocket'
ftp.o(.text+0x1eda):ftp.c:1655undefined reference to `as225_s_close'
ftp.o(.text+0x1f0e): In function 
`lostconn':
ftp.c:1671: undefined reference to `amitcp_Shutdown'
ftp.o(.text+0x1f1c):ftp.c:1671undefined reference to `as225_shutdown'
ftp.o(.text+0x1f2e):ftp.c:1672: undefined reference to 
`amitcp_CloseSocket'
ftp.o(.text+0x1f3a):ftp.c:1672: undefined reference to `as225_s_close'
ftp_util.o(.text+0x224): In function `getuseraddress':
ftp_util.c:163: undefined reference to 
`amitcp_GetHostName'
ftp_util.o(.text+0x23c):ftp_util.c:163: undefined reference to `as225_gethostname'
ftp_recursive.o(.text+0x3486): In function `rec_ftp_select':
ftp_recursive.c:3085: undefined reference to 
`amitcp_WaitSelect'
ftp_recursive.o(.text+0x34a2):ftp_recursive.c:3085: undefined reference to `as225_selectwait'


Then i try to start from AmiTCP calls, and do such redefine:

#define amitcp_Accept accept

All compiles fine, but on linking have undefs to new accept. Should i download somewhere bsdsocket sdk for os3 to use with ? I somehow think that its all in package already (at least if sys/socket.h present, and accept() is defined here, it should works, but maybe again that ixemul crap should be used..).

Have anyone clues/ideas ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: need help to deal with old commodore and amitcp network calls
Home away from home
Home away from home


See User information
@all
I build os4 native version just with commenting out all those defines of amitcp/as_x functions, and do it just like:

#define    amitcp_Accept accept
#define amitcp_Bind bind
#define amitcp_CloseSocket CloseSocket
#define amitcp_Connect connect

#define amitcp_GetHostName gethostname
#define amitcp_GetSockName getsockname

#define amitcp_Recv recv
#define amitcp_Send send

#define amitcp_Shutdown Shutdown
#define amitcp_WaitSelect WaitSelect

#define s_close CloseSocket
#define selectwait WaitSelect
#define setup_sockets(uw,ip)    (SetErrnoPtr( ip, sizeof( *ip ) ), TRUE) 

#define as225_gethostname gethostname


For os3 still fails to links because of that connect/bind/send undefs, so i assume i need there self made bsdsocket inlines for or so.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: need help to deal with old commodore and amitcp network calls
Amigans Defender
Amigans Defender


See User information
http://aminet.net/package/comm/tcp/socket_lib12
Unfortunately there's no header file or you'd be able to build directly against it.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project