one push one pop

This commit is contained in:
Alexandr Dubovikov 2016-04-19 20:22:49 +02:00
parent d710787fa9
commit 024af441b8

View File

@ -163,130 +163,64 @@ struct hep_chunk {
uint16_t length; uint16_t length;
} PACKED; } PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
typedef struct hep_chunk hep_chunk_t; typedef struct hep_chunk hep_chunk_t;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_chunk_uint8 { struct hep_chunk_uint8 {
hep_chunk_t chunk; hep_chunk_t chunk;
uint8_t data; uint8_t data;
} PACKED; } PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
typedef struct hep_chunk_uint8 hep_chunk_uint8_t; typedef struct hep_chunk_uint8 hep_chunk_uint8_t;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_chunk_uint16 { struct hep_chunk_uint16 {
hep_chunk_t chunk; hep_chunk_t chunk;
uint16_t data; uint16_t data;
} PACKED; } PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
typedef struct hep_chunk_uint16 hep_chunk_uint16_t; typedef struct hep_chunk_uint16 hep_chunk_uint16_t;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_chunk_uint32 { struct hep_chunk_uint32 {
hep_chunk_t chunk; hep_chunk_t chunk;
uint32_t data; uint32_t data;
} PACKED; } PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
typedef struct hep_chunk_uint32 hep_chunk_uint32_t; typedef struct hep_chunk_uint32 hep_chunk_uint32_t;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_chunk_str { struct hep_chunk_str {
hep_chunk_t chunk; hep_chunk_t chunk;
char *data; char *data;
} PACKED; } PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
typedef struct hep_chunk_str hep_chunk_str_t; typedef struct hep_chunk_str hep_chunk_str_t;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_chunk_ip4 { struct hep_chunk_ip4 {
hep_chunk_t chunk; hep_chunk_t chunk;
struct in_addr data; struct in_addr data;
} PACKED; } PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
typedef struct hep_chunk_ip4 hep_chunk_ip4_t; typedef struct hep_chunk_ip4 hep_chunk_ip4_t;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_chunk_ip6 { struct hep_chunk_ip6 {
hep_chunk_t chunk; hep_chunk_t chunk;
struct in6_addr data; struct in6_addr data;
} PACKED; } PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
typedef struct hep_chunk_ip6 hep_chunk_ip6_t; typedef struct hep_chunk_ip6 hep_chunk_ip6_t;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_chunk_payload { struct hep_chunk_payload {
hep_chunk_t chunk; hep_chunk_t chunk;
char *data; char *data;
} PACKED; } PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#elsif
typedef struct hep_chunk_payload hep_chunk_payload_t; typedef struct hep_chunk_payload hep_chunk_payload_t;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_ctrl { struct hep_ctrl {
char id[4]; char id[4];
uint16_t length; uint16_t length;
} PACKED; } PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
typedef struct hep_ctrl hep_ctrl_t; typedef struct hep_ctrl hep_ctrl_t;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_generic { struct hep_generic {
hep_ctrl_t header; hep_ctrl_t header;
hep_chunk_uint8_t ip_family; hep_chunk_uint8_t ip_family;
@ -298,13 +232,13 @@ struct hep_generic {
hep_chunk_uint8_t proto_t; hep_chunk_uint8_t proto_t;
hep_chunk_uint32_t capt_id; hep_chunk_uint32_t capt_id;
} PACKED; } PACKED;
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma pack(pop) #pragma pack(pop)
#endif #endif
typedef struct hep_generic hep_generic_t; typedef struct hep_generic hep_generic_t;
/** Maximum size when streaming. */ /** Maximum size when streaming. */
#define MSG_SSIZE_MAX (USIZE_MAX) #define MSG_SSIZE_MAX (USIZE_MAX)