]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/net/common/v2_0/include/network.h
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / net / common / v2_0 / include / network.h
1
2 //==========================================================================
3 //
4 //      include/network.h
5 //
6 //      Misc network support
7 //
8 //==========================================================================
9 //####BSDCOPYRIGHTBEGIN####
10 //
11 // -------------------------------------------
12 //
13 // Portions of this software may have been derived from OpenBSD or other sources,
14 // and are covered by the appropriate copyright disclaimers included herein.
15 //
16 // -------------------------------------------
17 //
18 //####BSDCOPYRIGHTEND####
19 //==========================================================================
20 //#####DESCRIPTIONBEGIN####
21 //
22 // Author(s):    gthomas
23 // Contributors: gthomas, andrew.lunn@ascom.ch
24 // Date:         2000-01-10
25 // Purpose:      
26 // Description:  
27 //              
28 //
29 //####DESCRIPTIONEND####
30 //
31 //==========================================================================
32
33 #ifndef _NETWORK_H_
34 #define _NETWORK_H_
35
36 #define NO_LIBKERN_INLINE  // Avoid kernel inline functions
37
38 #include <pkgconf/system.h>
39 #include <pkgconf/net.h>
40 #include <pkgconf/io_eth_drivers.h>
41 #undef _KERNEL
42 #include <sys/param.h>
43 #include <sys/socket.h>
44 #include <sys/ioctl.h>
45 #include <sys/errno.h>
46
47 #include <net/if.h>
48 #include <netinet/in.h>
49 #include <netinet/ip.h>
50 #include <netinet/ip_icmp.h>
51 #include <net/route.h>
52 #include <string.h>
53
54 #include <cyg/infra/diag.h>
55 #include <cyg/kernel/kapi.h>
56
57 #include <netdb.h>
58 #include <bootp.h>
59
60 #ifdef CYGHWR_NET_DRIVER_ETH0
61 extern struct bootp eth0_bootp_data;
62 extern cyg_bool_t   eth0_up;
63 extern const char  *eth0_name;
64 #endif
65 #ifdef CYGHWR_NET_DRIVER_ETH1
66 extern struct bootp eth1_bootp_data;
67 extern cyg_bool_t   eth1_up;
68 extern const char  *eth1_name;
69 #endif
70
71 __externC void init_all_network_interfaces(void);
72
73 __externC void     cyg_route_reinit(void);
74 __externC void     perror(const char *) __THROW;
75 __externC int      close(int);
76 __externC ssize_t  read(int, void *, size_t);
77 __externC ssize_t  write(int, const void *, size_t);
78 __externC int      select(int, fd_set *, fd_set *, fd_set *, struct timeval *tv);
79
80 // This API is for our own automated network tests.
81 // It's not at all supported.
82 #define CYG_NET_GET_MEM_STATS_MISC  0 // Misc mpool
83 #define CYG_NET_GET_MEM_STATS_MBUFS 1 // Mbufs pool
84 #define CYG_NET_GET_MEM_STATS_CLUST 2 // Clust pool
85 int cyg_net_get_mem_stats( int which, cyg_mempool_info *p );
86
87 #ifdef CYGPKG_NET_INET6
88 #ifdef CYGOPT_NET_IPV6_ROUTING_THREAD 
89 __externC void ipv6_start_routing_thread(void);
90 __externC int cyg_net_get_ipv6_advrouter(struct sockaddr_in6 * addr);
91 #endif
92 #endif
93
94 #endif // _NETWORK_H_