ldp.h revision 1.1 1 /* $NetBSD: ldp.h,v 1.1 2010/12/08 07:20:14 kefren Exp $ */
2
3 /*-
4 * Copyright (c) 2010 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Mihai Chelaru <kefren (at) NetBSD.org>
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #ifndef _LDP_H_
33 #define _LDP_H_
34
35 #include <sys/types.h>
36 #include <netinet/in.h>
37
38 #define ALL_ROUTERS "224.0.0.2"
39 #define LDP_PORT 646
40 #define LDP_COMMAND_PORT 2626
41
42 #define LDPD_VER "0.3.0"
43
44 extern char my_ldp_id[20];
45
46 #define LDP_ID my_ldp_id
47
48 /* LDP Messages */
49 #define LDP_NOTIFICATION 0x0001
50 #define LDP_HELLO 0x0100
51 #define LDP_INITIALIZE 0x0200
52 #define LDP_KEEPALIVE 0x0201
53 #define LDP_ADDRESS 0x0300
54 #define LDP_ADDRESS_WITHDRAW 0x0301
55 #define LDP_LABEL_MAPPING 0x0400
56 #define LDP_LABEL_REQUEST 0x0401
57 #define LDP_LABEL_WITHDRAW 0x0402
58 #define LDP_LABEL_RELEASE 0x0403
59 #define LDP_LABEL_ABORT 0x0404
60
61 /* Protocol version */
62 #define LDP_VERSION 1
63
64 /* Various timers */
65 #define LDP_HELLO_TIME 5
66 #define LDP_HELLO_KEEP 15
67 #define LDP_KEEPALIVE_TIME 4
68 #define LDP_HOLDTIME 15
69
70 #define MIN_LABEL 16
71 #define MAX_LABEL 1048576
72
73 #define ROUTE_LOOKUP_LOOP 6
74 #define REPLAY_MAX 100
75 #define MAX_POLL_FDS 200
76
77 void print_usage(char*);
78
79 #endif /* !_LDP_H_ */
80