]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/net/common/v2_0/include/network.h
e8c9c347e103c93c90c1d46f06f4fe5966294db9
[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
53 #include <cyg/infra/diag.h>
54 #include <cyg/kernel/kapi.h>
55
56 #include <netdb.h>
57 #include <bootp.h>
58
59 #ifdef CYGHWR_NET_DRIVER_ETH0
60 extern struct bootp eth0_bootp_data;
61 extern cyg_bool_t   eth0_up;
62 extern const char  *eth0_name;
63 #endif
64 #ifdef CYGHWR_NET_DRIVER_ETH1
65 extern struct bootp eth1_bootp_data;
66 extern cyg_bool_t   eth1_up;
67 extern const char  *eth1_name;
68 #endif
69
70 __externC void init_all_network_interfaces(void);
71
72 __externC void     cyg_route_reinit(void);
73 __externC void     perror(const char *) __THROW;
74 __externC int      close(int);
75 __externC ssize_t  read(int, void *, size_t);
76 __externC ssize_t  write(int, const void *, size_t);
77 __externC int      select(int, fd_set *, fd_set *, fd_set *, struct timeval *tv);
78
79 // This API is for our own automated network tests.
80 // It's not at all supported.
81 #define CYG_NET_GET_MEM_STATS_MISC  0 // Misc mpool
82 #define CYG_NET_GET_MEM_STATS_MBUFS 1 // Mbufs pool
83 #define CYG_NET_GET_MEM_STATS_CLUST 2 // Clust pool
84 int cyg_net_get_mem_stats( int which, cyg_mempool_info *p );
85
86 #ifdef CYGPKG_NET_INET6
87 #ifdef CYGOPT_NET_IPV6_ROUTING_THREAD 
88 __externC void ipv6_start_routing_thread(void);
89 __externC int cyg_net_get_ipv6_advrouter(struct sockaddr_in6 * addr);
90 #endif
91 #endif
92
93 #endif // _NETWORK_H_