/home/tomh/openhip/hip-0.5/src/usermode/hip_esp.c File Reference

#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/time.h>
#include <sys/errno.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <arpa/inet.h>
#include <linux/types.h>
#include <string.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#include <openssl/des.h>
#include <openssl/rand.h>
#include <win32/pfkeyv2.h>
#include <hip/hip_types.h>
#include <hip/hip_funcs.h>
#include <hip/hip_usermode.h>
#include <hip/hip_sadb.h>
#include <win32/checksum.h>

Classes

struct  ip_esp_hdr
struct  ip_esp_padinfo
struct  eth_hdr
struct  arp_hdr

Defines

#define BUFF_LEN   2000
#define HMAC_SHA_96_BITS   96
#define MAX_ETH_ADDRS   255
#define ARPOP_REQUEST   1
#define ARPOP_REPLY   2

Functions

__u16 checksum_udp_packet (__u8 *data, struct sockaddr *src, struct sockaddr *dst)
void tunreader_shutdown ()
int handle_nsol (__u8 *in, int len, __u8 *out, int *outlen, struct sockaddr *addr)
int handle_arp (__u8 *in, int len, __u8 *out, int *outlen, struct sockaddr *addr)
int hip_esp_encrypt (__u8 *in, int len, __u8 *out, int *outlen, hip_sadb_entry *entry, struct timeval *now)
int hip_esp_decrypt (__u8 *in, int len, __u8 *out, int *offset, int *outlen, hip_sadb_entry *entry, struct ip *iph, struct timeval *now)
__u16 rewrite_checksum (__u8 *data, __u16 magic)
void add_eth_header (__u8 *data, __u64 src, __u64 dst, __u32 type)
void add_ipv4_header (__u8 *data, __u32 src, __u32 dst, struct ip *old, __u16 len, __u8 proto)
void add_ipv6_pseudo_header (__u8 *data, struct sockaddr *src, struct sockaddr *dst, __u32 len, __u8 proto)
void add_ipv6_header (__u8 *data, struct sockaddr *src, struct sockaddr *dst, struct ip6_hdr *old, struct ip *old4, __u16 len, __u8 proto)
__u16 in_cksum (struct ip *iph)
__u64 get_eth_addr (int family, __u8 *addr)
int send_udp_esp_tunnel_activation (__u32 spi_out)
__u32 get_preferred_lsi ()
int do_bcast ()
int maxof (int num_args,...)
void init_readsp ()
void * hip_esp_output (void *arg)
void * hip_esp_input (void *arg)
void * udp_esp_keepalive (void *arg)
void * tunreader (void *arg)
void print_sadb ()

Variables

int tapfd
int readsp [2] = {0,0}
int s_esp
int s_esp_udp
int s_esp6
int s_udp
hip_sadb_dst_entry hip_sadb_dst [SADB_SIZE]
__u32 g_tap_lsi
__u64 g_tap_mac
long g_read_usec
__u8 eth_addrs [6 *MAX_ETH_ADDRS]
hip_sadb_entry hip_sadb [SADB_SIZE]

Define Documentation

#define ARPOP_REPLY   2

#define ARPOP_REQUEST   1

#define BUFF_LEN   2000

#define HMAC_SHA_96_BITS   96

#define MAX_ETH_ADDRS   255


Function Documentation

void add_eth_header ( __u8 data,
__u64  src,
__u64  dst,
__u32  type 
)

void add_ipv4_header ( __u8 data,
__u32  src,
__u32  dst,
struct ip old,
__u16  len,
__u8  proto 
)

void add_ipv6_header ( __u8 data,
struct sockaddr *  src,
struct sockaddr *  dst,
struct ip6_hdr old,
struct ip old4,
__u16  len,
__u8  proto 
)

void add_ipv6_pseudo_header ( __u8 data,
struct sockaddr *  src,
struct sockaddr *  dst,
__u32  len,
__u8  proto 
)

__u16 checksum_udp_packet ( __u8 data,
struct sockaddr *  src,
struct sockaddr *  dst 
)

int do_bcast (  ) 

__u64 get_eth_addr ( int  family,
__u8 addr 
)

__u32 get_preferred_lsi (  ) 

int handle_arp ( __u8 in,
int  len,
__u8 out,
int *  outlen,
struct sockaddr *  addr 
)

int handle_nsol ( __u8 in,
int  len,
__u8 out,
int *  outlen,
struct sockaddr *  addr 
)

int hip_esp_decrypt ( __u8 in,
int  len,
__u8 out,
int *  offset,
int *  outlen,
hip_sadb_entry entry,
struct ip iph,
struct timeval *  now 
)

int hip_esp_encrypt ( __u8 in,
int  len,
__u8 out,
int *  outlen,
hip_sadb_entry entry,
struct timeval *  now 
)

void* hip_esp_input ( void *  arg  ) 

void* hip_esp_output ( void *  arg  ) 

__u16 in_cksum ( struct ip iph  ) 

void init_readsp (  ) 

int maxof ( int  num_args,
  ... 
)

void print_sadb (  ) 

__u16 rewrite_checksum ( __u8 data,
__u16  magic 
)

int send_udp_esp_tunnel_activation ( __u32  spi_out  ) 

void* tunreader ( void *  arg  ) 

void tunreader_shutdown (  ) 

void* udp_esp_keepalive ( void *  arg  ) 


Variable Documentation

__u8 eth_addrs[6 *MAX_ETH_ADDRS]

long g_read_usec

__u32 g_tap_lsi

__u64 g_tap_mac

hip_sadb_entry hip_sadb[SADB_SIZE]

hip_sadb_dst_entry hip_sadb_dst[SADB_SIZE]

int readsp[2] = {0,0}

int s_esp

int s_esp6

int s_esp_udp

int s_udp

int tapfd


Generated on Mon Oct 22 11:43:44 2007 for OpenHIP by  doxygen 1.5.1