1 | /* |
---|
2 | * Network configuration |
---|
3 | * |
---|
4 | ************************************************************ |
---|
5 | * EDIT THIS FILE TO REFLECT YOUR NETWORK CONFIGURATION * |
---|
6 | * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! * |
---|
7 | ************************************************************ |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #ifndef _RTEMS_NETWORKCONFIG_H_ |
---|
13 | #define _RTEMS_NETWORKCONFIG_H_ |
---|
14 | |
---|
15 | /* |
---|
16 | * The following will normally be set by the BSP if it supports |
---|
17 | * a single network device driver. In the event, it supports |
---|
18 | * multiple network device drivers, then the user's default |
---|
19 | * network device driver will have to be selected by a BSP |
---|
20 | * specific mechanism. |
---|
21 | */ |
---|
22 | |
---|
23 | #ifndef RTEMS_BSP_NETWORK_DRIVER_NAME |
---|
24 | #warning "RTEMS_BSP_NETWORK_DRIVER_NAME is not defined" |
---|
25 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "no_network1" |
---|
26 | #endif |
---|
27 | |
---|
28 | #ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH |
---|
29 | #warning "RTEMS_BSP_NETWORK_DRIVER_ATTACH is not defined" |
---|
30 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH 0 |
---|
31 | #endif |
---|
32 | |
---|
33 | /* #define RTEMS_USE_BOOTP */ |
---|
34 | |
---|
35 | #include <bsp.h> |
---|
36 | |
---|
37 | /* |
---|
38 | * Define RTEMS_SET_ETHERNET_ADDRESS if you want to specify the |
---|
39 | * Ethernet address here. If RTEMS_SET_ETHERNET_ADDRESS is not |
---|
40 | * defined the driver will choose an address. |
---|
41 | */ |
---|
42 | #define RTEMS_SET_ETHERNET_ADDRESS |
---|
43 | #if (defined (RTEMS_SET_ETHERNET_ADDRESS)) |
---|
44 | /* static char ethernet_address[6] = { 0x08, 0x00, 0x3e, 0x12, 0x28, 0xb1 }; */ |
---|
45 | static char ethernet_address[6] = { 0x00, 0x80, 0x7F, 0x22, 0x61, 0x77 }; |
---|
46 | |
---|
47 | #endif |
---|
48 | |
---|
49 | #ifdef RTEMS_USE_LOOPBACK |
---|
50 | /* |
---|
51 | * Loopback interface |
---|
52 | */ |
---|
53 | extern void rtems_bsdnet_loopattach(); |
---|
54 | static struct rtems_bsdnet_ifconfig loopback_config = { |
---|
55 | "lo0", /* name */ |
---|
56 | rtems_bsdnet_loopattach, /* attach function */ |
---|
57 | |
---|
58 | NULL, /* link to next interface */ |
---|
59 | |
---|
60 | "127.0.0.1", /* IP address */ |
---|
61 | "255.0.0.0", /* IP net mask */ |
---|
62 | }; |
---|
63 | #endif |
---|
64 | |
---|
65 | /* |
---|
66 | * Default network interface |
---|
67 | */ |
---|
68 | static struct rtems_bsdnet_ifconfig netdriver_config = { |
---|
69 | RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */ |
---|
70 | RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach function */ |
---|
71 | |
---|
72 | #ifdef RTEMS_USE_LOOPBACK |
---|
73 | &loopback_config, /* link to next interface */ |
---|
74 | #else |
---|
75 | NULL, /* No more interfaces */ |
---|
76 | #endif |
---|
77 | |
---|
78 | #if (defined (RTEMS_USE_BOOTP)) |
---|
79 | NULL, /* BOOTP supplies IP address */ |
---|
80 | NULL, /* BOOTP supplies IP net mask */ |
---|
81 | #else |
---|
82 | "XXX.YYY.ZZZ.XYZ", /* IP address */ |
---|
83 | "255.255.255.0", /* IP net mask */ |
---|
84 | #endif /* !RTEMS_USE_BOOTP */ |
---|
85 | |
---|
86 | #if (defined (RTEMS_SET_ETHERNET_ADDRESS)) |
---|
87 | ethernet_address, /* Ethernet hardware address */ |
---|
88 | #else |
---|
89 | NULL, /* Driver supplies hardware address */ |
---|
90 | #endif |
---|
91 | 0 /* Use default driver parameters */ |
---|
92 | }; |
---|
93 | |
---|
94 | /* |
---|
95 | * Network configuration |
---|
96 | */ |
---|
97 | struct rtems_bsdnet_config rtems_bsdnet_config = { |
---|
98 | &netdriver_config, |
---|
99 | |
---|
100 | #if (defined (RTEMS_USE_BOOTP)) |
---|
101 | rtems_bsdnet_do_bootp, |
---|
102 | #else |
---|
103 | NULL, |
---|
104 | #endif |
---|
105 | |
---|
106 | 0, /* Default network task priority */ |
---|
107 | 0, /* Default mbuf capacity */ |
---|
108 | 0, /* Default mbuf cluster capacity */ |
---|
109 | |
---|
110 | #if (!defined (RTEMS_USE_BOOTP)) |
---|
111 | "rtems_host", /* Host name */ |
---|
112 | "nodomain.com", /* Domain name */ |
---|
113 | "XXX.YYY.ZZZ.1", /* Gateway */ |
---|
114 | "XXX.YYY.ZZZ.1", /* Log host */ |
---|
115 | {"XXX.YYY.ZZZ.1" }, /* Name server(s) */ |
---|
116 | {"XXX.YYY.ZZZ.1" }, /* NTP server(s) */ |
---|
117 | |
---|
118 | /* |
---|
119 | * A real example -- DO NOT USE THIS YOURSELF!!! |
---|
120 | */ |
---|
121 | |
---|
122 | #if 0 |
---|
123 | "dy4", /* Host name */ |
---|
124 | "NOT_oarcorp.com", /* Domain name */ |
---|
125 | "192.168.1.2", /* Gateway */ |
---|
126 | "192.168.1.2", /* Log host */ |
---|
127 | {"192.168.1.2" }, /* Name server(s) */ |
---|
128 | {"192.168.1.2" }, /* NTP server(s) */ |
---|
129 | #endif |
---|
130 | #endif /* !RTEMS_USE_BOOTP */ |
---|
131 | |
---|
132 | }; |
---|
133 | |
---|
134 | /* |
---|
135 | * For TFTP test application |
---|
136 | */ |
---|
137 | #if (defined (RTEMS_USE_BOOTP)) |
---|
138 | #define RTEMS_TFTP_TEST_HOST_NAME "BOOTP_HOST" |
---|
139 | #define RTEMS_TFTP_TEST_FILE_NAME "BOOTP_FILE" |
---|
140 | #else |
---|
141 | #define RTEMS_TFTP_TEST_HOST_NAME "XXX.YYY.ZZZ.XYZ" |
---|
142 | #define RTEMS_TFTP_TEST_FILE_NAME "tftptest" |
---|
143 | #endif |
---|
144 | |
---|
145 | #endif /* _RTEMS_NETWORKCONFIG_H_ */ |
---|