]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_ptm.h
zebra: dup addr detect clear cmd non-zero return
[mirror_frr.git] / zebra / zebra_ptm.h
1 /*
2 * Definitions for prescriptive topology module (PTM).
3 * Copyright (C) 1998, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
4 *
5 * This file is part of GNU Zebra.
6 *
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef _ZEBRA_PTM_H
23 #define _ZEBRA_PTM_H
24
25 extern const char ZEBRA_PTM_SOCK_NAME[];
26 #define ZEBRA_PTM_MAX_SOCKBUF 3200 /* 25B *128 ports */
27 #define ZEBRA_PTM_SEND_MAX_SOCKBUF 512
28
29 #define ZEBRA_PTM_BFD_CLIENT_FLAG_REG (1 << 1) /* client registered with BFD */
30
31 #include "zebra/zserv.h"
32 #include "zebra/interface.h"
33
34 /* Zebra ptm context block */
35 struct zebra_ptm_cb {
36 int ptm_sock; /* ptm file descriptor. */
37
38 struct buffer *wb; /* Buffer of data waiting to be written to ptm. */
39
40 struct thread *t_read; /* Thread for read */
41 struct thread *t_write; /* Thread for write */
42 struct thread *t_timer; /* Thread for timer */
43
44 char *out_data;
45 char *in_data;
46 int reconnect_time;
47
48 int ptm_enable;
49 int pid;
50 uint8_t client_flags[ZEBRA_ROUTE_MAX];
51 };
52
53 #define ZEBRA_PTM_STATUS_DOWN 0
54 #define ZEBRA_PTM_STATUS_UP 1
55 #define ZEBRA_PTM_STATUS_UNKNOWN 2
56
57 /* For interface ptm-enable configuration. */
58 #define ZEBRA_IF_PTM_ENABLE_OFF 0
59 #define ZEBRA_IF_PTM_ENABLE_ON 1
60 #define ZEBRA_IF_PTM_ENABLE_UNSPEC 2
61
62 #define IS_BFD_ENABLED_PROTOCOL(protocol) ( \
63 (protocol) == ZEBRA_ROUTE_BGP || \
64 (protocol) == ZEBRA_ROUTE_OSPF || \
65 (protocol) == ZEBRA_ROUTE_OSPF6 || \
66 (protocol) == ZEBRA_ROUTE_ISIS || \
67 (protocol) == ZEBRA_ROUTE_PIM || \
68 (protocol) == ZEBRA_ROUTE_OPENFABRIC \
69 )
70
71 void zebra_ptm_init(void);
72 void zebra_ptm_finish(void);
73 int zebra_ptm_connect(struct thread *t);
74 void zebra_ptm_write(struct vty *vty);
75 int zebra_ptm_get_enable_state(void);
76
77 /* ZAPI message handlers */
78 void zebra_ptm_bfd_dst_register(ZAPI_HANDLER_ARGS);
79 void zebra_ptm_bfd_dst_deregister(ZAPI_HANDLER_ARGS);
80 void zebra_ptm_bfd_client_register(ZAPI_HANDLER_ARGS);
81 #if HAVE_BFDD > 0
82 void zebra_ptm_bfd_dst_replay(ZAPI_HANDLER_ARGS);
83 #endif /* HAVE_BFDD */
84
85 void zebra_ptm_show_status(struct vty *vty, struct interface *ifp);
86 void zebra_ptm_if_init(struct zebra_if *zebra_ifp);
87 void zebra_ptm_if_set_ptm_state(struct interface *ifp,
88 struct zebra_if *zebra_ifp);
89 void zebra_ptm_if_write(struct vty *vty, struct zebra_if *zebra_ifp);
90 #endif