aboutsummaryrefslogtreecommitdiff
path: root/src/ppkt.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-03-20 00:14:56 +0100
committerToni Uhlig <matzeton@googlemail.com>2022-03-20 00:14:56 +0100
commit34498f719fef5d867f23344a5a2b9e8ef08c6d57 (patch)
treea79b9b2529f36b90d0f94c0dd2433a69ec87270e /src/ppkt.h
parente42e3117e767242f4682fe9e44f8e8750b167b33 (diff)
fourth smth
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/ppkt.h')
-rw-r--r--src/ppkt.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/ppkt.h b/src/ppkt.h
index 34c3075..a4068ec 100644
--- a/src/ppkt.h
+++ b/src/ppkt.h
@@ -3,22 +3,33 @@
#include <stdint.h>
-
#define PTUNNEL_IDENT 0xdeadc0de
struct psock;
-struct ppkt
-{
- uint32_t ident;
+struct ppkt_option_header {
uint16_t type;
- uint16_t data_size;
+ uint16_t size;
+} __attribute__((__packed__));
+
+struct ppkt_option_auth {
+ struct ppkt_option_header option;
uint8_t data[0];
} __attribute__((__packed__));
+union ppkt_option {
+ struct ppkt_option_auth auth;
+} __attribute__((__packed__));
+;
+
+struct ppkt {
+ uint32_t ident;
+ uint16_t total_size;
+ union ppkt_option current;
+} __attribute__((__packed__));
-void ppkt_process_icmp(struct psock *);
+int ppkt_process_icmp(struct psock *);
-void ppkt_process_body(struct psock *);
+int ppkt_process_ppkt(struct psock *);
#endif