1 | /* |
---|
2 | * $Id$ |
---|
3 | */ |
---|
4 | |
---|
5 | #ifndef _RTEMS_BSDNET_ |
---|
6 | #define _RTEMS_BSDNET_ |
---|
7 | |
---|
8 | #include <rtems.h> |
---|
9 | |
---|
10 | /* |
---|
11 | * Values that may be obtained by BOOTP |
---|
12 | */ |
---|
13 | extern struct in_addr rtems_bsdnet_bootp_server_address; |
---|
14 | extern char *rtems_bsdnet_bootp_boot_file_name; |
---|
15 | |
---|
16 | /* |
---|
17 | * Manipulate routing tables |
---|
18 | */ |
---|
19 | struct sockaddr; |
---|
20 | struct rtentry; |
---|
21 | int rtems_bsdnet_rtrequest ( |
---|
22 | int req, |
---|
23 | struct sockaddr *dst, |
---|
24 | struct sockaddr *gateway, |
---|
25 | struct sockaddr *netmask, |
---|
26 | int flags, |
---|
27 | struct rtentry **net_nrt); |
---|
28 | |
---|
29 | /* |
---|
30 | * Diagnostics |
---|
31 | */ |
---|
32 | void rtems_bsdnet_show_inet_routes (void); |
---|
33 | void rtems_bsdnet_show_mbuf_stats (void); |
---|
34 | void rtems_bsdnet_show_if_stats (void); |
---|
35 | void rtems_bsdnet_show_ip_stats (void); |
---|
36 | void rtems_bsdnet_show_icmp_stats (void); |
---|
37 | void rtems_bsdnet_show_udp_stats (void); |
---|
38 | void rtems_bsdnet_show_tcp_stats (void); |
---|
39 | |
---|
40 | /* |
---|
41 | * Network configuration |
---|
42 | */ |
---|
43 | struct rtems_bsdnet_ifconfig { |
---|
44 | /* |
---|
45 | * These two entries must be supplied for each interface. |
---|
46 | */ |
---|
47 | char *name; |
---|
48 | int (*attach)(struct rtems_bsdnet_ifconfig *conf); |
---|
49 | |
---|
50 | /* |
---|
51 | * Link to next interface |
---|
52 | */ |
---|
53 | struct rtems_bsdnet_ifconfig *next; |
---|
54 | |
---|
55 | /* |
---|
56 | * The following entries may be obtained |
---|
57 | * from BOOTP or explicitily supplied. |
---|
58 | */ |
---|
59 | char *ip_address; |
---|
60 | char *ip_netmask; |
---|
61 | void *hardware_address; |
---|
62 | |
---|
63 | /* |
---|
64 | * The driver assigns defaults values to the following |
---|
65 | * entries if they are not explicitly supplied. |
---|
66 | */ |
---|
67 | int ignore_broadcast; |
---|
68 | int mtu; |
---|
69 | int rbuf_count; |
---|
70 | int xbuf_count; |
---|
71 | |
---|
72 | /* |
---|
73 | * For external ethernet controller board the following |
---|
74 | * parameters are needed |
---|
75 | */ |
---|
76 | unsigned int port; /* port of the board */ |
---|
77 | unsigned int irno; /* irq of the board */ |
---|
78 | unsigned int bpar; /* memory of the board */ |
---|
79 | |
---|
80 | }; |
---|
81 | |
---|
82 | struct rtems_bsdnet_config { |
---|
83 | /* |
---|
84 | * This entry points to the head of the ifconfig chain. |
---|
85 | */ |
---|
86 | struct rtems_bsdnet_ifconfig *ifconfig; |
---|
87 | |
---|
88 | /* |
---|
89 | * This entry should be rtems_bsdnet_do_bootp if BOOTP |
---|
90 | * is being used to configure the network, and NULL |
---|
91 | * if BOOTP is not being used. |
---|
92 | */ |
---|
93 | void (*bootp)(void); |
---|
94 | |
---|
95 | /* |
---|
96 | * The remaining items can be initialized to 0, in |
---|
97 | * which case the default value will be used. |
---|
98 | */ |
---|
99 | rtems_task_priority network_task_priority; /* 100 */ |
---|
100 | unsigned long mbuf_bytecount; /* 64 kbytes */ |
---|
101 | unsigned long mbuf_cluster_bytecount; /* 128 kbytes */ |
---|
102 | char *hostname; /* BOOTP */ |
---|
103 | char *domainname; /* BOOTP */ |
---|
104 | char *gateway; /* BOOTP */ |
---|
105 | char *log_host; /* BOOTP */ |
---|
106 | char *name_server[3]; /* BOOTP */ |
---|
107 | }; |
---|
108 | extern struct rtems_bsdnet_config rtems_bsdnet_config; |
---|
109 | int rtems_bsdnet_initialize_network (void); |
---|
110 | void rtems_bsdnet_do_bootp (void); |
---|
111 | |
---|
112 | #endif /* _RTEMS_BSDNET_ */ |
---|