ConOpSys V2970  P004.07
ANVILEX control operating system
Classes | Macros | Enumerations | Variables
dhcp.h File Reference
#include "lwip/opt.h"
#include "lwip/arch.h"
#include "lwip/prot/ip4.h"
Include dependency graph for dhcp.h:

Go to the source code of this file.

Classes

struct  dhcp_msg
 

Macros

#define DHCP_CHADDR_LEN   16U
 
#define DHCP_SNAME_OFS   44U
 
#define DHCP_SNAME_LEN   64U
 
#define DHCP_FILE_OFS   108U
 
#define DHCP_FILE_LEN   128U
 
#define DHCP_MSG_LEN   236U
 
#define DHCP_OPTIONS_OFS   (DHCP_MSG_LEN + 4U) /* 4 byte: cookie */
 
#define DHCP_MIN_OPTIONS_LEN   68U
 
#define DHCP_OPTIONS_LEN   DHCP_MIN_OPTIONS_LEN
 
#define DHCP_BOOTREQUEST   1
 
#define DHCP_BOOTREPLY   2
 
#define DHCP_DISCOVER   1
 
#define DHCP_OFFER   2
 
#define DHCP_REQUEST   3
 
#define DHCP_DECLINE   4
 
#define DHCP_ACK   5
 
#define DHCP_NAK   6
 
#define DHCP_RELEASE   7
 
#define DHCP_INFORM   8
 
#define DHCP_MAGIC_COOKIE   0x63825363UL
 
#define DHCP_OPTION_PAD   0
 
#define DHCP_OPTION_SUBNET_MASK   1 /* RFC 2132 3.3 */
 
#define DHCP_OPTION_ROUTER   3
 
#define DHCP_OPTION_DNS_SERVER   6
 
#define DHCP_OPTION_HOSTNAME   12
 
#define DHCP_OPTION_IP_TTL   23
 
#define DHCP_OPTION_MTU   26
 
#define DHCP_OPTION_BROADCAST   28
 
#define DHCP_OPTION_TCP_TTL   37
 
#define DHCP_OPTION_NTP   42
 
#define DHCP_OPTION_END   255
 
#define DHCP_OPTION_REQUESTED_IP   50 /* RFC 2132 9.1, requested IP address */
 
#define DHCP_OPTION_LEASE_TIME   51 /* RFC 2132 9.2, time in seconds, in 4 bytes */
 
#define DHCP_OPTION_OVERLOAD   52 /* RFC2132 9.3, use file and/or sname field for options */
 
#define DHCP_OPTION_MESSAGE_TYPE   53 /* RFC 2132 9.6, important for DHCP */
 
#define DHCP_OPTION_MESSAGE_TYPE_LEN   1
 
#define DHCP_OPTION_SERVER_ID   54 /* RFC 2132 9.7, server IP address */
 
#define DHCP_OPTION_PARAMETER_REQUEST_LIST   55 /* RFC 2132 9.8, requested option types */
 
#define DHCP_OPTION_MAX_MSG_SIZE   57 /* RFC 2132 9.10, message size accepted >= 576 */
 
#define DHCP_OPTION_MAX_MSG_SIZE_LEN   2
 
#define DHCP_OPTION_T1   58 /* T1 renewal time */
 
#define DHCP_OPTION_T2   59 /* T2 rebinding time */
 
#define DHCP_OPTION_US   60
 
#define DHCP_OPTION_CLIENT_ID   61
 
#define DHCP_OPTION_TFTP_SERVERNAME   66
 
#define DHCP_OPTION_BOOTFILE   67
 
#define DHCP_OVERLOAD_NONE   0
 
#define DHCP_OVERLOAD_FILE   1
 
#define DHCP_OVERLOAD_SNAME   2
 
#define DHCP_OVERLOAD_SNAME_FILE   3
 

Enumerations

enum  dhcp_state_enum_t {
  DHCP_STATE_OFF = 0 , DHCP_STATE_REQUESTING = 1 , DHCP_STATE_INIT = 2 , DHCP_STATE_REBOOTING = 3 ,
  DHCP_STATE_REBINDING = 4 , DHCP_STATE_RENEWING = 5 , DHCP_STATE_SELECTING = 6 , DHCP_STATE_INFORMING = 7 ,
  DHCP_STATE_CHECKING = 8 , DHCP_STATE_PERMANENT = 9 , DHCP_STATE_BOUND = 10 , DHCP_STATE_RELEASING = 11 ,
  DHCP_STATE_BACKING_OFF = 12
}
 

Variables

PACK_STRUCT_BEGIN struct dhcp_msg PACK_STRUCT_STRUCT
 

Detailed Description

DHCP protocol definitions

Macro Definition Documentation

◆ DHCP_ACK

#define DHCP_ACK   5

◆ DHCP_BOOTREPLY

#define DHCP_BOOTREPLY   2

◆ DHCP_BOOTREQUEST

#define DHCP_BOOTREQUEST   1

◆ DHCP_CHADDR_LEN

#define DHCP_CHADDR_LEN   16U

◆ DHCP_DECLINE

#define DHCP_DECLINE   4

◆ DHCP_DISCOVER

#define DHCP_DISCOVER   1

◆ DHCP_FILE_LEN

#define DHCP_FILE_LEN   128U

◆ DHCP_FILE_OFS

#define DHCP_FILE_OFS   108U

◆ DHCP_INFORM

#define DHCP_INFORM   8

◆ DHCP_MAGIC_COOKIE

#define DHCP_MAGIC_COOKIE   0x63825363UL

◆ DHCP_MIN_OPTIONS_LEN

