]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_ptm.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Definitions for prescriptive topology module (PTM).
4 * Copyright (C) 1998, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
10 extern const char ZEBRA_PTM_SOCK_NAME
[];
11 #define ZEBRA_PTM_MAX_SOCKBUF 3200 /* 25B *128 ports */
12 #define ZEBRA_PTM_SEND_MAX_SOCKBUF 512
14 #define ZEBRA_PTM_BFD_CLIENT_FLAG_REG (1 << 1) /* client registered with BFD */
16 #include "zebra/zserv.h"
17 #include "zebra/interface.h"
23 /* Zebra ptm context block */
25 int ptm_sock
; /* ptm file descriptor. */
27 struct buffer
*wb
; /* Buffer of data waiting to be written to ptm. */
29 struct event
*t_read
; /* Thread for read */
30 struct event
*t_write
; /* Thread for write */
31 struct event
*t_timer
; /* Thread for timer */
39 uint8_t client_flags
[ZEBRA_ROUTE_MAX
];
42 #define ZEBRA_PTM_STATUS_DOWN 0
43 #define ZEBRA_PTM_STATUS_UP 1
44 #define ZEBRA_PTM_STATUS_UNKNOWN 2
46 /* For interface ptm-enable configuration. */
47 #define ZEBRA_IF_PTM_ENABLE_OFF 0
48 #define ZEBRA_IF_PTM_ENABLE_ON 1
49 #define ZEBRA_IF_PTM_ENABLE_UNSPEC 2
51 #define IS_BFD_ENABLED_PROTOCOL(protocol) \
52 ((protocol) == ZEBRA_ROUTE_BGP || (protocol) == ZEBRA_ROUTE_OSPF || \
53 (protocol) == ZEBRA_ROUTE_OSPF6 || (protocol) == ZEBRA_ROUTE_ISIS || \
54 (protocol) == ZEBRA_ROUTE_PIM || \
55 (protocol) == ZEBRA_ROUTE_OPENFABRIC || \
56 (protocol) == ZEBRA_ROUTE_STATIC || (protocol) == ZEBRA_ROUTE_RIP)
58 void zebra_ptm_init(void);
59 void zebra_ptm_finish(void);
60 void zebra_ptm_connect(struct event
*t
);
61 void zebra_ptm_write(struct vty
*vty
);
62 int zebra_ptm_get_enable_state(void);
64 /* ZAPI message handlers */
65 void zebra_ptm_bfd_dst_register(ZAPI_HANDLER_ARGS
);
66 void zebra_ptm_bfd_dst_deregister(ZAPI_HANDLER_ARGS
);
67 void zebra_ptm_bfd_client_register(ZAPI_HANDLER_ARGS
);
69 void zebra_ptm_bfd_dst_replay(ZAPI_HANDLER_ARGS
);
70 #endif /* HAVE_BFDD */
72 void zebra_ptm_show_status(struct vty
*vty
, json_object
*json
,
73 struct interface
*ifp
);
74 void zebra_ptm_if_init(struct zebra_if
*zebra_ifp
);
75 void zebra_ptm_if_set_ptm_state(struct interface
*ifp
,
76 struct zebra_if
*zebra_ifp
);
77 void zebra_ptm_if_write(struct vty
*vty
, struct zebra_if
*zebra_ifp
);