47 lines
1.4 KiB
C
47 lines
1.4 KiB
C
#ifndef __ASNLIB_INCLUDE__
|
|
#define __ASNLIB_INCLUDE__
|
|
|
|
/******************************************************************************
|
|
* includes
|
|
*****************************************************************************/
|
|
|
|
#include <stdint.h>
|
|
#include <sys/types.h>
|
|
#include <memory.h>
|
|
|
|
/******************************************************************************
|
|
* defines
|
|
*****************************************************************************/
|
|
|
|
/******************************************************************************
|
|
* structs & typedefs
|
|
*****************************************************************************/
|
|
|
|
typedef struct _bit_struct {
|
|
const uint8_t *ptr;
|
|
int bit;
|
|
int max;
|
|
int consumed;
|
|
} UPER_Stream;
|
|
|
|
/******************************************************************************
|
|
* function prototypes
|
|
*****************************************************************************/
|
|
/* export C functions to C++ */
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
int uper_get_bit(const uint8_t *pkt, int bit);
|
|
uint64_t uper_get_bits_direct(const uint8_t *pkt, int bit, int bits);
|
|
uint64_t uper_get_bits_stream(UPER_Stream *ptr, int bits)
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
/******************************************************************************
|
|
* Macros
|
|
* ***************************************************************************/
|
|
|
|
#endif
|