-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdsr-rerr.h
57 lines (45 loc) · 1.14 KB
/
dsr-rerr.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
48
49
50
51
52
53
54
55
56
57
/* Copyright (C) Uppsala University
*
* This file is distributed under the terms of the GNU general Public
* License (GPL), see the file LICENSE
*
* Author: Erik Nordström, <[email protected]>
*/
#ifndef _DSR_RERR_H
#define _DSR_RERR_H
#include "dsr.h"
#ifdef NS2
#include "endian.h"
#endif
#ifndef NO_GLOBALS
struct dsr_rerr_opt {
u_int8_t type;
u_int8_t length;
u_int8_t err_type;
#if defined(__LITTLE_ENDIAN_BITFIELD)
u_int8_t res:4;
u_int8_t salv:4;
#elif defined (__BIG_ENDIAN_BITFIELD)
u_int8_t res:4;
u_int8_t salv:4;
#else
#error "Please fix <asm/byteorder.h>"
#endif
u_int32_t err_src;
u_int32_t err_dst;
char info[0];
};
#define DSR_RERR_HDR_LEN sizeof(struct dsr_rerr_opt)
#define DSR_RERR_OPT_LEN (DSR_RERR_HDR_LEN - 2)
struct node_unreach_info {
u_int32_t unr_node;
};
#define NODE_UNREACHABLE 1
#define FLOW_STATE_NOT_SUPPORTED 2
#define OPTION_NOT_SUPPORTED 3
#endif /* NO_GLOBALS */
#ifndef NO_DECLS
int dsr_rerr_send(struct dsr_pkt *dp_trigg, struct in_addr unr_addr);
int dsr_rerr_opt_recv(struct dsr_pkt *dp, struct dsr_rerr_opt *dsr_rerr_opt);
#endif /* NO_DECLS */
#endif /* _DSR_RERR_H */