nip_init.h

Go to the documentation of this file.
00001 /*##############################################################################
00002 
00003 nIP - nano IP stack
00004 
00005 File        : nip_init.h
00006 
00007 Description : Initialize NIP Internetstack (HEADER)
00008 
00009 Copyright notice:
00010 
00011 Copyright (C) 2007 -
00012 Andreas Dittrich, dittrich@informatik.hu-berlin.de
00013 Jon Kowal, kowal@informatik.hu-berlin.de
00014 
00015 This program is free software; you can redistribute it and/or
00016 modify it under the terms of the GNU General Public License
00017 as published by the Free Software Foundation; either version 2
00018 of the License, or (at your option) any later version.
00019 
00020 This program is distributed in the hope that it will be useful,
00021 but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00023 GNU General Public License for more details.
00024 
00025 You should have received a copy of the GNU General Public License
00026 along with this program; if not, write to the Free Software
00027 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00028 
00029 ##############################################################################*/
00030 
00031 #ifndef _NIP_INIT_H
00032  #define _NIP_INIT_H
00033 
00034 #include "nip_types.h"
00035 
00036 #define QMAKESTR(s) #s
00037 #define MAKESTR(s)  QMAKESTR(s)
00038 
00039 /** @name Architecture */
00040 //@{
00041 /** define what architecture the NIP network stack will be compiled for. The
00042  * architecture has to match a directory name in the `'arch'' directory.
00043  */
00044 #define NIP_ARCH       avr
00045 
00046 /** path for architecture-dependent files. */
00047 #define NIP_ARCH_PATH  arch/NIP_ARCH
00048 
00049 /** Build filename for includes depending on the architecture. */
00050 #define NIP_ARCH_FILE( file ) MAKESTR(NIP_ARCH_PATH/file)
00051 
00052 //@}
00053 
00054 /** @name nIP Modules */
00055 //@{
00056 
00057 #define NIP_ICMP_ENABLE   1
00058 #define NIP_UDP_ENABLE    1
00059 #define NIP_TCP_ENABLE    0
00060 #define NIP_DHCP_ENABLE   1 /** Dynamic Host Configuration Protocol. Requires NIP_UDP_ENABLE. */
00061 #define NIP_AUTOIP_ENABLE 1 /** Dynamic Configuration of IPv4 Link-Local Addresses */
00062 #define NIP_MULTICAST_ENABLE 1 /** Send and receive IP multicast messages */
00063 #define NIP_IGMP_ENABLE   0 /** needed to receive multihop multicast messages. Requires NIP_MULTICAST_ENABLE */
00064 #define NIP_MDNS_ENABLE   1 /** not yet implemented */
00065 
00066 //@}
00067 
00068 /** @name Network Interface Configuration */
00069 //@{
00070 
00071 /** Define Number of network interfaces */
00072 #define NIP_NET_IF_COUNT 1
00073 
00074 /** Define maximum number of queued transmissions per interface. Defaults to 2.*/
00075 #define NIP_NET_RX_TRANS_COUNT 2
00076 
00077 /** Define maximum number transmissions in global send queue. Defaults to 2.*/
00078 #define NIP_NET_TX_TRANS_COUNT 2
00079 
00080 /** Define maximum hardware address size. Defaults to 6 for ethernet addresses.*/
00081 #define NIP_MAX_HW_ADDR_SIZE 6
00082 
00083 /** Define maximum network address size. Defaults to 4 for ip addressing.*/
00084 #define NIP_MAX_NET_ADDR_SIZE 4
00085 
00086 /** Enable local loopback of network packages */
00087 #define NIP_NET_LOOPBACK_ENABLE 1
00088 
00089 //@}
00090 
00091 /** @name Network Interface Statistics */
00092 //@{
00093 
00094 /** count network interface receive buffer overruns */
00095 #define NIP_NET_IF_CNT_OVERRUN
00096 
00097 /** count receive errors */
00098 #define NIP_NET_IF_CNT_RXE
00099 
00100 /** count transmit errors */
00101 #define NIP_NET_IF_CNT_TXE
00102 
00103 /** count discarded packets */
00104 #define NIP_NET_IF_CNT_DISCARDED
00105 
00106 /** count received packets  */
00107 #define NIP_NET_IF_CNT_RECEIVED
00108 
00109 //@}
00110 
00111 
00112 /** @name Transport Layer Configuration */
00113 //@{
00114 
00115 //** Define maximum number of transport layer sockets. */
00116 //#define NIP_MAX_SOCKETS 10
00117 
00118 /** Use fixed socket array (static allocation of memory for fixed numer of
00119         * sockets) or use dynamic array of sockets with at most NIP_UDP_MAX_SOCKETS
00120         * sockets. */
00121 #define NIP_UDP_USE_FIXED_SOCKETS  1
00122 
00123 /** Fixed number of UDP sockets to be used for fixed socket configuration */
00124 #define NIP_UDP_FIXED_SOCKETS      4
00125 
00126 /** Fixed size of UDP queue for incoming packets */
00127 #define NIP_UDP_PACKET_QUEUE_SIZE  4
00128 
00129 
00130 //@}
00131 
00132 
00133 
00134 /** @name Memory management */
00135 //@{
00136 
00137 /** Define maximum number of memory blocks.
00138   * \note Any number larger than 255 will cause memory addresses to be larger
00139   * than 8 Bit, which  may be disadvantagous on 8-bit architectures. */
00140 #define NIP_MEM_MAX_BLOCKS 255
00141 
00142 /** Number of bytes reserved for dynamic buffer management.
00143  * \note Not all of the reservied memory will actually be available for
00144  * allocation, as some of it will be spent on management information.
00145  */
00146 #define NIP_MEM_DYNAMIC_SIZE 600
00147 
00148 
00149 /** enable additional sanity check which may be useful points to halt the
00150  * debugger at. Check for DEBUG comments in nip_mem.c.
00151  */
00152 #define NIP_MEM_DEBUG  1
00153 
00154 //@}
00155 
00156 
00157 
00158 
00159 void nip_init( void );
00160 
00161 #endif /* _NIP_INIT */
00162 

Generated on Thu Feb 14 12:55:09 2008 for NIP by  doxygen 1.5.3