ldp.h revision 1.5 1 /* $NetBSD: ldp.h,v 1.5 2013/01/26 17:29:55 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 /* RFC5036 */
39 #define ALL_ROUTERS "224.0.0.2"
40 /* draft-ietf-mpls-ldp-ipv6 */
41 #define ALL_ROUTERS6 "FF02::2"
42 /* RFC5036 */
43 #define LDP_PORT 646
44
45 #define LDP_COMMAND_PORT 2626
46
47 #define LDPD_VER "0.4.0"
48
49 #define CONFFILE "/etc/ldpd.conf"
50
51 extern char my_ldp_id[20];
52
53 #define LDP_ID my_ldp_id
54
55 /* LDP Messages */
56 #define LDP_NOTIFICATION 0x0001
57 #define LDP_HELLO 0x0100
58 #define LDP_INITIALIZE 0x0200
59 #define LDP_KEEPALIVE 0x0201
60 #define LDP_ADDRESS 0x0300
61 #define LDP_ADDRESS_WITHDRAW 0x0301
62 #define LDP_LABEL_MAPPING 0x0400
63 #define LDP_LABEL_REQUEST 0x0401
64 #define LDP_LABEL_WITHDRAW 0x0402
65 #define LDP_LABEL_RELEASE 0x0403
66 #define LDP_LABEL_ABORT 0x0404
67
68 /* Protocol version */
69 #define LDP_VERSION 1
70
71 /* Various timers */
72 #define LDP_HELLO_TIME 5
73 #define LDP_HELLO_KEEP 15
74 #define LDP_THELLO_KEEP 45
75 #define LDP_KEEPALIVE_TIME 4
76 #define LDP_HOLDTIME 15
77
78 #define MIN_LABEL 16
79 #define MAX_LABEL 1048576
80
81 #define ROUTE_LOOKUP_LOOP 6
82 #define REPLAY_MAX 100
83 #define MAX_POLL_FDS 200
84
85 void print_usage(char*);
86
87 #endif /* !_LDP_H_ */
88