/home/tomh/openhip/hip-0.5/src/include/hip/hip_service.h

Go to the documentation of this file.
00001 /*
00002  * Host Identity Protocol
00003  * Copyright (C) 2002-04 the Boeing Company
00004  * 
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  *  hip_service.h
00016  *
00017  *  Authors: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
00018  * 
00019  * Definition of HIP Windows service thread functions.
00020  *
00021  */
00022 #ifdef __WIN32__
00023 #include <winsock2.h>
00024 #include <ws2tcpip.h>
00025 #include <time.h>
00026 #else
00027 #include <sys/socket.h> /* struct sockaddr */
00028 #endif
00029 
00030 /*
00031  * Globally-accessible functions
00032  */
00033 /* Windows _beghinthread() uses different type than pthread_create() */
00034 #ifdef __WIN32__
00035 void hip_esp_output(void *arg);
00036 void hip_esp_input(void *arg);
00037 void hip_pfkey(void *arg);
00038 void tunreader(void *arg);
00039 void hip_dns(void *arg);
00040 void hipd_main(void *arg);
00041 void hip_netlink(void *arg);
00042 void hip_status(void *arg);
00043 void udp_esp_keepalive(void *arg);
00044 void udp_hip_keepalive(void *arg);
00045 extern int socketpair(int, int, int, int sv[2]);
00046 #define RETNULL ;
00047 #else
00048 void *hip_esp_output(void *arg);
00049 void *hip_esp_input(void *arg);
00050 void *hip_pfkey(void *arg);
00051 void *tunreader(void *arg);
00052 void *hip_dns(void *arg);
00053 void *hipd_main(void *arg);
00054 void *hip_netlink(void *arg);
00055 void *hip_status(void *arg);
00056 void *udp_esp_keepalive(void *arg);
00057 void *udp_hip_keepalive(void *arg);
00058 #define RETNULL NULL;
00059 #endif
00060 
00061 int pfkey_send_acquire(struct sockaddr *target);
00062 extern void hip_sleep(int seconds);
00063 
00064 /*
00065  * Global definitions
00066  */
00067 #ifdef __MACOSX__
00068 #include <mac/mac_types.h>
00069 #else
00070 #ifndef __WIN32__
00071 #include <asm/types.h>
00072 #endif
00073 #endif
00074 
00075 #ifndef CONFIG_HIP
00076 #define CONFIG_HIP
00077 #endif
00078 
00079 #define DNS_PORT 53
00080 #define HIP_DNS_SUFFIX ".hip"
00081 #define HIP_UDP_PORT 50500
00082 extern __u64 g_tap_mac;
00083 extern int g_state;
00084 
00085 /*#ifndef HIP_ESP_UDP_PORT*/
00086 #define HIP_ESP_UDP_PORT 54500
00087 /*#endif*/
00088 #define KEEPALIVE_TIMEOUT 20
00089 
00090 /* from linux/include/linux/kernel.h */
00091 #define NIPQUAD(addr) \
00092         ((unsigned char *)&addr)[0], \
00093         ((unsigned char *)&addr)[1], \
00094         ((unsigned char *)&addr)[2], \
00095         ((unsigned char *)&addr)[3]
00096 
00097 #define NIP6(addr) \
00098         ntohs((addr).s6_addr16[0]), \
00099         ntohs((addr).s6_addr16[1]), \
00100         ntohs((addr).s6_addr16[2]), \
00101         ntohs((addr).s6_addr16[3]), \
00102         ntohs((addr).s6_addr16[4]), \
00103         ntohs((addr).s6_addr16[5]), \
00104         ntohs((addr).s6_addr16[6]), \
00105         ntohs((addr).s6_addr16[7])
00106 
00107 #define TRUE 1
00108 #define FALSE 0
00109 

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