net_kern.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __UM_NET_KERN_H
  6. #define __UM_NET_KERN_H
  7. #include <linux/netdevice.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/skbuff.h>
  10. #include <linux/socket.h>
  11. #include <linux/list.h>
  12. struct uml_net {
  13. struct list_head list;
  14. struct net_device *dev;
  15. struct platform_device pdev;
  16. int index;
  17. unsigned char mac[ETH_ALEN];
  18. };
  19. struct uml_net_private {
  20. struct list_head list;
  21. spinlock_t lock;
  22. struct net_device *dev;
  23. struct timer_list tl;
  24. struct net_device_stats stats;
  25. int fd;
  26. unsigned char mac[ETH_ALEN];
  27. unsigned short (*protocol)(struct sk_buff *);
  28. int (*open)(void *);
  29. void (*close)(int, void *);
  30. void (*remove)(void *);
  31. int (*read)(int, struct sk_buff **skb, struct uml_net_private *);
  32. int (*write)(int, struct sk_buff **skb, struct uml_net_private *);
  33. void (*add_address)(unsigned char *, unsigned char *, void *);
  34. void (*delete_address)(unsigned char *, unsigned char *, void *);
  35. int (*set_mtu)(int mtu, void *);
  36. int user[1];
  37. };
  38. struct net_kern_info {
  39. void (*init)(struct net_device *, void *);
  40. unsigned short (*protocol)(struct sk_buff *);
  41. int (*read)(int, struct sk_buff **skb, struct uml_net_private *);
  42. int (*write)(int, struct sk_buff **skb, struct uml_net_private *);
  43. };
  44. struct transport {
  45. struct list_head list;
  46. char *name;
  47. int (*setup)(char *, char **, void *);
  48. const struct net_user_info *user;
  49. const struct net_kern_info *kern;
  50. int private_size;
  51. int setup_size;
  52. };
  53. extern struct net_device *ether_init(int);
  54. extern unsigned short ether_protocol(struct sk_buff *);
  55. extern struct sk_buff *ether_adjust_skb(struct sk_buff *skb, int extra);
  56. extern int tap_setup_common(char *str, char *type, char **dev_name,
  57. char **mac_out, char **gate_addr);
  58. extern void register_transport(struct transport *new);
  59. extern unsigned short eth_protocol(struct sk_buff *skb);
  60. #endif