| 1 |
#ifndef RIST_PROTO_PROTOCOL_GRE_H |
| 2 |
#define RIST_PROTO_PROTOCOL_GRE_H |
| 3 |
|
| 4 |
#include "common/attributes.h" |
| 5 |
#include <stdint.h> |
| 6 |
#include <stddef.h> |
| 7 |
#include "rist-private.h" |
| 8 |
#include "proto/gre.h" |
| 9 |
|
| 10 |
struct rist_keepalive_info { |
| 11 |
uint8_t ka[SIZEOF_GRE_KEEPALIVE]; |
| 12 |
uint8_t mac[6]; |
| 13 |
bool x : 1; |
| 14 |
bool r : 1; |
| 15 |
bool b : 1; |
| 16 |
bool a : 1; |
| 17 |
bool p : 1; |
| 18 |
bool e : 1; |
| 19 |
bool l : 1; |
| 20 |
bool n : 1; |
| 21 |
bool d : 1; |
| 22 |
bool t : 1; |
| 23 |
bool v : 1; |
| 24 |
bool j : 1; |
| 25 |
bool f : 1; |
| 26 |
|
| 27 |
bool adv_i : 1; |
| 28 |
bool adv_g : 1; |
| 29 |
bool adv_c : 1; |
| 30 |
size_t json_len; |
| 31 |
const char *json; |
| 32 |
}; |
| 33 |
|
| 34 |
RIST_PRIV ssize_t _librist_proto_gre_send_data(struct rist_peer *p, uint8_t payload_type, uint16_t proto, uint8_t *payload, size_t payload_len, uint16_t src_port, uint16_t dst_port, uint8_t gre_version); |
| 35 |
RIST_PRIV void _librist_proto_gre_send_keepalive(struct rist_peer *p, uint8_t gre_version); |
| 36 |
RIST_PRIV int _librist_proto_gre_parse_keepalive(const uint8_t buf[], size_t buflen, struct rist_keepalive_info *info); |
| 37 |
RIST_PRIV void _librist_proto_gre_send_buffer_negotiation(struct rist_peer *p, uint16_t sender_max_buffer, uint16_t receiver_current_buffer); |
| 38 |
RIST_PRIV int _librist_proto_gre_parse_buffer_negotiation(struct rist_peer *p, uint8_t buf[], size_t buflen, uint16_t *sender_max_buffer, uint16_t *receiver_current_buffer); |
| 39 |
#endif |