Watt-32 tcp/ip  2.2 dev-rel.10
Functions
bsdname.c File Reference

Go to the source code of this file.

Functions

DWORD W32_CALL _gethostid (void)
 Core style: Returns local IPv4-address. More...
 
DWORD W32_CALL _sethostid (DWORD ip)
 Core-style: Sets local IPv4-address. More...
 
XHOSTID_RETV W32_CALL gethostid (void)
 BSD style: returns local IPv4-address. More...
 
XHOSTID_RETV W32_CALL sethostid (DWORD ip)
 BSD-style: Sets local IPv4-address. More...
 
const void_gethostid6 (void)
 Core-style: Returns local IPv6-address. More...
 
void _sethostid6 (const void *addr)
 Core-style: Sets local IPv6-address. More...
 
int W32_CALL _getpeername (const sock_type *s, void *dest, int *len)
 Core-style:
Return 'watt_sockaddr' for peer in a UDP/TCP connection.
 
int W32_CALL _getsockname (const sock_type *s, void *dest, int *len)
 Core-style:
Return 'watt_sockaddr' for our side of a UDP/TCP connection.
 
int W32_CALL getdomainname (char *buffer, size_t buflen)
 BSD-style:
Return domain name of this host. More...
 
int W32_CALL setdomainname (const char *name, size_t len)
 BSD-style:
Set the host's domain name. More...
 
int W32_CALL gethostname (char *buffer, GETHOSTNAME_ARG2 buflen)
 
int W32_CALL sethostname (const char *fqdn, SETHOSTNAME_ARG2 len)
 BSD-style:
Expects a "Fully Qualified Domain Name" in `fqdn'. More...
 
int _get_machine_name (char *buf, int size)
 Try asking a LAN extension of DOS for a host-name. More...
 

Detailed Description

BSD and core-style name function.

Deprecated:
Oldstyle BSD similar functions are prefixed with '_'.

Definition in file bsdname.c.

Function Documentation

int _get_machine_name ( char *  buf,
int  size 
)

Try asking a LAN extension of DOS for a host-name.

Work for a DOS-box under Windows-XP.

Definition at line 351 of file bsdname.c.

DWORD W32_CALL _gethostid ( void  )

Core style: Returns local IPv4-address.

Return values
addresson host order.

Definition at line 49 of file bsdname.c.

References my_ip_addr.

const void* _gethostid6 ( void  )

Core-style: Returns local IPv6-address.

Note
no BSD equivalent for this.
Return values
pointerto current local IPv6 address.

Definition at line 91 of file bsdname.c.

References netdb_init().

DWORD W32_CALL _sethostid ( DWORD  ip)

Core-style: Sets local IPv4-address.

Return values
addresson host order.

Definition at line 58 of file bsdname.c.

References my_ip_addr.

void _sethostid6 ( const void addr)

Core-style: Sets local IPv6-address.

Note
no BSD equivalent for this.

Definition at line 102 of file bsdname.c.

int W32_CALL getdomainname ( char *  buffer,
size_t  buflen 
)

BSD-style:
Return domain name of this host.

As per BSD spec, the resultant buffer ... ... "will be null-terminated _unless_there_is_insufficient_space_";

Set errno on failure and return -1.

Definition at line 186 of file bsdname.c.

W32_FUNC u_long W32_CALL gethostid ( void  )

BSD style: returns local IPv4-address.

Return values
addresson network order.

Definition at line 68 of file bsdname.c.

References my_ip_addr, and netdb_init().

int W32_CALL setdomainname ( const char *  name,
size_t  len 
)

BSD-style:
Set the host's domain name.

Set errno on failure and return -1.

Definition at line 213 of file bsdname.c.

References _strlcpy(), and defaultdomain.

XHOSTID_RETV W32_CALL sethostid ( DWORD  ip)

BSD-style: Sets local IPv4-address.

Return values
addresson host order.

Definition at line 79 of file bsdname.c.

References my_ip_addr.

int W32_CALL sethostname ( const char *  fqdn,
SETHOSTNAME_ARG2  len 
)

BSD-style:
Expects a "Fully Qualified Domain Name" in `fqdn'.

Split at first `.' and extract `hostname' and `def_domain'. Set errno on failure and return -1.

Todo:
: should do complete alpha/digit/underscore check here

Definition at line 293 of file bsdname.c.

References hostname, and setdomainname().