BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJLIB Reference

rtems_network_config.h
1 /* $Id: rtems_network_config.h 3553 2011-05-05 06:14:19Z nanang $ */
2 /*
3  * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * Thanks Zetron, Inc and Phil Torre <ptorre@zetron.com> for donating PJLIB
23  * port to RTEMS.
24  */
25 
26 /*
27  * Network configuration
28  *
29  ************************************************************
30  * EDIT THIS FILE TO REFLECT YOUR NETWORK CONFIGURATION *
31  * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! *
32  ************************************************************
33  *
34  */
35 
36 #ifndef _RTEMS_NETWORKCONFIG_H_
37 #define _RTEMS_NETWORKCONFIG_H_
38 
39 
40 #define DEFAULT_IP_ADDRESS_STRING "192.168.0.2"
41 #define DEFAULT_NETMASK_STRING "255.255.255.0"
42 #define DEFAULT_GATEWAY_STRING "192.168.0.1"
43 
44 
45 
46 
47 #ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
48 #warning "RTEMS_BSP_NETWORK_DRIVER_NAME is not defined"
49 #define RTEMS_BSP_NETWORK_DRIVER_NAME "no_network1"
50 #endif
51 
52 #ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH
53 #warning "RTEMS_BSP_NETWORK_DRIVER_ATTACH is not defined"
54 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH 0
55 #endif
56 
57 #define NETWORK_STACK_PRIORITY 128
58 /* #define RTEMS_USE_BOOTP */
59 
60 /* #define RTEMS_USE_LOOPBACK */
61 
62 #include <bsp.h>
63 
64 /*
65  * Define RTEMS_SET_ETHERNET_ADDRESS if you want to specify the
66  * Ethernet address here. If RTEMS_SET_ETHERNET_ADDRESS is not
67  * defined the driver will choose an address.
68  */
69 // NOTE: The address below is a dummy address that should only ever
70 // be used for testing on a private network. DO NOT LET A PRODUCT
71 // CONTAINING THIS ETHERNET ADDRESS OUT INTO THE FIELD!
72 //#define RTEMS_SET_ETHERNET_ADDRESS
73 #if (defined (RTEMS_SET_ETHERNET_ADDRESS))
74 static char ethernet_address[6] = { 0x00, 0x80, 0x7F, 0x22, 0x61, 0x77 };
75 #endif
76 
77 #define RTEMS_USE_LOOPBACK
78 #ifdef RTEMS_USE_LOOPBACK
79 /*
80  * Loopback interface
81  */
82 extern int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig* dummy, int unused);
83 static struct rtems_bsdnet_ifconfig loopback_config = {
84  "lo0", /* name */
85  rtems_bsdnet_loopattach, /* attach function */
86  NULL, /* link to next interface */
87  "127.0.0.1", /* IP address */
88  "255.0.0.0", /* IP net mask */
89 };
90 #endif
91 
92 /*
93  * Default network interface
94  */
95 static struct rtems_bsdnet_ifconfig netdriver_config = {
96  RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */
97  RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach function */
98 
99 #ifdef RTEMS_USE_LOOPBACK
100  &loopback_config, /* link to next interface */
101 #else
102  NULL, /* No more interfaces */
103 #endif
104 
105 #if (defined (RTEMS_USE_BOOTP))
106  NULL, /* BOOTP supplies IP address */
107  NULL, /* BOOTP supplies IP net mask */
108 #else
109  "192.168.0.33", /* IP address */
110  "255.255.255.0", /* IP net mask */
111 #endif /* !RTEMS_USE_BOOTP */
112 
113 #if (defined (RTEMS_SET_ETHERNET_ADDRESS))
114  ethernet_address, /* Ethernet hardware address */
115 #else
116  NULL, /* Driver supplies hardware address */
117 #endif
118  0 /* Use default driver parameters */
119 };
120 
121 /*
122  * Network configuration
123  */
124 struct rtems_bsdnet_config rtems_bsdnet_config = {
125  &netdriver_config,
126 
127 #if (defined (RTEMS_USE_BOOTP))
128  rtems_bsdnet_do_bootp,
129 #else
130  NULL,
131 #endif
132 
133  NETWORK_STACK_PRIORITY, /* Default network task priority */
134  1048576, /* Default mbuf capacity */
135  1048576, /* Default mbuf cluster capacity */
136 
137 #if (!defined (RTEMS_USE_BOOTP))
138  "testnode", /* Host name */
139  "example.org", /* Domain name */
140  "192.168.6.9", /* Gateway */
141  "192.168.7.41", /* Log host */
142  {"198.137.231.1" }, /* Name server(s) */
143  {"207.202.190.162" }, /* NTP server(s) */
144 #endif /* !RTEMS_USE_BOOTP */
145 
146 };
147 
148 #endif /* _RTEMS_NETWORKCONFIG_H_ */
149 

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.