]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: No need to pass sock descriptor around.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 11 Oct 2017 12:31:35 +0000 (08:31 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 23 Oct 2017 22:09:22 +0000 (18:09 -0400)
Standardize the api to read zapi requests from protocols.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/rtadv.c
zebra/rtadv.h
zebra/zebra_mroute.c
zebra/zebra_mroute.h
zebra/zebra_ptm.c
zebra/zebra_ptm.h
zebra/zebra_vxlan.c
zebra/zebra_vxlan.h
zebra/zserv.c

index 6a8e2ac594e2ac86fd134e9bb5c1a2281f697b7d..7f9bc473156582ba04bf965dd4ca2deb035b0e04 100644 (file)
@@ -799,7 +799,7 @@ static void ipv6_nd_suppress_ra_set(struct interface *ifp,
  * if the operator has explicitly enabled RA. The enable request can also
  * specify a RA interval (in seconds).
  */
-void zebra_interface_radv_set(struct zserv *client, int sock, u_short length,
+void zebra_interface_radv_set(struct zserv *client, u_short length,
                              struct zebra_vrf *zvrf, int enable)
 {
        struct stream *s;
index dcaeb3ed28bf1e359add90fc355f670f10ec645a..9ec1bffa8deaa9e649a1cc4f6911a5459e1e2bbc 100644 (file)
@@ -103,7 +103,7 @@ typedef enum {
 extern void rtadv_init(struct zebra_ns *);
 extern void rtadv_terminate(struct zebra_ns *);
 extern void rtadv_cmd_init(void);
-extern void zebra_interface_radv_set(struct zserv *client, int sock,
+extern void zebra_interface_radv_set(struct zserv *client,
                                     u_short length, struct zebra_vrf *zvrf,
                                     int enable);
 
index 75d5d5d6276c0167a06e9ad2a473751237301215..8fa00b83c9343e311d5bc814593a827b96436974 100644 (file)
@@ -32,7 +32,7 @@
 #include "zebra/rt.h"
 #include "zebra/debug.h"
 
-int zebra_ipmr_route_stats(struct zserv *client, int fd, u_short length,
+int zebra_ipmr_route_stats(struct zserv *client, u_short length,
                           struct zebra_vrf *zvrf)
 {
        struct mcast_route_data mroute;
index fda97e80d74704a78e934f6fee021bff7fb5e3c1..616c3a83ab54c27227daf5e4c6ccfe5d47dc0898 100644 (file)
@@ -28,7 +28,7 @@ struct mcast_route_data {
        unsigned long long lastused;
 };
 
-int zebra_ipmr_route_stats(struct zserv *client, int sock, u_short length,
+int zebra_ipmr_route_stats(struct zserv *client, u_short length,
                           struct zebra_vrf *zvf);
 
 #endif
index 12d7387ed71663de742704858c5443216408f342..464a8cf875f2f9844c13fcd223befe1573b00d71 100644 (file)
@@ -661,7 +661,7 @@ int zebra_ptm_sock_read(struct thread *thread)
 }
 
 /* BFD peer/dst register/update */
-int zebra_ptm_bfd_dst_register(struct zserv *client, int sock, u_short length,
+int zebra_ptm_bfd_dst_register(struct zserv *client, u_short length,
                               int command, struct zebra_vrf *zvrf)
 {
        struct stream *s;
@@ -819,7 +819,7 @@ int zebra_ptm_bfd_dst_register(struct zserv *client, int sock, u_short length,
 }
 
 /* BFD peer/dst deregister */
-int zebra_ptm_bfd_dst_deregister(struct zserv *client, int sock, u_short length,
+int zebra_ptm_bfd_dst_deregister(struct zserv *client, u_short length,
                                 struct zebra_vrf *zvrf)
 {
        struct stream *s;
@@ -946,7 +946,7 @@ int zebra_ptm_bfd_dst_deregister(struct zserv *client, int sock, u_short length,
 }
 
 /* BFD client register */
-int zebra_ptm_bfd_client_register(struct zserv *client, int sock,
+int zebra_ptm_bfd_client_register(struct zserv *client,
                                  u_short length)
 {
        struct stream *s;
index 9f9269ab55b796069e8b33e22d5cb0d8b6f1a4a0..664221eff79e7eb32fb6d54c80ec3ce441768053 100644 (file)
@@ -62,12 +62,12 @@ int zebra_ptm_connect(struct thread *t);
 void zebra_ptm_write(struct vty *vty);
 int zebra_ptm_get_enable_state(void);
 
-int zebra_ptm_bfd_dst_register(struct zserv *client, int sock, u_short length,
+int zebra_ptm_bfd_dst_register(struct zserv *client, u_short length,
                               int command, struct zebra_vrf *zvrf);
-int zebra_ptm_bfd_dst_deregister(struct zserv *client, int sock, u_short length,
+int zebra_ptm_bfd_dst_deregister(struct zserv *client, u_short length,
                                 struct zebra_vrf *zvrf);
 void zebra_ptm_show_status(struct vty *vty, struct interface *ifp);
-int zebra_ptm_bfd_client_register(struct zserv *client, int sock,
+int zebra_ptm_bfd_client_register(struct zserv *client,
                                  u_short length);
 void zebra_ptm_if_init(struct zebra_if *zebra_ifp);
 void zebra_ptm_if_set_ptm_state(struct interface *ifp,
index c0b5f9d10fa51839102bf91a01617b99417a629a..bd430423b33a81b27911b75f2110b5984830e0c9 100644 (file)
@@ -3028,7 +3028,7 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
 /*
  * Handle message from client to delete a remote MACIP for a VNI.
  */
-int zebra_vxlan_remote_macip_del(struct zserv *client, int sock, u_short length,
+int zebra_vxlan_remote_macip_del(struct zserv *client, u_short length,
                                 struct zebra_vrf *zvrf)
 {
        struct stream *s;
@@ -3168,7 +3168,7 @@ int zebra_vxlan_remote_macip_del(struct zserv *client, int sock, u_short length,
  * could be just the add of a MAC address or the add of a neighbor
  * (IP+MAC).
  */
-int zebra_vxlan_remote_macip_add(struct zserv *client, int sock, u_short length,
+int zebra_vxlan_remote_macip_add(struct zserv *client, u_short length,
                                 struct zebra_vrf *zvrf)
 {
        struct stream *s;
@@ -3671,7 +3671,7 @@ int zebra_vxlan_local_mac_add_update(struct interface *ifp,
 /*
  * Handle message from client to delete a remote VTEP for a VNI.
  */
-int zebra_vxlan_remote_vtep_del(struct zserv *client, int sock, u_short length,
+int zebra_vxlan_remote_vtep_del(struct zserv *client, u_short length,
                                struct zebra_vrf *zvrf)
 {
        struct stream *s;
@@ -3750,7 +3750,7 @@ int zebra_vxlan_remote_vtep_del(struct zserv *client, int sock, u_short length,
 /*
  * Handle message from client to add a remote VTEP for a VNI.
  */
-int zebra_vxlan_remote_vtep_add(struct zserv *client, int sock, u_short length,
+int zebra_vxlan_remote_vtep_add(struct zserv *client, u_short length,
                                struct zebra_vrf *zvrf)
 {
        struct stream *s;
@@ -4280,8 +4280,8 @@ int zebra_vxlan_if_add(struct interface *ifp)
  * Handle message from client to enable/disable advertisement of g/w macip
  * routes
  */
-int zebra_vxlan_advertise_gw_macip(struct zserv *client, int sock,
-                                  u_short length, struct zebra_vrf *zvrf)
+int zebra_vxlan_advertise_gw_macip(struct zserv *client, u_short length,
+                                  struct zebra_vrf *zvrf)
 {
        struct stream *s;
        int advertise;
@@ -4388,7 +4388,7 @@ int zebra_vxlan_advertise_gw_macip(struct zserv *client, int sock,
  * when disabled, the entries should be deleted and remote VTEPs and MACs
  * uninstalled from the kernel.
  */
-int zebra_vxlan_advertise_all_vni(struct zserv *client, int sock,
+int zebra_vxlan_advertise_all_vni(struct zserv *client,
                                  u_short length, struct zebra_vrf *zvrf)
 {
        struct stream *s;
index 8b43615bb3e17951a18f2985b3b085cf56f5e441..290d19bcf3302d2028fd6a574f07cf7d85c10fe5 100644 (file)
@@ -96,9 +96,9 @@ extern int zebra_vxlan_local_neigh_add_update(
 extern int zebra_vxlan_local_neigh_del(struct interface *ifp,
                                       struct interface *link_if,
                                       struct ipaddr *ip);
-extern int zebra_vxlan_remote_macip_add(struct zserv *client, int sock,
+extern int zebra_vxlan_remote_macip_add(struct zserv *client,
                                        u_short length, struct zebra_vrf *zvrf);
-extern int zebra_vxlan_remote_macip_del(struct zserv *client, int sock,
+extern int zebra_vxlan_remote_macip_del(struct zserv *client,
                                        u_short length, struct zebra_vrf *zvrf);
 extern int zebra_vxlan_local_mac_add_update(struct interface *ifp,
                                            struct interface *br_if,
@@ -119,14 +119,14 @@ extern int zebra_vxlan_if_down(struct interface *ifp);
 extern int zebra_vxlan_if_add(struct interface *ifp);
 extern int zebra_vxlan_if_update(struct interface *ifp, u_int16_t chgflags);
 extern int zebra_vxlan_if_del(struct interface *ifp);
-extern int zebra_vxlan_remote_vtep_add(struct zserv *client, int sock,
+extern int zebra_vxlan_remote_vtep_add(struct zserv *client,
                                       u_short length, struct zebra_vrf *zvrf);
-extern int zebra_vxlan_remote_vtep_del(struct zserv *client, int sock,
+extern int zebra_vxlan_remote_vtep_del(struct zserv *client,
                                       u_short length, struct zebra_vrf *zvrf);
-extern int zebra_vxlan_advertise_gw_macip(struct zserv *client, int sock,
+extern int zebra_vxlan_advertise_gw_macip(struct zserv *client,
                                          u_short length,
                                          struct zebra_vrf *zvrf);
-extern int zebra_vxlan_advertise_all_vni(struct zserv *client, int sock,
+extern int zebra_vxlan_advertise_all_vni(struct zserv *client,
                                         u_short length,
                                         struct zebra_vrf *zvrf);
 extern void zebra_vxlan_init_tables(struct zebra_vrf *zvrf);
index cbc9f2bed9dd41085ee7c1f25ad4cfa96e9bfff4..69a0fe7f35bff87e1d52f35424466a4d4ff0a9b1 100644 (file)
@@ -693,7 +693,7 @@ static int zsend_write_nexthop(struct stream *s, struct nexthop *nexthop)
 }
 
 /* Nexthop register */
-static int zserv_rnh_register(struct zserv *client, int sock, u_short length,
+static int zserv_rnh_register(struct zserv *client, u_short length,
                              rnh_type_t type, struct zebra_vrf *zvrf)
 {
        struct rnh *rnh;
@@ -754,7 +754,7 @@ static int zserv_rnh_register(struct zserv *client, int sock, u_short length,
 }
 
 /* Nexthop register */
-static int zserv_rnh_unregister(struct zserv *client, int sock, u_short length,
+static int zserv_rnh_unregister(struct zserv *client, u_short length,
                                rnh_type_t type, struct zebra_vrf *zvrf)
 {
        struct rnh *rnh;
@@ -798,7 +798,7 @@ static int zserv_rnh_unregister(struct zserv *client, int sock, u_short length,
 #define ZEBRA_MIN_FEC_LENGTH 5
 
 /* FEC register */
-static int zserv_fec_register(struct zserv *client, int sock, u_short length)
+static int zserv_fec_register(struct zserv *client, u_short length)
 {
        struct stream *s;
        struct zebra_vrf *zvrf;
@@ -849,7 +849,7 @@ static int zserv_fec_register(struct zserv *client, int sock, u_short length)
 }
 
 /* FEC unregister */
-static int zserv_fec_unregister(struct zserv *client, int sock, u_short length)
+static int zserv_fec_unregister(struct zserv *client, u_short length)
 {
        struct stream *s;
        struct zebra_vrf *zvrf;
@@ -2210,7 +2210,7 @@ static void zebra_client_create(int sock)
        zebra_vrf_update_all(client);
 }
 
-static int zread_interface_set_master(struct zserv *client, int sock,
+static int zread_interface_set_master(struct zserv *client,
                                      u_short length)
 {
        struct interface *master;
@@ -2405,42 +2405,42 @@ static int zebra_client_read(struct thread *thread)
                zread_hello(client);
                break;
        case ZEBRA_NEXTHOP_REGISTER:
-               zserv_rnh_register(client, sock, length, RNH_NEXTHOP_TYPE,
+               zserv_rnh_register(client, length, RNH_NEXTHOP_TYPE,
                                   zvrf);
                break;
        case ZEBRA_NEXTHOP_UNREGISTER:
-               zserv_rnh_unregister(client, sock, length, RNH_NEXTHOP_TYPE,
+               zserv_rnh_unregister(client, length, RNH_NEXTHOP_TYPE,
                                     zvrf);
                break;
        case ZEBRA_IMPORT_ROUTE_REGISTER:
-               zserv_rnh_register(client, sock, length, RNH_IMPORT_CHECK_TYPE,
+               zserv_rnh_register(client, length, RNH_IMPORT_CHECK_TYPE,
                                   zvrf);
                break;
        case ZEBRA_IMPORT_ROUTE_UNREGISTER:
-               zserv_rnh_unregister(client, sock, length,
+               zserv_rnh_unregister(client, length,
                                     RNH_IMPORT_CHECK_TYPE, zvrf);
                break;
        case ZEBRA_BFD_DEST_UPDATE:
        case ZEBRA_BFD_DEST_REGISTER:
-               zebra_ptm_bfd_dst_register(client, sock, length, command, zvrf);
+               zebra_ptm_bfd_dst_register(client, length, command, zvrf);
                break;
        case ZEBRA_BFD_DEST_DEREGISTER:
-               zebra_ptm_bfd_dst_deregister(client, sock, length, zvrf);
+               zebra_ptm_bfd_dst_deregister(client, length, zvrf);
                break;
        case ZEBRA_VRF_UNREGISTER:
                zread_vrf_unregister(client, length, zvrf);
                break;
        case ZEBRA_BFD_CLIENT_REGISTER:
-               zebra_ptm_bfd_client_register(client, sock, length);
+               zebra_ptm_bfd_client_register(client, length);
                break;
        case ZEBRA_INTERFACE_ENABLE_RADV:
 #if defined(HAVE_RTADV)
-               zebra_interface_radv_set(client, sock, length, zvrf, 1);
+               zebra_interface_radv_set(client, length, zvrf, 1);
 #endif
                break;
        case ZEBRA_INTERFACE_DISABLE_RADV:
 #if defined(HAVE_RTADV)
-               zebra_interface_radv_set(client, sock, length, zvrf, 0);
+               zebra_interface_radv_set(client, length, zvrf, 0);
 #endif
                break;
        case ZEBRA_MPLS_LABELS_ADD:
@@ -2448,7 +2448,7 @@ static int zebra_client_read(struct thread *thread)
                zread_mpls_labels(command, client, length, vrf_id);
                break;
        case ZEBRA_IPMR_ROUTE_STATS:
-               zebra_ipmr_route_stats(client, sock, length, zvrf);
+               zebra_ipmr_route_stats(client, length, zvrf);
                break;
        case ZEBRA_LABEL_MANAGER_CONNECT:
        case ZEBRA_GET_LABEL_CHUNK:
@@ -2456,31 +2456,31 @@ static int zebra_client_read(struct thread *thread)
                zread_label_manager_request(command, client, vrf_id);
                break;
        case ZEBRA_FEC_REGISTER:
-               zserv_fec_register(client, sock, length);
+               zserv_fec_register(client, length);
                break;
        case ZEBRA_FEC_UNREGISTER:
-               zserv_fec_unregister(client, sock, length);
+               zserv_fec_unregister(client, length);
                break;
        case ZEBRA_ADVERTISE_DEFAULT_GW:
-               zebra_vxlan_advertise_gw_macip(client, sock, length, zvrf);
+               zebra_vxlan_advertise_gw_macip(client, length, zvrf);
                break;
        case ZEBRA_ADVERTISE_ALL_VNI:
-               zebra_vxlan_advertise_all_vni(client, sock, length, zvrf);
+               zebra_vxlan_advertise_all_vni(client, length, zvrf);
                break;
        case ZEBRA_REMOTE_VTEP_ADD:
-               zebra_vxlan_remote_vtep_add(client, sock, length, zvrf);
+               zebra_vxlan_remote_vtep_add(client, length, zvrf);
                break;
        case ZEBRA_REMOTE_VTEP_DEL:
-               zebra_vxlan_remote_vtep_del(client, sock, length, zvrf);
+               zebra_vxlan_remote_vtep_del(client, length, zvrf);
                break;
        case ZEBRA_REMOTE_MACIP_ADD:
-               zebra_vxlan_remote_macip_add(client, sock, length, zvrf);
+               zebra_vxlan_remote_macip_add(client, length, zvrf);
                break;
        case ZEBRA_REMOTE_MACIP_DEL:
-               zebra_vxlan_remote_macip_del(client, sock, length, zvrf);
+               zebra_vxlan_remote_macip_del(client, length, zvrf);
                break;
        case ZEBRA_INTERFACE_SET_MASTER:
-               zread_interface_set_master(client, sock, length);
+               zread_interface_set_master(client, length);
                break;
        case ZEBRA_PW_ADD:
        case ZEBRA_PW_DELETE: