3      Copyright (C) Dean Camera, 2011. 
   5   dean [at] fourwalledcubicle [dot] com 
  10   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com) 
  12   Permission to use, copy, modify, distribute, and sell this 
  13   software and its documentation for any purpose is hereby granted 
  14   without fee, provided that the above copyright notice appear in 
  15   all copies and that both that the copyright notice and this 
  16   permission notice and warranty disclaimer appear in supporting 
  17   documentation, and that the name of the author not be used in 
  18   advertising or publicity pertaining to distribution of the 
  19   software without specific, written prior permission. 
  21   The author disclaim all warranties with regard to this 
  22   software, including all implied warranties of merchantability 
  23   and fitness.  In no event shall the author be liable for any 
  24   special, indirect or consequential damages or any damages 
  25   whatsoever resulting from loss of use, data or profits, whether 
  26   in an action of contract, negligence or other tortious action, 
  27   arising out of or in connection with the use or performance of 
  33  *  Header file for uIPManagement.c. 
  36 #ifndef _UIP_MANAGEMENT_H_ 
  37 #define _UIP_MANAGEMENT_H_ 
  40                 #include <LUFA/Drivers/USB/USB.h> 
  44                 #include <uip-split.h> 
  47                 #include "Lib/DHCPClientApp.h" 
  48                 #include "Lib/DHCPServerApp.h" 
  49                 #include "Lib/HTTPServerApp.h" 
  50                 #include "Lib/TELNETServerApp.h" 
  53                 /** IP address that the webserver should use once connected to a RNDIS device (when DHCP is disabled). */ 
  54                 #define DEVICE_IP_ADDRESS         (uint8_t[]){10, 0, 0, 2} 
  56                 /** Netmask that the webserver should once connected to a RNDIS device (when DHCP is disabled). */ 
  57                 #define DEVICE_NETMASK            (uint8_t[]){255, 255, 255, 0} 
  59                 /** IP address of the default gateway the webserver should use when routing outside the local subnet 
  60                  *  (when DHCP is disabled). 
  62                 #define DEVICE_GATEWAY            (uint8_t[]){10, 0, 0, 1} 
  64                 /** Ethernet MAC address of the virtual webserver. When in device RNDIS mode, the virtual webserver requires 
  65                  *  a unique MAC address that it can use when sending packets to the RNDIS adapter, which contains a seperate 
  66                  *  MAC address as set in the RNDIS class driver configuration structure. 
  68                 #define SERVER_MAC_ADDRESS        (uint8_t[]){1, 0, 1, 0, 1, 0} 
  70         /* External Variables: */ 
  71                 extern struct uip_eth_addr MACAddress
; 
  73         /* Function Prototypes: */ 
  74                 void uIPManagement_Init(void); 
  75                 void uIPManagement_ManageNetwork(void); 
  76                 void uIPManagement_TCPCallback(void); 
  77                 void uIPManagement_UDPCallback(void); 
  79                 #if defined(INCLUDE_FROM_UIPMANAGEMENT_C) 
  80                         static void uIPManagement_ProcessIncomingPacket(void); 
  81                         static void uIPManagement_ManageConnections(void);