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