Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/networking/dnserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
static struct udp_pcb *pcb = NULL;
dns_query_proc_t query_proc = NULL;

#pragma pack(push, 1)
PACK_STRUCT_BEGIN
typedef struct
{
#if BYTE_ORDER == LITTLE_ENDIAN
Expand Down Expand Up @@ -74,7 +74,7 @@ typedef struct dns_answer
uint16_t len;
uint32_t addr;
} dns_answer_t;
#pragma pack(pop)
PACK_STRUCT_END

typedef struct dns_query
{
Expand Down
18 changes: 18 additions & 0 deletions lib/networking/rndis_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@

#include <stdint.h>

#if (TU_BYTE_ORDER==TU_BIG_ENDIAN)
/* These macros should be calculated by the preprocessor and are used within
compile-time constants only (so that there is no endian overhead at runtime). */
#define PP_RNDIS_HTONS(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8))
#define PP_RNDIS_NTOHS(x) PP_RNDIS_HTONS(x)
#define PP_RNDIS_HTONL(x) ((((x) & 0xff) << 24) | \
(((x) & 0xff00) << 8) | \
(((x) & 0xff0000UL) >> 8) | \
(((x) & 0xff000000UL) >> 24))
#define PP_RNDIS_NTOHL(x) PP_RNDIS_HTONL(x)
#else
#define PP_RNDIS_HTONS(x) (x)
#define PP_RNDIS_NTOHS(x) (x)
#define PP_RNDIS_HTONL(x) (x)
#define PP_RNDIS_NTOHL(x) (x)
#endif


#define RNDIS_MAJOR_VERSION 1
#define RNDIS_MINOR_VERSION 0

Expand Down
Loading