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