162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * ppp_defs.h - PPP definitions. 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright 1994-2000 Paul Mackerras. 662306a36Sopenharmony_ci */ 762306a36Sopenharmony_ci#ifndef _PPP_DEFS_H_ 862306a36Sopenharmony_ci#define _PPP_DEFS_H_ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#include <linux/crc-ccitt.h> 1162306a36Sopenharmony_ci#include <uapi/linux/ppp_defs.h> 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c) 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci/** 1662306a36Sopenharmony_ci * ppp_proto_is_valid - checks if PPP protocol is valid 1762306a36Sopenharmony_ci * @proto: PPP protocol 1862306a36Sopenharmony_ci * 1962306a36Sopenharmony_ci * Assumes proto is not compressed. 2062306a36Sopenharmony_ci * Protocol is valid if the value is odd and the least significant bit of the 2162306a36Sopenharmony_ci * most significant octet is 0 (see RFC 1661, section 2). 2262306a36Sopenharmony_ci */ 2362306a36Sopenharmony_cistatic inline bool ppp_proto_is_valid(u16 proto) 2462306a36Sopenharmony_ci{ 2562306a36Sopenharmony_ci return !!((proto & 0x0101) == 0x0001); 2662306a36Sopenharmony_ci} 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci#endif /* _PPP_DEFS_H_ */ 29