IBR-DTNSuite  0.8
tools/src/DTNTun/ip.h File Reference
#include <inttypes.h>
#include <arpa/inet.h>
Include dependency graph for ip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define _noalign
#define IP_VERSION   0
#define IP_VERSION_AND_HEADERLENGTH   0
#define IPV4_TYPE_OF_SERVICE   1
#define IPV4_LENGTH   2
#define IPV4_IDENTFICATION   4
#define IPV4_FLAGS_AND_FRAGMENT_OFSET   6
#define IPV4_TTL   8
#define IPV4_PROTOCOL   9
#define IPV4_CHECKSUM   10
#define IPV4_SOURCE   12
#define IPV4_DESTINATION   16
#define IP_PROT_UDP   17
#define IP_PROT_TCP   11
#define IP_PROT_ICMP   1
#define ICMP_TYPE   0
#define ICMP_CODE   1
#define ICMP_CRC   2
#define ICMP_ECHO_IDENTIFIER   4
#define ICMP_ECHO_SEQNUMBER   6
#define ICMP_DATA   8
#define ICMP_ECHO_REQUEST   8
#define ICMP_ECHO_REPLY   0
#define GET_UINT16(buffer, position)   ( ntohs( *(_noalign uint16_t *)(buffer+position) ) )
#define GET_UINT32(buffer, position)   ( ntohl( *(_noalign uint32_t *)(buffer+position) ) )
#define SET_UINT16(buffer, position, data)   ( *( _noalign uint16_t *)(buffer+position)=htons(data) )
#define SET_UINT32(buffer, position, data)   ( *( _noalign uint32_t *)(buffer+position)=htonl(data) )

Define Documentation

#define _noalign

Definition at line 7 of file ip.h.

#define GET_UINT16 (   buffer,
  position 
)    ( ntohs( *(_noalign uint16_t *)(buffer+position) ) )

Definition at line 44 of file ip.h.

#define GET_UINT32 (   buffer,
  position 
)    ( ntohl( *(_noalign uint32_t *)(buffer+position) ) )

Definition at line 45 of file ip.h.

Referenced by process_icmp().

#define ICMP_CODE   1

Definition at line 31 of file ip.h.

Referenced by process_icmp().

#define ICMP_CRC   2

Definition at line 32 of file ip.h.

Referenced by process_icmp().

#define ICMP_DATA   8

Definition at line 35 of file ip.h.

#define ICMP_ECHO_IDENTIFIER   4

Definition at line 33 of file ip.h.

#define ICMP_ECHO_REPLY   0

Definition at line 38 of file ip.h.

Referenced by process_icmp().

#define ICMP_ECHO_REQUEST   8

Definition at line 37 of file ip.h.

Referenced by process_icmp().

#define ICMP_ECHO_SEQNUMBER   6

Definition at line 34 of file ip.h.

#define ICMP_TYPE   0

Definition at line 30 of file ip.h.

Referenced by process_icmp().

#define IP_PROT_ICMP   1

Definition at line 26 of file ip.h.

Referenced by process_ipv4().

#define IP_PROT_TCP   11

Definition at line 25 of file ip.h.

Referenced by process_ipv4().

#define IP_PROT_UDP   17

Definition at line 24 of file ip.h.

Referenced by process_ipv4().

#define IP_VERSION   0

Definition at line 9 of file ip.h.

Referenced by process_packet().

Definition at line 11 of file ip.h.

#define IPV4_CHECKSUM   10

Definition at line 18 of file ip.h.

Referenced by process_icmp().

#define IPV4_DESTINATION   16

Definition at line 20 of file ip.h.

Referenced by process_icmp().

Definition at line 15 of file ip.h.

#define IPV4_IDENTFICATION   4

Definition at line 14 of file ip.h.

#define IPV4_LENGTH   2

Definition at line 13 of file ip.h.

#define IPV4_PROTOCOL   9

Definition at line 17 of file ip.h.

Referenced by process_ipv4().

#define IPV4_SOURCE   12

Definition at line 19 of file ip.h.

Referenced by process_icmp().

#define IPV4_TTL   8

Definition at line 16 of file ip.h.

#define IPV4_TYPE_OF_SERVICE   1

Definition at line 12 of file ip.h.

#define SET_UINT16 (   buffer,
  position,
  data 
)    ( *( _noalign uint16_t *)(buffer+position)=htons(data) )

Definition at line 47 of file ip.h.

Referenced by process_icmp().

#define SET_UINT32 (   buffer,
  position,
  data 
)    ( *( _noalign uint32_t *)(buffer+position)=htonl(data) )

Definition at line 48 of file ip.h.

Referenced by process_icmp().