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