![]() |
io6Library
WIZnet Dual Stack TCP/IP Ethernet Controller Driver
|
DHCPv6 APIs implement file. More...
Go to the source code of this file.
Data Structures | |
| struct | __attribute__ |
Macros | |
| #define | _DHCP6_DEBUG_ |
| #define | STATE_DHCP6_INIT 0 |
| Initialize. More... | |
| #define | STATE_DHCP6_SOLICIT 1 |
| send DISCOVER and wait OFFER More... | |
| #define | STATE_DHCP6_REQUEST 2 |
| send REQEUST and wait ACK or NACK More... | |
| #define | STATE_DHCP6_LEASED 3 |
| ReceiveD ACK and IP leased. More... | |
| #define | STATE_DHCP6_REREQUEST 4 |
| send REQUEST for maintaining leased IP More... | |
| #define | STATE_DHCP6_RELEASE 5 |
| No use. More... | |
| #define | STATE_DHCP6_STOP 6 |
| Stop procssing DHCP. More... | |
| #define | DHCP6_SOLICIT 1 |
| DISCOVER message in OPT of RIP_MSG. More... | |
| #define | DHCP6_ADVERTISE 2 |
| OFFER message in OPT of RIP_MSG. More... | |
| #define | DHCP6_REQUEST 3 |
| REQUEST message in OPT of RIP_MSG. More... | |
| #define | DHCP6_CONFIRM 4 |
| DECLINE message in OPT of RIP_MSG. More... | |
| #define | DHCP6_RENEW 5 |
| ACK message in OPT of RIP_MSG. More... | |
| #define | DHCP6_REBIND 6 |
| NACK message in OPT of RIP_MSG. More... | |
| #define | DHCP6_REPLY 7 |
| RELEASE message in OPT of RIP_MSG. No use. More... | |
| #define | DHCP6_RELEASE 8 |
| INFORM message in OPT of RIP_MSG. No use. More... | |
| #define | DHCP6_DECLINE 9 |
| INFORM message in OPT of RIP_MSG. No use. More... | |
| #define | DHCP6_RECONFIGURE 10 |
| INFORM message in OPT of RIP_MSG. No use. More... | |
| #define | DHCP6_INFO_REQUEST 11 |
| INFORM message in OPT of RIP_MSG. No use. More... | |
Enumerations | |
| enum | { OPT_CLIENTID = 1, OPT_SERVERID = 2, OPT_IANA = 3, OPT_IATA = 4, OPT_IAADDR = 5, OPT_REQUEST = 6, OPT_PREFERENCE = 7, OPT_ELAPSED_TIME = 8, OPT_RELAY_MSG = 9, OPT_AUTH = 11, OPT_UNICAST = 12, OPT_STATUS_CODE = 13, OPT_RAPID_COMMIT = 14, OPT_USER_CLASS = 15, OPT_VENDOR_CLASS = 16, OPT_VENDOR_OPTS = 17, OPT_INTERFACE_ID = 18, OPT_RECONF_MSG = 19, OPT_RECONF_ACCEPT = 20, SIP_Server_DNL = 21, SIP_Server_V6ADDR = 22, DNS_RecursiveNameServer = 23, Domain_Search_List = 24, OPT_IAPD = 25, OPT_IAPREFIX = 26, OPT_NIS_SERVERS = 27, OPT_NISP_SERVERS = 28, OPT_NIS_DOMAIN_NAME = 29, OPT_NISP_DOMAIN_NAME = 30, OPT_LIFETIME = 32, FQ_DOMAIN_NAME = 39 } |
Functions | |
| void | send_DHCP_SOLICIT (void) |
| uint8_t | send_DHCP_REQUEST (void) |
| uint8_t | check_DHCP_timeout (void) |
| void | reset_DHCP_timeout (void) |
| void | InitDhcpOption (unsigned asize, unsigned agrowby) |
| void | AppendDhcpOption (uint8_t value) |
| void | DumpDhcpOption (char *sMark) |
| void | DHCP_Option_Select (uint8_t option) |
| uint8_t | send_DHCP_INFOREQ (void) |
| int8_t | parseDHCPMSG (void) |
| uint8_t | DHCP_run2 (void) |
| uint8_t | DHCP_run (wiz_NetInfo *netinfo) |
| void | DHCP_stop (void) |
| void | DHCP_init (uint8_t s, uint8_t *buf) |
| void | DHCP_time_handler (void) |
Variables | |
| uint8_t | DNS6_Address [16] |
| uint8_t | DHCP_SOCKET |
| uint8_t | DHCP_allocated_ip [16] |
| int8_t | dhcp_state = STATE_DHCP6_INIT |
| int8_t | dhcp_retry_count = 0 |
| volatile uint32_t | dhcp_tick_1s = 0 |
| uint32_t | dhcp_tick_next = DHCP_WAIT_TIME |
| uint32_t | DHCP_XID |
| RIP_MSG | pDHCPMSG |
| uint8_t | HOST_NAME [] = DCHP_HOST_NAME |
| uint8_t | DHCP_CHADDR [6] |
| uint16_t | DUID_type_s |
| uint16_t | Hardware_type_s |
| uint8_t | Time_s [4] |
| uint32_t | Enterprise_num_s |
| uint8_t | Server_MAC [6] |
| uint8_t | recv_IP [16] |
| uint32_t | PreLifeTime |
| uint32_t | ValidLifeTime |
| uint16_t | code |
| uint8_t | IAID [4] |
| uint8_t | T1 [4] |
| uint8_t | T2 [4] |
| uint16_t | iana_len |
| uint16_t | iaaddr_len |
| uint16_t | statuscode_len |
| uint16_t | Lstatuscode_len |
| uint16_t | serverid_len |
| uint16_t | clientid_len |
| uint8_t | status_msg [] = "" |
| unsigned | size |
| unsigned | num |
| unsigned | num2 = 0 |
| unsigned | growby |
DHCPv6 APIs implement file.
Processig DHCPv6 protocol as SOLICIT, ADVERTISE.
Copyright (c) 2016, WIZnet Co., LTD. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file dhcpv6.c.
| #define STATE_DHCP6_REQUEST 2 |
| #define STATE_DHCP6_REREQUEST 4 |
| #define DHCP6_REPLY 7 |
| #define DHCP6_RELEASE 8 |
| #define DHCP6_DECLINE 9 |
| #define DHCP6_RECONFIGURE 10 |
| #define DHCP6_INFO_REQUEST 11 |
| anonymous enum |
| void send_DHCP_SOLICIT | ( | void | ) |
Definition at line 275 of file dhcpv6.c.
References AppendDhcpOption(), DHCP6_SOLICIT, DHCP_CHADDR, DHCP_SERVER_PORT, DHCP_SOCKET, DHCP_XID, DumpDhcpOption(), growby, InitDhcpOption(), num, RIP_MSG::OPT, OPT_CLIENTID, OPT_IANA, pDHCPMSG, sendto(), and size.
Referenced by check_DHCP_timeout(), and DHCP_run().
| uint8_t send_DHCP_REQUEST | ( | void | ) |
Definition at line 392 of file dhcpv6.c.
References AppendDhcpOption(), code, DHCP6_REQUEST, DHCP_CHADDR, DHCP_SERVER_PORT, DHCP_SOCKET, DHCP_XID, DUID_type_s, DumpDhcpOption(), growby, Hardware_type_s, iaaddr_len, IAID, iana_len, InitDhcpOption(), Lstatuscode_len, num, RIP_MSG::OPT, OPT_CLIENTID, OPT_IAADDR, OPT_IANA, OPT_SERVERID, OPT_STATUS_CODE, pDHCPMSG, PreLifeTime, recv_IP, sendto(), Server_MAC, serverid_len, size, T1, T2, Time_s, and ValidLifeTime.
Referenced by DHCP_run().
| uint8_t check_DHCP_timeout | ( | void | ) |
Definition at line 1176 of file dhcpv6.c.
References DHCP_FAILED, dhcp_retry_count, DHCP_RUNNING, dhcp_state, dhcp_tick_1s, dhcp_tick_next, DHCP_WAIT_TIME, MAX_DHCP_RETRY, reset_DHCP_timeout(), send_DHCP_SOLICIT(), STATE_DHCP6_INIT, and STATE_DHCP6_SOLICIT.
| void reset_DHCP_timeout | ( | void | ) |
Definition at line 1261 of file dhcpv6.c.
References dhcp_retry_count, dhcp_tick_1s, dhcp_tick_next, and DHCP_WAIT_TIME.
Referenced by check_DHCP_timeout(), and DHCP_init().
| void InitDhcpOption | ( | unsigned | asize, |
| unsigned | agrowby | ||
| ) |
| asize | |
| agrowby |
Definition at line 188 of file dhcpv6.c.
References growby, num, and size.
Referenced by send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
| void AppendDhcpOption | ( | uint8_t | value | ) |
| value |
Definition at line 200 of file dhcpv6.c.
References num, RIP_MSG::OPT, pDHCPMSG, and size.
Referenced by send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
| void DumpDhcpOption | ( | char * | sMark | ) |
| sMark |
Definition at line 218 of file dhcpv6.c.
References num, num2, RIP_MSG::OPT, pDHCPMSG, and size.
Referenced by send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
| void DHCP_Option_Select | ( | uint8_t | option | ) |
| option |
Definition at line 235 of file dhcpv6.c.
References DNS_RecursiveNameServer, Domain_Search_List, FQ_DOMAIN_NAME, OPT_AUTH, OPT_CLIENTID, OPT_ELAPSED_TIME, OPT_IAADDR, OPT_IANA, OPT_IAPD, OPT_IAPREFIX, OPT_IATA, OPT_INTERFACE_ID, OPT_NIS_DOMAIN_NAME, OPT_NIS_SERVERS, OPT_NISP_DOMAIN_NAME, OPT_NISP_SERVERS, OPT_PREFERENCE, OPT_RAPID_COMMIT, OPT_RECONF_ACCEPT, OPT_RECONF_MSG, OPT_RELAY_MSG, OPT_REQUEST, OPT_SERVERID, OPT_STATUS_CODE, OPT_UNICAST, OPT_USER_CLASS, OPT_VENDOR_CLASS, OPT_VENDOR_OPTS, SIP_Server_DNL, and SIP_Server_V6ADDR.
| uint8_t send_DHCP_INFOREQ | ( | void | ) |
Definition at line 601 of file dhcpv6.c.
References AppendDhcpOption(), DHCP6_INFO_REQUEST, DHCP_CHADDR, DHCP_SERVER_PORT, DHCP_SOCKET, DHCP_XID, DNS_RecursiveNameServer, Domain_Search_List, DumpDhcpOption(), growby, InitDhcpOption(), num, RIP_MSG::OPT, OPT_CLIENTID, OPT_LIFETIME, OPT_REQUEST, pDHCPMSG, sendto(), and size.
Referenced by DHCP_run2().
| int8_t parseDHCPMSG | ( | void | ) |
Definition at line 690 of file dhcpv6.c.
References clientid_len, code, DHCP6_ADVERTISE, DHCP6_REPLY, DHCP_SOCKET, DNS6_Address, DNS_RecursiveNameServer, Domain_Search_List, DUID_type_s, Enterprise_num_s, getSn_RX_RSR(), Hardware_type_s, iaaddr_len, IAID, iana_len, Lstatuscode_len, RIP_MSG::OPT, OPT_CLIENTID, OPT_IAADDR, OPT_IANA, OPT_IATA, OPT_SERVERID, OPT_STATUS_CODE, pDHCPMSG, PreLifeTime, recv_IP, recvfrom(), Server_MAC, serverid_len, statuscode_len, T1, T2, Time_s, and ValidLifeTime.
Referenced by DHCP_run(), and DHCP_run2().
| uint8_t DHCP_run2 | ( | void | ) |
Definition at line 1036 of file dhcpv6.c.
References _Sn_TTLR_, DHCP_CLIENT_PORT, DHCP_IP_LEASED, DHCP_RUNNING, DHCP_SOCKET, dhcp_state, DHCP_STOPPED, getSn_SR, parseDHCPMSG(), send_DHCP_INFOREQ(), Sn_MR_UDP6, SOCK_UDP, socket(), STATE_DHCP6_INIT, STATE_DHCP6_RELEASE, STATE_DHCP6_STOP, and WIZCHIP_WRITE().
| uint8_t DHCP_run | ( | wiz_NetInfo * | netinfo | ) |
| netinfo |
Definition at line 1074 of file dhcpv6.c.
References _Sn_TTLR_, DHCP6_ADVERTISE, DHCP_allocated_ip, DHCP_CLIENT_PORT, DHCP_IP_LEASED, DHCP_RUNNING, DHCP_SOCKET, dhcp_state, DHCP_STOPPED, getSn_SR, wiz_NetInfo_t::gua, parseDHCPMSG(), recv_IP, send_DHCP_REQUEST(), send_DHCP_SOLICIT(), Sn_MR_UDP6, SOCK_UDP, socket(), STATE_DHCP6_INIT, STATE_DHCP6_REQUEST, STATE_DHCP6_SOLICIT, STATE_DHCP6_STOP, and WIZCHIP_WRITE().
| void DHCP_stop | ( | void | ) |
Definition at line 1165 of file dhcpv6.c.
References close(), DHCP_SOCKET, dhcp_state, and STATE_DHCP6_STOP.
| void DHCP_init | ( | uint8_t | s, |
| uint8_t * | buf | ||
| ) |
| s | |
| buf |
Definition at line 1228 of file dhcpv6.c.
References DHCP_CHADDR, DHCP_SOCKET, dhcp_state, DHCP_XID, getSHAR, RIP_MSG::OPT, pDHCPMSG, reset_DHCP_timeout(), setSHAR, and STATE_DHCP6_INIT.
| void DHCP_time_handler | ( | void | ) |
Definition at line 1272 of file dhcpv6.c.
References dhcp_tick_1s.
| uint8_t DNS6_Address[16] |
| uint8_t DHCP_SOCKET |
Definition at line 127 of file dhcpv6.c.
Referenced by DHCP_init(), DHCP_run(), DHCP_run2(), DHCP_stop(), parseDHCPMSG(), send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
| uint8_t DHCP_allocated_ip[16] |
| int8_t dhcp_state = STATE_DHCP6_INIT |
Definition at line 133 of file dhcpv6.c.
Referenced by check_DHCP_timeout(), DHCP_init(), DHCP_run(), DHCP_run2(), and DHCP_stop().
| int8_t dhcp_retry_count = 0 |
Definition at line 134 of file dhcpv6.c.
Referenced by check_DHCP_timeout(), and reset_DHCP_timeout().
| volatile uint32_t dhcp_tick_1s = 0 |
Definition at line 136 of file dhcpv6.c.
Referenced by check_DHCP_timeout(), DHCP_time_handler(), and reset_DHCP_timeout().
| uint32_t dhcp_tick_next = DHCP_WAIT_TIME |
Definition at line 137 of file dhcpv6.c.
Referenced by check_DHCP_timeout(), and reset_DHCP_timeout().
| uint32_t DHCP_XID |
Definition at line 139 of file dhcpv6.c.
Referenced by DHCP_init(), send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
| RIP_MSG pDHCPMSG |
Definition at line 141 of file dhcpv6.c.
Referenced by AppendDhcpOption(), DHCP_init(), DumpDhcpOption(), parseDHCPMSG(), send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
| uint8_t HOST_NAME[] = DCHP_HOST_NAME |
| uint8_t DHCP_CHADDR[6] |
Definition at line 145 of file dhcpv6.c.
Referenced by DHCP_init(), send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
| uint16_t DUID_type_s |
Definition at line 157 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint16_t Hardware_type_s |
Definition at line 158 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint8_t Time_s[4] |
Definition at line 159 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint32_t Enterprise_num_s |
Definition at line 160 of file dhcpv6.c.
Referenced by parseDHCPMSG().
| uint8_t Server_MAC[6] |
Definition at line 161 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint8_t recv_IP[16] |
Definition at line 162 of file dhcpv6.c.
Referenced by DHCP_run(), parseDHCPMSG(), and send_DHCP_REQUEST().
| uint32_t PreLifeTime |
Definition at line 163 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint32_t ValidLifeTime |
Definition at line 164 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint16_t code |
Definition at line 165 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint8_t IAID[4] |
Definition at line 166 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint8_t T1[4] |
Definition at line 167 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint8_t T2[4] |
Definition at line 168 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint16_t iana_len |
Definition at line 169 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint16_t iaaddr_len |
Definition at line 170 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint16_t statuscode_len |
Definition at line 171 of file dhcpv6.c.
Referenced by parseDHCPMSG().
| uint16_t Lstatuscode_len |
Definition at line 172 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint16_t serverid_len |
Definition at line 173 of file dhcpv6.c.
Referenced by parseDHCPMSG(), and send_DHCP_REQUEST().
| uint16_t clientid_len |
Definition at line 174 of file dhcpv6.c.
Referenced by parseDHCPMSG().
| unsigned size |
Definition at line 177 of file dhcpv6.c.
Referenced by AppendDhcpOption(), DumpDhcpOption(), InitDhcpOption(), loopback_udps(), send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
| unsigned num |
Definition at line 178 of file dhcpv6.c.
Referenced by AppendDhcpOption(), DumpDhcpOption(), InitDhcpOption(), send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
| unsigned num2 = 0 |
Definition at line 179 of file dhcpv6.c.
Referenced by DumpDhcpOption().
| unsigned growby |
Definition at line 180 of file dhcpv6.c.
Referenced by InitDhcpOption(), send_DHCP_INFOREQ(), send_DHCP_REQUEST(), and send_DHCP_SOLICIT().
1.8.17