lapb.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * These are the public elements of the Linux LAPB module.
  3. */
  4. #ifndef LAPB_KERNEL_H
  5. #define LAPB_KERNEL_H
  6. #define LAPB_OK 0
  7. #define LAPB_BADTOKEN 1
  8. #define LAPB_INVALUE 2
  9. #define LAPB_CONNECTED 3
  10. #define LAPB_NOTCONNECTED 4
  11. #define LAPB_REFUSED 5
  12. #define LAPB_TIMEDOUT 6
  13. #define LAPB_NOMEM 7
  14. #define LAPB_STANDARD 0x00
  15. #define LAPB_EXTENDED 0x01
  16. #define LAPB_SLP 0x00
  17. #define LAPB_MLP 0x02
  18. #define LAPB_DTE 0x00
  19. #define LAPB_DCE 0x04
  20. struct lapb_register_struct {
  21. void (*connect_confirmation)(struct net_device *dev, int reason);
  22. void (*connect_indication)(struct net_device *dev, int reason);
  23. void (*disconnect_confirmation)(struct net_device *dev, int reason);
  24. void (*disconnect_indication)(struct net_device *dev, int reason);
  25. int (*data_indication)(struct net_device *dev, struct sk_buff *skb);
  26. void (*data_transmit)(struct net_device *dev, struct sk_buff *skb);
  27. };
  28. struct lapb_parms_struct {
  29. unsigned int t1;
  30. unsigned int t1timer;
  31. unsigned int t2;
  32. unsigned int t2timer;
  33. unsigned int n2;
  34. unsigned int n2count;
  35. unsigned int window;
  36. unsigned int state;
  37. unsigned int mode;
  38. };
  39. extern int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks);
  40. extern int lapb_unregister(struct net_device *dev);
  41. extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms);
  42. extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms);
  43. extern int lapb_connect_request(struct net_device *dev);
  44. extern int lapb_disconnect_request(struct net_device *dev);
  45. extern int lapb_data_request(struct net_device *dev, struct sk_buff *skb);
  46. extern int lapb_data_received(struct net_device *dev, struct sk_buff *skb);
  47. #endif