#include "nip_init.h"
#include "nip_types.h"
#include "net/net_if.h"
#include "net/udp.h"
Go to the source code of this file.
#define DHCP_OPTION_DNS 6 |
#define DHCP_OPTION_END 255 |
Definition at line 71 of file dhcp.h.
Referenced by nip_dhcp_disp_check(), and nip_dhcp_find_option().
#define DHCP_OPTION_LEASETIME 51 |
#define DHCP_OPTION_MSGTYPE 53 |
#define DHCP_OPTION_MSGTYPE_ACK 5 |
#define DHCP_OPTION_MSGTYPE_DISCOVER 1 |
#define DHCP_OPTION_MSGTYPE_NAK 6 |
#define DHCP_OPTION_MSGTYPE_OFFER 2 |
#define DHCP_OPTION_MSGTYPE_REQUEST 3 |
#define DHCP_OPTION_PADDING 0 |
#define DHCP_OPTION_REBINDING_TIME 59 |
#define DHCP_OPTION_RENEWAL_TIME 58 |
#define DHCP_OPTION_ROUTER 3 |
#define DHCP_OPTION_SUBNETMASK 1 |
#define NIP_DHCP_INIT_BACKOFF 4 |
initial delay for exponential backoff algorithm
Definition at line 40 of file dhcp.h.
Referenced by nip_dhcp_disp_check().
#define NIP_DHCP_MAGIC_COOKIE 0x63825363 |
DHCP Magic Cookie Option in Network Byte Order (decimal 99.130.82.99).
Definition at line 79 of file dhcp.h.
Referenced by nip_dhcp_disp_check().
#define NIP_DHCP_MAX_BACKOFF 64 |
maximum delay for exponential backoff algorithm
Definition at line 41 of file dhcp.h.
Referenced by nip_dhcp_disp_check().
#define NIP_DHCP_OP_REPLY 2 |
#define NIP_DHCP_OP_REQUEST 1 |
enum nip_dhcp_stat_t |
void nip_dhcp_disable | ( | nip_net_if_id_t | net_if | ) |
disable dhcp for given network interface
Definition at line 67 of file dhcp.c.
References NIP_DHCP_CONF, and NIP_DHCP_STAT_DISABLED.
void nip_dhcp_disp_check | ( | void | ) |
Dispatcher function to be called to check dhcp status.
Definition at line 135 of file dhcp.c.
References nip_if_ip_conf::addr, nip_dhcp_packet::chaddr, nip_dhcp_packet::ciaddr, CONF_ATTR, DHCP_OPTION_DNS, DHCP_OPTION_END, DHCP_OPTION_LEASETIME, DHCP_OPTION_MSGTYPE, DHCP_OPTION_MSGTYPE_ACK, DHCP_OPTION_MSGTYPE_DISCOVER, DHCP_OPTION_MSGTYPE_NAK, DHCP_OPTION_MSGTYPE_OFFER, DHCP_OPTION_MSGTYPE_REQUEST, DHCP_OPTION_REBINDING_TIME, DHCP_OPTION_RENEWAL_TIME, DHCP_OPTION_ROUTER, DHCP_OPTION_SUBNETMASK, DHCPMSGSIZE, nip_dhcp_packet::flags, nip_dhcp_packet::hlen, nip_dhcp_packet::htype, nip_phy_if_t::hw_addr, nip_phy_if_t::hw_addr_size, nip_net_if::ip_conf, nip_dhcp_option::ipaddr, nip_dhcp_packet::magic_cookie, nip_dhcp_option::msgtype, NIP_CURR_CMD, NIP_CURR_IF, NIP_DHCP_CONF, nip_dhcp_disp_sock_init(), nip_dhcp_find_option(), NIP_DHCP_INIT_BACKOFF, NIP_DHCP_MAGIC_COOKIE, NIP_DHCP_MAX_BACKOFF, NIP_DHCP_OP_REPLY, NIP_DHCP_OP_REQUEST, nip_dhcp_sock, NIP_DHCP_STAT_BOUND, NIP_DHCP_STAT_INIT, NIP_DHCP_STAT_REBINDING, NIP_DHCP_STAT_RENEWING, NIP_DHCP_STAT_REQUESTING, NIP_DHCP_STAT_SELECTING, NIP_E_OK, nip_ip_addr_autoconf(), nip_ip_addr_set(), nip_ip_subnet_set(), nip_memcpy(), nip_memset, nip_net_if_list, nip_tickcount, nip_udp_cancel_recv(), nip_udp_cancel_send(), nip_udp_close(), nip_udp_data_ptr(), nip_udp_forward(), nip_udp_init_send(), NIP_UDP_NO_SOCKET, NIP_UDP_PORT_DHCPSERVER, nip_udp_ptr_release(), nip_udp_recvfrom(), NIP_UDP_RX_BUF, nip_udp_transmit(), NIP_UDP_TX_BUF, nip_udp_write(), ntohl, NULL, nip_dhcp_packet::op, nip_dhcp_packet::options, nip_net_if::phy_conf, nip_if_ip_conf::std_gateway, nip_dhcp_option::time, nip_phy_if_t::type, nip_dhcp_option::valsize, nip_dhcp_option::value, nip_dhcp_packet::xid, and nip_dhcp_packet::yiaddr.
void nip_dhcp_start | ( | nip_net_if_id_t | net_if | ) |
enable dhcp for given network interface
Definition at line 59 of file dhcp.c.
References NIP_DHCP_CONF, NIP_DHCP_STAT_INIT, NIP_DISP_IF_DHCP, and nip_disp_notify_if().