SOCU:gethostbyname: Difference between revisions

Created page with "=Request= {| class="wikitable" border="1" |- ! Index Word ! Description |- | 0 | Header code [0x000D0082] |- | 1 | Input hostname buffer size, including null-terminator. |- | 2..."
 
DaniElectra (talk | contribs)
Description: Add hostent struct docs
 
(One intermediate revision by one other user not shown)
Line 15: Line 15:
|-
|-
| 3
| 3
| (insize<<14)  <nowiki>|</nowiki> 2
| (insize<<14)  <nowiki>|</nowiki> 0xC02
|-
|-
| 4
| 4
Line 50: Line 50:
|}
|}


=Description=
=struct hostent=
It's currently unknown how the output buffer is converted into a hostent struct.
Internally the sysmodule uses the standard hostent struct, but using s16 for h_addrtype and h_length:
 
struct hostent {
char*  h_name;
char** h_aliases;
s16    h_addrtype;
s16    h_length;
char** h_addr_list;
};
 
However, the struct returned is different from the internal one:
 
struct hostent_3ds_t {
s16          h_addrtype;    //< Host address type
s16          h_length;      //< Length of address. Maximum of 16 for IPV6
s16          h_addr_count;  //< Number of addresses returned. Maximum of 24
s16          h_alias_count; //< Number of aliases returned. Maximum of 24
char[256]    h_name;        //< Official name of host
char[256][24] h_aliases;    //< Alias list
char[16][24]  h_addr_list;  //< List of addresses from name server
};
 
Its size is of 0x1A88 bytes.