32 #ifndef SYSTEM_CORE_INC_NET_OC_DHCP_H_ 33 #define SYSTEM_CORE_INC_NET_OC_DHCP_H_ 45 #define _________________________________________DEFINITIONS_SECTION________________________________________________________________________ 53 #define oC_DHCP_MAGIC_COOKIE 0x63825363 61 #define oC_DHCP_END_OPTION 0xFF 69 #define oC_DHCP_OPTIONS_BUFFER_SIZE 600 71 #undef _________________________________________DEFINITIONS_SECTION________________________________________________________________________ 79 #define _________________________________________TYPES_SECTION______________________________________________________________________________ 229 #elif defined(BIG_ENDIAN) 230 # error The structure is not defined for BIG_ENDIAN 232 # error Endianess is not correct 236 #undef _________________________________________TYPES_SECTION______________________________________________________________________________ 243 #define _________________________________________FUNCTIONS_SECTION__________________________________________________________________________ 253 #undef _________________________________________FUNCTIONS_SECTION__________________________________________________________________________ oC_ErrorCode_t oC_Dhcp_RequestIp(oC_Netif_t Netif, oC_Time_t Timeout)
performs DHCP IP request procedure
uint32_t GIAddr
Gateway IP Address - a router IP
Minimum length in bytes for option #oC_Dhcp_Option_DnsServerMin.
oC_ErrorCode_t oC_Dhcp_ReceiveOffer(oC_Netif_t Netif, oC_Time_t Timeout)
receives offer from the DHCP server
uint8_t Options[oC_DHCP_OPTIONS_BUFFER_SIZE]
Additional options array.
The PAD value used to align word bound.
Length in bytes for option oC_Dhcp_Option_MessageType.
oC_Dhcp_Flags_t
stores flags for the DHCP message
Minimum length in bytes for option oC_Dhcp_Option_Bootfile.
uint32_t YIAddr
Your IP Address - the server fills it as the proposed IP address for the client
The router option specifies a list of IP addresses on the client subnetwork.
Minimum length in bytes for option oC_Dhcp_Option_RequestedList.
The file contains definitions for the compiler, that helps to manage errors, etc. ...
uint32_t MagicCookie
Magic cookie - set to oC_DHCP_MAGIC_COOKIE (0x63825363) to identify the information as vendor indepen...
LocalNet (IBM PCNet or SYTEK LocalNET)
uint32_t Hops
Set to 0 by a client when transmitting a request and used by relay agents to control the forwarding o...
Broadcast flag - a client does not know its own IP address so it send the message as broadcast...
Used by the DHCP server to mark, that File or SName or both of these fields are overloaded to store D...
Length in bytes for option #oC_Dhcp_Option_T2RebindingTime.
Contains interface for netif object.
struct PACKED oC_Dhcp_Message_t
stores DHCP message
Length in bytes for option oC_Dhcp_Option_SubnetMask.
Used by the DHCP client to request values for specified configuration parameters. ...
uint32_t Secs
Seconds - In BOOTP this field was vaguely defined and not always used.
Address to use in client subnetwork for sending broadcast packets.
Destination IP address of DHCP server.
Default TTL value for TCP segments.
When the SName field is used for options, this field specifies name of the TFTP server.
Minimum length in bytes for option #oC_Dhcp_Option_ClientIdMin.
uint32_t Operation
Specifies type of the message.
oC_ErrorCode_t oC_Dhcp_SendDiscovery(oC_Netif_t Netif, oC_Time_t Timeout)
sends DHCP discovery message to DHCP server
Length in bytes for option oC_Dhcp_Option_RequestedIp.
oC_ErrorCode_t oC_Dhcp_SendRequest(oC_Netif_t Netif, oC_Time_t Timeout)
sends request message to the DHCP server
#define oC_DHCP_END_OPTION
Value for marking last entry in the options array.
Time interval from address assignment until the client have to renew the address. ...
uint32_t XID
Transaction ID Generated by the client to allow it to match up the request with replies received from...
Minimum length in bytes for option #oC_Dhcp_Option_HostnameMin.
uint32_t SIAddr
Server IP Address - the server fills it with its own address, that should be used for the states afte...
Asynchronous Transfer Mode (ATM)
Length in bytes for option oC_Dhcp_Option_Overload.
oC_ErrorCode_t oC_Dhcp_ReceiveAcknowledge(oC_Netif_t Netif, oC_Time_t Timeout)
receives ACK message from DHCP server
Minimum length in bytes for option #oC_Dhcp_Option_NtpMin.
Specifies MTU for the interface.
The option allows to request the specified static IP.
Specifies subnetwork mask.
char File[128]
Boot Filename - Optionally used by the client to request a particular type of boot file in a DISCOVER...
Length in bytes for option oC_Dhcp_Option_Broadcast.
Length in bytes for option oC_Dhcp_Option_DefaultTTL.
Minimum length in bytes for option #oC_Dhcp_Option_RouterMin.
The end option marks end of the options array.
uint8_t CHAddr[16]
Client Hardware Address - the hardware address of the client used for identification and communicatio...
Length in bytes for option oC_Dhcp_Option_MTU.
Length in bytes for option oC_Dhcp_Option_TcpTTL.
oC_ErrorCode_t oC_Dhcp_ReceiveMessage(oC_Netif_t Netif, oC_Dhcp_Message_t *outMessage, oC_Time_t Timeout)
receives DHCP message from DHCP server
List of Network Time Protocol Servers available in the subnetwork.
char SName[64]
Server Name - The server can optionally put its name in this field
Time interval until the client transitions to the REBINDING state.
uint32_t HardwareAddressLength
Length of the hardware address in bytes.
Length in bytes for option oC_Dhcp_Option_TimeOffset.
Length in bytes for option oC_Dhcp_Option_ServerId.
Minimum length in bytes for option #oC_Dhcp_Option_TftpServerNameMin.
oC_Dhcp_Option_t
Stores DHCP options that can be added into the DHCP message.
List of DNS servers in the subnetwork.
When the File field is used for options, this field specifies a boot file name.
uint32_t HardwareType
Hardware Type - specifies type of the hardware used in the local network.
#define oC_DHCP_OPTIONS_BUFFER_SIZE
stores maximum number of bytes reserved for options in DHCP message
uint32_t CIAddr
Client IP Address - If a client has IP address and it is valid (while BOUND, RENEWING or REBINDING st...
Used by the DHCP clients to specify their unique ID.
oC_Dhcp_HardwareType_t
stores type of hardware for oC_Dhcp_Message_t type
File with interface for the NET module.
Allows the client to request a lease time for the IP address.
Used to mark type of the message - 1 for Discover, 2 - Offer, 3 - Request, 4 - Declide, 5 - Pack , 6 - Pnak, 7 - Release, 8 - Inform
oC_Dhcp_OperationCode_t
stores operation code The type is for storing operation code for field Operation in the oC_Dhcp_Messa...
Offset of the client subnetwork in seconds from Coordinated Universal Time (UTC). ...
oC_ErrorCode_t oC_Dhcp_SendMessage(oC_Netif_t Netif, oC_Dhcp_Message_t *Message, uint16_t Size, oC_Time_t Timeout)
sends DHCP message to DHCP server
Specifies default TTL value for packets.
Length in bytes for option #oC_Dhcp_Option_T1RenevalTime.
Specifies name of the client.
Length in bytes for option oC_Dhcp_Option_LeaseTime.
uint32_t Flags
Flags of the message, look at oC_Dhcp_Flags_t type for more.
oC_Dhcp_OptionLength_t
stores length for options from oC_Dhcp_Option_t type