2 The mediastreamer library aims at providing modular media processing and I/O
3 for linphone, but also for any telephony application.
4 Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #define MAKE_MASK(bits) ( (1<<(bits)) -1 )
27 static inline unsigned int rfc2429_get_P(const uint8_t *header){
28 return (header[0]>>2) & 0x1;
31 static inline void rfc2429_set_P(uint8_t *header, bool_t val){
32 header[0]=header[0] | ( (val&0x1)<<2);
35 static inline unsigned int rfc2429_get_V(const uint8_t *header){
36 return (header[0]>>1) & 0x1;
39 static inline unsigned int rfc2429_get_PLEN(const uint8_t *header){
40 unsigned short *p=(unsigned short*)header;
41 return (ntohs(p[0])>>3) & MAKE_MASK(6);
44 static inline unsigned int rfc2429_get_PEBIT(const uint8_t *header){
45 unsigned short *p=(unsigned short*)header;
46 return ntohs(p[0]) & MAKE_MASK(3);