slip.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __UM_SLIP_H
  2. #define __UM_SLIP_H
  3. #define BUF_SIZE 1500
  4. /* two bytes each for a (pathological) max packet of escaped chars + *
  5. * terminating END char + initial END char */
  6. #define ENC_BUF_SIZE (2 * BUF_SIZE + 2)
  7. struct slip_data {
  8. void *dev;
  9. char name[sizeof("slnnnnn\0")];
  10. char *addr;
  11. char *gate_addr;
  12. int slave;
  13. unsigned char ibuf[ENC_BUF_SIZE];
  14. unsigned char obuf[ENC_BUF_SIZE];
  15. int more; /* more data: do not read fd until ibuf has been drained */
  16. int pos;
  17. int esc;
  18. };
  19. extern struct net_user_info slip_user_info;
  20. extern int set_umn_addr(int fd, char *addr, char *ptp_addr);
  21. extern int slip_user_read(int fd, void *buf, int len, struct slip_data *pri);
  22. extern int slip_user_write(int fd, void *buf, int len, struct slip_data *pri);
  23. #endif
  24. /*
  25. * Overrides for Emacs so that we follow Linus's tabbing style.
  26. * Emacs will notice this stuff at the end of the file and automatically
  27. * adjust the settings for this buffer only. This must remain at the end
  28. * of the file.
  29. * ---------------------------------------------------------------------------
  30. * Local variables:
  31. * c-file-style: "linux"
  32. * End:
  33. */