ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / um / include / net_kern.h
1 /* 
2  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  */
5
6 #ifndef __UM_NET_KERN_H
7 #define __UM_NET_KERN_H
8
9 #include "linux/netdevice.h"
10 #include "linux/skbuff.h"
11 #include "linux/socket.h"
12 #include "linux/list.h"
13
14 struct uml_net {
15         struct list_head list;
16         struct net_device *dev;
17         int index;
18         unsigned char mac[ETH_ALEN];
19         int have_mac;
20 };
21
22 struct uml_net_private {
23         struct list_head list;
24         spinlock_t lock;
25         struct net_device *dev;
26         struct timer_list tl;
27         struct net_device_stats stats;
28         int fd;
29         unsigned char mac[ETH_ALEN];
30         int have_mac;
31         unsigned short (*protocol)(struct sk_buff *);
32         int (*open)(void *);
33         void (*close)(int, void *);
34         void (*remove)(void *);
35         int (*read)(int, struct sk_buff **skb, struct uml_net_private *);
36         int (*write)(int, struct sk_buff **skb, struct uml_net_private *);
37         
38         void (*add_address)(unsigned char *, unsigned char *, void *);
39         void (*delete_address)(unsigned char *, unsigned char *, void *);
40         int (*set_mtu)(int mtu, void *);
41         int user[1];
42 };
43
44 struct net_kern_info {
45         void (*init)(struct net_device *, void *);
46         unsigned short (*protocol)(struct sk_buff *);
47         int (*read)(int, struct sk_buff **skb, struct uml_net_private *);
48         int (*write)(int, struct sk_buff **skb, struct uml_net_private *);
49 };
50
51 struct transport {
52         struct list_head list;
53         char *name;
54         int (*setup)(char *, char **, void *);
55         struct net_user_info *user;
56         struct net_kern_info *kern;
57         int private_size;
58         int setup_size;
59 };
60
61 extern struct net_device *ether_init(int);
62 extern unsigned short ether_protocol(struct sk_buff *);
63 extern int setup_etheraddr(char *str, unsigned char *addr);
64 extern struct sk_buff *ether_adjust_skb(struct sk_buff *skb, int extra);
65 extern int tap_setup_common(char *str, char *type, char **dev_name, 
66                             char **mac_out, char **gate_addr);
67 extern void register_transport(struct transport *new);
68 extern unsigned short eth_protocol(struct sk_buff *skb);
69
70 #endif
71
72 /*
73  * Overrides for Emacs so that we follow Linus's tabbing style.
74  * Emacs will notice this stuff at the end of the file and automatically
75  * adjust the settings for this buffer only.  This must remain at the end
76  * of the file.
77  * ---------------------------------------------------------------------------
78  * Local variables:
79  * c-file-style: "linux"
80  * End:
81  */