34,18 → 34,14 |
* |
*/ |
|
#ifndef __NET_SOCKADDR_H__ |
#define __NET_SOCKADDR_H__ |
#ifndef __NET_INET_H__ |
#define __NET_INET_H__ |
|
#include <sys/types.h> |
|
#define INET_ADDRSTRLEN ( 4 * 3 + 3 + 1 ) |
#define INET6_ADDRSTRLEN ( 8 * 4 + 7 + 1 ) |
#include "byteorder.h" |
|
typedef struct sockaddr sockaddr_t; |
typedef struct in_addr in_addr_t; |
typedef struct sockaddr_in sockaddr_in_t; |
typedef struct sockaddr_in6 sockaddr_in6_t; |
typedef struct addrinfo addrinfo_t; |
|
int inet_ntop( uint16_t family, const uint8_t * data, char * address, size_t length ); |
56,29 → 52,6 |
uint8_t sa_data[ 14 ]; // 14 bytes of protocol address |
}; |
|
struct in_addr{ |
uint32_t s_addr; // that's a 32-bit int (4 bytes) |
}; |
|
struct sockaddr_in{ |
uint16_t sin_family; // Address family, AF_INET |
uint16_t sin_port; // Port number |
struct in_addr sin_addr; // Internet address |
uint8_t sin_zero[ 8 ]; // Same size as struct sockaddr |
}; |
|
struct in6_addr{ |
unsigned char s6_addr[ 16 ]; // IPv6 address |
}; |
|
struct sockaddr_in6{ |
uint16_t sin6_family; // address family, AF_INET6 |
uint16_t sin6_port; // port number, Network Byte Order |
uint32_t sin6_flowinfo; // IPv6 flow information |
struct in6_addr sin6_addr; // IPv6 address |
uint32_t sin6_scope_id; // Scope ID |
}; |
|
struct addrinfo{ |
int ai_flags; // AI_PASSIVE, AI_CANONNAME, etc. |
uint16_t ai_family; // AF_INET, AF_INET6, AF_UNSPEC |
Property changes: |
Added: svn:mergeinfo |