The format of an internet addresses block is:
Offset Contents
0 Address family
2 Port number
4 IP address
8 Reserved (should be zero)
12 Reserved (should be zero)
Note: Port and IP address should be in network byte order - also known as 'big endian' - the reverse of the format used by the ARM processor on RISC OS machines.
The internet form of an address is (in C):
struct sockaddr_in {
unsigned short sin_family; /* address family (AF_INET) */
unsigned short sin_port; /* port number */
struct in_addr sin_addr; /* internet address (sin_addr.s_addr) */
char sin_zero[8]; /* zero padding */
};
This address format is deprecated, from Internet 5.00 onwards this sockaddr format should be used in preference. In the case of accept, getpeername, getsockname, recvfrom, recvmsg, sendmsg this also requires calling the alternate SWI number (so that the Internet module can be confident you know which address block style is expected).
|
|
|