source: rtems/c/src/libnetworking/rtems/rtems_bsdnet.h @ 11f84b3c

4.104.114.84.95
Last change on this file since 11f84b3c was 11f84b3c, checked in by Joel Sherrill <joel.sherrill@…>, on 04/19/99 at 15:27:20

After discussion with Eric Norum <eric@…>,
I added INSIDE_RTEMS_BSD_TCPIP_STACK that trips all the needed
macro definitions for a network driver.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*
2 *  $Id$
3 */
4
5#ifndef _RTEMS_BSDNET_
6#define _RTEMS_BSDNET_
7
8#include <rtems.h>
9
10/*
11 *  If this file is included from inside the Network Stack proper or
12 *  a device driver, then __INSIDE_RTEMS_BSD_TCPIP_STACK__ should be
13 *  defined.  This triggers a number of internally used definitions.
14 */
15
16#if defined(__INSIDE_RTEMS_BSD_TCPIP_STACK__)
17#undef _COMPILING_BSD_KERNEL_
18#undef KERNEL
19#undef INET
20#undef NFS
21#undef DIAGNOSTIC
22#undef BOOTP_COMPAT
23
24#define _COMPILING_BSD_KERNEL_
25#define KERNEL
26#define INET
27#define NFS
28#define DIAGNOSTIC
29#define BOOTP_COMPAT
30#endif
31
32/*
33 * Values that may be obtained by BOOTP
34 */
35extern struct in_addr rtems_bsdnet_bootp_server_address;
36extern char *rtems_bsdnet_bootp_server_name;
37extern char *rtems_bsdnet_bootp_boot_file_name;
38
39/*
40 * Manipulate routing tables
41 */
42struct sockaddr;
43struct rtentry;
44int rtems_bsdnet_rtrequest (
45    int req,
46    struct sockaddr *dst,
47    struct sockaddr *gateway,
48    struct sockaddr *netmask,
49    int flags,
50    struct rtentry **net_nrt);
51
52/*
53 * Diagnostics
54 */
55void rtems_bsdnet_show_inet_routes (void);
56void rtems_bsdnet_show_mbuf_stats (void);
57void rtems_bsdnet_show_if_stats (void);
58void rtems_bsdnet_show_ip_stats (void);
59void rtems_bsdnet_show_icmp_stats (void);
60void rtems_bsdnet_show_udp_stats (void);
61void rtems_bsdnet_show_tcp_stats (void);
62
63/*
64 * Network configuration
65 */
66struct rtems_bsdnet_ifconfig {
67        /*
68         * These two entries must be supplied for each interface.
69         */
70        char            *name;
71        int             (*attach)(struct rtems_bsdnet_ifconfig *conf);
72
73        /*
74         * Link to next interface
75         */
76        struct rtems_bsdnet_ifconfig *next;
77
78        /*
79         * The following entries may be obtained
80         * from BOOTP or explicitily supplied.
81         */
82        char            *ip_address;
83        char            *ip_netmask;
84        void            *hardware_address;
85
86        /*
87         * The driver assigns defaults values to the following
88         * entries if they are not explicitly supplied.
89         */
90        int             ignore_broadcast;
91        int             mtu;
92        int             rbuf_count;
93        int             xbuf_count;
94
95        /*
96         * For external ethernet controller board the following
97         * parameters are needed
98         */
99        unsigned int    port;   /* port of the board */
100        unsigned int    irno;   /* irq of the board */
101        unsigned int    bpar;   /* memory of the board */
102
103};
104
105struct rtems_bsdnet_config {
106        /*
107         * This entry points to the head of the ifconfig chain.
108         */
109        struct rtems_bsdnet_ifconfig *ifconfig;
110
111        /*
112         * This entry should be rtems_bsdnet_do_bootp if BOOTP
113         * is being used to configure the network, and NULL
114         * if BOOTP is not being used.
115         */
116        void                    (*bootp)(void);
117
118        /*
119         * The remaining items can be initialized to 0, in
120         * which case the default value will be used.
121         */
122        rtems_task_priority     network_task_priority;  /* 100          */
123        unsigned long           mbuf_bytecount;         /* 64 kbytes    */
124        unsigned long           mbuf_cluster_bytecount; /* 128 kbytes   */
125        char                    *hostname;              /* BOOTP        */
126        char                    *domainname;            /* BOOTP        */
127        char                    *gateway;               /* BOOTP        */
128        char                    *log_host;              /* BOOTP        */
129        char                    *name_server[3];        /* BOOTP        */
130};
131extern struct rtems_bsdnet_config rtems_bsdnet_config;
132int rtems_bsdnet_initialize_network (void);
133void rtems_bsdnet_do_bootp (void);
134
135#endif /* _RTEMS_BSDNET_ */
Note: See TracBrowser for help on using the repository browser.