2005-03-08 18:53:11 +00:00
|
|
|
#ifndef _IN_H
|
|
|
|
#define _IN_H
|
|
|
|
|
2005-04-30 13:49:28 +00:00
|
|
|
#include "stdint.h"
|
2005-03-08 18:53:11 +00:00
|
|
|
#include <if_ether.h>
|
|
|
|
#define IP ETH_P_IP
|
|
|
|
#define ARP ETH_P_ARP
|
|
|
|
#define RARP ETH_P_RARP
|
|
|
|
|
|
|
|
#define IP_ICMP 1
|
|
|
|
#define IP_IGMP 2
|
|
|
|
#define IP_TCP 6
|
|
|
|
#define IP_UDP 17
|
|
|
|
|
|
|
|
/* Same after going through htonl */
|
|
|
|
#define IP_BROADCAST 0xFFFFFFFF
|
|
|
|
|
2005-04-30 13:49:28 +00:00
|
|
|
struct in_addr {
|
2005-03-08 18:53:11 +00:00
|
|
|
uint32_t s_addr;
|
2005-04-30 13:49:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 );
|
2005-03-08 18:53:11 +00:00
|
|
|
|
|
|
|
#endif /* _IN_H */
|