source: rtems/c/src/exec/libnetworking/rtems/rtems_bsdnet.h @ a0af97d

4.104.114.84.95
Last change on this file since a0af97d was a0af97d, checked in by Joel Sherrill <joel.sherrill@…>, on 11/09/99 at 03:43:47

Patch from Eric Norum <eric@…> to add NTP BOOTP support because
EPICS needs a synchronized time-of-day clock. This patch is the changes
needed to get NTP server information from a BOOTP server.

This patch also adds NTP server information to the network configuration
structure, too.

  • Property mode set to 100644
File size: 3.2 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;
38extern struct in_addr rtems_bsdnet_ntpserver[];
39extern int rtems_bsdnet_ntpserver_count;
40extern long rtems_bsdnet_timeoffset;
41
42/*
43 * Manipulate routing tables
44 */
45struct sockaddr;
46struct rtentry;
47int rtems_bsdnet_rtrequest (
48    int req,
49    struct sockaddr *dst,
50    struct sockaddr *gateway,
51    struct sockaddr *netmask,
52    int flags,
53    struct rtentry **net_nrt);
54
55/*
56 * Diagnostics
57 */
58void rtems_bsdnet_show_inet_routes (void);
59void rtems_bsdnet_show_mbuf_stats (void);
60void rtems_bsdnet_show_if_stats (void);
61void rtems_bsdnet_show_ip_stats (void);
62void rtems_bsdnet_show_icmp_stats (void);
63void rtems_bsdnet_show_udp_stats (void);
64void rtems_bsdnet_show_tcp_stats (void);
65
66/*
67 * Network configuration
68 */
69struct rtems_bsdnet_ifconfig {
70        /*
71         * These two entries must be supplied for each interface.
72         */
73        char            *name;
74        int             (*attach)(struct rtems_bsdnet_ifconfig *conf);
75
76        /*
77         * Link to next interface
78         */
79        struct rtems_bsdnet_ifconfig *next;
80
81        /*
82         * The following entries may be obtained
83         * from BOOTP or explicitily supplied.
84         */
85        char            *ip_address;
86        char            *ip_netmask;
87        void            *hardware_address;
88
89        /*
90         * The driver assigns defaults values to the following
91         * entries if they are not explicitly supplied.
92         */
93        int             ignore_broadcast;
94        int             mtu;
95        int             rbuf_count;
96        int             xbuf_count;
97
98        /*
99         * For external ethernet controller board the following
100         * parameters are needed
101         */
102        unsigned int    port;   /* port of the board */
103        unsigned int    irno;   /* irq of the board */
104        unsigned int    bpar;   /* memory of the board */
105
106};
107
108struct rtems_bsdnet_config {
109        /*
110         * This entry points to the head of the ifconfig chain.
111         */
112        struct rtems_bsdnet_ifconfig *ifconfig;
113
114        /*
115         * This entry should be rtems_bsdnet_do_bootp if BOOTP
116         * is being used to configure the network, and NULL
117         * if BOOTP is not being used.
118         */
119        void                    (*bootp)(void);
120
121        /*
122         * The remaining items can be initialized to 0, in
123         * which case the default value will be used.
124         */
125        rtems_task_priority     network_task_priority;  /* 100          */
126        unsigned long           mbuf_bytecount;         /* 64 kbytes    */
127        unsigned long           mbuf_cluster_bytecount; /* 128 kbytes   */
128        char                    *hostname;              /* BOOTP        */
129        char                    *domainname;            /* BOOTP        */
130        char                    *gateway;               /* BOOTP        */
131        char                    *log_host;              /* BOOTP        */
132        char                    *name_server[3];        /* BOOTP        */
133        char                    *ntp_server[3];         /* BOOTP        */
134};
135extern struct rtems_bsdnet_config rtems_bsdnet_config;
136int rtems_bsdnet_initialize_network (void);
137void rtems_bsdnet_do_bootp (void);
138
139#endif /* _RTEMS_BSDNET_ */
Note: See TracBrowser for help on using the repository browser.