![]() |
io6Library
WIZnet Dual Stack TCP/IP Ethernet Controller Driver
|
DHCP APIs Header file. More...
Go to the source code of this file.
Macros | |
| #define | MAX_DHCPV4_RETRY 2 |
| Maximum retry count. More... | |
| #define | DHCPV4_WAIT_TIME 10 |
| Wait Time 10s. More... | |
| #define | DHCPV4_SERVER_PORT 67 |
| DHCP server port number. More... | |
| #define | DHCPV4_CLIENT_PORT 68 |
| DHCP client port number. More... | |
| #define | MAGIC_COOKIE 0x63825363 |
| You should not modify it number. More... | |
| #define | DCHPV4_HOST_NAME "WIZnet\0" |
Enumerations | |
| enum | { DHCPV4_FAILED = 0, DHCPV4_RUNNING, DHCP_IPV4_ASSIGN, DHCP_IPV4_CHANGED, DHCP_IPV4_LEASED, DHCPV4_STOPPED } |
Functions | |
| void | DHCPv4_init (uint8_t s, uint8_t *buf) |
| void | DHCPv4_time_handler (void) |
| void | reg_dhcpv4_cbfunc (void(*ip_assign)(void), void(*ip_update)(void), void(*ip_conflict)(void)) |
| uint8_t | DHCPv4_run (void) |
| void | DHCPv4_stop (void) |
| void | getIPfromDHCPv4 (uint8_t *ip) |
| void | getGWfromDHCPv4 (uint8_t *ip) |
| void | getSNfromDHCPv4 (uint8_t *ip) |
| void | getDNSfromDHCPv4 (uint8_t *ip) |
| uint32_t | getDHCPv4Leasetime (void) |
DHCP APIs Header file.
Processig DHCP protocol as DISCOVER, OFFER, REQUEST, ACK, NACK and DECLINE.
Copyright (c) 2013, 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 dhcpv4.h.
| #define MAGIC_COOKIE 0x63825363 |
| anonymous enum |
| void DHCPv4_init | ( | uint8_t | s, |
| uint8_t * | buf | ||
| ) |
Definition at line 932 of file dhcpv4.c.
References DHCPv4_CHADDR, DHCPV4_SOCKET, dhcpv4_state, DHCPV4_XID, getSHAR, pDHCPv4MSG, reset_DHCPv4_timeout(), setGAR, setSHAR, setSIPR, and STATE_DHCPV4_INIT.
| void DHCPv4_time_handler | ( | void | ) |
Definition at line 969 of file dhcpv4.c.
References dhcpv4_tick_1s.
| void reg_dhcpv4_cbfunc | ( | void(*)(void) | ip_assign, |
| void(*)(void) | ip_update, | ||
| void(*)(void) | ip_conflict | ||
| ) |
Definition at line 284 of file dhcpv4.c.
References default_ipv4_assign(), default_ipv4_conflict(), default_ipv4_update(), and dhcp_ipv4_assign.
| uint8_t DHCPv4_run | ( | void | ) |
Definition at line 707 of file dhcpv4.c.
References check_DHCPv4_leasedIP(), check_DHCPv4_timeout(), dhcp_ipv4_assign, DHCP_IPV4_CHANGED, DHCP_IPV4_LEASED, DHCPV4_ACK, DHCPv4_allocated_ip, DHCPV4_CLIENT_PORT, dhcpv4_lease_time, DHCPV4_NAK, DHCPV4_OFFER, dhcpv4_retry_count, DHCPV4_RUNNING, DHCPV4_SOCKET, dhcpv4_state, DHCPV4_STOPPED, dhcpv4_tick_1s, DHCPV4_XID, getSn_SR, INFINITE_LEASETIME, OLD_allocated_ip, parseDHCPv4MSG(), pDHCPv4MSG, reset_DHCPv4_timeout(), send_DHCPv4_DISCOVER(), send_DHCPv4_REQUEST(), Sn_MR_UDP, SOCK_UDP, socket(), STATE_DHCPV4_DISCOVER, STATE_DHCPV4_INIT, STATE_DHCPV4_LEASED, STATE_DHCPV4_REQUEST, STATE_DHCPV4_REREQUEST, STATE_DHCPV4_STOP, and RIP_MSG::yiaddr.
| void DHCPv4_stop | ( | void | ) |
Definition at line 838 of file dhcpv4.c.
References close(), DHCPV4_SOCKET, dhcpv4_state, and STATE_DHCPV4_STOP.
| void getIPfromDHCPv4 | ( | uint8_t * | ip | ) |
Definition at line 974 of file dhcpv4.c.
References DHCPv4_allocated_ip.
| void getGWfromDHCPv4 | ( | uint8_t * | ip | ) |
Definition at line 982 of file dhcpv4.c.
References DHCPv4_allocated_gw.
| void getSNfromDHCPv4 | ( | uint8_t * | ip | ) |
Definition at line 990 of file dhcpv4.c.
References DHCPv4_allocated_sn.
| void getDNSfromDHCPv4 | ( | uint8_t * | ip | ) |
Definition at line 998 of file dhcpv4.c.
References DHCPv4_allocated_dns.
| uint32_t getDHCPv4Leasetime | ( | void | ) |
Definition at line 1006 of file dhcpv4.c.
References dhcpv4_lease_time.
1.8.17