extern "C" {
#endif
+/* Memory type for PBR objects. */
+DECLARE_MTYPE(PBR_OBJ);
+
+struct zebra_pbr_action {
+ afi_t afi;
+
+ /* currently only one nexthop is supported */
+ union g_addr gate;
+
+ /* dest-interface */
+ ifindex_t ifindex;
+
+ /* dataplane info */
+ intptr_t dp_flow_ptr;
+
+ /* neigh */
+ struct zebra_neigh_ent *neigh;
+ /* zebra_pbr_rule is linked to neigh via neigh_listnode */
+ struct listnode neigh_listnode;
+};
+
struct zebra_pbr_rule {
int sock;
char ifname[INTERFACE_NAMSIZ];
+ struct zebra_pbr_action action;
+
vrf_id_t vrf_id;
};
*/
uint32_t type;
+ uint8_t family;
+
char ipset_name[ZEBRA_IPSET_NAME_SIZE];
};
struct list *interface_name_list;
+#define IPTABLE_INSTALL_QUEUED 1 << 1
+#define IPTABLE_UNINSTALL_QUEUED 1 << 2
+ uint8_t internal_flags;
char ipset_name[ZEBRA_IPSET_NAME_SIZE];
};
extern uint32_t zebra_pbr_iptable_hash_key(const void *arg);
extern bool zebra_pbr_iptable_hash_equal(const void *arg1, const void *arg2);
+extern void zebra_pbr_config_write(struct vty *vty);
+extern void zebra_pbr_expand_action_update(bool enable);
extern void zebra_pbr_init(void);
extern void zebra_pbr_show_ipset_list(struct vty *vty, char *ipsetname);
extern void zebra_pbr_show_iptable(struct vty *vty, char *iptable);
struct zebra_pbr_iptable *zpi);
size_t zebra_pbr_tcpflags_snprintf(char *buffer, size_t len,
uint16_t tcp_val);
+extern void zebra_pbr_show_rule(struct vty *vty);
+extern void zebra_pbr_show_rule_unit(struct zebra_pbr_rule *rule,
+ struct vty *vty);
DECLARE_HOOK(zebra_pbr_ipset_entry_get_stat,
(struct zebra_pbr_ipset_entry *ipset, uint64_t *pkts,
uint64_t *bytes),
- (ipset, pkts, bytes))
+ (ipset, pkts, bytes));
DECLARE_HOOK(zebra_pbr_iptable_get_stat,
(struct zebra_pbr_iptable *iptable, uint64_t *pkts,
uint64_t *bytes),
- (iptable, pkts, bytes))
+ (iptable, pkts, bytes));
DECLARE_HOOK(zebra_pbr_iptable_update,
(int cmd, struct zebra_pbr_iptable *iptable), (cmd, iptable));