-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutil.h
47 lines (40 loc) · 993 Bytes
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __UTIL_H
#define __UTIL_H
#include <netinet/ip6.h>
#include <netdb.h>
#include <netinet/in.h>
#ifdef __UTIL_C
#define EXTERN
#else
#define EXTERN extern
#endif
#define MAX_MSG_LEN 100
typedef struct
{
uint16_t port;
uint16_t vrf;
uint8_t flags;
uint8_t reserved[3];
uint8_t addr8[16];
} dst_opt_tlv_data_t;
typedef struct
{
uint8_t padn;
uint8_t len;
uint8_t data[8];
} dst_opt_tlv_pad_t;
typedef struct
{
dst_opt_tlv_data_t data;
dst_opt_tlv_pad_t pad;
} dst_opt_tlv_t;
EXTERN void print_error(const char *const);
EXTERN void print_error_h(const char *const);
EXTERN void print_error_n(const char *const);
EXTERN int add_dstopts(int);
EXTERN void get_dst_opts(int);
EXTERN void *prepare_buff(u_int8_t, const void *const, size_t, size_t *);
EXTERN void print_hex_data(const unsigned char *const, const int);
EXTERN void find_option_data(dst_opt_tlv_t *, void *, uint8_t);
EXTERN void print_option_data(const dst_opt_tlv_t *const);
#endif