ha.h

Go to the documentation of this file.
00001 /* $Id: ha.h,v 1.13 2001/02/17 18:19:09 jm Exp $
00002  * Header file for Home Agent
00003  *
00004  * Dynamic hierarchial IP tunnel
00005  * Copyright (C) 1998-2001, Dynamics group
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 2 as
00009  * published by the Free Software Foundation. See README and COPYING for
00010  * more details.
00011  */
00012 
00013 #ifndef HA_H
00014 #define HA_H
00015 
00016 #ifdef HAVE_CONFIG_H
00017 #include <config.h>
00018 #endif
00019 
00020 //dhcpstuff added 19.10.2007->
00021 #ifndef _DHCPC_H
00022 #define _DHCPC_H
00023 
00024 #include "libbb_udhcp.h"
00025 
00026 #define INIT_SELECTING  0
00027 #define REQUESTING      1
00028 #define BOUND           2
00029 #define RENEWING        3
00030 #define REBINDING       4
00031 #define INIT_REBOOT     5
00032 #define RENEW_REQUESTED 6
00033 #define RELEASED        7
00034 
00035 #define REQUESTIP       0
00036 #define RENEWIP         1
00037 #define RELEASEIP       2
00038 
00039 
00040 
00041 
00042 /************************************/
00043 /* Defaults _you_ may want to tweak */
00044 /************************************/
00045 
00046 /* the period of time the client is allowed to use that address */
00047 #define LEASE_TIME              (60*60*24*10) /* 10 days of seconds */
00048 
00049 /* where to find the DHCP server configuration file */
00050 #define DHCPD_CONF_FILE         "/etc/udhcpd.conf"
00051 
00052 /*****************************************************************/
00053 /* Do not modify below here unless you know what you are doing!! */
00054 /*****************************************************************/
00055 
00056 /* DHCP protocol -- see RFC 2131 */
00057 #define SERVER_PORT             67
00058 #define CLIENT_PORT             68
00059 
00060 #define DHCP_MAGIC              0x63825363
00061 
00062 /* DHCP option codes (partial list) */
00063 #define DHCP_PADDING            0x00
00064 #define DHCP_SUBNET             0x01
00065 #define DHCP_TIME_OFFSET        0x02
00066 #define DHCP_ROUTER             0x03
00067 #define DHCP_TIME_SERVER        0x04
00068 #define DHCP_NAME_SERVER        0x05
00069 #define DHCP_DNS_SERVER         0x06
00070 #define DHCP_LOG_SERVER         0x07
00071 #define DHCP_COOKIE_SERVER      0x08
00072 #define DHCP_LPR_SERVER         0x09
00073 #define DHCP_HOST_NAME          0x0c
00074 #define DHCP_BOOT_SIZE          0x0d
00075 #define DHCP_DOMAIN_NAME        0x0f
00076 #define DHCP_SWAP_SERVER        0x10
00077 #define DHCP_ROOT_PATH          0x11
00078 #define DHCP_IP_TTL             0x17
00079 #define DHCP_MTU                0x1a
00080 #define DHCP_BROADCAST          0x1c
00081 #define DHCP_NTP_SERVER         0x2a
00082 #define DHCP_WINS_SERVER        0x2c
00083 #define DHCP_REQUESTED_IP       0x32
00084 #define DHCP_LEASE_TIME         0x33
00085 #define DHCP_OPTION_OVER        0x34
00086 #define DHCP_MESSAGE_TYPE       0x35
00087 #define DHCP_SERVER_ID          0x36
00088 #define DHCP_PARAM_REQ          0x37
00089 #define DHCP_MESSAGE            0x38
00090 #define DHCP_MAX_SIZE           0x39
00091 #define DHCP_T1                 0x3a
00092 #define DHCP_T2                 0x3b
00093 #define DHCP_VENDOR             0x3c
00094 #define DHCP_CLIENT_ID          0x3d
00095 
00096 #define DHCP_END                0xFF
00097 
00098 
00099 #define BOOTREQUEST             1
00100 #define BOOTREPLY               2
00101 
00102 #define ETH_10MB                1
00103 #define ETH_10MB_LEN            6
00104 
00105 #define DHCPDISCOVER            1
00106 #define DHCPOFFER               2
00107 #define DHCPREQUEST             3
00108 #define DHCPDECLINE             4
00109 #define DHCPACK                 5
00110 #define DHCPNAK                 6
00111 #define DHCPRELEASE             7
00112 #define DHCPINFORM              8
00113 
00114 #define BROADCAST_FLAG          0x8000
00115 
00116 #define OPTION_FIELD            0
00117 #define FILE_FIELD              1
00118 #define SNAME_FIELD             2
00119 
00120 /* miscellaneous defines */
00121 #define MAC_BCAST_ADDR          (unsigned char *) "\xff\xff\xff\xff\xff\xff"
00122 #define OPT_CODE 0
00123 #define OPT_LEN 1
00124 #define OPT_DATA 2
00125 
00126 //<-dhcp stuff
00127 
00128 #include "owntypes.h"
00129 #define HA_CONF_FILE         "dynhad.conf"
00130 #define HA_GLOBAL_CONF_FILE  SYSCONFDIR "/" HA_CONF_FILE 
00131 
00132 /* The process id of the daemon is saved here to make it easier to
00133    kill the correct daemon when necessary. */
00134 #define HA_PID_FILE          PIDDIR "/dynhad.pid"
00135 
00136 enum { ENCAPS_IPIP, ENCAPS_MINIMAL, ENCAPS_GRE };
00137 enum { AUTH_RFC2002, AUTH_RFC2002BIS };
00138 
00139 struct ha_tunnel_data {
00140         struct in_addr lower_saddr; /* source address of the request */
00141         __u32 nonce; /* last sent nonce */
00142         unsigned char auth_type; /* AUTH_RFC2002 for RFC 2002bis MAC
00143                                   * calculation (i.e., include the SPI field);
00144                                   * AUTH_RFC2002BIS for RFC 2002 MAC
00145                                   * calculation */
00146         int reverse_tunnel; /* 0 = triangle, 1 = reverse */
00147         int encapsulation; /* encapsulation type */
00148         char arp_if[IFNAMSIZ]; /* interface used for proxy ARP entry */
00149         time_t last_failure_time; /* time of the last failure reply */
00150 };
00151 
00152 
00153 
00154 /* dhcpc.h */
00155 //dhcp clientin structin esittely
00156 
00157 
00158 struct client_config_t {
00159         char foreground;                /* Do not fork */
00160         char quit_after_lease;          /* Quit after obtaining lease */
00161         char abort_if_no_lease;         /* Abort if no lease */
00162         char background_if_no_lease;    /* Fork to background if no lease */
00163         char *interface;                /* The name of the interface to use */
00164         char *pidfile;                  /* Optionally store the process ID */
00165         char *script;                   /* User script to run at dhcp events */
00166         unsigned char *clientid;        /* Optional client id to use */
00167         unsigned char *hostname;        /* Optional hostname to use */
00168         int ifindex;                    /* Index number of the interface to use */
00169         unsigned char arp[6];           /* Our arp address */
00170 };
00171 
00172 extern struct client_config_t client_config;
00173 
00174 
00175 
00176 #endif //dhcp
00177 #endif /* HA_H */

Generated on Tue Jan 15 12:24:45 2008 for Dynamics 0.8.1.Dynamo.1 by  doxygen 1.5.1