aboutsummaryrefslogtreecommitdiff
path: root/src/ppkt.h
diff options
context:
space:
mode:
authorlns <matzeton@googlemail.com>2022-06-09 16:46:41 +0200
committerlns <matzeton@googlemail.com>2022-06-09 16:46:41 +0200
commit5825a6dd3781f4f1a37d6924f18f2bfdf34858d6 (patch)
treea75d13590292d23d218aa628c28079a2966ecfc9 /src/ppkt.h
parentf8904fcfbbeb0336b0516d75c758322cce12de7d (diff)
Signed-off-by: lns <matzeton@googlemail.com>
Diffstat (limited to 'src/ppkt.h')
-rw-r--r--src/ppkt.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ppkt.h b/src/ppkt.h
index 029e73b..bdfb57d 100644
--- a/src/ppkt.h
+++ b/src/ppkt.h
@@ -7,9 +7,7 @@
#define PTUNNEL_MAGIC 0xdeadc0de
-#define PTUNNAL_MAX_BODY_SIZE (1500 - sizeof(struct iphdr) \
- - sizeof(struct icmphdr) \
- - sizeof(struct ppkt_header))
+#define PTUNNAL_MAX_BODY_SIZE (1500 - sizeof(struct iphdr) - sizeof(struct icmphdr) - sizeof(struct ppkt_header))
enum ptype {
PTYPE_INVALID = 0,
@@ -31,6 +29,7 @@ struct ppkt_auth_response {
} __attribute__((__packed__));
struct ppkt_header {
+ // sizeof(header) + sizeof(body) + sizeof(data)
uint16_t total_size;
uint8_t type;
} __attribute__((__packed__));
@@ -50,7 +49,7 @@ struct ppkt_buffer {
union ppkt_body pbody;
};
-enum ptype ppkt_type_to_enum(struct ppkt_header *);
+enum ptype ppkt_type_to_enum(struct ppkt_header const *);
int ppkt_process_icmp(struct psock *);