Annotation of embedaddon/mrouted/rsrr.h, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (c) 1993, 1998-2001.
3: * The University of Southern California/Information Sciences Institute.
4: * All rights reserved.
5: *
6: * Redistribution and use in source and binary forms, with or without
7: * modification, are permitted provided that the following conditions
8: * are met:
9: * 1. Redistributions of source code must retain the above copyright
10: * notice, this list of conditions and the following disclaimer.
11: * 2. Redistributions in binary form must reproduce the above copyright
12: * notice, this list of conditions and the following disclaimer in the
13: * documentation and/or other materials provided with the distribution.
14: * 3. Neither the name of the project nor the names of its contributors
15: * may be used to endorse or promote products derived from this software
16: * without specific prior written permission.
17: *
18: * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21: * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28: * SUCH DAMAGE.
29: */
30:
31: #define RSRR_SERV_PATH "/tmp/.rsrr_svr"
32: /* Note this needs to be 14 chars for 4.3 BSD compatibility */
33: #define RSRR_CLI_PATH "/tmp/.rsrr_cli"
34:
35: #define RSRR_MAX_LEN 2048
36: #define RSRR_HEADER_LEN (sizeof(struct rsrr_header))
37: #define RSRR_RQ_LEN (RSRR_HEADER_LEN + sizeof(struct rsrr_rq))
38: #define RSRR_RR_LEN (RSRR_HEADER_LEN + sizeof(struct rsrr_rr))
39: #define RSRR_VIF_LEN (sizeof(struct rsrr_vif))
40:
41: /* Current maximum number of vifs. */
42: #define RSRR_MAX_VIFS 32
43:
44: /* Maximum acceptable version */
45: #define RSRR_MAX_VERSION 1
46:
47: /* RSRR message types */
48: #define RSRR_ALL_TYPES 0
49: #define RSRR_INITIAL_QUERY 1
50: #define RSRR_INITIAL_REPLY 2
51: #define RSRR_ROUTE_QUERY 3
52: #define RSRR_ROUTE_REPLY 4
53:
54: /* RSRR Initial Reply (Vif) Status bits
55: * Each definition represents the position of the bit from right to left.
56: *
57: * Right-most bit is the disabled bit, set if the vif is administratively
58: * disabled.
59: */
60: #define RSRR_DISABLED_BIT 0
61: /* All other bits are zeroes */
62:
63: /* RSRR Route Query/Reply flag bits
64: * Each definition represents the position of the bit from right to left.
65: *
66: * Right-most bit is the Route Change Notification bit, set if the
67: * reservation protocol wishes to receive notification of
68: * a route change for the source-destination pair listed in the query.
69: * Notification is in the form of an unsolicitied Route Reply.
70: */
71: #define RSRR_NOTIFICATION_BIT 0
72: /* Next bit indicates an error returning the Route Reply. */
73: #define RSRR_ERROR_BIT 1
74: /* All other bits are zeroes */
75:
76: /* Definition of an RSRR message header.
77: * An Initial Query uses only the header, and an Initial Reply uses
78: * the header and a list of vifs.
79: */
80: struct rsrr_header {
81: u_char version; /* RSRR Version, currently 1 */
82: u_char type; /* type of message, as defined above */
83: u_char flags; /* flags; defined by type */
84: u_char num; /* number; defined by type */
85: };
86:
87: /* Definition of a vif as seen by the reservation protocol.
88: *
89: * Routing gives the reservation protocol a list of vifs in the
90: * Initial Reply.
91: *
92: * We explicitly list the ID because we can't assume that all routing
93: * protocols will use the same numbering scheme.
94: *
95: * The status is a bitmask of status flags, as defined above. It is the
96: * responsibility of the reservation protocol to perform any status checks
97: * if it uses the MULTICAST_VIF socket option.
98: *
99: * The threshold indicates the ttl an outgoing packet needs in order to
100: * be forwarded. The reservation protocol must perform this check itself if
101: * it uses the MULTICAST_VIF socket option.
102: *
103: * The local address is the address of the physical interface over which
104: * packets are sent.
105: */
106: struct rsrr_vif {
107: u_char id; /* vif id */
108: u_char threshold; /* vif threshold ttl */
109: u_int16_t status; /* vif status bitmask */
110: struct in_addr local_addr; /* vif local address */
111: };
112:
113: /* Definition of an RSRR Route Query.
114: *
115: * The query asks routing for the forwarding entry for a particular
116: * source and destination. The query ID uniquely identifies the query
117: * for the reservation protocol. Thus, the combination of the client's
118: * address and the query ID forms a unique identifier for routing.
119: * Flags are defined above.
120: */
121: struct rsrr_rq {
122: struct in_addr dest_addr; /* destination */
123: struct in_addr source_addr; /* source */
124: u_long query_id; /* query ID */
125: };
126:
127: /* Definition of an RSRR Route Reply.
128: *
129: * Routing uses the reply to give the reservation protocol the
130: * forwarding entry for a source-destination pair. Routing copies the
131: * query ID from the query and fills in the incoming vif and a bitmask
132: * of the outgoing vifs.
133: * Flags are defined above.
134: */
135: struct rsrr_rr {
136: struct in_addr dest_addr; /* destination */
137: struct in_addr source_addr; /* source */
138: u_long query_id; /* query ID */
139: u_int16_t in_vif; /* incoming vif */
140: u_int16_t reserved; /* reserved */
141: u_long out_vif_bm; /* outgoing vif bitmask */
142: };
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>