Skip to content

Commit

Permalink
remove dependency to <endian.h>
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Aug 7, 2024
1 parent d75608e commit bdb736f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
15 changes: 5 additions & 10 deletions tunnels/layer3/ip_overrider/ip_overrider.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "managers/node_manager.h"
#include "utils/jsonutils.h"
#include "utils/stringutils.h"
#include <endian.h>

typedef struct layer3_ip_overrider_state_s
{
Expand All @@ -23,14 +22,12 @@ typedef struct layer3_ip_overrider_con_state_s

struct ipv4hdr
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned int ihl : 4;
unsigned int version : 4;
#elif __BYTE_ORDER == __BIG_ENDIAN
#if __BIG_ENDIAN__
unsigned int version : 4;
unsigned int ihl : 4;
#else
#error "byte order macro is not defined"
unsigned int ihl : 4;
unsigned int version : 4;
#endif
uint8_t tos;
uint16_t tot_len;
Expand All @@ -46,12 +43,10 @@ struct ipv4hdr

struct ipv6hdr
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
uint8_t priority : 4, version : 4;
#elif __BYTE_ORDER == __BIG_ENDIAN
#if __BIG_ENDIAN__
uint8_t version : 4, priority : 4;
#else
#error "byte order macro is not defined"
uint8_t priority : 4, version : 4;
#endif
uint8_t flow_lbl[3];

Expand Down
1 change: 0 additions & 1 deletion ww/utils/mathutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <math.h> //cel,log2,pow
#include <stdint.h>
#include <stdlib.h>
#include <endian.h>

// windows defines min/max in header <stdlib.h> :)
#undef max
Expand Down

0 comments on commit bdb736f

Please sign in to comment.