#define DHCP_MIN_OPTIONS_LEN   68U

◆ DHCP_MSG_LEN

#define DHCP_MSG_LEN   236U

◆ DHCP_NAK

#define DHCP_NAK   6

◆ DHCP_OFFER

#define DHCP_OFFER   2

◆ DHCP_OPTION_BOOTFILE

#define DHCP_OPTION_BOOTFILE   67

◆ DHCP_OPTION_BROADCAST

#define DHCP_OPTION_BROADCAST   28

◆ DHCP_OPTION_CLIENT_ID

#define DHCP_OPTION_CLIENT_ID   61

◆ DHCP_OPTION_DNS_SERVER

#define DHCP_OPTION_DNS_SERVER   6

◆ DHCP_OPTION_END

#define DHCP_OPTION_END   255

◆ DHCP_OPTION_HOSTNAME

#define DHCP_OPTION_HOSTNAME   12

◆ DHCP_OPTION_IP_TTL

#define DHCP_OPTION_IP_TTL   23

◆ DHCP_OPTION_LEASE_TIME

#define DHCP_OPTION_LEASE_TIME   51 /* RFC 2132 9.2, time in seconds, in 4 bytes */

◆ DHCP_OPTION_MAX_MSG_SIZE

#define DHCP_OPTION_MAX_MSG_SIZE   57 /* RFC 2132 9.10, message size accepted >= 576 */

◆ DHCP_OPTION_MAX_MSG_SIZE_LEN

#define DHCP_OPTION_MAX_MSG_SIZE_LEN   2

◆ DHCP_OPTION_MESSAGE_TYPE

#define DHCP_OPTION_MESSAGE_TYPE   53 /* RFC 2132 9.6, important for DHCP */

◆ DHCP_OPTION_MESSAGE_TYPE_LEN

#define DHCP_OPTION_MESSAGE_TYPE_LEN   1

◆ DHCP_OPTION_MTU

#define DHCP_OPTION_MTU   26

◆ DHCP_OPTION_NTP

#define DHCP_OPTION_NTP   42

◆ DHCP_OPTION_OVERLOAD

#define DHCP_OPTION_OVERLOAD   52 /* RFC2132 9.3, use file and/or sname field for options */

◆ DHCP_OPTION_PAD

#define DHCP_OPTION_PAD   0

◆ DHCP_OPTION_PARAMETER_REQUEST_LIST

#define DHCP_OPTION_PARAMETER_REQUEST_LIST   55 /* RFC 2132 9.8, requested option types */

◆ DHCP_OPTION_REQUESTED_IP

#define DHCP_OPTION_REQUESTED_IP   50 /* RFC 2132 9.1, requested IP address */

◆ DHCP_OPTION_ROUTER

#define DHCP_OPTION_ROUTER   3

◆ DHCP_OPTION_SERVER_ID

#define DHCP_OPTION_SERVER_ID   54 /* RFC 2132 9.7, server IP address */

◆ DHCP_OPTION_SUBNET_MASK

#define DHCP_OPTION_SUBNET_MASK   1 /* RFC 2132 3.3 */

◆ DHCP_OPTION_T1

#define DHCP_OPTION_T1   58 /* T1 renewal time */

◆ DHCP_OPTION_T2

#define DHCP_OPTION_T2   59 /* T2 rebinding time */

◆ DHCP_OPTION_TCP_TTL

#define DHCP_OPTION_TCP_TTL   37

◆ DHCP_OPTION_TFTP_SERVERNAME

#define DHCP_OPTION_TFTP_SERVERNAME   66

◆ DHCP_OPTION_US

#define DHCP_OPTION_US   60

◆ DHCP_OPTIONS_LEN

#define DHCP_OPTIONS_LEN   DHCP_MIN_OPTIONS_LEN

make sure user does not configure this too small allow this to be configured in lwipopts.h, but not too small set this to be sufficient for your options in outgoing DHCP msgs

◆ DHCP_OPTIONS_OFS

#define DHCP_OPTIONS_OFS   (DHCP_MSG_LEN + 4U) /* 4 byte: cookie */

◆ DHCP_OVERLOAD_FILE

#define DHCP_OVERLOAD_FILE   1

◆ DHCP_OVERLOAD_NONE

#define DHCP_OVERLOAD_NONE   0

◆ DHCP_OVERLOAD_SNAME

#define DHCP_OVERLOAD_SNAME   2

◆ DHCP_OVERLOAD_SNAME_FILE

#define DHCP_OVERLOAD_SNAME_FILE   3

◆ DHCP_RELEASE

#define DHCP_RELEASE   7

◆ DHCP_REQUEST

#define DHCP_REQUEST   3

◆ DHCP_SNAME_LEN

#define DHCP_SNAME_LEN   64U

◆ DHCP_SNAME_OFS

#define DHCP_SNAME_OFS   44U

Enumeration Type Documentation

◆ dhcp_state_enum_t

Enumerator
DHCP_STATE_OFF 
DHCP_STATE_REQUESTING 
DHCP_STATE_INIT 
DHCP_STATE_REBOOTING 
DHCP_STATE_REBINDING 
DHCP_STATE_RENEWING 
DHCP_STATE_SELECTING 
DHCP_STATE_INFORMING 
DHCP_STATE_CHECKING 
DHCP_STATE_PERMANENT 
DHCP_STATE_BOUND 
DHCP_STATE_RELEASING 
DHCP_STATE_BACKING_OFF 

Variable Documentation

◆ PACK_STRUCT_STRUCT

PACK_STRUCT_BEGIN struct dhcp_msg PACK_STRUCT_STRUCT