diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-03-20 00:14:56 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-03-20 00:14:56 +0100 |
commit | 34498f719fef5d867f23344a5a2b9e8ef08c6d57 (patch) | |
tree | a79b9b2529f36b90d0f94c0dd2433a69ec87270e /src/ppkt.h | |
parent | e42e3117e767242f4682fe9e44f8e8750b167b33 (diff) |
fourth smth
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/ppkt.h')
-rw-r--r-- | src/ppkt.h | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -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 |