]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/redistribute.c
zebra: reorganize zserv, batch i/o
[mirror_frr.git] / zebra / redistribute.c
index c03d755b2a41600eb62a26965f85cce5d65d064e..5a239306fbfae0fbd2ec6e19e04d111fe8d8a026 100644 (file)
@@ -243,16 +243,15 @@ void redistribute_delete(struct prefix *p, struct prefix *src_p,
        }
 }
 
-void zebra_redistribute_add(int command, struct zserv *client, int length,
-                           struct zebra_vrf *zvrf)
+void zebra_redistribute_add(ZAPI_HANDLER_ARGS)
 {
        afi_t afi = 0;
        int type = 0;
        u_short instance;
 
-       STREAM_GETC(client->ibuf, afi);
-       STREAM_GETC(client->ibuf, type);
-       STREAM_GETW(client->ibuf, instance);
+       STREAM_GETC(msg, afi);
+       STREAM_GETC(msg, type);
+       STREAM_GETW(msg, instance);
 
        if (afi == 0 || afi > AFI_MAX) {
                zlog_warn("%s: Specified afi %d does not exist",
@@ -287,16 +286,15 @@ stream_failure:
        return;
 }
 
-void zebra_redistribute_delete(int command, struct zserv *client, int length,
-                              struct zebra_vrf *zvrf)
+void zebra_redistribute_delete(ZAPI_HANDLER_ARGS)
 {
        afi_t afi = 0;
        int type = 0;
        u_short instance;
 
-       STREAM_GETC(client->ibuf, afi);
-       STREAM_GETC(client->ibuf, type);
-       STREAM_GETW(client->ibuf, instance);
+       STREAM_GETC(msg, afi);
+       STREAM_GETC(msg, type);
+       STREAM_GETW(msg, instance);
 
        if (afi == 0 || afi > AFI_MAX) {
                zlog_warn("%s: Specified afi %d does not exist",
@@ -325,15 +323,13 @@ stream_failure:
        return;
 }
 
-void zebra_redistribute_default_add(int command, struct zserv *client,
-                                   int length, struct zebra_vrf *zvrf)
+void zebra_redistribute_default_add(ZAPI_HANDLER_ARGS)
 {
        vrf_bitmap_set(client->redist_default, zvrf_id(zvrf));
        zebra_redistribute_default(client, zvrf_id(zvrf));
 }
 
-void zebra_redistribute_default_delete(int command, struct zserv *client,
-                                      int length, struct zebra_vrf *zvrf)
+void zebra_redistribute_default_delete(ZAPI_HANDLER_ARGS)
 {
        vrf_bitmap_unset(client->redist_default, zvrf_id(zvrf));
 }
@@ -519,8 +515,8 @@ int zebra_add_import_table_entry(struct route_node *rn, struct route_entry *re,
        afi = family2afi(rn->p.family);
        if (rmap_name)
                ret = zebra_import_table_route_map_check(
-                       afi, re->type, &rn->p, re->nexthop, re->vrf_id, re->tag,
-                       rmap_name);
+                       afi, re->type, &rn->p, re->ng.nexthop, re->vrf_id,
+                       re->tag, rmap_name);
 
        if (ret != RMAP_MATCH) {
                zebra_del_import_table_entry(rn, re);
@@ -552,7 +548,7 @@ int zebra_add_import_table_entry(struct route_node *rn, struct route_entry *re,
        newre->nexthop_num = 0;
        newre->uptime = time(NULL);
        newre->instance = re->table;
-       route_entry_copy_nexthops(newre, re->nexthop);
+       route_entry_copy_nexthops(newre, re->ng.nexthop);
 
        rib_add_multipath(afi, SAFI_UNICAST, &p, NULL, newre);
 
@@ -568,8 +564,8 @@ int zebra_del_import_table_entry(struct route_node *rn, struct route_entry *re)
        prefix_copy(&p, &rn->p);
 
        rib_delete(afi, SAFI_UNICAST, re->vrf_id, ZEBRA_ROUTE_TABLE, re->table,
-                  re->flags, &p, NULL, re->nexthop, zebrad.rtm_table_default,
-                  re->metric, false, NULL);
+                  re->flags, &p, NULL, re->ng.nexthop,
+                  zebrad.rtm_table_default, re->metric, false, NULL);
 
        return 0;
 }