ppp_defs.h 663 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * ppp_defs.h - PPP definitions.
  4. *
  5. * Copyright 1994-2000 Paul Mackerras.
  6. */
  7. #ifndef _PPP_DEFS_H_
  8. #define _PPP_DEFS_H_
  9. #include <linux/crc-ccitt.h>
  10. #include <uapi/linux/ppp_defs.h>
  11. #define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c)
  12. /**
  13. * ppp_proto_is_valid - checks if PPP protocol is valid
  14. * @proto: PPP protocol
  15. *
  16. * Assumes proto is not compressed.
  17. * Protocol is valid if the value is odd and the least significant bit of the
  18. * most significant octet is 0 (see RFC 1661, section 2).
  19. */
  20. static inline bool ppp_proto_is_valid(u16 proto)
  21. {
  22. return !!((proto & 0x0101) == 0x0001);
  23. }
  24. #endif /* _PPP_DEFS_H_ */