CDC/ECM driver for mbed, based on USBDevice by mbed-official. Uses PicoTCP to access Ethernet USB device. License: GPLv2

Dependents:   USBEthernet_TEST

Fork of USB_Ethernet by Daniele Lacamera

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pico_dhcp_server.h Source File

pico_dhcp_server.h

00001 /*********************************************************************
00002 PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved.
00003 See LICENSE and COPYING for usage.
00004 
00005 *********************************************************************/
00006 #ifndef _INCLUDE_PICO_DHCP_SERVER
00007 #define _INCLUDE_PICO_DHCP_SERVER
00008 
00009 #include "pico_dhcp_common.h"
00010 #include "pico_addressing.h"
00011 
00012 /* default configuration */ 
00013 #define OPENDNS (long_be(0xd043dede)) /* OpenDNS DNS server 208.67.222.222 */
00014 #define POOL_START long_be(0x00000064)
00015 #define POOL_END long_be(0x000000fe)
00016 #define LEASE_TIME long_be(0x00000078)
00017 
00018 struct pico_dhcpd_settings
00019 {
00020   struct pico_device *dev;
00021   struct pico_socket *s;
00022   struct pico_ip4 my_ip;
00023   struct pico_ip4 netmask;
00024   uint32_t pool_start;
00025   uint32_t pool_next;
00026   uint32_t pool_end;
00027   uint32_t lease_time;
00028   uint8_t flags; /* unused atm */
00029 };
00030 
00031 struct pico_dhcp_negotiation {
00032   struct pico_dhcpd_settings *settings;
00033   struct pico_ip4 ipv4;
00034   struct pico_eth eth;
00035   enum dhcp_negotiation_state state;
00036   uint32_t xid;
00037   uint32_t assigned_address;
00038 };
00039 
00040 /* required settings field: IP address of the interface to serve, only IPs of this network will be served. */
00041 int pico_dhcp_server_initiate(struct pico_dhcpd_settings *setting);
00042 
00043 #endif /* _INCLUDE_PICO_DHCP_SERVER */