]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_ptm.h
*: add indent control files
[mirror_frr.git] / zebra / zebra_ptm.h
CommitLineData
244c1cdc
DS
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 *
896014f4
DL
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
244c1cdc
DS
20 */
21
22#ifndef _ZEBRA_PTM_H
23#define _ZEBRA_PTM_H
24
25extern const char ZEBRA_PTM_SOCK_NAME[];
26#define ZEBRA_PTM_MAX_SOCKBUF 3200 /* 25B *128 ports */
c43ed2e4 27#define ZEBRA_PTM_SEND_MAX_SOCKBUF 512
c8ed14dd 28
2376c3f2 29#define ZEBRA_PTM_BFD_CLIENT_FLAG_REG (1 << 1) /* client registered with BFD */
30
c8ed14dd
DS
31/* Zebra ptm context block */
32struct zebra_ptm_cb
33{
34 int ptm_sock; /* ptm file descriptor. */
35
36 struct buffer *wb; /* Buffer of data waiting to be written to ptm. */
37
38 struct thread *t_read; /* Thread for read */
39 struct thread *t_write; /* Thread for write */
40 struct thread *t_timer; /* Thread for timer */
41
42 char *out_data;
43 char *in_data;
44 int reconnect_time;
45
46 int ptm_enable;
47 int pid;
2376c3f2 48 u_int8_t client_flags[ZEBRA_ROUTE_MAX];
c8ed14dd 49};
244c1cdc 50
950bd436 51#define ZEBRA_PTM_STATUS_DOWN 0
52#define ZEBRA_PTM_STATUS_UP 1
53#define ZEBRA_PTM_STATUS_UNKNOWN 2
54
986aa00f 55/* For interface ptm-enable configuration. */
56#define ZEBRA_IF_PTM_ENABLE_OFF 0
57#define ZEBRA_IF_PTM_ENABLE_ON 1
58#define ZEBRA_IF_PTM_ENABLE_UNSPEC 2
59
244c1cdc 60void zebra_ptm_init (void);
c8ed14dd 61void zebra_ptm_finish(void);
244c1cdc
DS
62int zebra_ptm_connect (struct thread *t);
63void zebra_ptm_write (struct vty *vty);
c8ed14dd 64int zebra_ptm_get_enable_state(void);
244c1cdc 65
c43ed2e4 66int zebra_ptm_bfd_dst_register (struct zserv *client, int sock, u_short length,
d651649e 67 int command, struct zebra_vrf *zvrf);
d553294e 68int zebra_ptm_bfd_dst_deregister (struct zserv *client, int sock,
d651649e 69 u_short length, struct zebra_vrf *zvrf);
950bd436 70void
71zebra_ptm_show_status(struct vty *vty, struct interface *ifp);
055c4dfc 72int zebra_ptm_bfd_client_register (struct zserv *client, int sock,
73 u_short length);
986aa00f 74void zebra_ptm_if_init(struct zebra_if *zebra_ifp);
75void zebra_ptm_if_set_ptm_state(struct interface *ifp, struct zebra_if *zebra_ifp);
76void zebra_ptm_if_write (struct vty *vty, struct zebra_if *zebra_ifp);
2376c3f2 77void zebra_ptm_bfd_client_deregister (int proto);
244c1cdc 78#endif