link some files against libinternal.a
[util-vserver.git] / util-vserver / kernel / network.h
1 #ifndef _VX_NETWORK_H
2 #define _VX_NETWORK_H
3
4
5 #define NB_IPV4ROOT     16
6
7 #ifdef  __KERNEL__
8
9 #include <linux/list.h>
10 #include <linux/spinlock.h>
11 #include <linux/utsname.h>
12 #include <asm/resource.h>
13 #include <asm/atomic.h>
14
15
16 struct ip_info {
17         struct list_head ip_list;       /* linked list of ipinfos */
18         nid_t ip_id;                    /* vnet id */
19         atomic_t ip_refcount;
20         int nbipv4;
21         __u32 ipv4[NB_IPV4ROOT];        /* Process can only bind to these IPs */
22                                         /* The first one is used to connect */
23                                         /* and for bind any service */
24                                         /* The other must be used explicity */
25         __u32 mask[NB_IPV4ROOT];        /* Netmask for each ipv4 */
26                                         /* Used to select the proper source */
27                                         /* address for sockets */
28         __u32 v4_bcast;                 /* Broadcast address to receive UDP  */
29 };
30
31
32 extern spinlock_t iplist_lock;
33 extern struct list_head ip_infos;
34
35
36 void free_ip_info(struct ip_info *);
37 struct ip_info *create_ip_info(void);
38
39 extern struct ip_info *find_ip_info(int);
40 extern int ip_info_id_valid(int);
41
42
43 #endif  /* __KERNEL__ */
44 #endif  /* _VX_NETWORK_H */