xref: /openbsd/usr.sbin/bgpd/log.h (revision 17098ec8)
1 /*	$OpenBSD: log.h,v 1.15 2013/03/07 21:26:28 claudio Exp $ */
2 
3 /*
4  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 static const char * const statenames[] = {
20 	"None",
21 	"Idle",
22 	"Connect",
23 	"Active",
24 	"OpenSent",
25 	"OpenConfirm",
26 	"Established"
27 };
28 
29 static const char * const eventnames[] = {
30 	"None",
31 	"Start",
32 	"Stop",
33 	"Connection opened",
34 	"Connection closed",
35 	"Connection open failed",
36 	"Fatal error",
37 	"ConnectRetryTimer expired",
38 	"HoldTimer expired",
39 	"KeepaliveTimer expired",
40 	"OPEN message received",
41 	"KEEPALIVE message received",
42 	"UPDATE message received",
43 	"NOTIFICATION received"
44 };
45 
46 static const char * const errnames[] = {
47 	"none",
48 	"Header error",
49 	"error in OPEN message",
50 	"error in UPDATE message",
51 	"HoldTimer expired",
52 	"Finite State Machine error",
53 	"Cease"
54 };
55 
56 static const char * const suberr_header_names[] = {
57 	"none",
58 	"synchronization error",
59 	"wrong length",
60 	"unknown message type"
61 };
62 
63 static const char * const suberr_open_names[] = {
64 	"none",
65 	"version mismatch",
66 	"AS unacceptable",
67 	"BGPID invalid",
68 	"optional parameter error",
69 	"authentication error",
70 	"unacceptable holdtime",
71 	"unsupported capability"
72 };
73 
74 static const char * const suberr_fsm_names[] = {
75 	"unspecified error",
76 	"received unexpected message in OpenSent",
77 	"received unexpected message in OpenConfirm",
78 	"received unexpected message in Established"
79 };
80 
81 static const char * const suberr_update_names[] = {
82 	"none",
83 	"attribute list error",
84 	"unknown well-known attribute",
85 	"well-known attribute missing",
86 	"attribute flags error",
87 	"attribute length wrong",
88 	"origin unacceptable",
89 	"loop detected",
90 	"nexthop unacceptable",
91 	"optional attribute error",
92 	"network unacceptable",
93 	"AS-Path unacceptable"
94 };
95 
96 static const char * const suberr_cease_names[] = {
97 	"none",
98 	"max-prefix exceeded",
99 	"administratively down",
100 	"peer unconfigured",
101 	"administrative reset",
102 	"connection rejected",
103 	"other config change",
104 	"collision",
105 	"resource exhaustion"
106 };
107 
108 static const char * const procnames[] = {
109 	"parent",
110 	"SE",
111 	"RDE"
112 };
113 
114 static const char * const ctl_res_strerror[] = {
115 	"no error",
116 	"no such neighbor",
117 	"permission denied",
118 	"neighbor does not have this capability",
119 	"config file has errors, reload failed",
120 	"previous reload still running",
121 	"out of memory",
122 	"not a cloned peer",
123 	"peer still active, down peer first"
124 };
125 
126 static const char * const timernames[] = {
127 	"None",
128 	"ConnectRetryTimer",
129 	"KeepaliveTimer",
130 	"HoldTimer",
131 	"IdleHoldTimer",
132 	"IdleHoldResetTimer",
133 	"CarpUndemoteTimer",
134 	""
135 };
136