ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

dhcp.h
Go to the documentation of this file.
00001 /*  $OpenBSD: dhcp.h,v 1.5 2004/05/04 15:49:49 deraadt Exp $    */
00002 
00003 /* Protocol structures... */
00004 
00005 /*
00006  * Copyright (c) 1995, 1996 The Internet Software Consortium.
00007  * All rights reserved.
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted provided that the following conditions
00011  * are met:
00012  *
00013  * 1. Redistributions of source code must retain the above copyright
00014  *    notice, this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in the
00017  *    documentation and/or other materials provided with the distribution.
00018  * 3. Neither the name of The Internet Software Consortium nor the names
00019  *    of its contributors may be used to endorse or promote products derived
00020  *    from this software without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
00023  * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
00024  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00025  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026  * DISCLAIMED.  IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
00027  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00028  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00029  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00030  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00031  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00033  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00034  * SUCH DAMAGE.
00035  *
00036  * This software has been written for the Internet Software Consortium
00037  * by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
00038  * Enterprises.  To learn more about the Internet Software Consortium,
00039  * see ``http://www.vix.com/isc''.  To learn more about Vixie
00040  * Enterprises, see ``http://www.vix.com''.
00041  */
00042 
00043 #define DHCP_UDP_OVERHEAD   (14 + /* Ethernet header */ \
00044                  20 + /* IP header */       \
00045                  8)   /* UDP header */
00046 #define DHCP_SNAME_LEN      64
00047 #define DHCP_FILE_LEN       128
00048 #define DHCP_FIXED_NON_UDP  236
00049 #define DHCP_FIXED_LEN      (DHCP_FIXED_NON_UDP + DHCP_UDP_OVERHEAD)
00050                         /* Everything but options. */
00051 #define DHCP_MTU_MAX        1500
00052 #define DHCP_OPTION_LEN     (DHCP_MTU_MAX - DHCP_FIXED_LEN)
00053 
00054 #define BOOTP_MIN_LEN       300
00055 #define DHCP_MIN_LEN        548
00056 
00057 struct dhcp_packet {
00058     u_int8_t  op;       /* Message opcode/type */
00059     u_int8_t  htype;    /* Hardware addr type (see net/if_types.h) */
00060     u_int8_t  hlen;     /* Hardware addr length */
00061     u_int8_t  hops;     /* Number of relay agent hops from client */
00062     u_int32_t xid;      /* Transaction ID */
00063     u_int16_t secs;     /* Seconds since client started looking */
00064     u_int16_t flags;    /* Flag bits */
00065     struct in_addr ciaddr;  /* Client IP address (if already in use) */
00066     struct in_addr yiaddr;  /* Client IP address */
00067     struct in_addr siaddr;  /* IP address of next server to talk to */
00068     struct in_addr giaddr;  /* DHCP relay agent IP address */
00069     unsigned char chaddr[16];   /* Client hardware address */
00070     char sname[DHCP_SNAME_LEN]; /* Server name */
00071     char file[DHCP_FILE_LEN];   /* Boot filename */
00072     unsigned char options[DHCP_OPTION_LEN];
00073                 /* Optional parameters
00074                    (actual length dependent on MTU). */
00075 };
00076 
00077 /* BOOTP (rfc951) message types */
00078 #define BOOTREQUEST 1
00079 #define BOOTREPLY   2
00080 
00081 /* Possible values for flags field... */
00082 #define BOOTP_BROADCAST 32768L
00083 
00084 /* Possible values for hardware type (htype) field... */
00085 #define HTYPE_ETHER 1       /* Ethernet         */
00086 #define HTYPE_IEEE802   6       /* IEEE 802.2 Token Ring... */
00087 #define HTYPE_FDDI  8       /* FDDI...          */
00088 
00089 /* Magic cookie validating dhcp options field (and bootp vendor
00090    extensions field). */
00091 #define DHCP_OPTIONS_COOKIE "\143\202\123\143"
00092 
00093 
00094 /* DHCP Option codes: */
00095 
00096 #define DHO_PAD             0
00097 #define DHO_SUBNET_MASK         1
00098 #define DHO_TIME_OFFSET         2
00099 #define DHO_ROUTERS         3
00100 #define DHO_TIME_SERVERS        4
00101 #define DHO_NAME_SERVERS        5
00102 #define DHO_DOMAIN_NAME_SERVERS     6
00103 #define DHO_LOG_SERVERS         7
00104 #define DHO_COOKIE_SERVERS      8
00105 #define DHO_LPR_SERVERS         9
00106 #define DHO_IMPRESS_SERVERS     10
00107 #define DHO_RESOURCE_LOCATION_SERVERS   11
00108 #define DHO_HOST_NAME           12
00109 #define DHO_BOOT_SIZE           13
00110 #define DHO_MERIT_DUMP          14
00111 #define DHO_DOMAIN_NAME         15
00112 #define DHO_SWAP_SERVER         16
00113 #define DHO_ROOT_PATH           17
00114 #define DHO_EXTENSIONS_PATH     18
00115 #define DHO_IP_FORWARDING       19
00116 #define DHO_NON_LOCAL_SOURCE_ROUTING    20
00117 #define DHO_POLICY_FILTER       21
00118 #define DHO_MAX_DGRAM_REASSEMBLY    22
00119 #define DHO_DEFAULT_IP_TTL      23
00120 #define DHO_PATH_MTU_AGING_TIMEOUT  24
00121 #define DHO_PATH_MTU_PLATEAU_TABLE  25
00122 #define DHO_INTERFACE_MTU       26
00123 #define DHO_ALL_SUBNETS_LOCAL       27
00124 #define DHO_BROADCAST_ADDRESS       28
00125 #define DHO_PERFORM_MASK_DISCOVERY  29
00126 #define DHO_MASK_SUPPLIER       30
00127 #define DHO_ROUTER_DISCOVERY        31
00128 #define DHO_ROUTER_SOLICITATION_ADDRESS 32
00129 #define DHO_STATIC_ROUTES       33
00130 #define DHO_TRAILER_ENCAPSULATION   34
00131 #define DHO_ARP_CACHE_TIMEOUT       35
00132 #define DHO_IEEE802_3_ENCAPSULATION 36
00133 #define DHO_DEFAULT_TCP_TTL     37
00134 #define DHO_TCP_KEEPALIVE_INTERVAL  38
00135 #define DHO_TCP_KEEPALIVE_GARBAGE   39
00136 #define DHO_NIS_DOMAIN          40
00137 #define DHO_NIS_SERVERS         41
00138 #define DHO_NTP_SERVERS         42
00139 #define DHO_VENDOR_ENCAPSULATED_OPTIONS 43
00140 #define DHO_NETBIOS_NAME_SERVERS    44
00141 #define DHO_NETBIOS_DD_SERVER       45
00142 #define DHO_NETBIOS_NODE_TYPE       46
00143 #define DHO_NETBIOS_SCOPE       47
00144 #define DHO_FONT_SERVERS        48
00145 #define DHO_X_DISPLAY_MANAGER       49
00146 #define DHO_DHCP_REQUESTED_ADDRESS  50
00147 #define DHO_DHCP_LEASE_TIME     51
00148 #define DHO_DHCP_OPTION_OVERLOAD    52
00149 #define DHO_DHCP_MESSAGE_TYPE       53
00150 #define DHO_DHCP_SERVER_IDENTIFIER  54
00151 #define DHO_DHCP_PARAMETER_REQUEST_LIST 55
00152 #define DHO_DHCP_MESSAGE        56
00153 #define DHO_DHCP_MAX_MESSAGE_SIZE   57
00154 #define DHO_DHCP_RENEWAL_TIME       58
00155 #define DHO_DHCP_REBINDING_TIME     59
00156 #define DHO_DHCP_CLASS_IDENTIFIER   60
00157 #define DHO_DHCP_CLIENT_IDENTIFIER  61
00158 #define DHO_DHCP_USER_CLASS_ID      77
00159 #define DHO_END             255
00160 
00161 /* DHCP message types. */
00162 #define DHCPDISCOVER    1
00163 #define DHCPOFFER   2
00164 #define DHCPREQUEST 3
00165 #define DHCPDECLINE 4
00166 #define DHCPACK     5
00167 #define DHCPNAK     6
00168 #define DHCPRELEASE 7
00169 #define DHCPINFORM  8

Generated on Sun May 27 2012 04:23:28 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.