mirror of
https://github.com/xcat2/xNBA.git
synced 2025-01-18 21:43:14 +00:00
Use struct in_addr rather than just "in_addr".
Add struct sockaddr_in.
This commit is contained in:
parent
70567c51a2
commit
00b78f73a4
@ -1,6 +1,7 @@
|
||||
#ifndef _IN_H
|
||||
#define _IN_H
|
||||
|
||||
#include "stdint.h"
|
||||
#include <if_ether.h>
|
||||
#define IP ETH_P_IP
|
||||
#define ARP ETH_P_ARP
|
||||
@ -14,8 +15,19 @@
|
||||
/* Same after going through htonl */
|
||||
#define IP_BROADCAST 0xFFFFFFFF
|
||||
|
||||
typedef struct {
|
||||
struct in_addr {
|
||||
uint32_t s_addr;
|
||||
} in_addr;
|
||||
};
|
||||
|
||||
typedef struct in_addr in_addr;
|
||||
|
||||
typedef uint16_t in_port_t;
|
||||
|
||||
struct sockaddr_in {
|
||||
struct in_addr sin_addr;
|
||||
in_port_t sin_port;
|
||||
};
|
||||
|
||||
extern int inet_aton ( const char *cp, struct in_addr *inp );
|
||||
|
||||
#endif /* _IN_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user