]>
git.proxmox.com Git - mirror_frr.git/blob - lib/pbr.h
1 /* Policy Based Routing (PBR) main header
2 * Copyright (C) 2018 6WIND
4 * FRR is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2, or (at your option) any
9 * FRR is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with FRR; see the file COPYING. If not, write to the Free
16 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 * The filter or match criteria in a PBR rule.
27 * For simplicity, all supported filters are grouped into a structure rather
28 * than delineating further. A bitmask denotes which filters are actually
32 uint32_t filter_bm
; /* not encoded by zapi
34 #define PBR_FILTER_SRC_IP (1 << 0)
35 #define PBR_FILTER_DST_IP (1 << 1)
36 #define PBR_FILTER_SRC_PORT (1 << 2)
37 #define PBR_FILTER_DST_PORT (1 << 3)
38 #define PBR_FILTER_FWMARK (1 << 4)
40 /* Source and Destination IP address with masks. */
44 /* Source and Destination higher-layer (TCP/UDP) port numbers. */
48 /* Filter with fwmark */
55 * The action corresponding to a PBR rule.
56 * While the user specifies the action in a particular way, the forwarding
57 * plane implementation (Linux only) requires that to be encoded into a
58 * route table and the rule then point to that route table; in some cases,
59 * the user criteria may directly point to a table too.
68 * This is a combination of the filter criteria and corresponding action.
69 * Rules also have a user-defined sequence number which defines the relative
70 * order amongst rules.
78 struct pbr_filter filter
;
79 struct pbr_action action
;
83 extern int zapi_pbr_rule_encode(uint8_t cmd
, struct stream
*s
,
84 struct pbr_rule
*zrule
);