@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 (int, struct sockaddr *, int *);
int as225_bind (int, struct sockaddr *, int );
void as225_cleanup_sockets ( void ) ;
int as225_connect (int, struct sockaddr *, int);
struct hostent *as225_gethostbyname ( char * );
int as225_gethostname (char *, int);
struct servent *as225_getservbyname ( char *, char * );
struct servent *as225_getservbyport ( int, char * );
int as225_getsockname ( int, struct sockaddr *, int * );
u_long as225_inet_addr ( char * );
int as225_listen (int , int);
int as225_recv(int, char *, int, int );
int as225_selectwait (int, fd_set *, fd_set *, fd_set *, struct timeval *, long *);
int as225_send (int, char *, int, int );
int as225_setsockopt( int, int, int, char *, int );
ULONG as225_setup_sockets ( UWORD, int * );
int as225_shutdown (int, int);
int as225_socket( int, int, int );
#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 s, struct sockaddr *addr, LONG *addrlen);
LONG amitcp_Bind(LONG s, struct sockaddr *name, LONG namelen);
LONG amitcp_CloseSocket(LONG d);
LONG amitcp_Connect(LONG s, struct sockaddr *name, LONG namelen);
struct hostent *amitcp_GetHostByName( UBYTE *name);
LONG amitcp_GetHostName(STRPTR hostname, LONG size); /* V3 */
struct servent *amitcp_GetServByName( UBYTE *name, UBYTE *proto);
struct servent *amitcp_GetServByPort( LONG, UBYTE *proto);
LONG amitcp_GetSockName(LONG s, struct sockaddr *name, LONG *namelen);
ULONG amitcp_Inet_Addr( UBYTE *);
LONG amitcp_Listen(LONG s, LONG backlog);
LONG amitcp_Recv(LONG s, UBYTE *buf, LONG len, LONG flags); /* V3 */
LONG amitcp_Send(LONG s, UBYTE *msg, LONG len, LONG flags);
LONG amitcp_SetErrnoPtr(void *errno_p, LONG size);
LONG amitcp_SetSockOpt(LONG s, LONG level, LONG optname,
const void *optval, LONG optlen);
LONG amitcp_Socket(LONG domain, LONG type, LONG protocol);
LONG amitcp_Shutdown(LONG s, LONG how);
LONG amitcp_WaitSelect(LONG nfds, fd_set *readfds, fd_set *writefds, fd_set *exeptfds,
struct timeval *timeout, ULONG *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 (int, struct sockaddr *, int *);
int bind (int, struct sockaddr *, int );
void cleanup_sockets ( void ) ;
int connect (int, struct sockaddr *, int);
struct hostent *gethostbyname ( char * );
int gethostname (char *, int);
struct servent *getservbyname ( char *, char * );
struct servent *getservbyport ( int, char * );
int getsockname ( int, struct sockaddr *, int * );
u_long inet_addr ( char * );
int listen (int , int);
int recv(int, char *, int, int );
int s_close ( int ) ;
int selectwait (int, fd_set *, fd_set *, fd_set *, struct timeval *, long *);
int send (int, char *, int, int );
ULONG setup_sockets ( UWORD, int * );
int shutdown (int, int);
int socket( int, int, int );
#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:1264: undefined 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:340: undefined 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:438: undefined 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:441: undefined 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:488: undefined 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:510: undefined 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:515: undefined 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:520: undefined 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:547: undefined 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:591: undefined 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:627: undefined 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:629: undefined 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:814: undefined 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:884: undefined 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:957: undefined 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:966: undefined 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:1132: undefined 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:1416: undefined 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:1468: undefined 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:1498: undefined 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:1562: undefined 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:1568: undefined 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:1580: undefined 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:1602: undefined 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:1655: undefined 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:1671: undefined 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 ?