]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/tc_netlink.h
2 * Zebra Traffic Control (TC) interaction with the kernel using netlink.
4 * Copyright (C) 2022 Shichu Yang
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef _ZEBRA_TC_NETLINK_H
22 #define _ZEBRA_TC_NETLINK_H
30 /* Represent a prefixed address in flower filter */
41 PREFIXLEN_SPECIFIED
= (1 << 0),
42 ADDRTYPE_INET
= (1 << 1),
43 ADDRTYPE_UNSPEC
= (1 << 2),
44 ADDRTYPE_MULTI
= (1 << 3),
46 ADDRTYPE_INET_UNSPEC
= ADDRTYPE_INET
| ADDRTYPE_UNSPEC
,
47 ADDRTYPE_INET_MULTI
= ADDRTYPE_INET
| ADDRTYPE_MULTI
50 extern enum netlink_msg_status
51 netlink_put_tc_qdisc_update_msg(struct nl_batch
*bth
,
52 struct zebra_dplane_ctx
*ctx
);
53 extern enum netlink_msg_status
54 netlink_put_tc_class_update_msg(struct nl_batch
*bth
,
55 struct zebra_dplane_ctx
*ctx
);
56 extern enum netlink_msg_status
57 netlink_put_tc_filter_update_msg(struct nl_batch
*bth
,
58 struct zebra_dplane_ctx
*ctx
);
61 * "filter" & "class" in the following become "tfilter" & "tclass" for
62 * the sake of consistency with kernel message types (RTM_NEWTFILTER etc.)
65 extern int netlink_qdisc_read(struct zebra_ns
*zns
);
66 extern int netlink_tfilter_read_for_interface(struct zebra_ns
*zns
,
69 extern int netlink_tfilter_change(struct nlmsghdr
*h
, ns_id_t ns_id
,
71 extern int netlink_tclass_change(struct nlmsghdr
*h
, ns_id_t ns_id
,
73 extern int netlink_qdisc_change(struct nlmsghdr
*h
, ns_id_t ns_id
, int startup
);
80 #endif /* HAVE_NETLINK */
82 #endif /* _ZEBRA_TC_NETLINK_H */