net_kern.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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/skbuff.h"
  9. #include "linux/socket.h"
  10. #include "linux/list.h"
  11. struct uml_net {
  12. struct list_head list;
  13. struct net_device *dev;
  14. struct platform_device pdev;
  15. int index;
  16. unsigned char mac[ETH_ALEN];
  17. int have_mac;
  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. int have_mac;
  28. unsigned short (*protocol)(struct sk_buff *);
  29. int (*open)(void *);
  30. void (*close)(int, void *);
  31. void (*remove)(void *);
  32. int (*read)(int, struct sk_buff **skb, struct uml_net_private *);
  33. int (*write)(int, struct sk_buff **skb, struct uml_net_private *);
  34. void (*add_address)(unsigned char *, unsigned char *, void *);
  35. void (*delete_address)(unsigned char *, unsigned char *, void *);
  36. int (*set_mtu)(int mtu, void *);
  37. int user[1];
  38. };
  39. struct net_kern_info {
  40. void (*init)(struct net_device *, void *);
  41. unsigned short (*protocol)(struct sk_buff *);
  42. int (*read)(int, struct sk_buff **skb, struct uml_net_private *);
  43. int (*write)(int, struct sk_buff **skb, struct uml_net_private *);
  44. };
  45. struct transport {
  46. struct list_head list;
  47. char *name;
  48. int (*setup)(char *, char **, void *);
  49. struct net_user_info *user;
  50. struct net_kern_info *kern;
  51. int private_size;
  52. int setup_size;
  53. };
  54. extern struct net_device *ether_init(int);
  55. extern unsigned short ether_protocol(struct sk_buff *);
  56. extern int setup_etheraddr(char *str, unsigned char *addr);
  57. extern struct sk_buff *ether_adjust_skb(struct sk_buff *skb, int extra);
  58. extern int tap_setup_common(char *str, char *type, char **dev_name,
  59. char **mac_out, char **gate_addr);
  60. extern void register_transport(struct transport *new);
  61. extern unsigned short eth_protocol(struct sk_buff *skb);
  62. #endif
  63. /*
  64. * Overrides for Emacs so that we follow Linus's tabbing style.
  65. * Emacs will notice this stuff at the end of the file and automatically
  66. * adjust the settings for this buffer only. This must remain at the end
  67. * of the file.
  68. * ---------------------------------------------------------------------------
  69. * Local variables:
  70. * c-file-style: "linux"
  71. * End:
  72. */