Commit 335fec3a authored by Franck Messaoudi's avatar Franck Messaoudi

Update: additional cleaning

parent fda3eef1
// #ifndef __CRC16_H__
// #define __CRC16_H__
// #include <stdint.h>
// #define CRC16 0x8005
// static uint16_t gen_crc16(const uint8_t *data, uint16_t size)
// {
// uint16_t out = 0;
// int bits_read = 0, bit_flag;
// /* Sanity check: */
// if(data == 0)
// return 0;
// // while(size > 0)
// int k;
// for(k = 0; k < 32; k++)
// {
// bit_flag = out >> 15;
// /* Get next bit: */
// out <<= 1;
// out |= (*data >> bits_read) & 1; // item a) work from the least
// significant bits
// /* Increment bit counter: */
// bits_read++;
// if(bits_read > 7)
// {
// bits_read = 0;
// data++;
// // size--;
// }
// /* Cycle check: */
// if(bit_flag)
// out ^= CRC16;
// }
// // item b) "push out" the last 16 bits
// int i;
// for (i = 0; i < 16; ++i) {
// bit_flag = out >> 15;
// out <<= 1;
// if(bit_flag)
// out ^= CRC16;
// }
// // item c) reverse the bits
// uint16_t crc = 0;
// i = 0x8000;
// int j = 0x0001;
// for (; i != 0; i >>=1, j <<= 1) {
// if (i & out) crc |= j;
// }
// return crc;
// }
// #endif // __CRC16_H__
\ No newline at end of file
#ifndef __PFCP_HEADER_H__
#define __PFCP_HEADER_H__
#include <types.h>
#include <ie/ie_base.h>
namespace pfcp {
//--------------------------------------------------------
// 7.2.2.2-1: PFCP Message Header for node related messages
typedef struct header_node {
u8 s : 1;
u8 mp : 1;
u8 spare : 3;
u8 version : 3 u16 message_length;
u32 sequence_number : 24;
u32 spare : 8;
} header_node_t_;
//--------------------------------------------------------
// 7.2.2.3-1: PFCP message Header for session related messages
// TODO
typedef struct header_node {
u8 s : 1;
u8 mp : 1;
u8 spare : 3;
u8 version : 3
} header_session_t_;
} // namespace pfcp
#endif // __PFCP_HEADER_H__
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <bpf_helpers.h> #include <bpf_helpers.h>
#include <bpf_endian.h> #include <bpf_endian.h>
#include <endian.h> #include <endian.h>
#include <lib/crc16.h> //#include <lib/crc16.h>
#include <utils/csum.h> #include <utils/csum.h>
#include <protocols/ip.h> #include <protocols/ip.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment