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