From 58da9ac6e691a8c660eb8ca838a154e11da0db68 Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Wed, 22 Jul 2020 04:40:55 +0200 Subject: Fix binapigen decoding and minor improvements - fixed allocating byte slices before copying decoded data - simplified encoding functions - several minor improvements Change-Id: I6669424b89eb86333805cb1b57e4551169980cc2 Signed-off-by: Ondrej Fabry --- Makefile | 7 +- api/binapi.go | 18 +- binapi/abf/abf.ba.go | 216 +- binapi/acl/acl.ba.go | 520 +- binapi/af_packet/af_packet.ba.go | 84 +- binapi/arp/arp.ba.go | 86 +- binapi/avf/avf.ba.go | 56 +- binapi/bfd/bfd.ba.go | 379 +- binapi/bier/bier.ba.go | 504 +- binapi/bond/bond.ba.go | 160 +- binapi/builtinurl/builtinurl.ba.go | 22 +- binapi/cdp/cdp.ba.go | 22 +- binapi/classify/classify.ba.go | 462 +- binapi/cop/cop.ba.go | 46 +- binapi/ct6/ct6.ba.go | 22 +- binapi/dhcp/dhcp.ba.go | 482 +- .../dhcp6_ia_na_client_cp.ba.go | 22 +- binapi/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go | 46 +- binapi/dns/dns.ba.go | 130 +- binapi/dslite/dslite.ba.go | 128 +- binapi/feature/feature.ba.go | 22 +- binapi/flowprobe/flowprobe.ba.go | 48 +- binapi/gbp/gbp.ba.go | 710 +-- binapi/gen.go | 21 + binapi/geneve/geneve.ba.go | 82 +- binapi/gre/gre.ba.go | 60 +- binapi/gso/gso.ba.go | 22 +- binapi/gtpu/gtpu.ba.go | 110 +- binapi/http_static/http_static.ba.go | 30 +- binapi/igmp/igmp.ba.go | 223 +- binapi/ikev2/ikev2.ba.go | 458 +- binapi/interface/interface.ba.go | 693 +-- binapi/ioam_cache/ioam_cache.ba.go | 22 +- binapi/ioam_export/ioam_export.ba.go | 22 +- binapi/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go | 158 +- binapi/ip/ip.ba.go | 1024 ++-- binapi/ip6_nd/ip6_nd.ba.go | 205 +- binapi/ip_neighbor/ip_neighbor.ba.go | 187 +- binapi/ip_types/ip_types.ba.go | 8 +- binapi/ipfix_export/ipfix_export.ba.go | 178 +- binapi/ipip/ipip.ba.go | 132 +- binapi/ipsec/ipsec.ba.go | 520 +- binapi/ipsec_types/ipsec_types.ba.go | 4 +- binapi/l2/l2.ba.go | 682 +-- binapi/l2e/l2e.ba.go | 22 +- binapi/l2tp/l2tp.ba.go | 136 +- binapi/l3xc/l3xc.ba.go | 184 +- binapi/lacp/lacp.ba.go | 46 +- binapi/lb/lb.ba.go | 260 +- binapi/lisp/lisp.ba.go | 752 +-- binapi/lisp_gpe/lisp_gpe.ba.go | 284 +- binapi/lisp_types/lisp_types.ba.go | 20 +- binapi/lldp/lldp.ba.go | 53 +- binapi/mactime/mactime.ba.go | 115 +- binapi/map/map.ba.go | 398 +- binapi/mdata/mdata.ba.go | 22 +- binapi/memclnt/memclnt.ba.go | 303 +- binapi/memif/memif.ba.go | 126 +- binapi/mpls/mpls.ba.go | 402 +- binapi/nat/nat.ba.go | 1607 ++--- binapi/nsh/nsh.ba.go | 162 +- binapi/nsim/nsim.ba.go | 74 +- binapi/oddbuf/oddbuf.ba.go | 22 +- binapi/one/one.ba.go | 1318 ++-- binapi/p2p_ethernet/p2p_ethernet.ba.go | 46 +- binapi/pg/pg.ba.go | 70 +- binapi/pipe/pipe.ba.go | 92 +- binapi/policer/policer.ba.go | 86 +- binapi/pot/pot.ba.go | 124 +- binapi/pppoe/pppoe.ba.go | 52 +- binapi/punt/punt.ba.go | 132 +- binapi/qos/qos.ba.go | 245 +- binapi/rd_cp/rd_cp.ba.go | 22 +- binapi/rdma/rdma.ba.go | 58 +- binapi/session/session.ba.go | 337 +- binapi/span/span.ba.go | 40 +- binapi/sr/sr.ba.go | 315 +- binapi/sr_mpls/sr_mpls.ba.go | 152 +- binapi/stn/stn.ba.go | 44 +- binapi/svs/svs.ba.go | 120 +- binapi/syslog/syslog.ba.go | 104 +- binapi/tapv2/tapv2.ba.go | 100 +- binapi/tcp/tcp.ba.go | 28 +- binapi/teib/teib.ba.go | 54 +- binapi/tls_openssl/tls_openssl.ba.go | 39 +- binapi/trace/trace.ba.go | 86 +- binapi/udp/udp.ba.go | 90 +- binapi/udp_ping/udp_ping.ba.go | 67 +- binapi/urpf/urpf.ba.go | 22 +- binapi/vhost_user/vhost_user.ba.go | 98 +- binapi/virtio/virtio.ba.go | 86 +- binapi/vmxnet3/vmxnet3.ba.go | 152 +- binapi/vpe/vpe.ba.go | 328 +- binapi/vrrp/vrrp.ba.go | 236 +- binapi/vxlan/vxlan.ba.go | 108 +- binapi/vxlan_gbp/vxlan_gbp.ba.go | 84 +- binapi/vxlan_gpe/vxlan_gpe.ba.go | 82 +- .../vxlan_gpe_ioam_export.ba.go | 22 +- binapigen/binapigen.go | 143 +- binapigen/binapigen_test.go | 17 + binapigen/definitions.go | 153 - binapigen/definitions_test.go | 39 - binapigen/gen_encoding.go | 229 +- binapigen/gen_helpers.go | 12 +- binapigen/generate.go | 76 +- binapigen/generator.go | 81 +- binapigen/generator_test.go | 5 +- binapigen/run.go | 48 +- binapigen/strings.go | 165 + binapigen/strings_test.go | 39 + binapigen/types.go | 4 +- codec/codec.go | 70 +- codec/marshaler_test.go | 175 +- codec/msg_codec.go | 10 + examples/simple-client/simple_client.go | 4 +- gen.go | 21 - govpp.go | 38 +- internal/testbinapi/binapi2001/.vppapi/VPP_VERSION | 1 + .../binapi2001/.vppapi/core/af_packet.api.json | 367 ++ .../binapi2001/.vppapi/core/arp.api.json | 648 ++ .../binapi2001/.vppapi/core/bfd.api.json | 1254 ++++ .../binapi2001/.vppapi/core/bier.api.json | 1086 ++++ .../binapi2001/.vppapi/core/bond.api.json | 620 ++ .../binapi2001/.vppapi/core/classify.api.json | 1154 ++++ .../binapi2001/.vppapi/core/cop.api.json | 277 + .../.vppapi/core/ethernet_types.api.json | 15 + .../binapi2001/.vppapi/core/feature.api.json | 228 + .../binapi2001/.vppapi/core/fib_types.api.json | 482 ++ .../binapi2001/.vppapi/core/geneve.api.json | 649 ++ .../binapi2001/.vppapi/core/gre.api.json | 617 ++ .../binapi2001/.vppapi/core/gso.api.json | 218 + .../binapi2001/.vppapi/core/interface.api.json | 1902 ++++++ .../.vppapi/core/interface_types.api.json | 167 + .../testbinapi/binapi2001/.vppapi/core/ip.api.json | 3219 ++++++++++ .../binapi2001/.vppapi/core/ip6_nd.api.json | 912 +++ .../binapi2001/.vppapi/core/ip_neighbor.api.json | 736 +++ .../binapi2001/.vppapi/core/ip_types.api.json | 298 + .../binapi2001/.vppapi/core/ipfix_export.api.json | 664 ++ .../binapi2001/.vppapi/core/ipip.api.json | 764 +++ .../binapi2001/.vppapi/core/ipip_types.api.json | 41 + .../binapi2001/.vppapi/core/ipsec.api.json | 1580 +++++ .../binapi2001/.vppapi/core/ipsec_types.api.json | 493 ++ .../testbinapi/binapi2001/.vppapi/core/l2.api.json | 2015 +++++++ .../binapi2001/.vppapi/core/l2tp.api.json | 767 +++ .../binapi2001/.vppapi/core/lisp.api.json | 1704 ++++++ .../binapi2001/.vppapi/core/lisp_gpe.api.json | 630 ++ .../binapi2001/.vppapi/core/lldp.api.json | 133 + .../binapi2001/.vppapi/core/memclnt.api.json | 595 ++ .../binapi2001/.vppapi/core/mfib_types.api.json | 786 +++ .../binapi2001/.vppapi/core/mpls.api.json | 1378 +++++ .../binapi2001/.vppapi/core/netmap.api.json | 119 + .../binapi2001/.vppapi/core/nhrp.api.json | 561 ++ .../binapi2001/.vppapi/core/one.api.json | 2867 +++++++++ .../binapi2001/.vppapi/core/p2p_ethernet.api.json | 277 + .../binapi2001/.vppapi/core/pci_types.api.json | 32 + .../testbinapi/binapi2001/.vppapi/core/pg.api.json | 183 + .../binapi2001/.vppapi/core/pipe.api.json | 319 + .../binapi2001/.vppapi/core/policer.api.json | 264 + .../binapi2001/.vppapi/core/punt.api.json | 629 ++ .../binapi2001/.vppapi/core/qos.api.json | 956 +++ .../binapi2001/.vppapi/core/rd_cp.api.json | 222 + .../binapi2001/.vppapi/core/session.api.json | 1372 +++++ .../binapi2001/.vppapi/core/span.api.json | 125 + .../testbinapi/binapi2001/.vppapi/core/sr.api.json | 656 ++ .../binapi2001/.vppapi/core/sr_mpls.api.json | 324 + .../binapi2001/.vppapi/core/syslog.api.json | 542 ++ .../binapi2001/.vppapi/core/tapv2.api.json | 775 +++ .../binapi2001/.vppapi/core/tcp.api.json | 351 ++ .../binapi2001/.vppapi/core/udp.api.json | 457 ++ .../binapi2001/.vppapi/core/vhost_user.api.json | 528 ++ .../binapi2001/.vppapi/core/virtio.api.json | 365 ++ .../binapi2001/.vppapi/core/virtio_types.api.json | 93 + .../binapi2001/.vppapi/core/vpe.api.json | 772 +++ .../binapi2001/.vppapi/core/vpe_types.api.json | 86 + .../binapi2001/.vppapi/core/vxlan.api.json | 275 + .../binapi2001/.vppapi/core/vxlan_gbp.api.json | 656 ++ .../binapi2001/.vppapi/core/vxlan_gpe.api.json | 224 + .../binapi2001/.vppapi/plugins/abf.api.json | 1161 ++++ .../binapi2001/.vppapi/plugins/acl.api.json | 1095 ++++ .../binapi2001/.vppapi/plugins/acl_types.api.json | 98 + .../binapi2001/.vppapi/plugins/avf.api.json | 277 + .../binapi2001/.vppapi/plugins/builtinurl.api.json | 53 + .../binapi2001/.vppapi/plugins/cdp.api.json | 57 + .../binapi2001/.vppapi/plugins/ct6.api.json | 222 + .../binapi2001/.vppapi/plugins/dhcp.api.json | 1581 +++++ .../.vppapi/plugins/dhcp6_ia_na_client_cp.api.json | 218 + .../.vppapi/plugins/dhcp6_pd_client_cp.api.json | 563 ++ .../binapi2001/.vppapi/plugins/dns.api.json | 224 + .../binapi2001/.vppapi/plugins/flowprobe.api.json | 309 + .../binapi2001/.vppapi/plugins/gbp.api.json | 1930 ++++++ .../binapi2001/.vppapi/plugins/gtpu.api.json | 645 ++ .../.vppapi/plugins/http_static.api.json | 79 + .../binapi2001/.vppapi/plugins/igmp.api.json | 969 +++ .../binapi2001/.vppapi/plugins/ikev2.api.json | 1187 ++++ .../binapi2001/.vppapi/plugins/ioam_cache.api.json | 57 + .../.vppapi/plugins/ioam_export.api.json | 351 ++ .../.vppapi/plugins/ioam_vxlan_gpe.api.json | 594 ++ .../binapi2001/.vppapi/plugins/l2e.api.json | 218 + .../binapi2001/.vppapi/plugins/l3xc.api.json | 841 +++ .../binapi2001/.vppapi/plugins/lacp.api.json | 289 + .../binapi2001/.vppapi/plugins/lb.api.json | 1090 ++++ .../binapi2001/.vppapi/plugins/lb_types.api.json | 437 ++ .../binapi2001/.vppapi/plugins/mactime.api.json | 424 ++ .../binapi2001/.vppapi/plugins/map.api.json | 1283 ++++ .../binapi2001/.vppapi/plugins/mdata.api.json | 214 + .../binapi2001/.vppapi/plugins/memif.api.json | 516 ++ .../binapi2001/.vppapi/plugins/nat.api.json | 4157 +++++++++++++ .../binapi2001/.vppapi/plugins/nsh.api.json | 499 ++ .../binapi2001/.vppapi/plugins/nsim.api.json | 324 + .../binapi2001/.vppapi/plugins/oddbuf.api.json | 218 + .../binapi2001/.vppapi/plugins/pot.api.json | 258 + .../binapi2001/.vppapi/plugins/pppoe.api.json | 590 ++ .../binapi2001/.vppapi/plugins/rdma.api.json | 313 + .../binapi2001/.vppapi/plugins/sctp.api.json | 175 + .../binapi2001/.vppapi/plugins/stn.api.json | 550 ++ .../binapi2001/.vppapi/plugins/svs.api.json | 707 +++ .../.vppapi/plugins/tls_openssl.api.json | 72 + .../binapi2001/.vppapi/plugins/trace.api.json | 171 + .../binapi2001/.vppapi/plugins/udp_ping.api.json | 423 ++ .../binapi2001/.vppapi/plugins/vmxnet3.api.json | 418 ++ .../.vppapi/plugins/vxlan_gpe_ioam_export.api.json | 351 ++ internal/testbinapi/binapi2001/abf/abf.ba.go | 1569 +++++ internal/testbinapi/binapi2001/abf/abf_rpc.ba.go | 133 + internal/testbinapi/binapi2001/acl/acl.ba.go | 3071 +++------- internal/testbinapi/binapi2001/acl/acl_rpc.ba.go | 313 +- .../binapi2001/acl_types/acl_types.ba.go | 49 + .../binapi2001/af_packet/af_packet.ba.go | 600 +- .../binapi2001/af_packet/af_packet_rpc.ba.go | 89 +- internal/testbinapi/binapi2001/arp/arp.ba.go | 1187 ++++ internal/testbinapi/binapi2001/arp/arp_rpc.ba.go | 123 + internal/testbinapi/binapi2001/avf/avf.ba.go | 456 ++ internal/testbinapi/binapi2001/avf/avf_rpc.ba.go | 40 + internal/testbinapi/binapi2001/bfd/bfd.ba.go | 2080 +++++++ internal/testbinapi/binapi2001/bfd/bfd_rpc.ba.go | 223 + internal/testbinapi/binapi2001/bier/bier.ba.go | 1980 ++++++ internal/testbinapi/binapi2001/bier/bier_rpc.ba.go | 283 + internal/testbinapi/binapi2001/bond/bond.ba.go | 976 +++ internal/testbinapi/binapi2001/bond/bond_rpc.ba.go | 153 + .../binapi2001/builtinurl/builtinurl.ba.go | 103 + .../binapi2001/builtinurl/builtinurl_rpc.ba.go | 30 + internal/testbinapi/binapi2001/cdp/cdp.ba.go | 109 + internal/testbinapi/binapi2001/cdp/cdp_rpc.ba.go | 30 + .../testbinapi/binapi2001/classify/classify.ba.go | 1661 +++++ .../binapi2001/classify/classify_rpc.ba.go | 253 + internal/testbinapi/binapi2001/cop/cop.ba.go | 460 ++ internal/testbinapi/binapi2001/cop/cop_rpc.ba.go | 40 + internal/testbinapi/binapi2001/ct6/ct6.ba.go | 374 ++ internal/testbinapi/binapi2001/ct6/ct6_rpc.ba.go | 30 + internal/testbinapi/binapi2001/dhcp/dhcp.ba.go | 2606 ++++++++ internal/testbinapi/binapi2001/dhcp/dhcp_rpc.ba.go | 213 + .../dhcp6_ia_na_client_cp.ba.go | 372 ++ .../dhcp6_ia_na_client_cp_rpc.ba.go | 30 + .../dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go | 1029 ++++ .../dhcp6_pd_client_cp_rpc.ba.go | 40 + internal/testbinapi/binapi2001/dns/dns.ba.go | 357 ++ internal/testbinapi/binapi2001/dns/dns_rpc.ba.go | 60 + .../binapi2001/ethernet_types/ethernet_types.ba.go | 53 + .../testbinapi/binapi2001/feature/feature.ba.go | 378 ++ .../binapi2001/feature/feature_rpc.ba.go | 30 + .../binapi2001/fib_types/fib_types.ba.go | 762 +++ .../binapi2001/flowprobe/flowprobe.ba.go | 552 ++ .../binapi2001/flowprobe/flowprobe_rpc.ba.go | 40 + internal/testbinapi/binapi2001/gbp/gbp.ba.go | 3363 +++++++++++ internal/testbinapi/binapi2001/gbp/gbp_rpc.ba.go | 523 ++ internal/testbinapi/binapi2001/gen.go | 17 + internal/testbinapi/binapi2001/geneve/geneve.ba.go | 1174 ++++ .../testbinapi/binapi2001/geneve/geneve_rpc.ba.go | 83 + internal/testbinapi/binapi2001/gre/gre.ba.go | 1131 ++++ internal/testbinapi/binapi2001/gre/gre_rpc.ba.go | 73 + internal/testbinapi/binapi2001/gso/gso.ba.go | 372 ++ internal/testbinapi/binapi2001/gso/gso_rpc.ba.go | 30 + internal/testbinapi/binapi2001/gtpu/gtpu.ba.go | 1144 ++++ internal/testbinapi/binapi2001/gtpu/gtpu_rpc.ba.go | 83 + .../binapi2001/http_static/http_static.ba.go | 129 + .../binapi2001/http_static/http_static_rpc.ba.go | 30 + internal/testbinapi/binapi2001/igmp/igmp.ba.go | 1686 ++++++ internal/testbinapi/binapi2001/igmp/igmp_rpc.ba.go | 173 + internal/testbinapi/binapi2001/ikev2/ikev2.ba.go | 1961 ++++++ .../testbinapi/binapi2001/ikev2/ikev2_rpc.ba.go | 160 + .../binapi2001/interface/interface.ba.go | 3083 ++++++++++ .../binapi2001/interface/interface_rpc.ba.go | 343 ++ .../interface_types/interface_types.ba.go | 278 + .../binapi2001/interfaces/interfaces.ba.go | 3961 ------------ .../binapi2001/interfaces/interfaces_rpc.ba.go | 321 - .../binapi2001/ioam_cache/ioam_cache.ba.go | 111 + .../binapi2001/ioam_cache/ioam_cache_rpc.ba.go | 30 + .../binapi2001/ioam_export/ioam_export.ba.go | 686 +++ .../binapi2001/ioam_export/ioam_export_rpc.ba.go | 30 + .../binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go | 1086 ++++ .../ioam_vxlan_gpe/ioam_vxlan_gpe_rpc.ba.go | 80 + internal/testbinapi/binapi2001/ip/ip.ba.go | 5951 +++++++----------- internal/testbinapi/binapi2001/ip/ip_rpc.ba.go | 576 +- internal/testbinapi/binapi2001/ip6_nd/ip6_nd.ba.go | 1520 +++++ .../testbinapi/binapi2001/ip6_nd/ip6_nd_rpc.ba.go | 113 + .../binapi2001/ip_neighbor/ip_neighbor.ba.go | 1341 ++++ .../binapi2001/ip_neighbor/ip_neighbor_rpc.ba.go | 93 + .../testbinapi/binapi2001/ip_types/ip_types.ba.go | 589 ++ .../binapi2001/ipfix_export/ipfix_export.ba.go | 1162 ++++ .../binapi2001/ipfix_export/ipfix_export_rpc.ba.go | 183 + internal/testbinapi/binapi2001/ipip/ipip.ba.go | 1365 +++++ internal/testbinapi/binapi2001/ipip/ipip_rpc.ba.go | 103 + .../binapi2001/ipip_types/ipip_types.ba.go | 81 + internal/testbinapi/binapi2001/ipsec/ipsec.ba.go | 2590 ++++++++ .../testbinapi/binapi2001/ipsec/ipsec_rpc.ba.go | 353 ++ .../binapi2001/ipsec_types/ipsec_types.ba.go | 795 +++ internal/testbinapi/binapi2001/l2/l2.ba.go | 3250 ++++++++++ internal/testbinapi/binapi2001/l2/l2_rpc.ba.go | 403 ++ internal/testbinapi/binapi2001/l2e/l2e.ba.go | 370 ++ internal/testbinapi/binapi2001/l2e/l2e_rpc.ba.go | 30 + internal/testbinapi/binapi2001/l2tp/l2tp.ba.go | 1365 +++++ internal/testbinapi/binapi2001/l2tp/l2tp_rpc.ba.go | 103 + internal/testbinapi/binapi2001/l3xc/l3xc.ba.go | 1485 +++++ internal/testbinapi/binapi2001/l3xc/l3xc_rpc.ba.go | 93 + internal/testbinapi/binapi2001/lacp/lacp.ba.go | 463 ++ internal/testbinapi/binapi2001/lacp/lacp_rpc.ba.go | 63 + internal/testbinapi/binapi2001/lb/lb.ba.go | 1803 ++++++ internal/testbinapi/binapi2001/lb/lb_rpc.ba.go | 163 + .../testbinapi/binapi2001/lb_types/lb_types.ba.go | 773 +++ internal/testbinapi/binapi2001/lisp/lisp.ba.go | 2568 ++++++++ internal/testbinapi/binapi2001/lisp/lisp_rpc.ba.go | 533 ++ .../testbinapi/binapi2001/lisp_gpe/lisp_gpe.ba.go | 979 +++ .../binapi2001/lisp_gpe/lisp_gpe_rpc.ba.go | 153 + internal/testbinapi/binapi2001/lldp/lldp.ba.go | 212 + internal/testbinapi/binapi2001/lldp/lldp_rpc.ba.go | 40 + .../testbinapi/binapi2001/mactime/mactime.ba.go | 695 +++ .../binapi2001/mactime/mactime_rpc.ba.go | 83 + internal/testbinapi/binapi2001/map/map.ba.go | 2133 +++++++ internal/testbinapi/binapi2001/map/map_rpc.ba.go | 233 + internal/testbinapi/binapi2001/mdata/mdata.ba.go | 366 ++ .../testbinapi/binapi2001/mdata/mdata_rpc.ba.go | 30 + .../testbinapi/binapi2001/memclnt/memclnt.ba.go | 1507 ++--- .../binapi2001/memclnt/memclnt_rpc.ba.go | 69 +- internal/testbinapi/binapi2001/memif/memif.ba.go | 908 ++- .../testbinapi/binapi2001/memif/memif_rpc.ba.go | 130 +- .../binapi2001/mfib_types/mfib_types.ba.go | 826 +++ internal/testbinapi/binapi2001/mpls/mpls.ba.go | 2025 +++++++ internal/testbinapi/binapi2001/mpls/mpls_rpc.ba.go | 193 + internal/testbinapi/binapi2001/nat/nat.ba.go | 6378 ++++++++++++++++++++ internal/testbinapi/binapi2001/nat/nat_rpc.ba.go | 1273 ++++ internal/testbinapi/binapi2001/netmap/netmap.ba.go | 198 + .../testbinapi/binapi2001/netmap/netmap_rpc.ba.go | 40 + internal/testbinapi/binapi2001/nhrp/nhrp.ba.go | 1036 ++++ internal/testbinapi/binapi2001/nhrp/nhrp_rpc.ba.go | 73 + internal/testbinapi/binapi2001/nsh/nsh.ba.go | 730 +++ internal/testbinapi/binapi2001/nsh/nsh_rpc.ba.go | 123 + internal/testbinapi/binapi2001/nsim/nsim.ba.go | 538 ++ internal/testbinapi/binapi2001/nsim/nsim_rpc.ba.go | 50 + internal/testbinapi/binapi2001/oddbuf/oddbuf.ba.go | 370 ++ .../testbinapi/binapi2001/oddbuf/oddbuf_rpc.ba.go | 30 + internal/testbinapi/binapi2001/one/one.ba.go | 4408 ++++++++++++++ internal/testbinapi/binapi2001/one/one_rpc.ba.go | 803 +++ .../binapi2001/p2p_ethernet/p2p_ethernet.ba.go | 483 ++ .../binapi2001/p2p_ethernet/p2p_ethernet_rpc.ba.go | 40 + .../binapi2001/pci_types/pci_types.ba.go | 30 + internal/testbinapi/binapi2001/pg/pg.ba.go | 287 + internal/testbinapi/binapi2001/pg/pg_rpc.ba.go | 50 + internal/testbinapi/binapi2001/pipe/pipe.ba.go | 532 ++ internal/testbinapi/binapi2001/pipe/pipe_rpc.ba.go | 83 + .../testbinapi/binapi2001/policer/policer.ba.go | 342 ++ .../binapi2001/policer/policer_rpc.ba.go | 73 + internal/testbinapi/binapi2001/pot/pot.ba.go | 387 ++ internal/testbinapi/binapi2001/pot/pot_rpc.ba.go | 93 + internal/testbinapi/binapi2001/pppoe/pppoe.ba.go | 1080 ++++ .../testbinapi/binapi2001/pppoe/pppoe_rpc.ba.go | 73 + internal/testbinapi/binapi2001/punt/punt.ba.go | 1110 ++++ internal/testbinapi/binapi2001/punt/punt_rpc.ba.go | 133 + internal/testbinapi/binapi2001/qos/qos.ba.go | 1633 +++++ internal/testbinapi/binapi2001/qos/qos_rpc.ba.go | 233 + internal/testbinapi/binapi2001/rd_cp/rd_cp.ba.go | 374 ++ .../testbinapi/binapi2001/rd_cp/rd_cp_rpc.ba.go | 30 + internal/testbinapi/binapi2001/rdma/rdma.ba.go | 490 ++ internal/testbinapi/binapi2001/rdma/rdma_rpc.ba.go | 40 + internal/testbinapi/binapi2001/sctp/sctp.ba.go | 285 + internal/testbinapi/binapi2001/sctp/sctp_rpc.ba.go | 50 + .../testbinapi/binapi2001/session/session.ba.go | 2026 +++++++ .../binapi2001/session/session_rpc.ba.go | 273 + internal/testbinapi/binapi2001/span/span.ba.go | 207 + internal/testbinapi/binapi2001/span/span_rpc.ba.go | 73 + internal/testbinapi/binapi2001/sr/sr.ba.go | 1857 ++---- internal/testbinapi/binapi2001/sr/sr_rpc.ba.go | 179 +- .../testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go | 502 ++ .../binapi2001/sr_mpls/sr_mpls_rpc.ba.go | 70 + internal/testbinapi/binapi2001/stn/stn.ba.go | 1012 ++++ internal/testbinapi/binapi2001/stn/stn_rpc.ba.go | 73 + internal/testbinapi/binapi2001/svs/svs.ba.go | 1248 ++++ internal/testbinapi/binapi2001/svs/svs_rpc.ba.go | 103 + internal/testbinapi/binapi2001/syslog/syslog.ba.go | 959 +++ .../testbinapi/binapi2001/syslog/syslog_rpc.ba.go | 60 + internal/testbinapi/binapi2001/tapv2/tapv2.ba.go | 1310 ++++ .../testbinapi/binapi2001/tapv2/tapv2_rpc.ba.go | 83 + internal/testbinapi/binapi2001/tcp/tcp.ba.go | 692 +++ internal/testbinapi/binapi2001/tcp/tcp_rpc.ba.go | 30 + .../binapi2001/tls_openssl/tls_openssl.ba.go | 124 + .../binapi2001/tls_openssl/tls_openssl_rpc.ba.go | 30 + internal/testbinapi/binapi2001/trace/trace.ba.go | 273 + .../testbinapi/binapi2001/trace/trace_rpc.ba.go | 50 + internal/testbinapi/binapi2001/udp/udp.ba.go | 866 +++ internal/testbinapi/binapi2001/udp/udp_rpc.ba.go | 83 + .../testbinapi/binapi2001/udp_ping/udp_ping.ba.go | 789 +++ .../binapi2001/udp_ping/udp_ping_rpc.ba.go | 40 + .../binapi2001/vhost_user/vhost_user.ba.go | 792 +++ .../binapi2001/vhost_user/vhost_user_rpc.ba.go | 93 + internal/testbinapi/binapi2001/virtio/virtio.ba.go | 602 ++ .../testbinapi/binapi2001/virtio/virtio_rpc.ba.go | 83 + .../binapi2001/virtio_types/virtio_types.ba.go | 116 + .../testbinapi/binapi2001/vmxnet3/vmxnet3.ba.go | 677 +++ .../binapi2001/vmxnet3/vmxnet3_rpc.ba.go | 83 + internal/testbinapi/binapi2001/vpe/vpe.ba.go | 1745 ++---- internal/testbinapi/binapi2001/vpe/vpe_rpc.ba.go | 108 +- .../binapi2001/vpe_types/vpe_types.ba.go | 88 + internal/testbinapi/binapi2001/vxlan/vxlan.ba.go | 409 ++ .../testbinapi/binapi2001/vxlan/vxlan_rpc.ba.go | 93 + .../binapi2001/vxlan_gbp/vxlan_gbp.ba.go | 1183 ++++ .../binapi2001/vxlan_gbp/vxlan_gbp_rpc.ba.go | 83 + .../binapi2001/vxlan_gpe/vxlan_gpe.ba.go | 333 + .../binapi2001/vxlan_gpe/vxlan_gpe_rpc.ba.go | 83 + .../vxlan_gpe_ioam_export.ba.go | 688 +++ .../vxlan_gpe_ioam_export_rpc.ba.go | 30 + 418 files changed, 189771 insertions(+), 27478 deletions(-) create mode 100644 binapi/gen.go delete mode 100644 binapigen/definitions.go delete mode 100644 binapigen/definitions_test.go create mode 100644 binapigen/strings.go create mode 100644 binapigen/strings_test.go delete mode 100644 gen.go create mode 100644 internal/testbinapi/binapi2001/.vppapi/VPP_VERSION create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/af_packet.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/arp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/bfd.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/bier.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/bond.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/classify.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/cop.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ethernet_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/feature.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/fib_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/geneve.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/gre.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/gso.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/interface.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/interface_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ip.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ip6_nd.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ip_neighbor.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ip_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ipfix_export.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ipip.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ipip_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ipsec.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/ipsec_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/l2.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/l2tp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/lisp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/lisp_gpe.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/lldp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/memclnt.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/mfib_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/mpls.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/netmap.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/nhrp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/one.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/p2p_ethernet.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/pci_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/pg.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/pipe.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/policer.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/punt.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/qos.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/rd_cp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/session.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/span.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/sr.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/sr_mpls.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/syslog.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/tapv2.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/tcp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/udp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/vhost_user.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/virtio.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/virtio_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/vpe.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/vpe_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/vxlan.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/vxlan_gbp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/core/vxlan_gpe.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/abf.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/acl.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/acl_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/avf.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/builtinurl.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/cdp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/ct6.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/dhcp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_ia_na_client_cp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_pd_client_cp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/dns.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/flowprobe.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/gbp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/gtpu.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/http_static.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/igmp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/ikev2.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/ioam_cache.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/ioam_export.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/ioam_vxlan_gpe.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/l2e.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/l3xc.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/lacp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/lb.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/lb_types.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/mactime.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/map.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/mdata.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/memif.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/nat.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/nsh.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/nsim.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/oddbuf.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/pot.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/pppoe.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/rdma.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/sctp.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/stn.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/svs.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/tls_openssl.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/trace.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/udp_ping.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/vmxnet3.api.json create mode 100644 internal/testbinapi/binapi2001/.vppapi/plugins/vxlan_gpe_ioam_export.api.json create mode 100644 internal/testbinapi/binapi2001/abf/abf.ba.go create mode 100644 internal/testbinapi/binapi2001/abf/abf_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/acl_types/acl_types.ba.go create mode 100644 internal/testbinapi/binapi2001/arp/arp.ba.go create mode 100644 internal/testbinapi/binapi2001/arp/arp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/avf/avf.ba.go create mode 100644 internal/testbinapi/binapi2001/avf/avf_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/bfd/bfd.ba.go create mode 100644 internal/testbinapi/binapi2001/bfd/bfd_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/bier/bier.ba.go create mode 100644 internal/testbinapi/binapi2001/bier/bier_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/bond/bond.ba.go create mode 100644 internal/testbinapi/binapi2001/bond/bond_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/builtinurl/builtinurl.ba.go create mode 100644 internal/testbinapi/binapi2001/builtinurl/builtinurl_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/cdp/cdp.ba.go create mode 100644 internal/testbinapi/binapi2001/cdp/cdp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/classify/classify.ba.go create mode 100644 internal/testbinapi/binapi2001/classify/classify_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/cop/cop.ba.go create mode 100644 internal/testbinapi/binapi2001/cop/cop_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ct6/ct6.ba.go create mode 100644 internal/testbinapi/binapi2001/ct6/ct6_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/dhcp/dhcp.ba.go create mode 100644 internal/testbinapi/binapi2001/dhcp/dhcp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go create mode 100644 internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go create mode 100644 internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/dns/dns.ba.go create mode 100644 internal/testbinapi/binapi2001/dns/dns_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ethernet_types/ethernet_types.ba.go create mode 100644 internal/testbinapi/binapi2001/feature/feature.ba.go create mode 100644 internal/testbinapi/binapi2001/feature/feature_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/fib_types/fib_types.ba.go create mode 100644 internal/testbinapi/binapi2001/flowprobe/flowprobe.ba.go create mode 100644 internal/testbinapi/binapi2001/flowprobe/flowprobe_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/gbp/gbp.ba.go create mode 100644 internal/testbinapi/binapi2001/gbp/gbp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/gen.go create mode 100644 internal/testbinapi/binapi2001/geneve/geneve.ba.go create mode 100644 internal/testbinapi/binapi2001/geneve/geneve_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/gre/gre.ba.go create mode 100644 internal/testbinapi/binapi2001/gre/gre_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/gso/gso.ba.go create mode 100644 internal/testbinapi/binapi2001/gso/gso_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/gtpu/gtpu.ba.go create mode 100644 internal/testbinapi/binapi2001/gtpu/gtpu_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/http_static/http_static.ba.go create mode 100644 internal/testbinapi/binapi2001/http_static/http_static_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/igmp/igmp.ba.go create mode 100644 internal/testbinapi/binapi2001/igmp/igmp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ikev2/ikev2.ba.go create mode 100644 internal/testbinapi/binapi2001/ikev2/ikev2_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/interface/interface.ba.go create mode 100644 internal/testbinapi/binapi2001/interface/interface_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/interface_types/interface_types.ba.go delete mode 100644 internal/testbinapi/binapi2001/interfaces/interfaces.ba.go delete mode 100644 internal/testbinapi/binapi2001/interfaces/interfaces_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ioam_cache/ioam_cache.ba.go create mode 100644 internal/testbinapi/binapi2001/ioam_cache/ioam_cache_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ioam_export/ioam_export.ba.go create mode 100644 internal/testbinapi/binapi2001/ioam_export/ioam_export_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go create mode 100644 internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ip6_nd/ip6_nd.ba.go create mode 100644 internal/testbinapi/binapi2001/ip6_nd/ip6_nd_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor.ba.go create mode 100644 internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ip_types/ip_types.ba.go create mode 100644 internal/testbinapi/binapi2001/ipfix_export/ipfix_export.ba.go create mode 100644 internal/testbinapi/binapi2001/ipfix_export/ipfix_export_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ipip/ipip.ba.go create mode 100644 internal/testbinapi/binapi2001/ipip/ipip_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ipip_types/ipip_types.ba.go create mode 100644 internal/testbinapi/binapi2001/ipsec/ipsec.ba.go create mode 100644 internal/testbinapi/binapi2001/ipsec/ipsec_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/ipsec_types/ipsec_types.ba.go create mode 100644 internal/testbinapi/binapi2001/l2/l2.ba.go create mode 100644 internal/testbinapi/binapi2001/l2/l2_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/l2e/l2e.ba.go create mode 100644 internal/testbinapi/binapi2001/l2e/l2e_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/l2tp/l2tp.ba.go create mode 100644 internal/testbinapi/binapi2001/l2tp/l2tp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/l3xc/l3xc.ba.go create mode 100644 internal/testbinapi/binapi2001/l3xc/l3xc_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/lacp/lacp.ba.go create mode 100644 internal/testbinapi/binapi2001/lacp/lacp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/lb/lb.ba.go create mode 100644 internal/testbinapi/binapi2001/lb/lb_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/lb_types/lb_types.ba.go create mode 100644 internal/testbinapi/binapi2001/lisp/lisp.ba.go create mode 100644 internal/testbinapi/binapi2001/lisp/lisp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe.ba.go create mode 100644 internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/lldp/lldp.ba.go create mode 100644 internal/testbinapi/binapi2001/lldp/lldp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/mactime/mactime.ba.go create mode 100644 internal/testbinapi/binapi2001/mactime/mactime_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/map/map.ba.go create mode 100644 internal/testbinapi/binapi2001/map/map_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/mdata/mdata.ba.go create mode 100644 internal/testbinapi/binapi2001/mdata/mdata_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/mfib_types/mfib_types.ba.go create mode 100644 internal/testbinapi/binapi2001/mpls/mpls.ba.go create mode 100644 internal/testbinapi/binapi2001/mpls/mpls_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/nat/nat.ba.go create mode 100644 internal/testbinapi/binapi2001/nat/nat_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/netmap/netmap.ba.go create mode 100644 internal/testbinapi/binapi2001/netmap/netmap_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/nhrp/nhrp.ba.go create mode 100644 internal/testbinapi/binapi2001/nhrp/nhrp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/nsh/nsh.ba.go create mode 100644 internal/testbinapi/binapi2001/nsh/nsh_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/nsim/nsim.ba.go create mode 100644 internal/testbinapi/binapi2001/nsim/nsim_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/oddbuf/oddbuf.ba.go create mode 100644 internal/testbinapi/binapi2001/oddbuf/oddbuf_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/one/one.ba.go create mode 100644 internal/testbinapi/binapi2001/one/one_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet.ba.go create mode 100644 internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/pci_types/pci_types.ba.go create mode 100644 internal/testbinapi/binapi2001/pg/pg.ba.go create mode 100644 internal/testbinapi/binapi2001/pg/pg_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/pipe/pipe.ba.go create mode 100644 internal/testbinapi/binapi2001/pipe/pipe_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/policer/policer.ba.go create mode 100644 internal/testbinapi/binapi2001/policer/policer_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/pot/pot.ba.go create mode 100644 internal/testbinapi/binapi2001/pot/pot_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/pppoe/pppoe.ba.go create mode 100644 internal/testbinapi/binapi2001/pppoe/pppoe_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/punt/punt.ba.go create mode 100644 internal/testbinapi/binapi2001/punt/punt_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/qos/qos.ba.go create mode 100644 internal/testbinapi/binapi2001/qos/qos_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/rd_cp/rd_cp.ba.go create mode 100644 internal/testbinapi/binapi2001/rd_cp/rd_cp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/rdma/rdma.ba.go create mode 100644 internal/testbinapi/binapi2001/rdma/rdma_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/sctp/sctp.ba.go create mode 100644 internal/testbinapi/binapi2001/sctp/sctp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/session/session.ba.go create mode 100644 internal/testbinapi/binapi2001/session/session_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/span/span.ba.go create mode 100644 internal/testbinapi/binapi2001/span/span_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go create mode 100644 internal/testbinapi/binapi2001/sr_mpls/sr_mpls_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/stn/stn.ba.go create mode 100644 internal/testbinapi/binapi2001/stn/stn_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/svs/svs.ba.go create mode 100644 internal/testbinapi/binapi2001/svs/svs_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/syslog/syslog.ba.go create mode 100644 internal/testbinapi/binapi2001/syslog/syslog_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/tapv2/tapv2.ba.go create mode 100644 internal/testbinapi/binapi2001/tapv2/tapv2_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/tcp/tcp.ba.go create mode 100644 internal/testbinapi/binapi2001/tcp/tcp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/tls_openssl/tls_openssl.ba.go create mode 100644 internal/testbinapi/binapi2001/tls_openssl/tls_openssl_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/trace/trace.ba.go create mode 100644 internal/testbinapi/binapi2001/trace/trace_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/udp/udp.ba.go create mode 100644 internal/testbinapi/binapi2001/udp/udp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/udp_ping/udp_ping.ba.go create mode 100644 internal/testbinapi/binapi2001/udp_ping/udp_ping_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/vhost_user/vhost_user.ba.go create mode 100644 internal/testbinapi/binapi2001/vhost_user/vhost_user_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/virtio/virtio.ba.go create mode 100644 internal/testbinapi/binapi2001/virtio/virtio_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/virtio_types/virtio_types.ba.go create mode 100644 internal/testbinapi/binapi2001/vmxnet3/vmxnet3.ba.go create mode 100644 internal/testbinapi/binapi2001/vmxnet3/vmxnet3_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/vpe_types/vpe_types.ba.go create mode 100644 internal/testbinapi/binapi2001/vxlan/vxlan.ba.go create mode 100644 internal/testbinapi/binapi2001/vxlan/vxlan_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp.ba.go create mode 100644 internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe.ba.go create mode 100644 internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe_rpc.ba.go create mode 100644 internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go create mode 100644 internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export_rpc.ba.go diff --git a/Makefile b/Makefile index bd11c26..675deb9 100644 --- a/Makefile +++ b/Makefile @@ -94,7 +94,8 @@ gen-binapi-docker: install-generator ## Generate binapi code (using Docker) docker run -t --rm \ -e DEBUG_GOVPP \ -v "$(shell which binapi-generator):/usr/local/bin/binapi-generator:ro" \ - -v "$(shell pwd):/govpp" -w /govpp \ + -v "$(shell pwd):/govpp" \ + -w /govpp \ -u "$(shell id -u):$(shell id -g)" \ "${VPP_IMG}" \ sh -ec "cd $(BINAPI_DIR) && $(cmds)" @@ -104,9 +105,9 @@ extras: help: @echo "List of make targets:" - grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -.DEFAULT = help +.DEFAULT_GOAL = help .PHONY: help \ build cmd examples clean \ diff --git a/api/binapi.go b/api/binapi.go index 04fdc9e..cb4ab85 100644 --- a/api/binapi.go +++ b/api/binapi.go @@ -19,11 +19,14 @@ import ( "reflect" ) -// MessageType represents the type of a VPP message. -// Note: this is currently derived from the message header (fields), -// and in many cases it does not represent the actual type of VPP message. -// This means that some replies can be identified as requests, etc. -// TODO: use services to identify type of message +// GoVppAPIPackageIsVersionX is referenced from generated binapi files +// to assert that that code is compatible with this version of the GoVPP api package. +const ( + GoVppAPIPackageIsVersion1 = true + GoVppAPIPackageIsVersion2 = true +) + +// MessageType represents the type of a VPP message derived from message header fields. type MessageType int const ( @@ -80,8 +83,3 @@ func GetRegisteredMessages() map[string]Message { func GetRegisteredMessageTypes() map[reflect.Type]string { return registeredMessageTypes } - -// GoVppAPIPackageIsVersionX is referenced from generated binapi files -// to assert that that code is compatible with this version of the GoVPP api package. -const GoVppAPIPackageIsVersion1 = true -const GoVppAPIPackageIsVersion2 = true diff --git a/binapi/abf/abf.ba.go b/binapi/abf/abf.ba.go index 2cea604..2b28afe 100644 --- a/binapi/abf/abf.ba.go +++ b/binapi/abf/abf.ba.go @@ -61,11 +61,10 @@ func (*AbfItfAttachAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AbfItfAttachAddDel) Size() int { +func (m *AbfItfAttachAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Attach.PolicyID size += 4 // m.Attach.SwIfIndex @@ -74,16 +73,14 @@ func (m *AbfItfAttachAddDel) Size() int { return size } func (m *AbfItfAttachAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Attach.PolicyID)) + buf.EncodeUint32(m.Attach.PolicyID) buf.EncodeUint32(uint32(m.Attach.SwIfIndex)) - buf.EncodeUint32(uint32(m.Attach.Priority)) + buf.EncodeUint32(m.Attach.Priority) buf.EncodeBool(m.Attach.IsIPv6) return buf.Bytes(), nil } @@ -109,27 +106,24 @@ func (*AbfItfAttachAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AbfItfAttachAddDelReply) Size() int { +func (m *AbfItfAttachAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *AbfItfAttachAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *AbfItfAttachAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -145,11 +139,10 @@ func (*AbfItfAttachDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AbfItfAttachDetails) Size() int { +func (m *AbfItfAttachDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Attach.PolicyID size += 4 // m.Attach.SwIfIndex size += 4 // m.Attach.Priority @@ -157,15 +150,13 @@ func (m *AbfItfAttachDetails) Size() int { return size } func (m *AbfItfAttachDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Attach.PolicyID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Attach.PolicyID) buf.EncodeUint32(uint32(m.Attach.SwIfIndex)) - buf.EncodeUint32(uint32(m.Attach.Priority)) + buf.EncodeUint32(m.Attach.Priority) buf.EncodeBool(m.Attach.IsIPv6) return buf.Bytes(), nil } @@ -188,20 +179,17 @@ func (*AbfItfAttachDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AbfItfAttachDump) Size() int { +func (m *AbfItfAttachDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *AbfItfAttachDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *AbfItfAttachDump) Unmarshal(b []byte) error { @@ -218,20 +206,17 @@ func (*AbfPluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AbfPluginGetVersion) Size() int { +func (m *AbfPluginGetVersion) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *AbfPluginGetVersion) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *AbfPluginGetVersion) Unmarshal(b []byte) error { @@ -251,24 +236,21 @@ func (*AbfPluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AbfPluginGetVersionReply) Size() int { +func (m *AbfPluginGetVersionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Major size += 4 // m.Minor return size } func (m *AbfPluginGetVersionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Major)) - buf.EncodeUint32(uint32(m.Minor)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Major) + buf.EncodeUint32(m.Minor) return buf.Bytes(), nil } func (m *AbfPluginGetVersionReply) Unmarshal(b []byte) error { @@ -291,11 +273,10 @@ func (*AbfPolicyAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AbfPolicyAddDel) Size() int { +func (m *AbfPolicyAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Policy.PolicyID size += 4 // m.Policy.ACLIndex @@ -320,57 +301,46 @@ func (m *AbfPolicyAddDel) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *AbfPolicyAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Policy.PolicyID)) - buf.EncodeUint32(uint32(m.Policy.ACLIndex)) + buf.EncodeUint32(m.Policy.PolicyID) + buf.EncodeUint32(m.Policy.ACLIndex) buf.EncodeUint8(uint8(len(m.Policy.Paths))) for j1 := 0; j1 < len(m.Policy.Paths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // Paths if j1 < len(m.Policy.Paths) { v1 = m.Policy.Paths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -381,7 +351,7 @@ func (m *AbfPolicyAddDel) Unmarshal(b []byte) error { m.Policy.PolicyID = buf.DecodeUint32() m.Policy.ACLIndex = buf.DecodeUint32() m.Policy.NPaths = buf.DecodeUint8() - m.Policy.Paths = make([]fib_types.FibPath, int(m.Policy.NPaths)) + m.Policy.Paths = make([]fib_types.FibPath, m.Policy.NPaths) for j1 := 0; j1 < len(m.Policy.Paths); j1++ { m.Policy.Paths[j1].SwIfIndex = buf.DecodeUint32() m.Policy.Paths[j1].TableID = buf.DecodeUint32() @@ -418,27 +388,24 @@ func (*AbfPolicyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AbfPolicyAddDelReply) Size() int { +func (m *AbfPolicyAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *AbfPolicyAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *AbfPolicyAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -454,11 +421,10 @@ func (*AbfPolicyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AbfPolicyDetails) Size() int { +func (m *AbfPolicyDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Policy.PolicyID size += 4 // m.Policy.ACLIndex size += 1 // m.Policy.NPaths @@ -482,56 +448,45 @@ func (m *AbfPolicyDetails) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *AbfPolicyDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Policy.PolicyID)) - buf.EncodeUint32(uint32(m.Policy.ACLIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Policy.PolicyID) + buf.EncodeUint32(m.Policy.ACLIndex) buf.EncodeUint8(uint8(len(m.Policy.Paths))) for j1 := 0; j1 < len(m.Policy.Paths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // Paths if j1 < len(m.Policy.Paths) { v1 = m.Policy.Paths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -541,7 +496,7 @@ func (m *AbfPolicyDetails) Unmarshal(b []byte) error { m.Policy.PolicyID = buf.DecodeUint32() m.Policy.ACLIndex = buf.DecodeUint32() m.Policy.NPaths = buf.DecodeUint8() - m.Policy.Paths = make([]fib_types.FibPath, int(m.Policy.NPaths)) + m.Policy.Paths = make([]fib_types.FibPath, m.Policy.NPaths) for j1 := 0; j1 < len(m.Policy.Paths); j1++ { m.Policy.Paths[j1].SwIfIndex = buf.DecodeUint32() m.Policy.Paths[j1].TableID = buf.DecodeUint32() @@ -576,20 +531,17 @@ func (*AbfPolicyDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AbfPolicyDump) Size() int { +func (m *AbfPolicyDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *AbfPolicyDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *AbfPolicyDump) Unmarshal(b []byte) error { diff --git a/binapi/acl/acl.ba.go b/binapi/acl/acl.ba.go index 3fac5ee..1f47a01 100644 --- a/binapi/acl/acl.ba.go +++ b/binapi/acl/acl.ba.go @@ -47,11 +47,10 @@ func (*ACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLAddReplace) Size() int { +func (m *ACLAddReplace) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex size += 64 // m.Tag size += 4 // m.Count @@ -79,34 +78,32 @@ func (m *ACLAddReplace) Size() int { return size } func (m *ACLAddReplace) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) buf.EncodeString(m.Tag, 64) buf.EncodeUint32(uint32(len(m.R))) for j0 := 0; j0 < len(m.R); j0++ { - var v0 acl_types.ACLRule + var v0 acl_types.ACLRule // R if j0 < len(m.R) { v0 = m.R[j0] } buf.EncodeUint8(uint8(v0.IsPermit)) buf.EncodeUint8(uint8(v0.SrcPrefix.Address.Af)) - buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(v0.SrcPrefix.Len)) + buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.SrcPrefix.Len) buf.EncodeUint8(uint8(v0.DstPrefix.Address.Af)) - buf.EncodeBytes(v0.DstPrefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(v0.DstPrefix.Len)) + buf.EncodeBytes(v0.DstPrefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.DstPrefix.Len) buf.EncodeUint8(uint8(v0.Proto)) - buf.EncodeUint16(uint16(v0.SrcportOrIcmptypeFirst)) - buf.EncodeUint16(uint16(v0.SrcportOrIcmptypeLast)) - buf.EncodeUint16(uint16(v0.DstportOrIcmpcodeFirst)) - buf.EncodeUint16(uint16(v0.DstportOrIcmpcodeLast)) - buf.EncodeUint8(uint8(v0.TCPFlagsMask)) - buf.EncodeUint8(uint8(v0.TCPFlagsValue)) + buf.EncodeUint16(v0.SrcportOrIcmptypeFirst) + buf.EncodeUint16(v0.SrcportOrIcmptypeLast) + buf.EncodeUint16(v0.DstportOrIcmpcodeFirst) + buf.EncodeUint16(v0.DstportOrIcmpcodeLast) + buf.EncodeUint8(v0.TCPFlagsMask) + buf.EncodeUint8(v0.TCPFlagsValue) } return buf.Bytes(), nil } @@ -115,7 +112,7 @@ func (m *ACLAddReplace) Unmarshal(b []byte) error { m.ACLIndex = buf.DecodeUint32() m.Tag = buf.DecodeString(64) m.Count = buf.DecodeUint32() - m.R = make([]acl_types.ACLRule, int(m.Count)) + m.R = make([]acl_types.ACLRule, m.Count) for j0 := 0; j0 < len(m.R); j0++ { m.R[j0].IsPermit = acl_types.ACLAction(buf.DecodeUint8()) m.R[j0].SrcPrefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) @@ -148,30 +145,27 @@ func (*ACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLAddReplaceReply) Size() int { +func (m *ACLAddReplaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex size += 4 // m.Retval return size } func (m *ACLAddReplaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ACLAddReplaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.ACLIndex = buf.DecodeUint32() - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -187,22 +181,19 @@ func (*ACLDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLDel) Size() int { +func (m *ACLDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex return size } func (m *ACLDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) return buf.Bytes(), nil } func (m *ACLDel) Unmarshal(b []byte) error { @@ -223,27 +214,24 @@ func (*ACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLDelReply) Size() int { +func (m *ACLDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ACLDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ACLDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -262,11 +250,10 @@ func (*ACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLDetails) Size() int { +func (m *ACLDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex size += 64 // m.Tag size += 4 // m.Count @@ -294,34 +281,32 @@ func (m *ACLDetails) Size() int { return size } func (m *ACLDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) buf.EncodeString(m.Tag, 64) buf.EncodeUint32(uint32(len(m.R))) for j0 := 0; j0 < len(m.R); j0++ { - var v0 acl_types.ACLRule + var v0 acl_types.ACLRule // R if j0 < len(m.R) { v0 = m.R[j0] } buf.EncodeUint8(uint8(v0.IsPermit)) buf.EncodeUint8(uint8(v0.SrcPrefix.Address.Af)) - buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(v0.SrcPrefix.Len)) + buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.SrcPrefix.Len) buf.EncodeUint8(uint8(v0.DstPrefix.Address.Af)) - buf.EncodeBytes(v0.DstPrefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(v0.DstPrefix.Len)) + buf.EncodeBytes(v0.DstPrefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.DstPrefix.Len) buf.EncodeUint8(uint8(v0.Proto)) - buf.EncodeUint16(uint16(v0.SrcportOrIcmptypeFirst)) - buf.EncodeUint16(uint16(v0.SrcportOrIcmptypeLast)) - buf.EncodeUint16(uint16(v0.DstportOrIcmpcodeFirst)) - buf.EncodeUint16(uint16(v0.DstportOrIcmpcodeLast)) - buf.EncodeUint8(uint8(v0.TCPFlagsMask)) - buf.EncodeUint8(uint8(v0.TCPFlagsValue)) + buf.EncodeUint16(v0.SrcportOrIcmptypeFirst) + buf.EncodeUint16(v0.SrcportOrIcmptypeLast) + buf.EncodeUint16(v0.DstportOrIcmpcodeFirst) + buf.EncodeUint16(v0.DstportOrIcmpcodeLast) + buf.EncodeUint8(v0.TCPFlagsMask) + buf.EncodeUint8(v0.TCPFlagsValue) } return buf.Bytes(), nil } @@ -330,7 +315,7 @@ func (m *ACLDetails) Unmarshal(b []byte) error { m.ACLIndex = buf.DecodeUint32() m.Tag = buf.DecodeString(64) m.Count = buf.DecodeUint32() - m.R = make([]acl_types.ACLRule, int(m.Count)) + m.R = make([]acl_types.ACLRule, m.Count) for j0 := 0; j0 < len(m.R); j0++ { m.R[j0].IsPermit = acl_types.ACLAction(buf.DecodeUint8()) m.R[j0].SrcPrefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) @@ -362,22 +347,19 @@ func (*ACLDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLDump) Size() int { +func (m *ACLDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex return size } func (m *ACLDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) return buf.Bytes(), nil } func (m *ACLDump) Unmarshal(b []byte) error { @@ -401,11 +383,10 @@ func (*ACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLInterfaceAddDel) Size() int { +func (m *ACLInterfaceAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IsInput size += 4 // m.SwIfIndex @@ -413,16 +394,14 @@ func (m *ACLInterfaceAddDel) Size() int { return size } func (m *ACLInterfaceAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.IsInput) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.ACLIndex)) + buf.EncodeUint32(m.ACLIndex) return buf.Bytes(), nil } func (m *ACLInterfaceAddDel) Unmarshal(b []byte) error { @@ -446,27 +425,24 @@ func (*ACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLInterfaceAddDelReply) Size() int { +func (m *ACLInterfaceAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ACLInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ACLInterfaceAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -487,11 +463,10 @@ func (*ACLInterfaceEtypeWhitelistDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLInterfaceEtypeWhitelistDetails) Size() int { +func (m *ACLInterfaceEtypeWhitelistDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Count size += 1 // m.NInput @@ -499,21 +474,19 @@ func (m *ACLInterfaceEtypeWhitelistDetails) Size() int { return size } func (m *ACLInterfaceEtypeWhitelistDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(len(m.Whitelist))) - buf.EncodeUint8(uint8(m.NInput)) + buf.EncodeUint8(m.NInput) for i := 0; i < len(m.Whitelist); i++ { var x uint16 if i < len(m.Whitelist) { x = uint16(m.Whitelist[i]) } - buf.EncodeUint16(uint16(x)) + buf.EncodeUint16(x) } return buf.Bytes(), nil } @@ -543,21 +516,18 @@ func (*ACLInterfaceEtypeWhitelistDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLInterfaceEtypeWhitelistDump) Size() int { +func (m *ACLInterfaceEtypeWhitelistDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *ACLInterfaceEtypeWhitelistDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -582,11 +552,10 @@ func (*ACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLInterfaceListDetails) Size() int { +func (m *ACLInterfaceListDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Count size += 1 // m.NInput @@ -594,21 +563,19 @@ func (m *ACLInterfaceListDetails) Size() int { return size } func (m *ACLInterfaceListDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(len(m.Acls))) - buf.EncodeUint8(uint8(m.NInput)) + buf.EncodeUint8(m.NInput) for i := 0; i < len(m.Acls); i++ { var x uint32 if i < len(m.Acls) { x = uint32(m.Acls[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } @@ -626,7 +593,7 @@ func (m *ACLInterfaceListDetails) Unmarshal(b []byte) error { // ACLInterfaceListDump defines message 'acl_interface_list_dump'. type ACLInterfaceListDump struct { - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` } func (m *ACLInterfaceListDump) Reset() { *m = ACLInterfaceListDump{} } @@ -636,21 +603,18 @@ func (*ACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLInterfaceListDump) Size() int { +func (m *ACLInterfaceListDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *ACLInterfaceListDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -675,11 +639,10 @@ func (*ACLInterfaceSetACLList) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLInterfaceSetACLList) Size() int { +func (m *ACLInterfaceSetACLList) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Count size += 1 // m.NInput @@ -687,21 +650,19 @@ func (m *ACLInterfaceSetACLList) Size() int { return size } func (m *ACLInterfaceSetACLList) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(len(m.Acls))) - buf.EncodeUint8(uint8(m.NInput)) + buf.EncodeUint8(m.NInput) for i := 0; i < len(m.Acls); i++ { var x uint32 if i < len(m.Acls) { x = uint32(m.Acls[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } @@ -731,27 +692,24 @@ func (*ACLInterfaceSetACLListReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLInterfaceSetACLListReply) Size() int { +func (m *ACLInterfaceSetACLListReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ACLInterfaceSetACLListReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ACLInterfaceSetACLListReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -772,11 +730,10 @@ func (*ACLInterfaceSetEtypeWhitelist) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLInterfaceSetEtypeWhitelist) Size() int { +func (m *ACLInterfaceSetEtypeWhitelist) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Count size += 1 // m.NInput @@ -784,21 +741,19 @@ func (m *ACLInterfaceSetEtypeWhitelist) Size() int { return size } func (m *ACLInterfaceSetEtypeWhitelist) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(len(m.Whitelist))) - buf.EncodeUint8(uint8(m.NInput)) + buf.EncodeUint8(m.NInput) for i := 0; i < len(m.Whitelist); i++ { var x uint16 if i < len(m.Whitelist) { x = uint16(m.Whitelist[i]) } - buf.EncodeUint16(uint16(x)) + buf.EncodeUint16(x) } return buf.Bytes(), nil } @@ -828,27 +783,24 @@ func (*ACLInterfaceSetEtypeWhitelistReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLInterfaceSetEtypeWhitelistReply) Size() int { +func (m *ACLInterfaceSetEtypeWhitelistReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ACLInterfaceSetEtypeWhitelistReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ACLInterfaceSetEtypeWhitelistReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -862,20 +814,17 @@ func (*ACLPluginControlPing) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLPluginControlPing) Size() int { +func (m *ACLPluginControlPing) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ACLPluginControlPing) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ACLPluginControlPing) Unmarshal(b []byte) error { @@ -896,31 +845,28 @@ func (*ACLPluginControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLPluginControlPingReply) Size() int { +func (m *ACLPluginControlPingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.ClientIndex size += 4 // m.VpePID return size } func (m *ACLPluginControlPingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.ClientIndex)) - buf.EncodeUint32(uint32(m.VpePID)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ClientIndex) + buf.EncodeUint32(m.VpePID) return buf.Bytes(), nil } func (m *ACLPluginControlPingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ClientIndex = buf.DecodeUint32() m.VpePID = buf.DecodeUint32() return nil @@ -938,20 +884,17 @@ func (*ACLPluginGetConnTableMaxEntries) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLPluginGetConnTableMaxEntries) Size() int { +func (m *ACLPluginGetConnTableMaxEntries) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ACLPluginGetConnTableMaxEntries) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ACLPluginGetConnTableMaxEntries) Unmarshal(b []byte) error { @@ -972,22 +915,19 @@ func (*ACLPluginGetConnTableMaxEntriesReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLPluginGetConnTableMaxEntriesReply) Size() int { +func (m *ACLPluginGetConnTableMaxEntriesReply) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.ConnTableMaxEntries return size } func (m *ACLPluginGetConnTableMaxEntriesReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint64(uint64(m.ConnTableMaxEntries)) + buf := codec.NewBuffer(b) + buf.EncodeUint64(m.ConnTableMaxEntries) return buf.Bytes(), nil } func (m *ACLPluginGetConnTableMaxEntriesReply) Unmarshal(b []byte) error { @@ -1006,20 +946,17 @@ func (*ACLPluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLPluginGetVersion) Size() int { +func (m *ACLPluginGetVersion) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ACLPluginGetVersion) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ACLPluginGetVersion) Unmarshal(b []byte) error { @@ -1039,24 +976,21 @@ func (*ACLPluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLPluginGetVersionReply) Size() int { +func (m *ACLPluginGetVersionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Major size += 4 // m.Minor return size } func (m *ACLPluginGetVersionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Major)) - buf.EncodeUint32(uint32(m.Minor)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Major) + buf.EncodeUint32(m.Minor) return buf.Bytes(), nil } func (m *ACLPluginGetVersionReply) Unmarshal(b []byte) error { @@ -1078,21 +1012,18 @@ func (*ACLStatsIntfCountersEnable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ACLStatsIntfCountersEnable) Size() int { +func (m *ACLStatsIntfCountersEnable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable return size } func (m *ACLStatsIntfCountersEnable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) return buf.Bytes(), nil } @@ -1116,27 +1047,24 @@ func (*ACLStatsIntfCountersEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ACLStatsIntfCountersEnableReply) Size() int { +func (m *ACLStatsIntfCountersEnableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ACLStatsIntfCountersEnableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ACLStatsIntfCountersEnableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1154,11 +1082,10 @@ func (*MacipACLAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MacipACLAdd) Size() int { +func (m *MacipACLAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Tag size += 4 // m.Count for j1 := 0; j1 < len(m.R); j1++ { @@ -1177,16 +1104,14 @@ func (m *MacipACLAdd) Size() int { return size } func (m *MacipACLAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Tag, 64) buf.EncodeUint32(uint32(len(m.R))) for j0 := 0; j0 < len(m.R); j0++ { - var v0 acl_types.MacipACLRule + var v0 acl_types.MacipACLRule // R if j0 < len(m.R) { v0 = m.R[j0] } @@ -1194,8 +1119,8 @@ func (m *MacipACLAdd) Marshal(b []byte) ([]byte, error) { buf.EncodeBytes(v0.SrcMac[:], 6) buf.EncodeBytes(v0.SrcMacMask[:], 6) buf.EncodeUint8(uint8(v0.SrcPrefix.Address.Af)) - buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(v0.SrcPrefix.Len)) + buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.SrcPrefix.Len) } return buf.Bytes(), nil } @@ -1203,7 +1128,7 @@ func (m *MacipACLAdd) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Tag = buf.DecodeString(64) m.Count = buf.DecodeUint32() - m.R = make([]acl_types.MacipACLRule, int(m.Count)) + m.R = make([]acl_types.MacipACLRule, m.Count) for j0 := 0; j0 < len(m.R); j0++ { m.R[j0].IsPermit = acl_types.ACLAction(buf.DecodeUint8()) copy(m.R[j0].SrcMac[:], buf.DecodeBytes(6)) @@ -1217,7 +1142,7 @@ func (m *MacipACLAdd) Unmarshal(b []byte) error { // MacipACLAddReplace defines message 'macip_acl_add_replace'. type MacipACLAddReplace struct { - ACLIndex uint32 `binapi:"u32,name=acl_index,default=%!s(float64=4.294967295e+09)" json:"acl_index,omitempty"` + ACLIndex uint32 `binapi:"u32,name=acl_index,default=4294967295" json:"acl_index,omitempty"` Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` Count uint32 `binapi:"u32,name=count" json:"-"` R []acl_types.MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"` @@ -1230,11 +1155,10 @@ func (*MacipACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MacipACLAddReplace) Size() int { +func (m *MacipACLAddReplace) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex size += 64 // m.Tag size += 4 // m.Count @@ -1254,17 +1178,15 @@ func (m *MacipACLAddReplace) Size() int { return size } func (m *MacipACLAddReplace) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) buf.EncodeString(m.Tag, 64) buf.EncodeUint32(uint32(len(m.R))) for j0 := 0; j0 < len(m.R); j0++ { - var v0 acl_types.MacipACLRule + var v0 acl_types.MacipACLRule // R if j0 < len(m.R) { v0 = m.R[j0] } @@ -1272,8 +1194,8 @@ func (m *MacipACLAddReplace) Marshal(b []byte) ([]byte, error) { buf.EncodeBytes(v0.SrcMac[:], 6) buf.EncodeBytes(v0.SrcMacMask[:], 6) buf.EncodeUint8(uint8(v0.SrcPrefix.Address.Af)) - buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(v0.SrcPrefix.Len)) + buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.SrcPrefix.Len) } return buf.Bytes(), nil } @@ -1282,7 +1204,7 @@ func (m *MacipACLAddReplace) Unmarshal(b []byte) error { m.ACLIndex = buf.DecodeUint32() m.Tag = buf.DecodeString(64) m.Count = buf.DecodeUint32() - m.R = make([]acl_types.MacipACLRule, int(m.Count)) + m.R = make([]acl_types.MacipACLRule, m.Count) for j0 := 0; j0 < len(m.R); j0++ { m.R[j0].IsPermit = acl_types.ACLAction(buf.DecodeUint8()) copy(m.R[j0].SrcMac[:], buf.DecodeBytes(6)) @@ -1307,30 +1229,27 @@ func (*MacipACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MacipACLAddReplaceReply) Size() int { +func (m *MacipACLAddReplaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex size += 4 // m.Retval return size } func (m *MacipACLAddReplaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MacipACLAddReplaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.ACLIndex = buf.DecodeUint32() - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1347,30 +1266,27 @@ func (*MacipACLAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MacipACLAddReply) Size() int { +func (m *MacipACLAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex size += 4 // m.Retval return size } func (m *MacipACLAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MacipACLAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.ACLIndex = buf.DecodeUint32() - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1386,22 +1302,19 @@ func (*MacipACLDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MacipACLDel) Size() int { +func (m *MacipACLDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex return size } func (m *MacipACLDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) return buf.Bytes(), nil } func (m *MacipACLDel) Unmarshal(b []byte) error { @@ -1422,27 +1335,24 @@ func (*MacipACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MacipACLDelReply) Size() int { +func (m *MacipACLDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MacipACLDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MacipACLDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1461,11 +1371,10 @@ func (*MacipACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MacipACLDetails) Size() int { +func (m *MacipACLDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex size += 64 // m.Tag size += 4 // m.Count @@ -1485,17 +1394,15 @@ func (m *MacipACLDetails) Size() int { return size } func (m *MacipACLDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) buf.EncodeString(m.Tag, 64) buf.EncodeUint32(uint32(len(m.R))) for j0 := 0; j0 < len(m.R); j0++ { - var v0 acl_types.MacipACLRule + var v0 acl_types.MacipACLRule // R if j0 < len(m.R) { v0 = m.R[j0] } @@ -1503,8 +1410,8 @@ func (m *MacipACLDetails) Marshal(b []byte) ([]byte, error) { buf.EncodeBytes(v0.SrcMac[:], 6) buf.EncodeBytes(v0.SrcMacMask[:], 6) buf.EncodeUint8(uint8(v0.SrcPrefix.Address.Af)) - buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(v0.SrcPrefix.Len)) + buf.EncodeBytes(v0.SrcPrefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.SrcPrefix.Len) } return buf.Bytes(), nil } @@ -1513,7 +1420,7 @@ func (m *MacipACLDetails) Unmarshal(b []byte) error { m.ACLIndex = buf.DecodeUint32() m.Tag = buf.DecodeString(64) m.Count = buf.DecodeUint32() - m.R = make([]acl_types.MacipACLRule, int(m.Count)) + m.R = make([]acl_types.MacipACLRule, m.Count) for j0 := 0; j0 < len(m.R); j0++ { m.R[j0].IsPermit = acl_types.ACLAction(buf.DecodeUint8()) copy(m.R[j0].SrcMac[:], buf.DecodeBytes(6)) @@ -1527,7 +1434,7 @@ func (m *MacipACLDetails) Unmarshal(b []byte) error { // MacipACLDump defines message 'macip_acl_dump'. type MacipACLDump struct { - ACLIndex uint32 `binapi:"u32,name=acl_index,default=%!s(float64=4.294967295e+09)" json:"acl_index,omitempty"` + ACLIndex uint32 `binapi:"u32,name=acl_index,default=4294967295" json:"acl_index,omitempty"` } func (m *MacipACLDump) Reset() { *m = MacipACLDump{} } @@ -1537,22 +1444,19 @@ func (*MacipACLDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MacipACLDump) Size() int { +func (m *MacipACLDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ACLIndex return size } func (m *MacipACLDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ACLIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ACLIndex) return buf.Bytes(), nil } func (m *MacipACLDump) Unmarshal(b []byte) error { @@ -1575,26 +1479,23 @@ func (*MacipACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MacipACLInterfaceAddDel) Size() int { +func (m *MacipACLInterfaceAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SwIfIndex size += 4 // m.ACLIndex return size } func (m *MacipACLInterfaceAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.ACLIndex)) + buf.EncodeUint32(m.ACLIndex) return buf.Bytes(), nil } func (m *MacipACLInterfaceAddDel) Unmarshal(b []byte) error { @@ -1619,27 +1520,24 @@ func (*MacipACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MacipACLInterfaceAddDelReply) Size() int { +func (m *MacipACLInterfaceAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MacipACLInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MacipACLInterfaceAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1653,20 +1551,17 @@ func (*MacipACLInterfaceGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MacipACLInterfaceGet) Size() int { +func (m *MacipACLInterfaceGet) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *MacipACLInterfaceGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *MacipACLInterfaceGet) Unmarshal(b []byte) error { @@ -1686,29 +1581,26 @@ func (*MacipACLInterfaceGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MacipACLInterfaceGetReply) Size() int { +func (m *MacipACLInterfaceGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Count size += 4 * len(m.Acls) // m.Acls return size } func (m *MacipACLInterfaceGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(len(m.Acls))) for i := 0; i < len(m.Acls); i++ { var x uint32 if i < len(m.Acls) { x = uint32(m.Acls[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } @@ -1738,23 +1630,20 @@ func (*MacipACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MacipACLInterfaceListDetails) Size() int { +func (m *MacipACLInterfaceListDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Count size += 4 * len(m.Acls) // m.Acls return size } func (m *MacipACLInterfaceListDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(len(m.Acls))) for i := 0; i < len(m.Acls); i++ { @@ -1762,7 +1651,7 @@ func (m *MacipACLInterfaceListDetails) Marshal(b []byte) ([]byte, error) { if i < len(m.Acls) { x = uint32(m.Acls[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } @@ -1789,21 +1678,18 @@ func (*MacipACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MacipACLInterfaceListDump) Size() int { +func (m *MacipACLInterfaceListDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *MacipACLInterfaceListDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } diff --git a/binapi/af_packet/af_packet.ba.go b/binapi/af_packet/af_packet.ba.go index 646636e..750e2ce 100644 --- a/binapi/af_packet/af_packet.ba.go +++ b/binapi/af_packet/af_packet.ba.go @@ -44,23 +44,20 @@ func (*AfPacketCreate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AfPacketCreate) Size() int { +func (m *AfPacketCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 6 // m.HwAddr size += 1 // m.UseRandomHwAddr size += 64 // m.HostIfName return size } func (m *AfPacketCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.HwAddr[:], 6) buf.EncodeBool(m.UseRandomHwAddr) buf.EncodeString(m.HostIfName, 64) @@ -87,29 +84,26 @@ func (*AfPacketCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AfPacketCreateReply) Size() int { +func (m *AfPacketCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *AfPacketCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *AfPacketCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -126,21 +120,18 @@ func (*AfPacketDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AfPacketDelete) Size() int { +func (m *AfPacketDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.HostIfName return size } func (m *AfPacketDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.HostIfName, 64) return buf.Bytes(), nil } @@ -162,27 +153,24 @@ func (*AfPacketDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AfPacketDeleteReply) Size() int { +func (m *AfPacketDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *AfPacketDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *AfPacketDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -199,22 +187,19 @@ func (*AfPacketDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AfPacketDetails) Size() int { +func (m *AfPacketDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 64 // m.HostIfName return size } func (m *AfPacketDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeString(m.HostIfName, 64) return buf.Bytes(), nil @@ -236,20 +221,17 @@ func (*AfPacketDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AfPacketDump) Size() int { +func (m *AfPacketDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *AfPacketDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *AfPacketDump) Unmarshal(b []byte) error { @@ -269,22 +251,19 @@ func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AfPacketSetL4CksumOffload) Size() int { +func (m *AfPacketSetL4CksumOffload) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Set return size } func (m *AfPacketSetL4CksumOffload) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Set) return buf.Bytes(), nil @@ -310,27 +289,24 @@ func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AfPacketSetL4CksumOffloadReply) Size() int { +func (m *AfPacketSetL4CksumOffloadReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *AfPacketSetL4CksumOffloadReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *AfPacketSetL4CksumOffloadReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/arp/arp.ba.go b/binapi/arp/arp.ba.go index deb5180..90ff55b 100644 --- a/binapi/arp/arp.ba.go +++ b/binapi/arp/arp.ba.go @@ -52,11 +52,10 @@ func (*ProxyArpAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ProxyArpAddDel) Size() int { +func (m *ProxyArpAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Proxy.TableID size += 1 * 4 // m.Proxy.Low @@ -64,14 +63,12 @@ func (m *ProxyArpAddDel) Size() int { return size } func (m *ProxyArpAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Proxy.TableID)) + buf.EncodeUint32(m.Proxy.TableID) buf.EncodeBytes(m.Proxy.Low[:], 4) buf.EncodeBytes(m.Proxy.Hi[:], 4) return buf.Bytes(), nil @@ -97,27 +94,24 @@ func (*ProxyArpAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ProxyArpAddDelReply) Size() int { +func (m *ProxyArpAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ProxyArpAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ProxyArpAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -133,24 +127,21 @@ func (*ProxyArpDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ProxyArpDetails) Size() int { +func (m *ProxyArpDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Proxy.TableID size += 1 * 4 // m.Proxy.Low size += 1 * 4 // m.Proxy.Hi return size } func (m *ProxyArpDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Proxy.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Proxy.TableID) buf.EncodeBytes(m.Proxy.Low[:], 4) buf.EncodeBytes(m.Proxy.Hi[:], 4) return buf.Bytes(), nil @@ -173,20 +164,17 @@ func (*ProxyArpDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ProxyArpDump) Size() int { +func (m *ProxyArpDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ProxyArpDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ProxyArpDump) Unmarshal(b []byte) error { @@ -205,22 +193,19 @@ func (*ProxyArpIntfcDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ProxyArpIntfcDetails) Size() int { +func (m *ProxyArpIntfcDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *ProxyArpIntfcDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SwIfIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SwIfIndex) return buf.Bytes(), nil } func (m *ProxyArpIntfcDetails) Unmarshal(b []byte) error { @@ -239,20 +224,17 @@ func (*ProxyArpIntfcDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ProxyArpIntfcDump) Size() int { +func (m *ProxyArpIntfcDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ProxyArpIntfcDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ProxyArpIntfcDump) Unmarshal(b []byte) error { @@ -272,22 +254,19 @@ func (*ProxyArpIntfcEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ProxyArpIntfcEnableDisable) Size() int { +func (m *ProxyArpIntfcEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Enable return size } func (m *ProxyArpIntfcEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) return buf.Bytes(), nil @@ -313,27 +292,24 @@ func (*ProxyArpIntfcEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ProxyArpIntfcEnableDisableReply) Size() int { +func (m *ProxyArpIntfcEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ProxyArpIntfcEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ProxyArpIntfcEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/avf/avf.ba.go b/binapi/avf/avf.ba.go index 436223b..edfa26e 100644 --- a/binapi/avf/avf.ba.go +++ b/binapi/avf/avf.ba.go @@ -45,11 +45,10 @@ func (*AvfCreate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AvfCreate) Size() int { +func (m *AvfCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PciAddr size += 4 // m.EnableElog size += 2 // m.RxqNum @@ -58,23 +57,21 @@ func (m *AvfCreate) Size() int { return size } func (m *AvfCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PciAddr)) - buf.EncodeUint32(uint32(m.EnableElog)) - buf.EncodeUint16(uint16(m.RxqNum)) - buf.EncodeUint16(uint16(m.RxqSize)) - buf.EncodeUint16(uint16(m.TxqSize)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PciAddr) + buf.EncodeInt32(m.EnableElog) + buf.EncodeUint16(m.RxqNum) + buf.EncodeUint16(m.RxqSize) + buf.EncodeUint16(m.TxqSize) return buf.Bytes(), nil } func (m *AvfCreate) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.PciAddr = buf.DecodeUint32() - m.EnableElog = int32(buf.DecodeUint32()) + m.EnableElog = buf.DecodeInt32() m.RxqNum = buf.DecodeUint16() m.RxqSize = buf.DecodeUint16() m.TxqSize = buf.DecodeUint16() @@ -94,29 +91,26 @@ func (*AvfCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AvfCreateReply) Size() int { +func (m *AvfCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *AvfCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *AvfCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -133,21 +127,18 @@ func (*AvfDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AvfDelete) Size() int { +func (m *AvfDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *AvfDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -169,27 +160,24 @@ func (*AvfDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AvfDeleteReply) Size() int { +func (m *AvfDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *AvfDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *AvfDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/bfd/bfd.ba.go b/binapi/bfd/bfd.ba.go index 2b4f5f0..b8b2820 100644 --- a/binapi/bfd/bfd.ba.go +++ b/binapi/bfd/bfd.ba.go @@ -77,22 +77,19 @@ func (*BfdAuthDelKey) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdAuthDelKey) Size() int { +func (m *BfdAuthDelKey) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ConfKeyID return size } func (m *BfdAuthDelKey) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ConfKeyID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ConfKeyID) return buf.Bytes(), nil } func (m *BfdAuthDelKey) Unmarshal(b []byte) error { @@ -113,27 +110,24 @@ func (*BfdAuthDelKeyReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdAuthDelKeyReply) Size() int { +func (m *BfdAuthDelKeyReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdAuthDelKeyReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdAuthDelKeyReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -151,26 +145,23 @@ func (*BfdAuthKeysDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdAuthKeysDetails) Size() int { +func (m *BfdAuthKeysDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ConfKeyID size += 4 // m.UseCount size += 1 // m.AuthType return size } func (m *BfdAuthKeysDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ConfKeyID)) - buf.EncodeUint32(uint32(m.UseCount)) - buf.EncodeUint8(uint8(m.AuthType)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ConfKeyID) + buf.EncodeUint32(m.UseCount) + buf.EncodeUint8(m.AuthType) return buf.Bytes(), nil } func (m *BfdAuthKeysDetails) Unmarshal(b []byte) error { @@ -191,20 +182,17 @@ func (*BfdAuthKeysDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdAuthKeysDump) Size() int { +func (m *BfdAuthKeysDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *BfdAuthKeysDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *BfdAuthKeysDump) Unmarshal(b []byte) error { @@ -226,11 +214,10 @@ func (*BfdAuthSetKey) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdAuthSetKey) Size() int { +func (m *BfdAuthSetKey) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ConfKeyID size += 1 // m.KeyLen size += 1 // m.AuthType @@ -238,16 +225,14 @@ func (m *BfdAuthSetKey) Size() int { return size } func (m *BfdAuthSetKey) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ConfKeyID)) - buf.EncodeUint8(uint8(m.KeyLen)) - buf.EncodeUint8(uint8(m.AuthType)) - buf.EncodeBytes(m.Key[:], 20) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ConfKeyID) + buf.EncodeUint8(m.KeyLen) + buf.EncodeUint8(m.AuthType) + buf.EncodeBytes(m.Key, 20) return buf.Bytes(), nil } func (m *BfdAuthSetKey) Unmarshal(b []byte) error { @@ -255,7 +240,8 @@ func (m *BfdAuthSetKey) Unmarshal(b []byte) error { m.ConfKeyID = buf.DecodeUint32() m.KeyLen = buf.DecodeUint8() m.AuthType = buf.DecodeUint8() - copy(m.Key[:], buf.DecodeBytes(20)) + m.Key = make([]byte, 20) + copy(m.Key, buf.DecodeBytes(len(m.Key))) return nil } @@ -271,27 +257,24 @@ func (*BfdAuthSetKeyReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdAuthSetKeyReply) Size() int { +func (m *BfdAuthSetKeyReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdAuthSetKeyReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdAuthSetKeyReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -315,11 +298,10 @@ func (*BfdUDPAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPAdd) Size() int { +func (m *BfdUDPAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.DesiredMinTx size += 4 // m.RequiredMinRx @@ -334,23 +316,21 @@ func (m *BfdUDPAdd) Size() int { return size } func (m *BfdUDPAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.DesiredMinTx)) - buf.EncodeUint32(uint32(m.RequiredMinRx)) + buf.EncodeUint32(m.DesiredMinTx) + buf.EncodeUint32(m.RequiredMinRx) buf.EncodeUint8(uint8(m.LocalAddr.Af)) - buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.PeerAddr.Af)) - buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.DetectMult)) + buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.DetectMult) buf.EncodeBool(m.IsAuthenticated) - buf.EncodeUint8(uint8(m.BfdKeyID)) - buf.EncodeUint32(uint32(m.ConfKeyID)) + buf.EncodeUint8(m.BfdKeyID) + buf.EncodeUint32(m.ConfKeyID) return buf.Bytes(), nil } func (m *BfdUDPAdd) Unmarshal(b []byte) error { @@ -381,27 +361,24 @@ func (*BfdUDPAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPAddReply) Size() int { +func (m *BfdUDPAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdUDPAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdUDPAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -422,11 +399,10 @@ func (*BfdUDPAuthActivate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPAuthActivate) Size() int { +func (m *BfdUDPAuthActivate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.LocalAddr.Af size += 1 * 16 // m.LocalAddr.Un @@ -438,20 +414,18 @@ func (m *BfdUDPAuthActivate) Size() int { return size } func (m *BfdUDPAuthActivate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.LocalAddr.Af)) - buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.PeerAddr.Af)) - buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16) buf.EncodeBool(m.IsDelayed) - buf.EncodeUint8(uint8(m.BfdKeyID)) - buf.EncodeUint32(uint32(m.ConfKeyID)) + buf.EncodeUint8(m.BfdKeyID) + buf.EncodeUint32(m.ConfKeyID) return buf.Bytes(), nil } func (m *BfdUDPAuthActivate) Unmarshal(b []byte) error { @@ -479,27 +453,24 @@ func (*BfdUDPAuthActivateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPAuthActivateReply) Size() int { +func (m *BfdUDPAuthActivateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdUDPAuthActivateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdUDPAuthActivateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -518,11 +489,10 @@ func (*BfdUDPAuthDeactivate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPAuthDeactivate) Size() int { +func (m *BfdUDPAuthDeactivate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.LocalAddr.Af size += 1 * 16 // m.LocalAddr.Un @@ -532,17 +502,15 @@ func (m *BfdUDPAuthDeactivate) Size() int { return size } func (m *BfdUDPAuthDeactivate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.LocalAddr.Af)) - buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.PeerAddr.Af)) - buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16) buf.EncodeBool(m.IsDelayed) return buf.Bytes(), nil } @@ -569,27 +537,24 @@ func (*BfdUDPAuthDeactivateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPAuthDeactivateReply) Size() int { +func (m *BfdUDPAuthDeactivateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdUDPAuthDeactivateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdUDPAuthDeactivateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -607,11 +572,10 @@ func (*BfdUDPDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPDel) Size() int { +func (m *BfdUDPDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.LocalAddr.Af size += 1 * 16 // m.LocalAddr.Un @@ -620,17 +584,15 @@ func (m *BfdUDPDel) Size() int { return size } func (m *BfdUDPDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.LocalAddr.Af)) - buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.PeerAddr.Af)) - buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *BfdUDPDel) Unmarshal(b []byte) error { @@ -653,20 +615,17 @@ func (*BfdUDPDelEchoSource) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPDelEchoSource) Size() int { +func (m *BfdUDPDelEchoSource) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *BfdUDPDelEchoSource) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *BfdUDPDelEchoSource) Unmarshal(b []byte) error { @@ -685,27 +644,24 @@ func (*BfdUDPDelEchoSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPDelEchoSourceReply) Size() int { +func (m *BfdUDPDelEchoSourceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdUDPDelEchoSourceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdUDPDelEchoSourceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -721,27 +677,24 @@ func (*BfdUDPDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPDelReply) Size() int { +func (m *BfdUDPDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdUDPDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdUDPDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -755,20 +708,17 @@ func (*BfdUDPGetEchoSource) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPGetEchoSource) Size() int { +func (m *BfdUDPGetEchoSource) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *BfdUDPGetEchoSource) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *BfdUDPGetEchoSource) Unmarshal(b []byte) error { @@ -793,11 +743,10 @@ func (*BfdUDPGetEchoSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPGetEchoSourceReply) Size() int { +func (m *BfdUDPGetEchoSourceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex size += 1 // m.IsSet @@ -808,13 +757,11 @@ func (m *BfdUDPGetEchoSourceReply) Size() int { return size } func (m *BfdUDPGetEchoSourceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsSet) buf.EncodeBool(m.HaveUsableIP4) @@ -825,7 +772,7 @@ func (m *BfdUDPGetEchoSourceReply) Marshal(b []byte) ([]byte, error) { } func (m *BfdUDPGetEchoSourceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.IsSet = buf.DecodeBool() m.HaveUsableIP4 = buf.DecodeBool() @@ -852,11 +799,10 @@ func (*BfdUDPMod) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPMod) Size() int { +func (m *BfdUDPMod) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.DesiredMinTx size += 4 // m.RequiredMinRx @@ -868,20 +814,18 @@ func (m *BfdUDPMod) Size() int { return size } func (m *BfdUDPMod) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.DesiredMinTx)) - buf.EncodeUint32(uint32(m.RequiredMinRx)) + buf.EncodeUint32(m.DesiredMinTx) + buf.EncodeUint32(m.RequiredMinRx) buf.EncodeUint8(uint8(m.LocalAddr.Af)) - buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.PeerAddr.Af)) - buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.DetectMult)) + buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.DetectMult) return buf.Bytes(), nil } func (m *BfdUDPMod) Unmarshal(b []byte) error { @@ -909,27 +853,24 @@ func (*BfdUDPModReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPModReply) Size() int { +func (m *BfdUDPModReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdUDPModReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdUDPModReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -954,11 +895,10 @@ func (*BfdUDPSessionDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPSessionDetails) Size() int { +func (m *BfdUDPSessionDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.LocalAddr.Af size += 1 * 16 // m.LocalAddr.Un @@ -974,24 +914,22 @@ func (m *BfdUDPSessionDetails) Size() int { return size } func (m *BfdUDPSessionDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.LocalAddr.Af)) - buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.PeerAddr.Af)) - buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.State)) buf.EncodeBool(m.IsAuthenticated) - buf.EncodeUint8(uint8(m.BfdKeyID)) - buf.EncodeUint32(uint32(m.ConfKeyID)) - buf.EncodeUint32(uint32(m.RequiredMinRx)) - buf.EncodeUint32(uint32(m.DesiredMinTx)) - buf.EncodeUint8(uint8(m.DetectMult)) + buf.EncodeUint8(m.BfdKeyID) + buf.EncodeUint32(m.ConfKeyID) + buf.EncodeUint32(m.RequiredMinRx) + buf.EncodeUint32(m.DesiredMinTx) + buf.EncodeUint8(m.DetectMult) return buf.Bytes(), nil } func (m *BfdUDPSessionDetails) Unmarshal(b []byte) error { @@ -1021,20 +959,17 @@ func (*BfdUDPSessionDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPSessionDump) Size() int { +func (m *BfdUDPSessionDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *BfdUDPSessionDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *BfdUDPSessionDump) Unmarshal(b []byte) error { @@ -1056,11 +991,10 @@ func (*BfdUDPSessionSetFlags) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPSessionSetFlags) Size() int { +func (m *BfdUDPSessionSetFlags) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.LocalAddr.Af size += 1 * 16 // m.LocalAddr.Un @@ -1070,17 +1004,15 @@ func (m *BfdUDPSessionSetFlags) Size() int { return size } func (m *BfdUDPSessionSetFlags) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.LocalAddr.Af)) - buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.PeerAddr.Af)) - buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.Flags)) return buf.Bytes(), nil } @@ -1107,27 +1039,24 @@ func (*BfdUDPSessionSetFlagsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPSessionSetFlagsReply) Size() int { +func (m *BfdUDPSessionSetFlagsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdUDPSessionSetFlagsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdUDPSessionSetFlagsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1143,21 +1072,18 @@ func (*BfdUDPSetEchoSource) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BfdUDPSetEchoSource) Size() int { +func (m *BfdUDPSetEchoSource) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *BfdUDPSetEchoSource) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -1179,27 +1105,24 @@ func (*BfdUDPSetEchoSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BfdUDPSetEchoSourceReply) Size() int { +func (m *BfdUDPSetEchoSourceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BfdUDPSetEchoSourceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BfdUDPSetEchoSourceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1216,24 +1139,21 @@ func (*WantBfdEvents) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *WantBfdEvents) Size() int { +func (m *WantBfdEvents) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable size += 4 // m.PID return size } func (m *WantBfdEvents) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) - buf.EncodeUint32(uint32(m.PID)) + buf.EncodeUint32(m.PID) return buf.Bytes(), nil } func (m *WantBfdEvents) Unmarshal(b []byte) error { @@ -1255,27 +1175,24 @@ func (*WantBfdEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *WantBfdEventsReply) Size() int { +func (m *WantBfdEventsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *WantBfdEventsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *WantBfdEventsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/bier/bier.ba.go b/binapi/bier/bier.ba.go index 456e25c..f024d80 100644 --- a/binapi/bier/bier.ba.go +++ b/binapi/bier/bier.ba.go @@ -63,11 +63,10 @@ func (*BierDispEntryAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierDispEntryAddDel) Size() int { +func (m *BierDispEntryAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.BdeBp size += 4 // m.BdeTblID size += 1 // m.BdeIsAdd @@ -93,58 +92,47 @@ func (m *BierDispEntryAddDel) Size() int { size += 4 // s1.Nh.ClassifyTableIndex size += 1 // s1.NLabels for j2 := 0; j2 < 16; j2++ { - var s2 fib_types.FibMplsLabel - _ = s2 - if j2 < len(s1.LabelStack) { - s2 = s1.LabelStack[j2] - } - size += 1 // s2.IsUniform - size += 4 // s2.Label - size += 1 // s2.TTL - size += 1 // s2.Exp + size += 1 // s1.LabelStack[j2].IsUniform + size += 4 // s1.LabelStack[j2].Label + size += 1 // s1.LabelStack[j2].TTL + size += 1 // s1.LabelStack[j2].Exp } } return size } func (m *BierDispEntryAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.BdeBp)) - buf.EncodeUint32(uint32(m.BdeTblID)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.BdeBp) + buf.EncodeUint32(m.BdeTblID) buf.EncodeBool(m.BdeIsAdd) - buf.EncodeUint8(uint8(m.BdePayloadProto)) + buf.EncodeUint8(m.BdePayloadProto) buf.EncodeUint8(uint8(len(m.BdePaths))) for j0 := 0; j0 < len(m.BdePaths); j0++ { - var v0 fib_types.FibPath + var v0 fib_types.FibPath // BdePaths if j0 < len(m.BdePaths) { v0 = m.BdePaths[j0] } - buf.EncodeUint32(uint32(v0.SwIfIndex)) - buf.EncodeUint32(uint32(v0.TableID)) - buf.EncodeUint32(uint32(v0.RpfID)) - buf.EncodeUint8(uint8(v0.Weight)) - buf.EncodeUint8(uint8(v0.Preference)) + buf.EncodeUint32(v0.SwIfIndex) + buf.EncodeUint32(v0.TableID) + buf.EncodeUint32(v0.RpfID) + buf.EncodeUint8(v0.Weight) + buf.EncodeUint8(v0.Preference) buf.EncodeUint32(uint32(v0.Type)) buf.EncodeUint32(uint32(v0.Flags)) buf.EncodeUint32(uint32(v0.Proto)) - buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v0.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v0.Nh.ObjID)) - buf.EncodeUint32(uint32(v0.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v0.NLabels)) + buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v0.Nh.ViaLabel) + buf.EncodeUint32(v0.Nh.ObjID) + buf.EncodeUint32(v0.Nh.ClassifyTableIndex) + buf.EncodeUint8(v0.NLabels) for j1 := 0; j1 < 16; j1++ { - var v1 fib_types.FibMplsLabel - if j1 < len(v0.LabelStack) { - v1 = v0.LabelStack[j1] - } - buf.EncodeUint8(uint8(v1.IsUniform)) - buf.EncodeUint32(uint32(v1.Label)) - buf.EncodeUint8(uint8(v1.TTL)) - buf.EncodeUint8(uint8(v1.Exp)) + buf.EncodeUint8(v0.LabelStack[j1].IsUniform) + buf.EncodeUint32(v0.LabelStack[j1].Label) + buf.EncodeUint8(v0.LabelStack[j1].TTL) + buf.EncodeUint8(v0.LabelStack[j1].Exp) } } return buf.Bytes(), nil @@ -156,7 +144,7 @@ func (m *BierDispEntryAddDel) Unmarshal(b []byte) error { m.BdeIsAdd = buf.DecodeBool() m.BdePayloadProto = buf.DecodeUint8() m.BdeNPaths = buf.DecodeUint8() - m.BdePaths = make([]fib_types.FibPath, int(m.BdeNPaths)) + m.BdePaths = make([]fib_types.FibPath, m.BdeNPaths) for j0 := 0; j0 < len(m.BdePaths); j0++ { m.BdePaths[j0].SwIfIndex = buf.DecodeUint32() m.BdePaths[j0].TableID = buf.DecodeUint32() @@ -193,27 +181,24 @@ func (*BierDispEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierDispEntryAddDelReply) Size() int { +func (m *BierDispEntryAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BierDispEntryAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BierDispEntryAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -234,11 +219,10 @@ func (*BierDispEntryDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierDispEntryDetails) Size() int { +func (m *BierDispEntryDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.BdeBp size += 4 // m.BdeTblID size += 1 // m.BdeIsAdd @@ -264,58 +248,47 @@ func (m *BierDispEntryDetails) Size() int { size += 4 // s1.Nh.ClassifyTableIndex size += 1 // s1.NLabels for j2 := 0; j2 < 16; j2++ { - var s2 fib_types.FibMplsLabel - _ = s2 - if j2 < len(s1.LabelStack) { - s2 = s1.LabelStack[j2] - } - size += 1 // s2.IsUniform - size += 4 // s2.Label - size += 1 // s2.TTL - size += 1 // s2.Exp + size += 1 // s1.LabelStack[j2].IsUniform + size += 4 // s1.LabelStack[j2].Label + size += 1 // s1.LabelStack[j2].TTL + size += 1 // s1.LabelStack[j2].Exp } } return size } func (m *BierDispEntryDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.BdeBp)) - buf.EncodeUint32(uint32(m.BdeTblID)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.BdeBp) + buf.EncodeUint32(m.BdeTblID) buf.EncodeBool(m.BdeIsAdd) - buf.EncodeUint8(uint8(m.BdePayloadProto)) + buf.EncodeUint8(m.BdePayloadProto) buf.EncodeUint8(uint8(len(m.BdePaths))) for j0 := 0; j0 < len(m.BdePaths); j0++ { - var v0 fib_types.FibPath + var v0 fib_types.FibPath // BdePaths if j0 < len(m.BdePaths) { v0 = m.BdePaths[j0] } - buf.EncodeUint32(uint32(v0.SwIfIndex)) - buf.EncodeUint32(uint32(v0.TableID)) - buf.EncodeUint32(uint32(v0.RpfID)) - buf.EncodeUint8(uint8(v0.Weight)) - buf.EncodeUint8(uint8(v0.Preference)) + buf.EncodeUint32(v0.SwIfIndex) + buf.EncodeUint32(v0.TableID) + buf.EncodeUint32(v0.RpfID) + buf.EncodeUint8(v0.Weight) + buf.EncodeUint8(v0.Preference) buf.EncodeUint32(uint32(v0.Type)) buf.EncodeUint32(uint32(v0.Flags)) buf.EncodeUint32(uint32(v0.Proto)) - buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v0.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v0.Nh.ObjID)) - buf.EncodeUint32(uint32(v0.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v0.NLabels)) + buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v0.Nh.ViaLabel) + buf.EncodeUint32(v0.Nh.ObjID) + buf.EncodeUint32(v0.Nh.ClassifyTableIndex) + buf.EncodeUint8(v0.NLabels) for j1 := 0; j1 < 16; j1++ { - var v1 fib_types.FibMplsLabel - if j1 < len(v0.LabelStack) { - v1 = v0.LabelStack[j1] - } - buf.EncodeUint8(uint8(v1.IsUniform)) - buf.EncodeUint32(uint32(v1.Label)) - buf.EncodeUint8(uint8(v1.TTL)) - buf.EncodeUint8(uint8(v1.Exp)) + buf.EncodeUint8(v0.LabelStack[j1].IsUniform) + buf.EncodeUint32(v0.LabelStack[j1].Label) + buf.EncodeUint8(v0.LabelStack[j1].TTL) + buf.EncodeUint8(v0.LabelStack[j1].Exp) } } return buf.Bytes(), nil @@ -327,7 +300,7 @@ func (m *BierDispEntryDetails) Unmarshal(b []byte) error { m.BdeIsAdd = buf.DecodeBool() m.BdePayloadProto = buf.DecodeUint8() m.BdeNPaths = buf.DecodeUint8() - m.BdePaths = make([]fib_types.FibPath, int(m.BdeNPaths)) + m.BdePaths = make([]fib_types.FibPath, m.BdeNPaths) for j0 := 0; j0 < len(m.BdePaths); j0++ { m.BdePaths[j0].SwIfIndex = buf.DecodeUint32() m.BdePaths[j0].TableID = buf.DecodeUint32() @@ -364,22 +337,19 @@ func (*BierDispEntryDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierDispEntryDump) Size() int { +func (m *BierDispEntryDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdeTblID return size } func (m *BierDispEntryDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdeTblID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdeTblID) return buf.Bytes(), nil } func (m *BierDispEntryDump) Unmarshal(b []byte) error { @@ -401,23 +371,20 @@ func (*BierDispTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierDispTableAddDel) Size() int { +func (m *BierDispTableAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdtTblID size += 1 // m.BdtIsAdd return size } func (m *BierDispTableAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdtTblID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdtTblID) buf.EncodeBool(m.BdtIsAdd) return buf.Bytes(), nil } @@ -440,27 +407,24 @@ func (*BierDispTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierDispTableAddDelReply) Size() int { +func (m *BierDispTableAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BierDispTableAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BierDispTableAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -476,22 +440,19 @@ func (*BierDispTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierDispTableDetails) Size() int { +func (m *BierDispTableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdtTblID return size } func (m *BierDispTableDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdtTblID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdtTblID) return buf.Bytes(), nil } func (m *BierDispTableDetails) Unmarshal(b []byte) error { @@ -510,20 +471,17 @@ func (*BierDispTableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierDispTableDump) Size() int { +func (m *BierDispTableDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *BierDispTableDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *BierDispTableDump) Unmarshal(b []byte) error { @@ -545,11 +503,10 @@ func (*BierImpAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierImpAdd) Size() int { +func (m *BierImpAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.BiTblID.BtSet size += 1 // m.BiTblID.BtSubDomain size += 1 // m.BiTblID.BtHdrLenID @@ -559,18 +516,16 @@ func (m *BierImpAdd) Size() int { return size } func (m *BierImpAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.BiTblID.BtSet)) - buf.EncodeUint8(uint8(m.BiTblID.BtSubDomain)) - buf.EncodeUint8(uint8(m.BiTblID.BtHdrLenID)) - buf.EncodeUint16(uint16(m.BiSrc)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.BiTblID.BtSet) + buf.EncodeUint8(m.BiTblID.BtSubDomain) + buf.EncodeUint8(m.BiTblID.BtHdrLenID) + buf.EncodeUint16(m.BiSrc) buf.EncodeUint8(uint8(len(m.BiBytes))) - buf.EncodeBytes(m.BiBytes[:], 0) + buf.EncodeBytes(m.BiBytes, 0) return buf.Bytes(), nil } func (m *BierImpAdd) Unmarshal(b []byte) error { @@ -580,7 +535,8 @@ func (m *BierImpAdd) Unmarshal(b []byte) error { m.BiTblID.BtHdrLenID = buf.DecodeUint8() m.BiSrc = buf.DecodeUint16() m.BiNBytes = buf.DecodeUint8() - copy(m.BiBytes[:], buf.DecodeBytes(0)) + m.BiBytes = make([]byte, m.BiNBytes) + copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes))) return nil } @@ -597,29 +553,26 @@ func (*BierImpAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierImpAddReply) Size() int { +func (m *BierImpAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.BiIndex return size } func (m *BierImpAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.BiIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.BiIndex) return buf.Bytes(), nil } func (m *BierImpAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.BiIndex = buf.DecodeUint32() return nil } @@ -636,22 +589,19 @@ func (*BierImpDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierImpDel) Size() int { +func (m *BierImpDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BiIndex return size } func (m *BierImpDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BiIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BiIndex) return buf.Bytes(), nil } func (m *BierImpDel) Unmarshal(b []byte) error { @@ -672,27 +622,24 @@ func (*BierImpDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierImpDelReply) Size() int { +func (m *BierImpDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BierImpDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BierImpDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -711,11 +658,10 @@ func (*BierImpDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierImpDetails) Size() int { +func (m *BierImpDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.BiTblID.BtSet size += 1 // m.BiTblID.BtSubDomain size += 1 // m.BiTblID.BtHdrLenID @@ -725,18 +671,16 @@ func (m *BierImpDetails) Size() int { return size } func (m *BierImpDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.BiTblID.BtSet)) - buf.EncodeUint8(uint8(m.BiTblID.BtSubDomain)) - buf.EncodeUint8(uint8(m.BiTblID.BtHdrLenID)) - buf.EncodeUint16(uint16(m.BiSrc)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.BiTblID.BtSet) + buf.EncodeUint8(m.BiTblID.BtSubDomain) + buf.EncodeUint8(m.BiTblID.BtHdrLenID) + buf.EncodeUint16(m.BiSrc) buf.EncodeUint8(uint8(len(m.BiBytes))) - buf.EncodeBytes(m.BiBytes[:], 0) + buf.EncodeBytes(m.BiBytes, 0) return buf.Bytes(), nil } func (m *BierImpDetails) Unmarshal(b []byte) error { @@ -746,7 +690,8 @@ func (m *BierImpDetails) Unmarshal(b []byte) error { m.BiTblID.BtHdrLenID = buf.DecodeUint8() m.BiSrc = buf.DecodeUint16() m.BiNBytes = buf.DecodeUint8() - copy(m.BiBytes[:], buf.DecodeBytes(0)) + m.BiBytes = make([]byte, m.BiNBytes) + copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes))) return nil } @@ -760,20 +705,17 @@ func (*BierImpDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierImpDump) Size() int { +func (m *BierImpDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *BierImpDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *BierImpDump) Unmarshal(b []byte) error { @@ -794,11 +736,10 @@ func (*BierRouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierRouteAddDel) Size() int { +func (m *BierRouteAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.BrIsAdd size += 1 // m.BrIsReplace size += 4 // m.BrRoute.BrBp @@ -826,60 +767,49 @@ func (m *BierRouteAddDel) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *BierRouteAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.BrIsAdd) buf.EncodeBool(m.BrIsReplace) - buf.EncodeUint32(uint32(m.BrRoute.BrBp)) - buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtSet)) - buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtSubDomain)) - buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtHdrLenID)) + buf.EncodeUint32(m.BrRoute.BrBp) + buf.EncodeUint8(m.BrRoute.BrTblID.BtSet) + buf.EncodeUint8(m.BrRoute.BrTblID.BtSubDomain) + buf.EncodeUint8(m.BrRoute.BrTblID.BtHdrLenID) buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths))) for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // BrPaths if j1 < len(m.BrRoute.BrPaths) { v1 = m.BrRoute.BrPaths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -893,7 +823,7 @@ func (m *BierRouteAddDel) Unmarshal(b []byte) error { m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8() m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8() m.BrRoute.BrNPaths = buf.DecodeUint8() - m.BrRoute.BrPaths = make([]fib_types.FibPath, int(m.BrRoute.BrNPaths)) + m.BrRoute.BrPaths = make([]fib_types.FibPath, m.BrRoute.BrNPaths) for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ { m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32() m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32() @@ -930,27 +860,24 @@ func (*BierRouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierRouteAddDelReply) Size() int { +func (m *BierRouteAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BierRouteAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BierRouteAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -966,11 +893,10 @@ func (*BierRouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierRouteDetails) Size() int { +func (m *BierRouteDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BrRoute.BrBp size += 1 // m.BrRoute.BrTblID.BtSet size += 1 // m.BrRoute.BrTblID.BtSubDomain @@ -996,58 +922,47 @@ func (m *BierRouteDetails) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *BierRouteDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BrRoute.BrBp)) - buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtSet)) - buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtSubDomain)) - buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtHdrLenID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BrRoute.BrBp) + buf.EncodeUint8(m.BrRoute.BrTblID.BtSet) + buf.EncodeUint8(m.BrRoute.BrTblID.BtSubDomain) + buf.EncodeUint8(m.BrRoute.BrTblID.BtHdrLenID) buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths))) for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // BrPaths if j1 < len(m.BrRoute.BrPaths) { v1 = m.BrRoute.BrPaths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -1059,7 +974,7 @@ func (m *BierRouteDetails) Unmarshal(b []byte) error { m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8() m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8() m.BrRoute.BrNPaths = buf.DecodeUint8() - m.BrRoute.BrPaths = make([]fib_types.FibPath, int(m.BrRoute.BrNPaths)) + m.BrRoute.BrPaths = make([]fib_types.FibPath, m.BrRoute.BrNPaths) for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ { m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32() m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32() @@ -1096,26 +1011,23 @@ func (*BierRouteDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierRouteDump) Size() int { +func (m *BierRouteDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.BrTblID.BtSet size += 1 // m.BrTblID.BtSubDomain size += 1 // m.BrTblID.BtHdrLenID return size } func (m *BierRouteDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.BrTblID.BtSet)) - buf.EncodeUint8(uint8(m.BrTblID.BtSubDomain)) - buf.EncodeUint8(uint8(m.BrTblID.BtHdrLenID)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.BrTblID.BtSet) + buf.EncodeUint8(m.BrTblID.BtSubDomain) + buf.EncodeUint8(m.BrTblID.BtHdrLenID) return buf.Bytes(), nil } func (m *BierRouteDump) Unmarshal(b []byte) error { @@ -1140,11 +1052,10 @@ func (*BierTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierTableAddDel) Size() int { +func (m *BierTableAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.BtTblID.BtSet size += 1 // m.BtTblID.BtSubDomain size += 1 // m.BtTblID.BtHdrLenID @@ -1153,16 +1064,14 @@ func (m *BierTableAddDel) Size() int { return size } func (m *BierTableAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.BtTblID.BtSet)) - buf.EncodeUint8(uint8(m.BtTblID.BtSubDomain)) - buf.EncodeUint8(uint8(m.BtTblID.BtHdrLenID)) - buf.EncodeUint32(uint32(m.BtLabel)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.BtTblID.BtSet) + buf.EncodeUint8(m.BtTblID.BtSubDomain) + buf.EncodeUint8(m.BtTblID.BtHdrLenID) + buf.EncodeUint32(m.BtLabel) buf.EncodeBool(m.BtIsAdd) return buf.Bytes(), nil } @@ -1188,27 +1097,24 @@ func (*BierTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierTableAddDelReply) Size() int { +func (m *BierTableAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BierTableAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BierTableAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1225,11 +1131,10 @@ func (*BierTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BierTableDetails) Size() int { +func (m *BierTableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BtLabel size += 1 // m.BtTblID.BtSet size += 1 // m.BtTblID.BtSubDomain @@ -1237,16 +1142,14 @@ func (m *BierTableDetails) Size() int { return size } func (m *BierTableDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BtLabel)) - buf.EncodeUint8(uint8(m.BtTblID.BtSet)) - buf.EncodeUint8(uint8(m.BtTblID.BtSubDomain)) - buf.EncodeUint8(uint8(m.BtTblID.BtHdrLenID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BtLabel) + buf.EncodeUint8(m.BtTblID.BtSet) + buf.EncodeUint8(m.BtTblID.BtSubDomain) + buf.EncodeUint8(m.BtTblID.BtHdrLenID) return buf.Bytes(), nil } func (m *BierTableDetails) Unmarshal(b []byte) error { @@ -1268,20 +1171,17 @@ func (*BierTableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BierTableDump) Size() int { +func (m *BierTableDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *BierTableDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *BierTableDump) Unmarshal(b []byte) error { diff --git a/binapi/bond/bond.ba.go b/binapi/bond/bond.ba.go index 378a8f3..a734200 100644 --- a/binapi/bond/bond.ba.go +++ b/binapi/bond/bond.ba.go @@ -109,7 +109,7 @@ func (x BondMode) String() string { // BondCreate defines message 'bond_create'. type BondCreate struct { - ID uint32 `binapi:"u32,name=id,default=%!s(float64=4.294967295e+09)" json:"id,omitempty"` + ID uint32 `binapi:"u32,name=id,default=4294967295" json:"id,omitempty"` UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"` MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` Mode BondMode `binapi:"bond_mode,name=mode" json:"mode,omitempty"` @@ -124,11 +124,10 @@ func (*BondCreate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BondCreate) Size() int { +func (m *BondCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ID size += 1 // m.UseCustomMac size += 1 * 6 // m.MacAddress @@ -138,13 +137,11 @@ func (m *BondCreate) Size() int { return size } func (m *BondCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ID) buf.EncodeBool(m.UseCustomMac) buf.EncodeBytes(m.MacAddress[:], 6) buf.EncodeUint32(uint32(m.Mode)) @@ -176,29 +173,26 @@ func (*BondCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BondCreateReply) Size() int { +func (m *BondCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *BondCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *BondCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -215,21 +209,18 @@ func (*BondDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BondDelete) Size() int { +func (m *BondDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *BondDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -251,27 +242,24 @@ func (*BondDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BondDeleteReply) Size() int { +func (m *BondDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BondDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BondDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -287,21 +275,18 @@ func (*BondDetachSlave) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BondDetachSlave) Size() int { +func (m *BondDetachSlave) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *BondDetachSlave) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -323,27 +308,24 @@ func (*BondDetachSlaveReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BondDetachSlaveReply) Size() int { +func (m *BondDetachSlaveReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BondDetachSlaveReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BondDetachSlaveReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -362,11 +344,10 @@ func (*BondEnslave) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BondEnslave) Size() int { +func (m *BondEnslave) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.BondSwIfIndex size += 1 // m.IsPassive @@ -374,12 +355,10 @@ func (m *BondEnslave) Size() int { return size } func (m *BondEnslave) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(uint32(m.BondSwIfIndex)) buf.EncodeBool(m.IsPassive) @@ -407,27 +386,24 @@ func (*BondEnslaveReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BondEnslaveReply) Size() int { +func (m *BondEnslaveReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BondEnslaveReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BondEnslaveReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -450,11 +426,10 @@ func (*SwInterfaceBondDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceBondDetails) Size() int { +func (m *SwInterfaceBondDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.ID size += 4 // m.Mode @@ -466,19 +441,17 @@ func (m *SwInterfaceBondDetails) Size() int { return size } func (m *SwInterfaceBondDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.ID)) + buf.EncodeUint32(m.ID) buf.EncodeUint32(uint32(m.Mode)) buf.EncodeUint32(uint32(m.Lb)) buf.EncodeBool(m.NumaOnly) - buf.EncodeUint32(uint32(m.ActiveSlaves)) - buf.EncodeUint32(uint32(m.Slaves)) + buf.EncodeUint32(m.ActiveSlaves) + buf.EncodeUint32(m.Slaves) buf.EncodeString(m.InterfaceName, 64) return buf.Bytes(), nil } @@ -505,20 +478,17 @@ func (*SwInterfaceBondDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceBondDump) Size() int { +func (m *SwInterfaceBondDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SwInterfaceBondDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SwInterfaceBondDump) Unmarshal(b []byte) error { @@ -538,24 +508,21 @@ func (*SwInterfaceSetBondWeight) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetBondWeight) Size() int { +func (m *SwInterfaceSetBondWeight) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.Weight return size } func (m *SwInterfaceSetBondWeight) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.Weight)) + buf.EncodeUint32(m.Weight) return buf.Bytes(), nil } func (m *SwInterfaceSetBondWeight) Unmarshal(b []byte) error { @@ -579,27 +546,24 @@ func (*SwInterfaceSetBondWeightReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetBondWeightReply) Size() int { +func (m *SwInterfaceSetBondWeightReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetBondWeightReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetBondWeightReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -620,11 +584,10 @@ func (*SwInterfaceSlaveDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSlaveDetails) Size() int { +func (m *SwInterfaceSlaveDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 64 // m.InterfaceName size += 1 // m.IsPassive @@ -634,18 +597,16 @@ func (m *SwInterfaceSlaveDetails) Size() int { return size } func (m *SwInterfaceSlaveDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeString(m.InterfaceName, 64) buf.EncodeBool(m.IsPassive) buf.EncodeBool(m.IsLongTimeout) buf.EncodeBool(m.IsLocalNuma) - buf.EncodeUint32(uint32(m.Weight)) + buf.EncodeUint32(m.Weight) return buf.Bytes(), nil } func (m *SwInterfaceSlaveDetails) Unmarshal(b []byte) error { @@ -671,21 +632,18 @@ func (*SwInterfaceSlaveDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSlaveDump) Size() int { +func (m *SwInterfaceSlaveDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *SwInterfaceSlaveDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } diff --git a/binapi/builtinurl/builtinurl.ba.go b/binapi/builtinurl/builtinurl.ba.go index bfc593f..6b0350d 100644 --- a/binapi/builtinurl/builtinurl.ba.go +++ b/binapi/builtinurl/builtinurl.ba.go @@ -38,20 +38,17 @@ func (*BuiltinurlEnable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BuiltinurlEnable) Size() int { +func (m *BuiltinurlEnable) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *BuiltinurlEnable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *BuiltinurlEnable) Unmarshal(b []byte) error { @@ -70,27 +67,24 @@ func (*BuiltinurlEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BuiltinurlEnableReply) Size() int { +func (m *BuiltinurlEnableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BuiltinurlEnableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BuiltinurlEnableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/cdp/cdp.ba.go b/binapi/cdp/cdp.ba.go index afd8c46..5430d74 100644 --- a/binapi/cdp/cdp.ba.go +++ b/binapi/cdp/cdp.ba.go @@ -40,21 +40,18 @@ func (*CdpEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CdpEnableDisable) Size() int { +func (m *CdpEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable return size } func (m *CdpEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) return buf.Bytes(), nil } @@ -76,27 +73,24 @@ func (*CdpEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CdpEnableDisableReply) Size() int { +func (m *CdpEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *CdpEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *CdpEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/classify/classify.ba.go b/binapi/classify/classify.ba.go index f1696aa..942c59c 100644 --- a/binapi/classify/classify.ba.go +++ b/binapi/classify/classify.ba.go @@ -125,11 +125,11 @@ func (x PolicerClassifyTable) String() string { type ClassifyAddDelSession struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` - HitNextIndex uint32 `binapi:"u32,name=hit_next_index,default=%!s(float64=4.294967295e+09)" json:"hit_next_index,omitempty"` - OpaqueIndex uint32 `binapi:"u32,name=opaque_index,default=%!s(float64=4.294967295e+09)" json:"opaque_index,omitempty"` - Advance int32 `binapi:"i32,name=advance,default=%!s(float64=0)" json:"advance,omitempty"` - Action ClassifyAction `binapi:"classify_action,name=action,default=%!s(float64=0)" json:"action,omitempty"` - Metadata uint32 `binapi:"u32,name=metadata,default=%!s(float64=0)" json:"metadata,omitempty"` + HitNextIndex uint32 `binapi:"u32,name=hit_next_index,default=4294967295" json:"hit_next_index,omitempty"` + OpaqueIndex uint32 `binapi:"u32,name=opaque_index,default=4294967295" json:"opaque_index,omitempty"` + Advance int32 `binapi:"i32,name=advance,default=0" json:"advance,omitempty"` + Action ClassifyAction `binapi:"classify_action,name=action,default=0" json:"action,omitempty"` + Metadata uint32 `binapi:"u32,name=metadata,default=0" json:"metadata,omitempty"` MatchLen uint32 `binapi:"u32,name=match_len" json:"-"` Match []byte `binapi:"u8[match_len],name=match" json:"match,omitempty"` } @@ -141,11 +141,10 @@ func (*ClassifyAddDelSession) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ClassifyAddDelSession) Size() int { +func (m *ClassifyAddDelSession) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.TableIndex size += 4 // m.HitNextIndex @@ -158,21 +157,19 @@ func (m *ClassifyAddDelSession) Size() int { return size } func (m *ClassifyAddDelSession) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.TableIndex)) - buf.EncodeUint32(uint32(m.HitNextIndex)) - buf.EncodeUint32(uint32(m.OpaqueIndex)) - buf.EncodeUint32(uint32(m.Advance)) + buf.EncodeUint32(m.TableIndex) + buf.EncodeUint32(m.HitNextIndex) + buf.EncodeUint32(m.OpaqueIndex) + buf.EncodeInt32(m.Advance) buf.EncodeUint8(uint8(m.Action)) - buf.EncodeUint32(uint32(m.Metadata)) + buf.EncodeUint32(m.Metadata) buf.EncodeUint32(uint32(len(m.Match))) - buf.EncodeBytes(m.Match[:], 0) + buf.EncodeBytes(m.Match, 0) return buf.Bytes(), nil } func (m *ClassifyAddDelSession) Unmarshal(b []byte) error { @@ -181,11 +178,12 @@ func (m *ClassifyAddDelSession) Unmarshal(b []byte) error { m.TableIndex = buf.DecodeUint32() m.HitNextIndex = buf.DecodeUint32() m.OpaqueIndex = buf.DecodeUint32() - m.Advance = int32(buf.DecodeUint32()) + m.Advance = buf.DecodeInt32() m.Action = ClassifyAction(buf.DecodeUint8()) m.Metadata = buf.DecodeUint32() m.MatchLen = buf.DecodeUint32() - copy(m.Match[:], buf.DecodeBytes(0)) + m.Match = make([]byte, m.MatchLen) + copy(m.Match, buf.DecodeBytes(len(m.Match))) return nil } @@ -201,27 +199,24 @@ func (*ClassifyAddDelSessionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ClassifyAddDelSessionReply) Size() int { +func (m *ClassifyAddDelSessionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ClassifyAddDelSessionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ClassifyAddDelSessionReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -229,15 +224,15 @@ func (m *ClassifyAddDelSessionReply) Unmarshal(b []byte) error { type ClassifyAddDelTable struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` DelChain bool `binapi:"bool,name=del_chain" json:"del_chain,omitempty"` - TableIndex uint32 `binapi:"u32,name=table_index,default=%!s(float64=4.294967295e+09)" json:"table_index,omitempty"` - Nbuckets uint32 `binapi:"u32,name=nbuckets,default=%!s(float64=2)" json:"nbuckets,omitempty"` - MemorySize uint32 `binapi:"u32,name=memory_size,default=%!s(float64=2.097152e+06)" json:"memory_size,omitempty"` - SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors,default=%!s(float64=0)" json:"skip_n_vectors,omitempty"` - MatchNVectors uint32 `binapi:"u32,name=match_n_vectors,default=%!s(float64=1)" json:"match_n_vectors,omitempty"` - NextTableIndex uint32 `binapi:"u32,name=next_table_index,default=%!s(float64=4.294967295e+09)" json:"next_table_index,omitempty"` - MissNextIndex uint32 `binapi:"u32,name=miss_next_index,default=%!s(float64=4.294967295e+09)" json:"miss_next_index,omitempty"` - CurrentDataFlag uint8 `binapi:"u8,name=current_data_flag,default=%!s(float64=0)" json:"current_data_flag,omitempty"` - CurrentDataOffset int16 `binapi:"i16,name=current_data_offset,default=%!s(float64=0)" json:"current_data_offset,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index,default=4294967295" json:"table_index,omitempty"` + Nbuckets uint32 `binapi:"u32,name=nbuckets,default=2" json:"nbuckets,omitempty"` + MemorySize uint32 `binapi:"u32,name=memory_size,default=2097152" json:"memory_size,omitempty"` + SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors,default=0" json:"skip_n_vectors,omitempty"` + MatchNVectors uint32 `binapi:"u32,name=match_n_vectors,default=1" json:"match_n_vectors,omitempty"` + NextTableIndex uint32 `binapi:"u32,name=next_table_index,default=4294967295" json:"next_table_index,omitempty"` + MissNextIndex uint32 `binapi:"u32,name=miss_next_index,default=4294967295" json:"miss_next_index,omitempty"` + CurrentDataFlag uint8 `binapi:"u8,name=current_data_flag,default=0" json:"current_data_flag,omitempty"` + CurrentDataOffset int16 `binapi:"i16,name=current_data_offset,default=0" json:"current_data_offset,omitempty"` MaskLen uint32 `binapi:"u32,name=mask_len" json:"-"` Mask []byte `binapi:"u8[mask_len],name=mask" json:"mask,omitempty"` } @@ -249,11 +244,10 @@ func (*ClassifyAddDelTable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ClassifyAddDelTable) Size() int { +func (m *ClassifyAddDelTable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.DelChain size += 4 // m.TableIndex @@ -270,25 +264,23 @@ func (m *ClassifyAddDelTable) Size() int { return size } func (m *ClassifyAddDelTable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.DelChain) - buf.EncodeUint32(uint32(m.TableIndex)) - buf.EncodeUint32(uint32(m.Nbuckets)) - buf.EncodeUint32(uint32(m.MemorySize)) - buf.EncodeUint32(uint32(m.SkipNVectors)) - buf.EncodeUint32(uint32(m.MatchNVectors)) - buf.EncodeUint32(uint32(m.NextTableIndex)) - buf.EncodeUint32(uint32(m.MissNextIndex)) - buf.EncodeUint8(uint8(m.CurrentDataFlag)) - buf.EncodeUint16(uint16(m.CurrentDataOffset)) + buf.EncodeUint32(m.TableIndex) + buf.EncodeUint32(m.Nbuckets) + buf.EncodeUint32(m.MemorySize) + buf.EncodeUint32(m.SkipNVectors) + buf.EncodeUint32(m.MatchNVectors) + buf.EncodeUint32(m.NextTableIndex) + buf.EncodeUint32(m.MissNextIndex) + buf.EncodeUint8(m.CurrentDataFlag) + buf.EncodeInt16(m.CurrentDataOffset) buf.EncodeUint32(uint32(len(m.Mask))) - buf.EncodeBytes(m.Mask[:], 0) + buf.EncodeBytes(m.Mask, 0) return buf.Bytes(), nil } func (m *ClassifyAddDelTable) Unmarshal(b []byte) error { @@ -303,9 +295,10 @@ func (m *ClassifyAddDelTable) Unmarshal(b []byte) error { m.NextTableIndex = buf.DecodeUint32() m.MissNextIndex = buf.DecodeUint32() m.CurrentDataFlag = buf.DecodeUint8() - m.CurrentDataOffset = int16(buf.DecodeUint16()) + m.CurrentDataOffset = buf.DecodeInt16() m.MaskLen = buf.DecodeUint32() - copy(m.Mask[:], buf.DecodeBytes(0)) + m.Mask = make([]byte, m.MaskLen) + copy(m.Mask, buf.DecodeBytes(len(m.Mask))) return nil } @@ -324,11 +317,10 @@ func (*ClassifyAddDelTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ClassifyAddDelTableReply) Size() int { +func (m *ClassifyAddDelTableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.NewTableIndex size += 4 // m.SkipNVectors @@ -336,21 +328,19 @@ func (m *ClassifyAddDelTableReply) Size() int { return size } func (m *ClassifyAddDelTableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.NewTableIndex)) - buf.EncodeUint32(uint32(m.SkipNVectors)) - buf.EncodeUint32(uint32(m.MatchNVectors)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.NewTableIndex) + buf.EncodeUint32(m.SkipNVectors) + buf.EncodeUint32(m.MatchNVectors) return buf.Bytes(), nil } func (m *ClassifyAddDelTableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.NewTableIndex = buf.DecodeUint32() m.SkipNVectors = buf.DecodeUint32() m.MatchNVectors = buf.DecodeUint32() @@ -375,11 +365,10 @@ func (*ClassifySessionDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ClassifySessionDetails) Size() int { +func (m *ClassifySessionDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.TableID size += 4 // m.HitNextIndex @@ -390,30 +379,29 @@ func (m *ClassifySessionDetails) Size() int { return size } func (m *ClassifySessionDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.TableID)) - buf.EncodeUint32(uint32(m.HitNextIndex)) - buf.EncodeUint32(uint32(m.Advance)) - buf.EncodeUint32(uint32(m.OpaqueIndex)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableID) + buf.EncodeUint32(m.HitNextIndex) + buf.EncodeInt32(m.Advance) + buf.EncodeUint32(m.OpaqueIndex) buf.EncodeUint32(uint32(len(m.Match))) - buf.EncodeBytes(m.Match[:], 0) + buf.EncodeBytes(m.Match, 0) return buf.Bytes(), nil } func (m *ClassifySessionDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.TableID = buf.DecodeUint32() m.HitNextIndex = buf.DecodeUint32() - m.Advance = int32(buf.DecodeUint32()) + m.Advance = buf.DecodeInt32() m.OpaqueIndex = buf.DecodeUint32() m.MatchLength = buf.DecodeUint32() - copy(m.Match[:], buf.DecodeBytes(0)) + m.Match = make([]byte, m.MatchLength) + copy(m.Match, buf.DecodeBytes(len(m.Match))) return nil } @@ -429,22 +417,19 @@ func (*ClassifySessionDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ClassifySessionDump) Size() int { +func (m *ClassifySessionDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TableID return size } func (m *ClassifySessionDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) return buf.Bytes(), nil } func (m *ClassifySessionDump) Unmarshal(b []byte) error { @@ -467,26 +452,23 @@ func (*ClassifySetInterfaceIPTable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ClassifySetInterfaceIPTable) Size() int { +func (m *ClassifySetInterfaceIPTable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsIPv6 size += 4 // m.SwIfIndex size += 4 // m.TableIndex return size } func (m *ClassifySetInterfaceIPTable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsIPv6) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.TableIndex)) + buf.EncodeUint32(m.TableIndex) return buf.Bytes(), nil } func (m *ClassifySetInterfaceIPTable) Unmarshal(b []byte) error { @@ -511,27 +493,24 @@ func (*ClassifySetInterfaceIPTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ClassifySetInterfaceIPTableReply) Size() int { +func (m *ClassifySetInterfaceIPTableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ClassifySetInterfaceIPTableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ClassifySetInterfaceIPTableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -553,11 +532,10 @@ func (*ClassifySetInterfaceL2Tables) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ClassifySetInterfaceL2Tables) Size() int { +func (m *ClassifySetInterfaceL2Tables) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.IP4TableIndex size += 4 // m.IP6TableIndex @@ -566,16 +544,14 @@ func (m *ClassifySetInterfaceL2Tables) Size() int { return size } func (m *ClassifySetInterfaceL2Tables) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.IP4TableIndex)) - buf.EncodeUint32(uint32(m.IP6TableIndex)) - buf.EncodeUint32(uint32(m.OtherTableIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeUint32(m.OtherTableIndex) buf.EncodeBool(m.IsInput) return buf.Bytes(), nil } @@ -603,27 +579,24 @@ func (*ClassifySetInterfaceL2TablesReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ClassifySetInterfaceL2TablesReply) Size() int { +func (m *ClassifySetInterfaceL2TablesReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ClassifySetInterfaceL2TablesReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ClassifySetInterfaceL2TablesReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -639,21 +612,18 @@ func (*ClassifyTableByInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ClassifyTableByInterface) Size() int { +func (m *ClassifyTableByInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *ClassifyTableByInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -681,11 +651,10 @@ func (*ClassifyTableByInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ClassifyTableByInterfaceReply) Size() int { +func (m *ClassifyTableByInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex size += 4 // m.L2TableID @@ -694,22 +663,20 @@ func (m *ClassifyTableByInterfaceReply) Size() int { return size } func (m *ClassifyTableByInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.L2TableID)) - buf.EncodeUint32(uint32(m.IP4TableID)) - buf.EncodeUint32(uint32(m.IP6TableID)) + buf.EncodeUint32(m.L2TableID) + buf.EncodeUint32(m.IP4TableID) + buf.EncodeUint32(m.IP6TableID) return buf.Bytes(), nil } func (m *ClassifyTableByInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.L2TableID = buf.DecodeUint32() m.IP4TableID = buf.DecodeUint32() @@ -727,20 +694,17 @@ func (*ClassifyTableIds) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ClassifyTableIds) Size() int { +func (m *ClassifyTableIds) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ClassifyTableIds) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ClassifyTableIds) Unmarshal(b []byte) error { @@ -761,37 +725,34 @@ func (*ClassifyTableIdsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ClassifyTableIdsReply) Size() int { +func (m *ClassifyTableIdsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count size += 4 * len(m.Ids) // m.Ids return size } func (m *ClassifyTableIdsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.Ids))) for i := 0; i < len(m.Ids); i++ { var x uint32 if i < len(m.Ids) { x = uint32(m.Ids[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } func (m *ClassifyTableIdsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() m.Ids = make([]uint32, m.Count) for i := 0; i < len(m.Ids); i++ { @@ -812,22 +773,19 @@ func (*ClassifyTableInfo) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ClassifyTableInfo) Size() int { +func (m *ClassifyTableInfo) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TableID return size } func (m *ClassifyTableInfo) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) return buf.Bytes(), nil } func (m *ClassifyTableInfo) Unmarshal(b []byte) error { @@ -857,11 +815,10 @@ func (*ClassifyTableInfoReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ClassifyTableInfoReply) Size() int { +func (m *ClassifyTableInfoReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.TableID size += 4 // m.Nbuckets @@ -875,27 +832,25 @@ func (m *ClassifyTableInfoReply) Size() int { return size } func (m *ClassifyTableInfoReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.TableID)) - buf.EncodeUint32(uint32(m.Nbuckets)) - buf.EncodeUint32(uint32(m.MatchNVectors)) - buf.EncodeUint32(uint32(m.SkipNVectors)) - buf.EncodeUint32(uint32(m.ActiveSessions)) - buf.EncodeUint32(uint32(m.NextTableIndex)) - buf.EncodeUint32(uint32(m.MissNextIndex)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableID) + buf.EncodeUint32(m.Nbuckets) + buf.EncodeUint32(m.MatchNVectors) + buf.EncodeUint32(m.SkipNVectors) + buf.EncodeUint32(m.ActiveSessions) + buf.EncodeUint32(m.NextTableIndex) + buf.EncodeUint32(m.MissNextIndex) buf.EncodeUint32(uint32(len(m.Mask))) - buf.EncodeBytes(m.Mask[:], 0) + buf.EncodeBytes(m.Mask, 0) return buf.Bytes(), nil } func (m *ClassifyTableInfoReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.TableID = buf.DecodeUint32() m.Nbuckets = buf.DecodeUint32() m.MatchNVectors = buf.DecodeUint32() @@ -904,7 +859,8 @@ func (m *ClassifyTableInfoReply) Unmarshal(b []byte) error { m.NextTableIndex = buf.DecodeUint32() m.MissNextIndex = buf.DecodeUint32() m.MaskLength = buf.DecodeUint32() - copy(m.Mask[:], buf.DecodeBytes(0)) + m.Mask = make([]byte, m.MaskLength) + copy(m.Mask, buf.DecodeBytes(len(m.Mask))) return nil } @@ -921,24 +877,21 @@ func (*FlowClassifyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *FlowClassifyDetails) Size() int { +func (m *FlowClassifyDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.TableIndex return size } func (m *FlowClassifyDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.TableIndex)) + buf.EncodeUint32(m.TableIndex) return buf.Bytes(), nil } func (m *FlowClassifyDetails) Unmarshal(b []byte) error { @@ -961,22 +914,19 @@ func (*FlowClassifyDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *FlowClassifyDump) Size() int { +func (m *FlowClassifyDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Type size += 4 // m.SwIfIndex return size } func (m *FlowClassifyDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Type)) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -1003,11 +953,10 @@ func (*FlowClassifySetInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *FlowClassifySetInterface) Size() int { +func (m *FlowClassifySetInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.IP4TableIndex size += 4 // m.IP6TableIndex @@ -1015,15 +964,13 @@ func (m *FlowClassifySetInterface) Size() int { return size } func (m *FlowClassifySetInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.IP4TableIndex)) - buf.EncodeUint32(uint32(m.IP6TableIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -1050,27 +997,24 @@ func (*FlowClassifySetInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *FlowClassifySetInterfaceReply) Size() int { +func (m *FlowClassifySetInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *FlowClassifySetInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *FlowClassifySetInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1090,11 +1034,10 @@ func (*InputACLSetInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *InputACLSetInterface) Size() int { +func (m *InputACLSetInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.IP4TableIndex size += 4 // m.IP6TableIndex @@ -1103,16 +1046,14 @@ func (m *InputACLSetInterface) Size() int { return size } func (m *InputACLSetInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.IP4TableIndex)) - buf.EncodeUint32(uint32(m.IP6TableIndex)) - buf.EncodeUint32(uint32(m.L2TableIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeUint32(m.L2TableIndex) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -1138,27 +1079,24 @@ func (*InputACLSetInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *InputACLSetInterfaceReply) Size() int { +func (m *InputACLSetInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *InputACLSetInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *InputACLSetInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1178,11 +1116,10 @@ func (*OutputACLSetInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OutputACLSetInterface) Size() int { +func (m *OutputACLSetInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.IP4TableIndex size += 4 // m.IP6TableIndex @@ -1191,16 +1128,14 @@ func (m *OutputACLSetInterface) Size() int { return size } func (m *OutputACLSetInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.IP4TableIndex)) - buf.EncodeUint32(uint32(m.IP6TableIndex)) - buf.EncodeUint32(uint32(m.L2TableIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeUint32(m.L2TableIndex) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -1226,27 +1161,24 @@ func (*OutputACLSetInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OutputACLSetInterfaceReply) Size() int { +func (m *OutputACLSetInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OutputACLSetInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OutputACLSetInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1263,24 +1195,21 @@ func (*PolicerClassifyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PolicerClassifyDetails) Size() int { +func (m *PolicerClassifyDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.TableIndex return size } func (m *PolicerClassifyDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.TableIndex)) + buf.EncodeUint32(m.TableIndex) return buf.Bytes(), nil } func (m *PolicerClassifyDetails) Unmarshal(b []byte) error { @@ -1303,22 +1232,19 @@ func (*PolicerClassifyDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PolicerClassifyDump) Size() int { +func (m *PolicerClassifyDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Type size += 4 // m.SwIfIndex return size } func (m *PolicerClassifyDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Type)) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -1346,11 +1272,10 @@ func (*PolicerClassifySetInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PolicerClassifySetInterface) Size() int { +func (m *PolicerClassifySetInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.IP4TableIndex size += 4 // m.IP6TableIndex @@ -1359,16 +1284,14 @@ func (m *PolicerClassifySetInterface) Size() int { return size } func (m *PolicerClassifySetInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.IP4TableIndex)) - buf.EncodeUint32(uint32(m.IP6TableIndex)) - buf.EncodeUint32(uint32(m.L2TableIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeUint32(m.L2TableIndex) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -1396,27 +1319,24 @@ func (*PolicerClassifySetInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PolicerClassifySetInterfaceReply) Size() int { +func (m *PolicerClassifySetInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *PolicerClassifySetInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *PolicerClassifySetInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/cop/cop.ba.go b/binapi/cop/cop.ba.go index a252c9a..14f0b11 100644 --- a/binapi/cop/cop.ba.go +++ b/binapi/cop/cop.ba.go @@ -42,22 +42,19 @@ func (*CopInterfaceEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CopInterfaceEnableDisable) Size() int { +func (m *CopInterfaceEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.EnableDisable return size } func (m *CopInterfaceEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.EnableDisable) return buf.Bytes(), nil @@ -83,27 +80,24 @@ func (*CopInterfaceEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CopInterfaceEnableDisableReply) Size() int { +func (m *CopInterfaceEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *CopInterfaceEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *CopInterfaceEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -123,11 +117,10 @@ func (*CopWhitelistEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CopWhitelistEnableDisable) Size() int { +func (m *CopWhitelistEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.FibID size += 1 // m.IP4 @@ -136,14 +129,12 @@ func (m *CopWhitelistEnableDisable) Size() int { return size } func (m *CopWhitelistEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.FibID)) + buf.EncodeUint32(m.FibID) buf.EncodeBool(m.IP4) buf.EncodeBool(m.IP6) buf.EncodeBool(m.DefaultCop) @@ -173,27 +164,24 @@ func (*CopWhitelistEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CopWhitelistEnableDisableReply) Size() int { +func (m *CopWhitelistEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *CopWhitelistEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *CopWhitelistEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ct6/ct6.ba.go b/binapi/ct6/ct6.ba.go index fbcc0bc..5dc6097 100644 --- a/binapi/ct6/ct6.ba.go +++ b/binapi/ct6/ct6.ba.go @@ -43,23 +43,20 @@ func (*Ct6EnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ct6EnableDisable) Size() int { +func (m *Ct6EnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable size += 1 // m.IsInside size += 4 // m.SwIfIndex return size } func (m *Ct6EnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) buf.EncodeBool(m.IsInside) buf.EncodeUint32(uint32(m.SwIfIndex)) @@ -85,27 +82,24 @@ func (*Ct6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ct6EnableDisableReply) Size() int { +func (m *Ct6EnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ct6EnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ct6EnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/dhcp/dhcp.ba.go b/binapi/dhcp/dhcp.ba.go index cb18b48..7e0fd0b 100644 --- a/binapi/dhcp/dhcp.ba.go +++ b/binapi/dhcp/dhcp.ba.go @@ -219,21 +219,18 @@ func (*DHCP6ClientsEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCP6ClientsEnableDisable) Size() int { +func (m *DHCP6ClientsEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable return size } func (m *DHCP6ClientsEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) return buf.Bytes(), nil } @@ -257,27 +254,24 @@ func (*DHCP6ClientsEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCP6ClientsEnableDisableReply) Size() int { +func (m *DHCP6ClientsEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DHCP6ClientsEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DHCP6ClientsEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -293,27 +287,25 @@ func (*DHCP6DuidLlSet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCP6DuidLlSet) Size() int { +func (m *DHCP6DuidLlSet) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 10 // m.DuidLl return size } func (m *DHCP6DuidLlSet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeBytes(m.DuidLl[:], 10) + buf := codec.NewBuffer(b) + buf.EncodeBytes(m.DuidLl, 10) return buf.Bytes(), nil } func (m *DHCP6DuidLlSet) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - copy(m.DuidLl[:], buf.DecodeBytes(10)) + m.DuidLl = make([]byte, 10) + copy(m.DuidLl, buf.DecodeBytes(len(m.DuidLl))) return nil } @@ -329,27 +321,24 @@ func (*DHCP6DuidLlSetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCP6DuidLlSetReply) Size() int { +func (m *DHCP6DuidLlSetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DHCP6DuidLlSetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DHCP6DuidLlSetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -375,11 +364,10 @@ func (*DHCP6PdReplyEvent) GetMessageType() api.MessageType { return api.EventMessage } -func (m *DHCP6PdReplyEvent) Size() int { +func (m *DHCP6PdReplyEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PID size += 4 // m.SwIfIndex size += 4 // m.ServerIndex @@ -404,31 +392,29 @@ func (m *DHCP6PdReplyEvent) Size() int { return size } func (m *DHCP6PdReplyEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PID) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.ServerIndex)) + buf.EncodeUint32(m.ServerIndex) buf.EncodeUint32(uint32(m.MsgType)) - buf.EncodeUint32(uint32(m.T1)) - buf.EncodeUint32(uint32(m.T2)) - buf.EncodeUint16(uint16(m.InnerStatusCode)) - buf.EncodeUint16(uint16(m.StatusCode)) - buf.EncodeUint8(uint8(m.Preference)) + buf.EncodeUint32(m.T1) + buf.EncodeUint32(m.T2) + buf.EncodeUint16(m.InnerStatusCode) + buf.EncodeUint16(m.StatusCode) + buf.EncodeUint8(m.Preference) buf.EncodeUint32(uint32(len(m.Prefixes))) for j0 := 0; j0 < len(m.Prefixes); j0++ { - var v0 DHCP6PdPrefixInfo + var v0 DHCP6PdPrefixInfo // Prefixes if j0 < len(m.Prefixes) { v0 = m.Prefixes[j0] } buf.EncodeBytes(v0.Prefix.Address[:], 16) - buf.EncodeUint8(uint8(v0.Prefix.Len)) - buf.EncodeUint32(uint32(v0.ValidTime)) - buf.EncodeUint32(uint32(v0.PreferredTime)) + buf.EncodeUint8(v0.Prefix.Len) + buf.EncodeUint32(v0.ValidTime) + buf.EncodeUint32(v0.PreferredTime) } return buf.Bytes(), nil } @@ -444,7 +430,7 @@ func (m *DHCP6PdReplyEvent) Unmarshal(b []byte) error { m.StatusCode = buf.DecodeUint16() m.Preference = buf.DecodeUint8() m.NPrefixes = buf.DecodeUint32() - m.Prefixes = make([]DHCP6PdPrefixInfo, int(m.NPrefixes)) + m.Prefixes = make([]DHCP6PdPrefixInfo, m.NPrefixes) for j0 := 0; j0 < len(m.Prefixes); j0++ { copy(m.Prefixes[j0].Prefix.Address[:], buf.DecodeBytes(16)) m.Prefixes[j0].Prefix.Len = buf.DecodeUint8() @@ -477,11 +463,10 @@ func (*DHCP6PdSendClientMessage) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCP6PdSendClientMessage) Size() int { +func (m *DHCP6PdSendClientMessage) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.ServerIndex size += 4 // m.Irt @@ -507,32 +492,30 @@ func (m *DHCP6PdSendClientMessage) Size() int { return size } func (m *DHCP6PdSendClientMessage) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.ServerIndex)) - buf.EncodeUint32(uint32(m.Irt)) - buf.EncodeUint32(uint32(m.Mrt)) - buf.EncodeUint32(uint32(m.Mrc)) - buf.EncodeUint32(uint32(m.Mrd)) + buf.EncodeUint32(m.ServerIndex) + buf.EncodeUint32(m.Irt) + buf.EncodeUint32(m.Mrt) + buf.EncodeUint32(m.Mrc) + buf.EncodeUint32(m.Mrd) buf.EncodeBool(m.Stop) buf.EncodeUint32(uint32(m.MsgType)) - buf.EncodeUint32(uint32(m.T1)) - buf.EncodeUint32(uint32(m.T2)) + buf.EncodeUint32(m.T1) + buf.EncodeUint32(m.T2) buf.EncodeUint32(uint32(len(m.Prefixes))) for j0 := 0; j0 < len(m.Prefixes); j0++ { - var v0 DHCP6PdPrefixInfo + var v0 DHCP6PdPrefixInfo // Prefixes if j0 < len(m.Prefixes) { v0 = m.Prefixes[j0] } buf.EncodeBytes(v0.Prefix.Address[:], 16) - buf.EncodeUint8(uint8(v0.Prefix.Len)) - buf.EncodeUint32(uint32(v0.ValidTime)) - buf.EncodeUint32(uint32(v0.PreferredTime)) + buf.EncodeUint8(v0.Prefix.Len) + buf.EncodeUint32(v0.ValidTime) + buf.EncodeUint32(v0.PreferredTime) } return buf.Bytes(), nil } @@ -549,7 +532,7 @@ func (m *DHCP6PdSendClientMessage) Unmarshal(b []byte) error { m.T1 = buf.DecodeUint32() m.T2 = buf.DecodeUint32() m.NPrefixes = buf.DecodeUint32() - m.Prefixes = make([]DHCP6PdPrefixInfo, int(m.NPrefixes)) + m.Prefixes = make([]DHCP6PdPrefixInfo, m.NPrefixes) for j0 := 0; j0 < len(m.Prefixes); j0++ { copy(m.Prefixes[j0].Prefix.Address[:], buf.DecodeBytes(16)) m.Prefixes[j0].Prefix.Len = buf.DecodeUint8() @@ -573,27 +556,24 @@ func (*DHCP6PdSendClientMessageReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCP6PdSendClientMessageReply) Size() int { +func (m *DHCP6PdSendClientMessageReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DHCP6PdSendClientMessageReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DHCP6PdSendClientMessageReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -619,11 +599,10 @@ func (*DHCP6ReplyEvent) GetMessageType() api.MessageType { return api.EventMessage } -func (m *DHCP6ReplyEvent) Size() int { +func (m *DHCP6ReplyEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PID size += 4 // m.SwIfIndex size += 4 // m.ServerIndex @@ -647,30 +626,28 @@ func (m *DHCP6ReplyEvent) Size() int { return size } func (m *DHCP6ReplyEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PID) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.ServerIndex)) + buf.EncodeUint32(m.ServerIndex) buf.EncodeUint32(uint32(m.MsgType)) - buf.EncodeUint32(uint32(m.T1)) - buf.EncodeUint32(uint32(m.T2)) - buf.EncodeUint16(uint16(m.InnerStatusCode)) - buf.EncodeUint16(uint16(m.StatusCode)) - buf.EncodeUint8(uint8(m.Preference)) + buf.EncodeUint32(m.T1) + buf.EncodeUint32(m.T2) + buf.EncodeUint16(m.InnerStatusCode) + buf.EncodeUint16(m.StatusCode) + buf.EncodeUint8(m.Preference) buf.EncodeUint32(uint32(len(m.Addresses))) for j0 := 0; j0 < len(m.Addresses); j0++ { - var v0 DHCP6AddressInfo + var v0 DHCP6AddressInfo // Addresses if j0 < len(m.Addresses) { v0 = m.Addresses[j0] } buf.EncodeBytes(v0.Address[:], 16) - buf.EncodeUint32(uint32(v0.ValidTime)) - buf.EncodeUint32(uint32(v0.PreferredTime)) + buf.EncodeUint32(v0.ValidTime) + buf.EncodeUint32(v0.PreferredTime) } return buf.Bytes(), nil } @@ -686,7 +663,7 @@ func (m *DHCP6ReplyEvent) Unmarshal(b []byte) error { m.StatusCode = buf.DecodeUint16() m.Preference = buf.DecodeUint8() m.NAddresses = buf.DecodeUint32() - m.Addresses = make([]DHCP6AddressInfo, int(m.NAddresses)) + m.Addresses = make([]DHCP6AddressInfo, m.NAddresses) for j0 := 0; j0 < len(m.Addresses); j0++ { copy(m.Addresses[j0].Address[:], buf.DecodeBytes(16)) m.Addresses[j0].ValidTime = buf.DecodeUint32() @@ -718,11 +695,10 @@ func (*DHCP6SendClientMessage) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCP6SendClientMessage) Size() int { +func (m *DHCP6SendClientMessage) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.ServerIndex size += 4 // m.Irt @@ -747,31 +723,29 @@ func (m *DHCP6SendClientMessage) Size() int { return size } func (m *DHCP6SendClientMessage) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.ServerIndex)) - buf.EncodeUint32(uint32(m.Irt)) - buf.EncodeUint32(uint32(m.Mrt)) - buf.EncodeUint32(uint32(m.Mrc)) - buf.EncodeUint32(uint32(m.Mrd)) + buf.EncodeUint32(m.ServerIndex) + buf.EncodeUint32(m.Irt) + buf.EncodeUint32(m.Mrt) + buf.EncodeUint32(m.Mrc) + buf.EncodeUint32(m.Mrd) buf.EncodeBool(m.Stop) buf.EncodeUint32(uint32(m.MsgType)) - buf.EncodeUint32(uint32(m.T1)) - buf.EncodeUint32(uint32(m.T2)) + buf.EncodeUint32(m.T1) + buf.EncodeUint32(m.T2) buf.EncodeUint32(uint32(len(m.Addresses))) for j0 := 0; j0 < len(m.Addresses); j0++ { - var v0 DHCP6AddressInfo + var v0 DHCP6AddressInfo // Addresses if j0 < len(m.Addresses) { v0 = m.Addresses[j0] } buf.EncodeBytes(v0.Address[:], 16) - buf.EncodeUint32(uint32(v0.ValidTime)) - buf.EncodeUint32(uint32(v0.PreferredTime)) + buf.EncodeUint32(v0.ValidTime) + buf.EncodeUint32(v0.PreferredTime) } return buf.Bytes(), nil } @@ -788,7 +762,7 @@ func (m *DHCP6SendClientMessage) Unmarshal(b []byte) error { m.T1 = buf.DecodeUint32() m.T2 = buf.DecodeUint32() m.NAddresses = buf.DecodeUint32() - m.Addresses = make([]DHCP6AddressInfo, int(m.NAddresses)) + m.Addresses = make([]DHCP6AddressInfo, m.NAddresses) for j0 := 0; j0 < len(m.Addresses); j0++ { copy(m.Addresses[j0].Address[:], buf.DecodeBytes(16)) m.Addresses[j0].ValidTime = buf.DecodeUint32() @@ -809,27 +783,24 @@ func (*DHCP6SendClientMessageReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCP6SendClientMessageReply) Size() int { +func (m *DHCP6SendClientMessageReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DHCP6SendClientMessageReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DHCP6SendClientMessageReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -846,11 +817,10 @@ func (*DHCPClientConfig) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCPClientConfig) Size() int { +func (m *DHCPClientConfig) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Client.SwIfIndex size += 64 // m.Client.Hostname @@ -862,20 +832,18 @@ func (m *DHCPClientConfig) Size() int { return size } func (m *DHCPClientConfig) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.Client.SwIfIndex)) buf.EncodeString(m.Client.Hostname, 64) - buf.EncodeBytes(m.Client.ID[:], 64) + buf.EncodeBytes(m.Client.ID, 64) buf.EncodeBool(m.Client.WantDHCPEvent) buf.EncodeBool(m.Client.SetBroadcastFlag) buf.EncodeUint8(uint8(m.Client.Dscp)) - buf.EncodeUint32(uint32(m.Client.PID)) + buf.EncodeUint32(m.Client.PID) return buf.Bytes(), nil } func (m *DHCPClientConfig) Unmarshal(b []byte) error { @@ -883,7 +851,8 @@ func (m *DHCPClientConfig) Unmarshal(b []byte) error { m.IsAdd = buf.DecodeBool() m.Client.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Client.Hostname = buf.DecodeString(64) - copy(m.Client.ID[:], buf.DecodeBytes(64)) + m.Client.ID = make([]byte, 64) + copy(m.Client.ID, buf.DecodeBytes(len(m.Client.ID))) m.Client.WantDHCPEvent = buf.DecodeBool() m.Client.SetBroadcastFlag = buf.DecodeBool() m.Client.Dscp = ip_types.IPDscp(buf.DecodeUint8()) @@ -903,27 +872,24 @@ func (*DHCPClientConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCPClientConfigReply) Size() int { +func (m *DHCPClientConfigReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DHCPClientConfigReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DHCPClientConfigReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -940,11 +906,10 @@ func (*DHCPClientDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCPClientDetails) Size() int { +func (m *DHCPClientDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Client.SwIfIndex size += 64 // m.Client.Hostname size += 1 * 64 // m.Client.ID @@ -975,37 +940,35 @@ func (m *DHCPClientDetails) Size() int { return size } func (m *DHCPClientDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Client.SwIfIndex)) buf.EncodeString(m.Client.Hostname, 64) - buf.EncodeBytes(m.Client.ID[:], 64) + buf.EncodeBytes(m.Client.ID, 64) buf.EncodeBool(m.Client.WantDHCPEvent) buf.EncodeBool(m.Client.SetBroadcastFlag) buf.EncodeUint8(uint8(m.Client.Dscp)) - buf.EncodeUint32(uint32(m.Client.PID)) + buf.EncodeUint32(m.Client.PID) buf.EncodeUint32(uint32(m.Lease.SwIfIndex)) buf.EncodeUint32(uint32(m.Lease.State)) buf.EncodeBool(m.Lease.IsIPv6) buf.EncodeString(m.Lease.Hostname, 64) - buf.EncodeUint8(uint8(m.Lease.MaskWidth)) + buf.EncodeUint8(m.Lease.MaskWidth) buf.EncodeUint8(uint8(m.Lease.HostAddress.Af)) - buf.EncodeBytes(m.Lease.HostAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Lease.HostAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Lease.RouterAddress.Af)) - buf.EncodeBytes(m.Lease.RouterAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Lease.RouterAddress.Un.XXX_UnionData[:], 16) buf.EncodeBytes(m.Lease.HostMac[:], 6) buf.EncodeUint8(uint8(len(m.Lease.DomainServer))) for j1 := 0; j1 < len(m.Lease.DomainServer); j1++ { - var v1 DomainServer + var v1 DomainServer // DomainServer if j1 < len(m.Lease.DomainServer) { v1 = m.Lease.DomainServer[j1] } buf.EncodeUint8(uint8(v1.Address.Af)) - buf.EncodeBytes(v1.Address.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v1.Address.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -1013,7 +976,8 @@ func (m *DHCPClientDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Client.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Client.Hostname = buf.DecodeString(64) - copy(m.Client.ID[:], buf.DecodeBytes(64)) + m.Client.ID = make([]byte, 64) + copy(m.Client.ID, buf.DecodeBytes(len(m.Client.ID))) m.Client.WantDHCPEvent = buf.DecodeBool() m.Client.SetBroadcastFlag = buf.DecodeBool() m.Client.Dscp = ip_types.IPDscp(buf.DecodeUint8()) @@ -1029,7 +993,7 @@ func (m *DHCPClientDetails) Unmarshal(b []byte) error { copy(m.Lease.RouterAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) copy(m.Lease.HostMac[:], buf.DecodeBytes(6)) m.Lease.Count = buf.DecodeUint8() - m.Lease.DomainServer = make([]DomainServer, int(m.Lease.Count)) + m.Lease.DomainServer = make([]DomainServer, m.Lease.Count) for j1 := 0; j1 < len(m.Lease.DomainServer); j1++ { m.Lease.DomainServer[j1].Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Lease.DomainServer[j1].Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -1047,20 +1011,17 @@ func (*DHCPClientDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCPClientDump) Size() int { +func (m *DHCPClientDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *DHCPClientDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *DHCPClientDump) Unmarshal(b []byte) error { @@ -1080,11 +1041,10 @@ func (*DHCPComplEvent) GetMessageType() api.MessageType { return api.EventMessage } -func (m *DHCPComplEvent) Size() int { +func (m *DHCPComplEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PID size += 4 // m.Lease.SwIfIndex size += 4 // m.Lease.State @@ -1109,31 +1069,29 @@ func (m *DHCPComplEvent) Size() int { return size } func (m *DHCPComplEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PID) buf.EncodeUint32(uint32(m.Lease.SwIfIndex)) buf.EncodeUint32(uint32(m.Lease.State)) buf.EncodeBool(m.Lease.IsIPv6) buf.EncodeString(m.Lease.Hostname, 64) - buf.EncodeUint8(uint8(m.Lease.MaskWidth)) + buf.EncodeUint8(m.Lease.MaskWidth) buf.EncodeUint8(uint8(m.Lease.HostAddress.Af)) - buf.EncodeBytes(m.Lease.HostAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Lease.HostAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Lease.RouterAddress.Af)) - buf.EncodeBytes(m.Lease.RouterAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Lease.RouterAddress.Un.XXX_UnionData[:], 16) buf.EncodeBytes(m.Lease.HostMac[:], 6) buf.EncodeUint8(uint8(len(m.Lease.DomainServer))) for j1 := 0; j1 < len(m.Lease.DomainServer); j1++ { - var v1 DomainServer + var v1 DomainServer // DomainServer if j1 < len(m.Lease.DomainServer) { v1 = m.Lease.DomainServer[j1] } buf.EncodeUint8(uint8(v1.Address.Af)) - buf.EncodeBytes(v1.Address.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v1.Address.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -1151,7 +1109,7 @@ func (m *DHCPComplEvent) Unmarshal(b []byte) error { copy(m.Lease.RouterAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) copy(m.Lease.HostMac[:], buf.DecodeBytes(6)) m.Lease.Count = buf.DecodeUint8() - m.Lease.DomainServer = make([]DomainServer, int(m.Lease.Count)) + m.Lease.DomainServer = make([]DomainServer, m.Lease.Count) for j1 := 0; j1 < len(m.Lease.DomainServer); j1++ { m.Lease.DomainServer[j1].Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Lease.DomainServer[j1].Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -1169,20 +1127,17 @@ func (*DHCPPluginControlPing) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCPPluginControlPing) Size() int { +func (m *DHCPPluginControlPing) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *DHCPPluginControlPing) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *DHCPPluginControlPing) Unmarshal(b []byte) error { @@ -1203,31 +1158,28 @@ func (*DHCPPluginControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCPPluginControlPingReply) Size() int { +func (m *DHCPPluginControlPingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.ClientIndex size += 4 // m.VpePID return size } func (m *DHCPPluginControlPingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.ClientIndex)) - buf.EncodeUint32(uint32(m.VpePID)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ClientIndex) + buf.EncodeUint32(m.VpePID) return buf.Bytes(), nil } func (m *DHCPPluginControlPingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ClientIndex = buf.DecodeUint32() m.VpePID = buf.DecodeUint32() return nil @@ -1243,20 +1195,17 @@ func (*DHCPPluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCPPluginGetVersion) Size() int { +func (m *DHCPPluginGetVersion) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *DHCPPluginGetVersion) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *DHCPPluginGetVersion) Unmarshal(b []byte) error { @@ -1276,24 +1225,21 @@ func (*DHCPPluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCPPluginGetVersionReply) Size() int { +func (m *DHCPPluginGetVersionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Major size += 4 // m.Minor return size } func (m *DHCPPluginGetVersionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Major)) - buf.EncodeUint32(uint32(m.Minor)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Major) + buf.EncodeUint32(m.Minor) return buf.Bytes(), nil } func (m *DHCPPluginGetVersionReply) Unmarshal(b []byte) error { @@ -1319,11 +1265,10 @@ func (*DHCPProxyConfig) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCPProxyConfig) Size() int { +func (m *DHCPProxyConfig) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.RxVrfID size += 4 // m.ServerVrfID size += 1 // m.IsAdd @@ -1334,19 +1279,17 @@ func (m *DHCPProxyConfig) Size() int { return size } func (m *DHCPProxyConfig) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.RxVrfID)) - buf.EncodeUint32(uint32(m.ServerVrfID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.RxVrfID) + buf.EncodeUint32(m.ServerVrfID) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.DHCPServer.Af)) - buf.EncodeBytes(m.DHCPServer.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DHCPServer.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.DHCPSrcAddress.Af)) - buf.EncodeBytes(m.DHCPSrcAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DHCPSrcAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *DHCPProxyConfig) Unmarshal(b []byte) error { @@ -1373,27 +1316,24 @@ func (*DHCPProxyConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCPProxyConfigReply) Size() int { +func (m *DHCPProxyConfigReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DHCPProxyConfigReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DHCPProxyConfigReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1417,11 +1357,10 @@ func (*DHCPProxyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCPProxyDetails) Size() int { +func (m *DHCPProxyDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.RxVrfID size += 4 // m.VssOui size += 4 // m.VssFibID @@ -1444,29 +1383,27 @@ func (m *DHCPProxyDetails) Size() int { return size } func (m *DHCPProxyDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.RxVrfID)) - buf.EncodeUint32(uint32(m.VssOui)) - buf.EncodeUint32(uint32(m.VssFibID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.RxVrfID) + buf.EncodeUint32(m.VssOui) + buf.EncodeUint32(m.VssFibID) buf.EncodeUint32(uint32(m.VssType)) buf.EncodeBool(m.IsIPv6) buf.EncodeString(m.VssVPNAsciiID, 129) buf.EncodeUint8(uint8(m.DHCPSrcAddress.Af)) - buf.EncodeBytes(m.DHCPSrcAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DHCPSrcAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(len(m.Servers))) for j0 := 0; j0 < len(m.Servers); j0++ { - var v0 DHCPServer + var v0 DHCPServer // Servers if j0 < len(m.Servers) { v0 = m.Servers[j0] } - buf.EncodeUint32(uint32(v0.ServerVrfID)) + buf.EncodeUint32(v0.ServerVrfID) buf.EncodeUint8(uint8(v0.DHCPServer.Af)) - buf.EncodeBytes(v0.DHCPServer.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.DHCPServer.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -1481,7 +1418,7 @@ func (m *DHCPProxyDetails) Unmarshal(b []byte) error { m.DHCPSrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.DHCPSrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Count = buf.DecodeUint8() - m.Servers = make([]DHCPServer, int(m.Count)) + m.Servers = make([]DHCPServer, m.Count) for j0 := 0; j0 < len(m.Servers); j0++ { m.Servers[j0].ServerVrfID = buf.DecodeUint32() m.Servers[j0].DHCPServer.Af = ip_types.AddressFamily(buf.DecodeUint8()) @@ -1502,21 +1439,18 @@ func (*DHCPProxyDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCPProxyDump) Size() int { +func (m *DHCPProxyDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsIP6 return size } func (m *DHCPProxyDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsIP6) return buf.Bytes(), nil } @@ -1544,11 +1478,10 @@ func (*DHCPProxySetVss) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCPProxySetVss) Size() int { +func (m *DHCPProxySetVss) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TblID size += 4 // m.VssType size += 129 // m.VPNAsciiID @@ -1559,17 +1492,15 @@ func (m *DHCPProxySetVss) Size() int { return size } func (m *DHCPProxySetVss) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.TblID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TblID) buf.EncodeUint32(uint32(m.VssType)) buf.EncodeString(m.VPNAsciiID, 129) - buf.EncodeUint32(uint32(m.Oui)) - buf.EncodeUint32(uint32(m.VPNIndex)) + buf.EncodeUint32(m.Oui) + buf.EncodeUint32(m.VPNIndex) buf.EncodeBool(m.IsIPv6) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil @@ -1598,27 +1529,24 @@ func (*DHCPProxySetVssReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCPProxySetVssReply) Size() int { +func (m *DHCPProxySetVssReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DHCPProxySetVssReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DHCPProxySetVssReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1635,24 +1563,21 @@ func (*WantDHCP6PdReplyEvents) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *WantDHCP6PdReplyEvents) Size() int { +func (m *WantDHCP6PdReplyEvents) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable size += 4 // m.PID return size } func (m *WantDHCP6PdReplyEvents) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) - buf.EncodeUint32(uint32(m.PID)) + buf.EncodeUint32(m.PID) return buf.Bytes(), nil } func (m *WantDHCP6PdReplyEvents) Unmarshal(b []byte) error { @@ -1676,27 +1601,24 @@ func (*WantDHCP6PdReplyEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *WantDHCP6PdReplyEventsReply) Size() int { +func (m *WantDHCP6PdReplyEventsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *WantDHCP6PdReplyEventsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *WantDHCP6PdReplyEventsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1713,24 +1635,21 @@ func (*WantDHCP6ReplyEvents) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *WantDHCP6ReplyEvents) Size() int { +func (m *WantDHCP6ReplyEvents) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable size += 4 // m.PID return size } func (m *WantDHCP6ReplyEvents) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.EnableDisable)) - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.EnableDisable) + buf.EncodeUint32(m.PID) return buf.Bytes(), nil } func (m *WantDHCP6ReplyEvents) Unmarshal(b []byte) error { @@ -1752,27 +1671,24 @@ func (*WantDHCP6ReplyEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *WantDHCP6ReplyEventsReply) Size() int { +func (m *WantDHCP6ReplyEventsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *WantDHCP6ReplyEventsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *WantDHCP6ReplyEventsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go b/binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go index 41ea756..4fcb012 100644 --- a/binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go +++ b/binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go @@ -42,22 +42,19 @@ func (*DHCP6ClientEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCP6ClientEnableDisable) Size() int { +func (m *DHCP6ClientEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Enable return size } func (m *DHCP6ClientEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) return buf.Bytes(), nil @@ -83,27 +80,24 @@ func (*DHCP6ClientEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCP6ClientEnableDisableReply) Size() int { +func (m *DHCP6ClientEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DHCP6ClientEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DHCP6ClientEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go b/binapi/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go index 73e7fad..7e4e2bb 100644 --- a/binapi/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go +++ b/binapi/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go @@ -44,23 +44,20 @@ func (*DHCP6PdClientEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DHCP6PdClientEnableDisable) Size() int { +func (m *DHCP6PdClientEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 64 // m.PrefixGroup size += 1 // m.Enable return size } func (m *DHCP6PdClientEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeString(m.PrefixGroup, 64) buf.EncodeBool(m.Enable) @@ -88,27 +85,24 @@ func (*DHCP6PdClientEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DHCP6PdClientEnableDisableReply) Size() int { +func (m *DHCP6PdClientEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DHCP6PdClientEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DHCP6PdClientEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -129,11 +123,10 @@ func (*IP6AddDelAddressUsingPrefix) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IP6AddDelAddressUsingPrefix) Size() int { +func (m *IP6AddDelAddressUsingPrefix) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 64 // m.PrefixGroup size += 1 * 16 // m.AddressWithPrefix.Address @@ -142,16 +135,14 @@ func (m *IP6AddDelAddressUsingPrefix) Size() int { return size } func (m *IP6AddDelAddressUsingPrefix) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeString(m.PrefixGroup, 64) buf.EncodeBytes(m.AddressWithPrefix.Address[:], 16) - buf.EncodeUint8(uint8(m.AddressWithPrefix.Len)) + buf.EncodeUint8(m.AddressWithPrefix.Len) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -179,27 +170,24 @@ func (*IP6AddDelAddressUsingPrefixReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IP6AddDelAddressUsingPrefixReply) Size() int { +func (m *IP6AddDelAddressUsingPrefixReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IP6AddDelAddressUsingPrefixReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IP6AddDelAddressUsingPrefixReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/dns/dns.ba.go b/binapi/dns/dns.ba.go index 25c8ddf..fc2324c 100644 --- a/binapi/dns/dns.ba.go +++ b/binapi/dns/dns.ba.go @@ -40,22 +40,19 @@ func (*DNSEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DNSEnableDisable) Size() int { +func (m *DNSEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable return size } func (m *DNSEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Enable)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Enable) return buf.Bytes(), nil } func (m *DNSEnableDisable) Unmarshal(b []byte) error { @@ -76,27 +73,24 @@ func (*DNSEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DNSEnableDisableReply) Size() int { +func (m *DNSEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DNSEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DNSEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -114,33 +108,31 @@ func (*DNSNameServerAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DNSNameServerAddDel) Size() int { +func (m *DNSNameServerAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsIP6 size += 1 // m.IsAdd size += 1 * 16 // m.ServerAddress return size } func (m *DNSNameServerAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.IsIP6)) - buf.EncodeUint8(uint8(m.IsAdd)) - buf.EncodeBytes(m.ServerAddress[:], 16) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.IsIP6) + buf.EncodeUint8(m.IsAdd) + buf.EncodeBytes(m.ServerAddress, 16) return buf.Bytes(), nil } func (m *DNSNameServerAddDel) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.IsIP6 = buf.DecodeUint8() m.IsAdd = buf.DecodeUint8() - copy(m.ServerAddress[:], buf.DecodeBytes(16)) + m.ServerAddress = make([]byte, 16) + copy(m.ServerAddress, buf.DecodeBytes(len(m.ServerAddress))) return nil } @@ -156,27 +148,24 @@ func (*DNSNameServerAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DNSNameServerAddDelReply) Size() int { +func (m *DNSNameServerAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DNSNameServerAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DNSNameServerAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -193,30 +182,28 @@ func (*DNSResolveIP) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DNSResolveIP) Size() int { +func (m *DNSResolveIP) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsIP6 size += 1 * 16 // m.Address return size } func (m *DNSResolveIP) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.IsIP6)) - buf.EncodeBytes(m.Address[:], 16) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.IsIP6) + buf.EncodeBytes(m.Address, 16) return buf.Bytes(), nil } func (m *DNSResolveIP) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.IsIP6 = buf.DecodeUint8() - copy(m.Address[:], buf.DecodeBytes(16)) + m.Address = make([]byte, 16) + copy(m.Address, buf.DecodeBytes(len(m.Address))) return nil } @@ -233,30 +220,28 @@ func (*DNSResolveIPReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DNSResolveIPReply) Size() int { +func (m *DNSResolveIPReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 * 256 // m.Name return size } func (m *DNSResolveIPReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeBytes(m.Name[:], 256) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeBytes(m.Name, 256) return buf.Bytes(), nil } func (m *DNSResolveIPReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) - copy(m.Name[:], buf.DecodeBytes(256)) + m.Retval = buf.DecodeInt32() + m.Name = make([]byte, 256) + copy(m.Name, buf.DecodeBytes(len(m.Name))) return nil } @@ -272,27 +257,25 @@ func (*DNSResolveName) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DNSResolveName) Size() int { +func (m *DNSResolveName) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 256 // m.Name return size } func (m *DNSResolveName) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeBytes(m.Name[:], 256) + buf := codec.NewBuffer(b) + buf.EncodeBytes(m.Name, 256) return buf.Bytes(), nil } func (m *DNSResolveName) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - copy(m.Name[:], buf.DecodeBytes(256)) + m.Name = make([]byte, 256) + copy(m.Name, buf.DecodeBytes(len(m.Name))) return nil } @@ -312,11 +295,10 @@ func (*DNSResolveNameReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DNSResolveNameReply) Size() int { +func (m *DNSResolveNameReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IP4Set size += 1 // m.IP6Set @@ -325,26 +307,26 @@ func (m *DNSResolveNameReply) Size() int { return size } func (m *DNSResolveNameReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint8(uint8(m.IP4Set)) - buf.EncodeUint8(uint8(m.IP6Set)) - buf.EncodeBytes(m.IP4Address[:], 4) - buf.EncodeBytes(m.IP6Address[:], 16) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint8(m.IP4Set) + buf.EncodeUint8(m.IP6Set) + buf.EncodeBytes(m.IP4Address, 4) + buf.EncodeBytes(m.IP6Address, 16) return buf.Bytes(), nil } func (m *DNSResolveNameReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IP4Set = buf.DecodeUint8() m.IP6Set = buf.DecodeUint8() - copy(m.IP4Address[:], buf.DecodeBytes(4)) - copy(m.IP6Address[:], buf.DecodeBytes(16)) + m.IP4Address = make([]byte, 4) + copy(m.IP4Address, buf.DecodeBytes(len(m.IP4Address))) + m.IP6Address = make([]byte, 16) + copy(m.IP6Address, buf.DecodeBytes(len(m.IP6Address))) return nil } diff --git a/binapi/dslite/dslite.ba.go b/binapi/dslite/dslite.ba.go index b7aff21..efcf240 100644 --- a/binapi/dslite/dslite.ba.go +++ b/binapi/dslite/dslite.ba.go @@ -44,23 +44,20 @@ func (*DsliteAddDelPoolAddrRange) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DsliteAddDelPoolAddrRange) Size() int { +func (m *DsliteAddDelPoolAddrRange) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.StartAddr size += 1 * 4 // m.EndAddr size += 1 // m.IsAdd return size } func (m *DsliteAddDelPoolAddrRange) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.StartAddr[:], 4) buf.EncodeBytes(m.EndAddr[:], 4) buf.EncodeBool(m.IsAdd) @@ -88,27 +85,24 @@ func (*DsliteAddDelPoolAddrRangeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DsliteAddDelPoolAddrRangeReply) Size() int { +func (m *DsliteAddDelPoolAddrRangeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DsliteAddDelPoolAddrRangeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DsliteAddDelPoolAddrRangeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -124,21 +118,18 @@ func (*DsliteAddressDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DsliteAddressDetails) Size() int { +func (m *DsliteAddressDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IPAddress return size } func (m *DsliteAddressDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IPAddress[:], 4) return buf.Bytes(), nil } @@ -158,20 +149,17 @@ func (*DsliteAddressDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DsliteAddressDump) Size() int { +func (m *DsliteAddressDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *DsliteAddressDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *DsliteAddressDump) Unmarshal(b []byte) error { @@ -188,20 +176,17 @@ func (*DsliteGetAftrAddr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DsliteGetAftrAddr) Size() int { +func (m *DsliteGetAftrAddr) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *DsliteGetAftrAddr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *DsliteGetAftrAddr) Unmarshal(b []byte) error { @@ -222,31 +207,28 @@ func (*DsliteGetAftrAddrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DsliteGetAftrAddrReply) Size() int { +func (m *DsliteGetAftrAddrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 * 4 // m.IP4Addr size += 1 * 16 // m.IP6Addr return size } func (m *DsliteGetAftrAddrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBytes(m.IP4Addr[:], 4) buf.EncodeBytes(m.IP6Addr[:], 16) return buf.Bytes(), nil } func (m *DsliteGetAftrAddrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() copy(m.IP4Addr[:], buf.DecodeBytes(4)) copy(m.IP6Addr[:], buf.DecodeBytes(16)) return nil @@ -262,20 +244,17 @@ func (*DsliteGetB4Addr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DsliteGetB4Addr) Size() int { +func (m *DsliteGetB4Addr) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *DsliteGetB4Addr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *DsliteGetB4Addr) Unmarshal(b []byte) error { @@ -296,31 +275,28 @@ func (*DsliteGetB4AddrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DsliteGetB4AddrReply) Size() int { +func (m *DsliteGetB4AddrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 * 4 // m.IP4Addr size += 1 * 16 // m.IP6Addr return size } func (m *DsliteGetB4AddrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBytes(m.IP4Addr[:], 4) buf.EncodeBytes(m.IP6Addr[:], 16) return buf.Bytes(), nil } func (m *DsliteGetB4AddrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() copy(m.IP4Addr[:], buf.DecodeBytes(4)) copy(m.IP6Addr[:], buf.DecodeBytes(16)) return nil @@ -339,22 +315,19 @@ func (*DsliteSetAftrAddr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DsliteSetAftrAddr) Size() int { +func (m *DsliteSetAftrAddr) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IP4Addr size += 1 * 16 // m.IP6Addr return size } func (m *DsliteSetAftrAddr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IP4Addr[:], 4) buf.EncodeBytes(m.IP6Addr[:], 16) return buf.Bytes(), nil @@ -378,27 +351,24 @@ func (*DsliteSetAftrAddrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DsliteSetAftrAddrReply) Size() int { +func (m *DsliteSetAftrAddrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DsliteSetAftrAddrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DsliteSetAftrAddrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -415,22 +385,19 @@ func (*DsliteSetB4Addr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DsliteSetB4Addr) Size() int { +func (m *DsliteSetB4Addr) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IP4Addr size += 1 * 16 // m.IP6Addr return size } func (m *DsliteSetB4Addr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IP4Addr[:], 4) buf.EncodeBytes(m.IP6Addr[:], 16) return buf.Bytes(), nil @@ -454,27 +421,24 @@ func (*DsliteSetB4AddrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DsliteSetB4AddrReply) Size() int { +func (m *DsliteSetB4AddrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DsliteSetB4AddrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DsliteSetB4AddrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/feature/feature.ba.go b/binapi/feature/feature.ba.go index 4d16ce8..cc54364 100644 --- a/binapi/feature/feature.ba.go +++ b/binapi/feature/feature.ba.go @@ -44,11 +44,10 @@ func (*FeatureEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *FeatureEnableDisable) Size() int { +func (m *FeatureEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Enable size += 64 // m.ArcName @@ -56,12 +55,10 @@ func (m *FeatureEnableDisable) Size() int { return size } func (m *FeatureEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) buf.EncodeString(m.ArcName, 64) @@ -89,27 +86,24 @@ func (*FeatureEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *FeatureEnableDisableReply) Size() int { +func (m *FeatureEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *FeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *FeatureEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/flowprobe/flowprobe.ba.go b/binapi/flowprobe/flowprobe.ba.go index c7073f2..a08f7d0 100644 --- a/binapi/flowprobe/flowprobe.ba.go +++ b/binapi/flowprobe/flowprobe.ba.go @@ -143,26 +143,23 @@ func (*FlowprobeParams) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *FlowprobeParams) Size() int { +func (m *FlowprobeParams) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.RecordFlags size += 4 // m.ActiveTimer size += 4 // m.PassiveTimer return size } func (m *FlowprobeParams) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.RecordFlags)) - buf.EncodeUint32(uint32(m.ActiveTimer)) - buf.EncodeUint32(uint32(m.PassiveTimer)) + buf.EncodeUint32(m.ActiveTimer) + buf.EncodeUint32(m.PassiveTimer) return buf.Bytes(), nil } func (m *FlowprobeParams) Unmarshal(b []byte) error { @@ -185,27 +182,24 @@ func (*FlowprobeParamsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *FlowprobeParamsReply) Size() int { +func (m *FlowprobeParamsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *FlowprobeParamsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *FlowprobeParamsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -223,23 +217,20 @@ func (*FlowprobeTxInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *FlowprobeTxInterfaceAddDel) Size() int { +func (m *FlowprobeTxInterfaceAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Which size += 4 // m.SwIfIndex return size } func (m *FlowprobeTxInterfaceAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Which)) buf.EncodeUint32(uint32(m.SwIfIndex)) @@ -267,27 +258,24 @@ func (*FlowprobeTxInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *FlowprobeTxInterfaceAddDelReply) Size() int { +func (m *FlowprobeTxInterfaceAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *FlowprobeTxInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *FlowprobeTxInterfaceAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/gbp/gbp.ba.go b/binapi/gbp/gbp.ba.go index 5baa4f5..a203527 100644 --- a/binapi/gbp/gbp.ba.go +++ b/binapi/gbp/gbp.ba.go @@ -446,11 +446,10 @@ func (*GbpBridgeDomainAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpBridgeDomainAdd) Size() int { +func (m *GbpBridgeDomainAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Bd.BdID size += 4 // m.Bd.RdID size += 4 // m.Bd.Flags @@ -460,14 +459,12 @@ func (m *GbpBridgeDomainAdd) Size() int { return size } func (m *GbpBridgeDomainAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Bd.BdID)) - buf.EncodeUint32(uint32(m.Bd.RdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Bd.BdID) + buf.EncodeUint32(m.Bd.RdID) buf.EncodeUint32(uint32(m.Bd.Flags)) buf.EncodeUint32(uint32(m.Bd.BviSwIfIndex)) buf.EncodeUint32(uint32(m.Bd.UuFwdSwIfIndex)) @@ -497,27 +494,24 @@ func (*GbpBridgeDomainAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpBridgeDomainAddReply) Size() int { +func (m *GbpBridgeDomainAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpBridgeDomainAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpBridgeDomainAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -533,22 +527,19 @@ func (*GbpBridgeDomainDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpBridgeDomainDel) Size() int { +func (m *GbpBridgeDomainDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID return size } func (m *GbpBridgeDomainDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) return buf.Bytes(), nil } func (m *GbpBridgeDomainDel) Unmarshal(b []byte) error { @@ -569,27 +560,24 @@ func (*GbpBridgeDomainDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpBridgeDomainDelReply) Size() int { +func (m *GbpBridgeDomainDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpBridgeDomainDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpBridgeDomainDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -605,11 +593,10 @@ func (*GbpBridgeDomainDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpBridgeDomainDetails) Size() int { +func (m *GbpBridgeDomainDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Bd.BdID size += 4 // m.Bd.RdID size += 4 // m.Bd.Flags @@ -619,14 +606,12 @@ func (m *GbpBridgeDomainDetails) Size() int { return size } func (m *GbpBridgeDomainDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Bd.BdID)) - buf.EncodeUint32(uint32(m.Bd.RdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Bd.BdID) + buf.EncodeUint32(m.Bd.RdID) buf.EncodeUint32(uint32(m.Bd.Flags)) buf.EncodeUint32(uint32(m.Bd.BviSwIfIndex)) buf.EncodeUint32(uint32(m.Bd.UuFwdSwIfIndex)) @@ -654,20 +639,17 @@ func (*GbpBridgeDomainDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpBridgeDomainDump) Size() int { +func (m *GbpBridgeDomainDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GbpBridgeDomainDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GbpBridgeDomainDump) Unmarshal(b []byte) error { @@ -686,27 +668,24 @@ func (*GbpBridgeDomainDumpReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpBridgeDomainDumpReply) Size() int { +func (m *GbpBridgeDomainDumpReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpBridgeDomainDumpReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpBridgeDomainDumpReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -723,11 +702,10 @@ func (*GbpContractAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpContractAddDel) Size() int { +func (m *GbpContractAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 2 // m.Contract.Scope size += 2 // m.Contract.Sclass @@ -746,59 +724,48 @@ func (m *GbpContractAddDel) Size() int { size += 4 // s2.NhSet.HashMode size += 1 // s2.NhSet.NNhs for j4 := 0; j4 < 8; j4++ { - var s4 GbpNextHop - _ = s4 - if j4 < len(s2.NhSet.Nhs) { - s4 = s2.NhSet.Nhs[j4] - } - size += 1 // s4.IP.Af - size += 1 * 16 // s4.IP.Un - size += 1 * 6 // s4.Mac - size += 4 // s4.BdID - size += 4 // s4.RdID + size += 1 // s2.NhSet.Nhs[j4].IP.Af + size += 1 * 16 // s2.NhSet.Nhs[j4].IP.Un + size += 1 * 6 // s2.NhSet.Nhs[j4].Mac + size += 4 // s2.NhSet.Nhs[j4].BdID + size += 4 // s2.NhSet.Nhs[j4].RdID } } return size } func (m *GbpContractAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint16(uint16(m.Contract.Scope)) - buf.EncodeUint16(uint16(m.Contract.Sclass)) - buf.EncodeUint16(uint16(m.Contract.Dclass)) - buf.EncodeUint32(uint32(m.Contract.ACLIndex)) - buf.EncodeUint8(uint8(m.Contract.NEtherTypes)) + buf.EncodeUint16(m.Contract.Sclass) + buf.EncodeUint16(m.Contract.Dclass) + buf.EncodeUint32(m.Contract.ACLIndex) + buf.EncodeUint8(m.Contract.NEtherTypes) for i := 0; i < 16; i++ { var x uint16 if i < len(m.Contract.AllowedEthertypes) { x = uint16(m.Contract.AllowedEthertypes[i]) } - buf.EncodeUint16(uint16(x)) + buf.EncodeUint16(x) } buf.EncodeUint8(uint8(len(m.Contract.Rules))) for j1 := 0; j1 < len(m.Contract.Rules); j1++ { - var v1 GbpRule + var v1 GbpRule // Rules if j1 < len(m.Contract.Rules) { v1 = m.Contract.Rules[j1] } buf.EncodeUint32(uint32(v1.Action)) buf.EncodeUint32(uint32(v1.NhSet.HashMode)) - buf.EncodeUint8(uint8(v1.NhSet.NNhs)) + buf.EncodeUint8(v1.NhSet.NNhs) for j3 := 0; j3 < 8; j3++ { - var v3 GbpNextHop - if j3 < len(v1.NhSet.Nhs) { - v3 = v1.NhSet.Nhs[j3] - } - buf.EncodeUint8(uint8(v3.IP.Af)) - buf.EncodeBytes(v3.IP.Un.XXX_UnionData[:], 0) - buf.EncodeBytes(v3.Mac[:], 6) - buf.EncodeUint32(uint32(v3.BdID)) - buf.EncodeUint32(uint32(v3.RdID)) + buf.EncodeUint8(uint8(v1.NhSet.Nhs[j3].IP.Af)) + buf.EncodeBytes(v1.NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], 16) + buf.EncodeBytes(v1.NhSet.Nhs[j3].Mac[:], 6) + buf.EncodeUint32(v1.NhSet.Nhs[j3].BdID) + buf.EncodeUint32(v1.NhSet.Nhs[j3].RdID) } } return buf.Bytes(), nil @@ -816,7 +783,7 @@ func (m *GbpContractAddDel) Unmarshal(b []byte) error { m.Contract.AllowedEthertypes[i] = buf.DecodeUint16() } m.Contract.NRules = buf.DecodeUint8() - m.Contract.Rules = make([]GbpRule, int(m.Contract.NRules)) + m.Contract.Rules = make([]GbpRule, m.Contract.NRules) for j1 := 0; j1 < len(m.Contract.Rules); j1++ { m.Contract.Rules[j1].Action = GbpRuleAction(buf.DecodeUint32()) m.Contract.Rules[j1].NhSet.HashMode = GbpHashMode(buf.DecodeUint32()) @@ -845,29 +812,26 @@ func (*GbpContractAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpContractAddDelReply) Size() int { +func (m *GbpContractAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.StatsIndex return size } func (m *GbpContractAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.StatsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatsIndex) return buf.Bytes(), nil } func (m *GbpContractAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.StatsIndex = buf.DecodeUint32() return nil } @@ -884,11 +848,10 @@ func (*GbpContractDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpContractDetails) Size() int { +func (m *GbpContractDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.Contract.Scope size += 2 // m.Contract.Sclass size += 2 // m.Contract.Dclass @@ -906,58 +869,47 @@ func (m *GbpContractDetails) Size() int { size += 4 // s2.NhSet.HashMode size += 1 // s2.NhSet.NNhs for j4 := 0; j4 < 8; j4++ { - var s4 GbpNextHop - _ = s4 - if j4 < len(s2.NhSet.Nhs) { - s4 = s2.NhSet.Nhs[j4] - } - size += 1 // s4.IP.Af - size += 1 * 16 // s4.IP.Un - size += 1 * 6 // s4.Mac - size += 4 // s4.BdID - size += 4 // s4.RdID + size += 1 // s2.NhSet.Nhs[j4].IP.Af + size += 1 * 16 // s2.NhSet.Nhs[j4].IP.Un + size += 1 * 6 // s2.NhSet.Nhs[j4].Mac + size += 4 // s2.NhSet.Nhs[j4].BdID + size += 4 // s2.NhSet.Nhs[j4].RdID } } return size } func (m *GbpContractDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint16(uint16(m.Contract.Scope)) - buf.EncodeUint16(uint16(m.Contract.Sclass)) - buf.EncodeUint16(uint16(m.Contract.Dclass)) - buf.EncodeUint32(uint32(m.Contract.ACLIndex)) - buf.EncodeUint8(uint8(m.Contract.NEtherTypes)) + buf.EncodeUint16(m.Contract.Sclass) + buf.EncodeUint16(m.Contract.Dclass) + buf.EncodeUint32(m.Contract.ACLIndex) + buf.EncodeUint8(m.Contract.NEtherTypes) for i := 0; i < 16; i++ { var x uint16 if i < len(m.Contract.AllowedEthertypes) { x = uint16(m.Contract.AllowedEthertypes[i]) } - buf.EncodeUint16(uint16(x)) + buf.EncodeUint16(x) } buf.EncodeUint8(uint8(len(m.Contract.Rules))) for j1 := 0; j1 < len(m.Contract.Rules); j1++ { - var v1 GbpRule + var v1 GbpRule // Rules if j1 < len(m.Contract.Rules) { v1 = m.Contract.Rules[j1] } buf.EncodeUint32(uint32(v1.Action)) buf.EncodeUint32(uint32(v1.NhSet.HashMode)) - buf.EncodeUint8(uint8(v1.NhSet.NNhs)) + buf.EncodeUint8(v1.NhSet.NNhs) for j3 := 0; j3 < 8; j3++ { - var v3 GbpNextHop - if j3 < len(v1.NhSet.Nhs) { - v3 = v1.NhSet.Nhs[j3] - } - buf.EncodeUint8(uint8(v3.IP.Af)) - buf.EncodeBytes(v3.IP.Un.XXX_UnionData[:], 0) - buf.EncodeBytes(v3.Mac[:], 6) - buf.EncodeUint32(uint32(v3.BdID)) - buf.EncodeUint32(uint32(v3.RdID)) + buf.EncodeUint8(uint8(v1.NhSet.Nhs[j3].IP.Af)) + buf.EncodeBytes(v1.NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], 16) + buf.EncodeBytes(v1.NhSet.Nhs[j3].Mac[:], 6) + buf.EncodeUint32(v1.NhSet.Nhs[j3].BdID) + buf.EncodeUint32(v1.NhSet.Nhs[j3].RdID) } } return buf.Bytes(), nil @@ -974,7 +926,7 @@ func (m *GbpContractDetails) Unmarshal(b []byte) error { m.Contract.AllowedEthertypes[i] = buf.DecodeUint16() } m.Contract.NRules = buf.DecodeUint8() - m.Contract.Rules = make([]GbpRule, int(m.Contract.NRules)) + m.Contract.Rules = make([]GbpRule, m.Contract.NRules) for j1 := 0; j1 < len(m.Contract.Rules); j1++ { m.Contract.Rules[j1].Action = GbpRuleAction(buf.DecodeUint32()) m.Contract.Rules[j1].NhSet.HashMode = GbpHashMode(buf.DecodeUint32()) @@ -1000,20 +952,17 @@ func (*GbpContractDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpContractDump) Size() int { +func (m *GbpContractDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GbpContractDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GbpContractDump) Unmarshal(b []byte) error { @@ -1032,11 +981,10 @@ func (*GbpEndpointAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpEndpointAdd) Size() int { +func (m *GbpEndpointAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Endpoint.SwIfIndex size += 2 // m.Endpoint.Sclass size += 4 // m.Endpoint.Flags @@ -1058,28 +1006,26 @@ func (m *GbpEndpointAdd) Size() int { return size } func (m *GbpEndpointAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Endpoint.SwIfIndex)) - buf.EncodeUint16(uint16(m.Endpoint.Sclass)) + buf.EncodeUint16(m.Endpoint.Sclass) buf.EncodeUint32(uint32(m.Endpoint.Flags)) buf.EncodeBytes(m.Endpoint.Mac[:], 6) buf.EncodeUint8(uint8(m.Endpoint.Tun.Src.Af)) - buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Endpoint.Tun.Dst.Af)) - buf.EncodeBytes(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(len(m.Endpoint.Ips))) for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ { - var v1 ip_types.Address + var v1 ip_types.Address // Ips if j1 < len(m.Endpoint.Ips) { v1 = m.Endpoint.Ips[j1] } buf.EncodeUint8(uint8(v1.Af)) - buf.EncodeBytes(v1.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v1.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -1094,7 +1040,7 @@ func (m *GbpEndpointAdd) Unmarshal(b []byte) error { m.Endpoint.Tun.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Endpoint.NIps = buf.DecodeUint8() - m.Endpoint.Ips = make([]ip_types.Address, int(m.Endpoint.NIps)) + m.Endpoint.Ips = make([]ip_types.Address, m.Endpoint.NIps) for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ { m.Endpoint.Ips[j1].Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Endpoint.Ips[j1].Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -1115,29 +1061,26 @@ func (*GbpEndpointAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpEndpointAddReply) Size() int { +func (m *GbpEndpointAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Handle return size } func (m *GbpEndpointAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.Handle)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.Handle) return buf.Bytes(), nil } func (m *GbpEndpointAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Handle = buf.DecodeUint32() return nil } @@ -1154,22 +1097,19 @@ func (*GbpEndpointDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpEndpointDel) Size() int { +func (m *GbpEndpointDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Handle return size } func (m *GbpEndpointDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Handle)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Handle) return buf.Bytes(), nil } func (m *GbpEndpointDel) Unmarshal(b []byte) error { @@ -1190,27 +1130,24 @@ func (*GbpEndpointDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpEndpointDelReply) Size() int { +func (m *GbpEndpointDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpEndpointDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpEndpointDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1228,11 +1165,10 @@ func (*GbpEndpointDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpEndpointDetails) Size() int { +func (m *GbpEndpointDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.Age size += 4 // m.Handle size += 4 // m.Endpoint.SwIfIndex @@ -1256,36 +1192,34 @@ func (m *GbpEndpointDetails) Size() int { return size } func (m *GbpEndpointDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeFloat64(float64(m.Age)) - buf.EncodeUint32(uint32(m.Handle)) + buf := codec.NewBuffer(b) + buf.EncodeFloat64(m.Age) + buf.EncodeUint32(m.Handle) buf.EncodeUint32(uint32(m.Endpoint.SwIfIndex)) - buf.EncodeUint16(uint16(m.Endpoint.Sclass)) + buf.EncodeUint16(m.Endpoint.Sclass) buf.EncodeUint32(uint32(m.Endpoint.Flags)) buf.EncodeBytes(m.Endpoint.Mac[:], 6) buf.EncodeUint8(uint8(m.Endpoint.Tun.Src.Af)) - buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Endpoint.Tun.Dst.Af)) - buf.EncodeBytes(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(len(m.Endpoint.Ips))) for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ { - var v1 ip_types.Address + var v1 ip_types.Address // Ips if j1 < len(m.Endpoint.Ips) { v1 = m.Endpoint.Ips[j1] } buf.EncodeUint8(uint8(v1.Af)) - buf.EncodeBytes(v1.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v1.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } func (m *GbpEndpointDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Age = float64(buf.DecodeFloat64()) + m.Age = buf.DecodeFloat64() m.Handle = buf.DecodeUint32() m.Endpoint.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Endpoint.Sclass = buf.DecodeUint16() @@ -1296,7 +1230,7 @@ func (m *GbpEndpointDetails) Unmarshal(b []byte) error { m.Endpoint.Tun.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Endpoint.NIps = buf.DecodeUint8() - m.Endpoint.Ips = make([]ip_types.Address, int(m.Endpoint.NIps)) + m.Endpoint.Ips = make([]ip_types.Address, m.Endpoint.NIps) for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ { m.Endpoint.Ips[j1].Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Endpoint.Ips[j1].Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -1314,20 +1248,17 @@ func (*GbpEndpointDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpEndpointDump) Size() int { +func (m *GbpEndpointDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GbpEndpointDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GbpEndpointDump) Unmarshal(b []byte) error { @@ -1346,11 +1277,10 @@ func (*GbpEndpointGroupAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpEndpointGroupAdd) Size() int { +func (m *GbpEndpointGroupAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Epg.Vnid size += 2 // m.Epg.Sclass size += 4 // m.Epg.BdID @@ -1360,18 +1290,16 @@ func (m *GbpEndpointGroupAdd) Size() int { return size } func (m *GbpEndpointGroupAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.Epg.Vnid)) - buf.EncodeUint16(uint16(m.Epg.Sclass)) - buf.EncodeUint32(uint32(m.Epg.BdID)) - buf.EncodeUint32(uint32(m.Epg.RdID)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Epg.Vnid) + buf.EncodeUint16(m.Epg.Sclass) + buf.EncodeUint32(m.Epg.BdID) + buf.EncodeUint32(m.Epg.RdID) buf.EncodeUint32(uint32(m.Epg.UplinkSwIfIndex)) - buf.EncodeUint32(uint32(m.Epg.Retention.RemoteEpTimeout)) + buf.EncodeUint32(m.Epg.Retention.RemoteEpTimeout) return buf.Bytes(), nil } func (m *GbpEndpointGroupAdd) Unmarshal(b []byte) error { @@ -1397,27 +1325,24 @@ func (*GbpEndpointGroupAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpEndpointGroupAddReply) Size() int { +func (m *GbpEndpointGroupAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpEndpointGroupAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpEndpointGroupAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1433,22 +1358,19 @@ func (*GbpEndpointGroupDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpEndpointGroupDel) Size() int { +func (m *GbpEndpointGroupDel) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.Sclass return size } func (m *GbpEndpointGroupDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.Sclass)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.Sclass) return buf.Bytes(), nil } func (m *GbpEndpointGroupDel) Unmarshal(b []byte) error { @@ -1469,27 +1391,24 @@ func (*GbpEndpointGroupDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpEndpointGroupDelReply) Size() int { +func (m *GbpEndpointGroupDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpEndpointGroupDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpEndpointGroupDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1505,11 +1424,10 @@ func (*GbpEndpointGroupDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpEndpointGroupDetails) Size() int { +func (m *GbpEndpointGroupDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Epg.Vnid size += 2 // m.Epg.Sclass size += 4 // m.Epg.BdID @@ -1519,18 +1437,16 @@ func (m *GbpEndpointGroupDetails) Size() int { return size } func (m *GbpEndpointGroupDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.Epg.Vnid)) - buf.EncodeUint16(uint16(m.Epg.Sclass)) - buf.EncodeUint32(uint32(m.Epg.BdID)) - buf.EncodeUint32(uint32(m.Epg.RdID)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Epg.Vnid) + buf.EncodeUint16(m.Epg.Sclass) + buf.EncodeUint32(m.Epg.BdID) + buf.EncodeUint32(m.Epg.RdID) buf.EncodeUint32(uint32(m.Epg.UplinkSwIfIndex)) - buf.EncodeUint32(uint32(m.Epg.Retention.RemoteEpTimeout)) + buf.EncodeUint32(m.Epg.Retention.RemoteEpTimeout) return buf.Bytes(), nil } func (m *GbpEndpointGroupDetails) Unmarshal(b []byte) error { @@ -1554,20 +1470,17 @@ func (*GbpEndpointGroupDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpEndpointGroupDump) Size() int { +func (m *GbpEndpointGroupDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GbpEndpointGroupDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GbpEndpointGroupDump) Unmarshal(b []byte) error { @@ -1587,11 +1500,10 @@ func (*GbpExtItfAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpExtItfAddDel) Size() int { +func (m *GbpExtItfAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.ExtItf.SwIfIndex size += 4 // m.ExtItf.BdID @@ -1600,16 +1512,14 @@ func (m *GbpExtItfAddDel) Size() int { return size } func (m *GbpExtItfAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.ExtItf.SwIfIndex)) - buf.EncodeUint32(uint32(m.ExtItf.BdID)) - buf.EncodeUint32(uint32(m.ExtItf.RdID)) + buf.EncodeUint32(m.ExtItf.BdID) + buf.EncodeUint32(m.ExtItf.RdID) buf.EncodeUint32(uint32(m.ExtItf.Flags)) return buf.Bytes(), nil } @@ -1635,27 +1545,24 @@ func (*GbpExtItfAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpExtItfAddDelReply) Size() int { +func (m *GbpExtItfAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpExtItfAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpExtItfAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1671,11 +1578,10 @@ func (*GbpExtItfDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpExtItfDetails) Size() int { +func (m *GbpExtItfDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ExtItf.SwIfIndex size += 4 // m.ExtItf.BdID size += 4 // m.ExtItf.RdID @@ -1683,15 +1589,13 @@ func (m *GbpExtItfDetails) Size() int { return size } func (m *GbpExtItfDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.ExtItf.SwIfIndex)) - buf.EncodeUint32(uint32(m.ExtItf.BdID)) - buf.EncodeUint32(uint32(m.ExtItf.RdID)) + buf.EncodeUint32(m.ExtItf.BdID) + buf.EncodeUint32(m.ExtItf.RdID) buf.EncodeUint32(uint32(m.ExtItf.Flags)) return buf.Bytes(), nil } @@ -1714,20 +1618,17 @@ func (*GbpExtItfDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpExtItfDump) Size() int { +func (m *GbpExtItfDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GbpExtItfDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GbpExtItfDump) Unmarshal(b []byte) error { @@ -1747,11 +1648,10 @@ func (*GbpRecircAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpRecircAddDel) Size() int { +func (m *GbpRecircAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Recirc.SwIfIndex size += 2 // m.Recirc.Sclass @@ -1759,15 +1659,13 @@ func (m *GbpRecircAddDel) Size() int { return size } func (m *GbpRecircAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.Recirc.SwIfIndex)) - buf.EncodeUint16(uint16(m.Recirc.Sclass)) + buf.EncodeUint16(m.Recirc.Sclass) buf.EncodeBool(m.Recirc.IsExt) return buf.Bytes(), nil } @@ -1792,27 +1690,24 @@ func (*GbpRecircAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpRecircAddDelReply) Size() int { +func (m *GbpRecircAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpRecircAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpRecircAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1828,25 +1723,22 @@ func (*GbpRecircDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpRecircDetails) Size() int { +func (m *GbpRecircDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Recirc.SwIfIndex size += 2 // m.Recirc.Sclass size += 1 // m.Recirc.IsExt return size } func (m *GbpRecircDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Recirc.SwIfIndex)) - buf.EncodeUint16(uint16(m.Recirc.Sclass)) + buf.EncodeUint16(m.Recirc.Sclass) buf.EncodeBool(m.Recirc.IsExt) return buf.Bytes(), nil } @@ -1868,20 +1760,17 @@ func (*GbpRecircDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpRecircDump) Size() int { +func (m *GbpRecircDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GbpRecircDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GbpRecircDump) Unmarshal(b []byte) error { @@ -1900,11 +1789,10 @@ func (*GbpRouteDomainAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpRouteDomainAdd) Size() int { +func (m *GbpRouteDomainAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Rd.RdID size += 4 // m.Rd.IP4TableID size += 4 // m.Rd.IP6TableID @@ -1914,15 +1802,13 @@ func (m *GbpRouteDomainAdd) Size() int { return size } func (m *GbpRouteDomainAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Rd.RdID)) - buf.EncodeUint32(uint32(m.Rd.IP4TableID)) - buf.EncodeUint32(uint32(m.Rd.IP6TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Rd.RdID) + buf.EncodeUint32(m.Rd.IP4TableID) + buf.EncodeUint32(m.Rd.IP6TableID) buf.EncodeUint32(uint32(m.Rd.IP4UuSwIfIndex)) buf.EncodeUint32(uint32(m.Rd.IP6UuSwIfIndex)) buf.EncodeUint16(uint16(m.Rd.Scope)) @@ -1951,27 +1837,24 @@ func (*GbpRouteDomainAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpRouteDomainAddReply) Size() int { +func (m *GbpRouteDomainAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpRouteDomainAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpRouteDomainAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1987,22 +1870,19 @@ func (*GbpRouteDomainDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpRouteDomainDel) Size() int { +func (m *GbpRouteDomainDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.RdID return size } func (m *GbpRouteDomainDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.RdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.RdID) return buf.Bytes(), nil } func (m *GbpRouteDomainDel) Unmarshal(b []byte) error { @@ -2023,27 +1903,24 @@ func (*GbpRouteDomainDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpRouteDomainDelReply) Size() int { +func (m *GbpRouteDomainDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpRouteDomainDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpRouteDomainDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2059,11 +1936,10 @@ func (*GbpRouteDomainDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpRouteDomainDetails) Size() int { +func (m *GbpRouteDomainDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Rd.RdID size += 4 // m.Rd.IP4TableID size += 4 // m.Rd.IP6TableID @@ -2073,15 +1949,13 @@ func (m *GbpRouteDomainDetails) Size() int { return size } func (m *GbpRouteDomainDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Rd.RdID)) - buf.EncodeUint32(uint32(m.Rd.IP4TableID)) - buf.EncodeUint32(uint32(m.Rd.IP6TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Rd.RdID) + buf.EncodeUint32(m.Rd.IP4TableID) + buf.EncodeUint32(m.Rd.IP6TableID) buf.EncodeUint32(uint32(m.Rd.IP4UuSwIfIndex)) buf.EncodeUint32(uint32(m.Rd.IP6UuSwIfIndex)) buf.EncodeUint16(uint16(m.Rd.Scope)) @@ -2108,20 +1982,17 @@ func (*GbpRouteDomainDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpRouteDomainDump) Size() int { +func (m *GbpRouteDomainDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GbpRouteDomainDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GbpRouteDomainDump) Unmarshal(b []byte) error { @@ -2140,27 +2011,24 @@ func (*GbpRouteDomainDumpReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpRouteDomainDumpReply) Size() int { +func (m *GbpRouteDomainDumpReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpRouteDomainDumpReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpRouteDomainDumpReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2177,11 +2045,10 @@ func (*GbpSubnetAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpSubnetAddDel) Size() int { +func (m *GbpSubnetAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Subnet.RdID size += 4 // m.Subnet.SwIfIndex @@ -2193,20 +2060,18 @@ func (m *GbpSubnetAddDel) Size() int { return size } func (m *GbpSubnetAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Subnet.RdID)) + buf.EncodeUint32(m.Subnet.RdID) buf.EncodeUint32(uint32(m.Subnet.SwIfIndex)) - buf.EncodeUint16(uint16(m.Subnet.Sclass)) + buf.EncodeUint16(m.Subnet.Sclass) buf.EncodeUint32(uint32(m.Subnet.Type)) buf.EncodeUint8(uint8(m.Subnet.Prefix.Address.Af)) - buf.EncodeBytes(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Subnet.Prefix.Len)) + buf.EncodeBytes(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Subnet.Prefix.Len) return buf.Bytes(), nil } func (m *GbpSubnetAddDel) Unmarshal(b []byte) error { @@ -2234,27 +2099,24 @@ func (*GbpSubnetAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpSubnetAddDelReply) Size() int { +func (m *GbpSubnetAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpSubnetAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpSubnetAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2270,11 +2132,10 @@ func (*GbpSubnetDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpSubnetDetails) Size() int { +func (m *GbpSubnetDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Subnet.RdID size += 4 // m.Subnet.SwIfIndex size += 2 // m.Subnet.Sclass @@ -2285,19 +2146,17 @@ func (m *GbpSubnetDetails) Size() int { return size } func (m *GbpSubnetDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Subnet.RdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Subnet.RdID) buf.EncodeUint32(uint32(m.Subnet.SwIfIndex)) - buf.EncodeUint16(uint16(m.Subnet.Sclass)) + buf.EncodeUint16(m.Subnet.Sclass) buf.EncodeUint32(uint32(m.Subnet.Type)) buf.EncodeUint8(uint8(m.Subnet.Prefix.Address.Af)) - buf.EncodeBytes(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Subnet.Prefix.Len)) + buf.EncodeBytes(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Subnet.Prefix.Len) return buf.Bytes(), nil } func (m *GbpSubnetDetails) Unmarshal(b []byte) error { @@ -2322,20 +2181,17 @@ func (*GbpSubnetDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpSubnetDump) Size() int { +func (m *GbpSubnetDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GbpSubnetDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GbpSubnetDump) Unmarshal(b []byte) error { @@ -2354,11 +2210,10 @@ func (*GbpVxlanTunnelAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpVxlanTunnelAdd) Size() int { +func (m *GbpVxlanTunnelAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Tunnel.Vni size += 4 // m.Tunnel.Mode size += 4 // m.Tunnel.BdRdID @@ -2366,15 +2221,13 @@ func (m *GbpVxlanTunnelAdd) Size() int { return size } func (m *GbpVxlanTunnelAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Tunnel.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Tunnel.Vni) buf.EncodeUint32(uint32(m.Tunnel.Mode)) - buf.EncodeUint32(uint32(m.Tunnel.BdRdID)) + buf.EncodeUint32(m.Tunnel.BdRdID) buf.EncodeBytes(m.Tunnel.Src[:], 4) return buf.Bytes(), nil } @@ -2400,29 +2253,26 @@ func (*GbpVxlanTunnelAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpVxlanTunnelAddReply) Size() int { +func (m *GbpVxlanTunnelAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *GbpVxlanTunnelAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *GbpVxlanTunnelAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -2439,22 +2289,19 @@ func (*GbpVxlanTunnelDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpVxlanTunnelDel) Size() int { +func (m *GbpVxlanTunnelDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni return size } func (m *GbpVxlanTunnelDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *GbpVxlanTunnelDel) Unmarshal(b []byte) error { @@ -2475,27 +2322,24 @@ func (*GbpVxlanTunnelDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpVxlanTunnelDelReply) Size() int { +func (m *GbpVxlanTunnelDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GbpVxlanTunnelDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GbpVxlanTunnelDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2511,11 +2355,10 @@ func (*GbpVxlanTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GbpVxlanTunnelDetails) Size() int { +func (m *GbpVxlanTunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Tunnel.Vni size += 4 // m.Tunnel.Mode size += 4 // m.Tunnel.BdRdID @@ -2523,15 +2366,13 @@ func (m *GbpVxlanTunnelDetails) Size() int { return size } func (m *GbpVxlanTunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Tunnel.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Tunnel.Vni) buf.EncodeUint32(uint32(m.Tunnel.Mode)) - buf.EncodeUint32(uint32(m.Tunnel.BdRdID)) + buf.EncodeUint32(m.Tunnel.BdRdID) buf.EncodeBytes(m.Tunnel.Src[:], 4) return buf.Bytes(), nil } @@ -2554,20 +2395,17 @@ func (*GbpVxlanTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GbpVxlanTunnelDump) Size() int { +func (m *GbpVxlanTunnelDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GbpVxlanTunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GbpVxlanTunnelDump) Unmarshal(b []byte) error { diff --git a/binapi/gen.go b/binapi/gen.go new file mode 100644 index 0000000..aefde2b --- /dev/null +++ b/binapi/gen.go @@ -0,0 +1,21 @@ +// Copyright (c) 2020 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package binapi + +// To generate bindings for VPP API files in the default system directory, run: +// +// go generate ./binapi +// +//go:generate binapi-generator -input-dir=/usr/share/vpp/api -output-dir=. -gen=rpc,rest diff --git a/binapi/geneve/geneve.ba.go b/binapi/geneve/geneve.ba.go index 154ce6a..fcd512d 100644 --- a/binapi/geneve/geneve.ba.go +++ b/binapi/geneve/geneve.ba.go @@ -49,11 +49,10 @@ func (*GeneveAddDelTunnel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GeneveAddDelTunnel) Size() int { +func (m *GeneveAddDelTunnel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.LocalAddress.Af size += 1 * 16 // m.LocalAddress.Un @@ -66,21 +65,19 @@ func (m *GeneveAddDelTunnel) Size() int { return size } func (m *GeneveAddDelTunnel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.LocalAddress.Af)) - buf.EncodeBytes(m.LocalAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LocalAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.RemoteAddress.Af)) - buf.EncodeBytes(m.RemoteAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.RemoteAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.EncapVrfID)) - buf.EncodeUint32(uint32(m.DecapNextIndex)) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapNextIndex) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *GeneveAddDelTunnel) Unmarshal(b []byte) error { @@ -110,29 +107,26 @@ func (*GeneveAddDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GeneveAddDelTunnelReply) Size() int { +func (m *GeneveAddDelTunnelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *GeneveAddDelTunnelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *GeneveAddDelTunnelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -155,11 +149,10 @@ func (*GeneveTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GeneveTunnelDetails) Size() int { +func (m *GeneveTunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.SrcAddress.Af size += 1 * 16 // m.SrcAddress.Un @@ -172,21 +165,19 @@ func (m *GeneveTunnelDetails) Size() int { return size } func (m *GeneveTunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.SrcAddress.Af)) - buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.DstAddress.Af)) - buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.EncapVrfID)) - buf.EncodeUint32(uint32(m.DecapNextIndex)) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapNextIndex) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *GeneveTunnelDetails) Unmarshal(b []byte) error { @@ -215,21 +206,18 @@ func (*GeneveTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GeneveTunnelDump) Size() int { +func (m *GeneveTunnelDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *GeneveTunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -253,23 +241,20 @@ func (*SwInterfaceSetGeneveBypass) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetGeneveBypass) Size() int { +func (m *SwInterfaceSetGeneveBypass) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 size += 1 // m.Enable return size } func (m *SwInterfaceSetGeneveBypass) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) buf.EncodeBool(m.Enable) @@ -297,27 +282,24 @@ func (*SwInterfaceSetGeneveBypassReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetGeneveBypassReply) Size() int { +func (m *SwInterfaceSetGeneveBypassReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetGeneveBypassReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetGeneveBypassReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/gre/gre.ba.go b/binapi/gre/gre.ba.go index e87e88f..d14c51e 100644 --- a/binapi/gre/gre.ba.go +++ b/binapi/gre/gre.ba.go @@ -90,11 +90,10 @@ func (*GreTunnelAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GreTunnelAddDel) Size() int { +func (m *GreTunnelAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Tunnel.Type size += 1 // m.Tunnel.Mode @@ -110,24 +109,22 @@ func (m *GreTunnelAddDel) Size() int { return size } func (m *GreTunnelAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Tunnel.Type)) buf.EncodeUint8(uint8(m.Tunnel.Mode)) buf.EncodeUint8(uint8(m.Tunnel.Flags)) - buf.EncodeUint16(uint16(m.Tunnel.SessionID)) - buf.EncodeUint32(uint32(m.Tunnel.Instance)) - buf.EncodeUint32(uint32(m.Tunnel.OuterTableID)) + buf.EncodeUint16(m.Tunnel.SessionID) + buf.EncodeUint32(m.Tunnel.Instance) + buf.EncodeUint32(m.Tunnel.OuterTableID) buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex)) buf.EncodeUint8(uint8(m.Tunnel.Src.Af)) - buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Tunnel.Dst.Af)) - buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *GreTunnelAddDel) Unmarshal(b []byte) error { @@ -160,29 +157,26 @@ func (*GreTunnelAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GreTunnelAddDelReply) Size() int { +func (m *GreTunnelAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *GreTunnelAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *GreTunnelAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -199,11 +193,10 @@ func (*GreTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GreTunnelDetails) Size() int { +func (m *GreTunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Tunnel.Type size += 1 // m.Tunnel.Mode size += 1 // m.Tunnel.Flags @@ -218,23 +211,21 @@ func (m *GreTunnelDetails) Size() int { return size } func (m *GreTunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Tunnel.Type)) buf.EncodeUint8(uint8(m.Tunnel.Mode)) buf.EncodeUint8(uint8(m.Tunnel.Flags)) - buf.EncodeUint16(uint16(m.Tunnel.SessionID)) - buf.EncodeUint32(uint32(m.Tunnel.Instance)) - buf.EncodeUint32(uint32(m.Tunnel.OuterTableID)) + buf.EncodeUint16(m.Tunnel.SessionID) + buf.EncodeUint32(m.Tunnel.Instance) + buf.EncodeUint32(m.Tunnel.OuterTableID) buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex)) buf.EncodeUint8(uint8(m.Tunnel.Src.Af)) - buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Tunnel.Dst.Af)) - buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *GreTunnelDetails) Unmarshal(b []byte) error { @@ -265,21 +256,18 @@ func (*GreTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GreTunnelDump) Size() int { +func (m *GreTunnelDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *GreTunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } diff --git a/binapi/gso/gso.ba.go b/binapi/gso/gso.ba.go index 2b2d45a..78e7536 100644 --- a/binapi/gso/gso.ba.go +++ b/binapi/gso/gso.ba.go @@ -42,22 +42,19 @@ func (*FeatureGsoEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *FeatureGsoEnableDisable) Size() int { +func (m *FeatureGsoEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.EnableDisable return size } func (m *FeatureGsoEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.EnableDisable) return buf.Bytes(), nil @@ -83,27 +80,24 @@ func (*FeatureGsoEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *FeatureGsoEnableDisableReply) Size() int { +func (m *FeatureGsoEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *FeatureGsoEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *FeatureGsoEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/gtpu/gtpu.ba.go b/binapi/gtpu/gtpu.ba.go index 02903a9..96ae51f 100644 --- a/binapi/gtpu/gtpu.ba.go +++ b/binapi/gtpu/gtpu.ba.go @@ -48,11 +48,10 @@ func (*GtpuAddDelTunnel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GtpuAddDelTunnel) Size() int { +func (m *GtpuAddDelTunnel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.SrcAddress.Af size += 1 * 16 // m.SrcAddress.Un @@ -65,21 +64,19 @@ func (m *GtpuAddDelTunnel) Size() int { return size } func (m *GtpuAddDelTunnel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.SrcAddress.Af)) - buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.DstAddress.Af)) - buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.EncapVrfID)) - buf.EncodeUint32(uint32(m.DecapNextIndex)) - buf.EncodeUint32(uint32(m.Teid)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapNextIndex) + buf.EncodeUint32(m.Teid) return buf.Bytes(), nil } func (m *GtpuAddDelTunnel) Unmarshal(b []byte) error { @@ -109,29 +106,26 @@ func (*GtpuAddDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GtpuAddDelTunnelReply) Size() int { +func (m *GtpuAddDelTunnelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *GtpuAddDelTunnelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *GtpuAddDelTunnelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -150,26 +144,23 @@ func (*GtpuOffloadRx) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GtpuOffloadRx) Size() int { +func (m *GtpuOffloadRx) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.HwIfIndex size += 4 // m.SwIfIndex size += 1 // m.Enable return size } func (m *GtpuOffloadRx) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.HwIfIndex)) - buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.Enable)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.HwIfIndex) + buf.EncodeUint32(m.SwIfIndex) + buf.EncodeUint8(m.Enable) return buf.Bytes(), nil } func (m *GtpuOffloadRx) Unmarshal(b []byte) error { @@ -192,27 +183,24 @@ func (*GtpuOffloadRxReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GtpuOffloadRxReply) Size() int { +func (m *GtpuOffloadRxReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GtpuOffloadRxReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GtpuOffloadRxReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -234,11 +222,10 @@ func (*GtpuTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GtpuTunnelDetails) Size() int { +func (m *GtpuTunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.SrcAddress.Af size += 1 * 16 // m.SrcAddress.Un @@ -251,21 +238,19 @@ func (m *GtpuTunnelDetails) Size() int { return size } func (m *GtpuTunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.SrcAddress.Af)) - buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.DstAddress.Af)) - buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.EncapVrfID)) - buf.EncodeUint32(uint32(m.DecapNextIndex)) - buf.EncodeUint32(uint32(m.Teid)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapNextIndex) + buf.EncodeUint32(m.Teid) return buf.Bytes(), nil } func (m *GtpuTunnelDetails) Unmarshal(b []byte) error { @@ -294,21 +279,18 @@ func (*GtpuTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GtpuTunnelDump) Size() int { +func (m *GtpuTunnelDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *GtpuTunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -332,23 +314,20 @@ func (*SwInterfaceSetGtpuBypass) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetGtpuBypass) Size() int { +func (m *SwInterfaceSetGtpuBypass) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 size += 1 // m.Enable return size } func (m *SwInterfaceSetGtpuBypass) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) buf.EncodeBool(m.Enable) @@ -376,27 +355,24 @@ func (*SwInterfaceSetGtpuBypassReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetGtpuBypassReply) Size() int { +func (m *SwInterfaceSetGtpuBypassReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetGtpuBypassReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetGtpuBypassReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/http_static/http_static.ba.go b/binapi/http_static/http_static.ba.go index c1338ed..2116a8b 100644 --- a/binapi/http_static/http_static.ba.go +++ b/binapi/http_static/http_static.ba.go @@ -45,11 +45,10 @@ func (*HTTPStaticEnable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *HTTPStaticEnable) Size() int { +func (m *HTTPStaticEnable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.FifoSize size += 4 // m.CacheSizeLimit size += 4 // m.PreallocFifos @@ -59,16 +58,14 @@ func (m *HTTPStaticEnable) Size() int { return size } func (m *HTTPStaticEnable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.FifoSize)) - buf.EncodeUint32(uint32(m.CacheSizeLimit)) - buf.EncodeUint32(uint32(m.PreallocFifos)) - buf.EncodeUint32(uint32(m.PrivateSegmentSize)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.FifoSize) + buf.EncodeUint32(m.CacheSizeLimit) + buf.EncodeUint32(m.PreallocFifos) + buf.EncodeUint32(m.PrivateSegmentSize) buf.EncodeString(m.WwwRoot, 256) buf.EncodeString(m.URI, 256) return buf.Bytes(), nil @@ -96,27 +93,24 @@ func (*HTTPStaticEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *HTTPStaticEnableReply) Size() int { +func (m *HTTPStaticEnableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *HTTPStaticEnableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *HTTPStaticEnableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/igmp/igmp.ba.go b/binapi/igmp/igmp.ba.go index 5e520cc..5026657 100644 --- a/binapi/igmp/igmp.ba.go +++ b/binapi/igmp/igmp.ba.go @@ -114,21 +114,18 @@ func (*IgmpClearInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IgmpClearInterface) Size() int { +func (m *IgmpClearInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *IgmpClearInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -150,27 +147,24 @@ func (*IgmpClearInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IgmpClearInterfaceReply) Size() int { +func (m *IgmpClearInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IgmpClearInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IgmpClearInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -188,23 +182,20 @@ func (*IgmpDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IgmpDetails) Size() int { +func (m *IgmpDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 * 4 // m.Saddr size += 1 * 4 // m.Gaddr return size } func (m *IgmpDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.Saddr[:], 4) buf.EncodeBytes(m.Gaddr[:], 4) @@ -230,21 +221,18 @@ func (*IgmpDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IgmpDump) Size() int { +func (m *IgmpDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *IgmpDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -268,25 +256,22 @@ func (*IgmpEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IgmpEnableDisable) Size() int { +func (m *IgmpEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable size += 1 // m.Mode size += 4 // m.SwIfIndex return size } func (m *IgmpEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) - buf.EncodeUint8(uint8(m.Mode)) + buf.EncodeUint8(m.Mode) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -310,27 +295,24 @@ func (*IgmpEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IgmpEnableDisableReply) Size() int { +func (m *IgmpEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IgmpEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IgmpEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -349,11 +331,10 @@ func (*IgmpEvent) GetMessageType() api.MessageType { return api.OtherMessage } -func (m *IgmpEvent) Size() int { +func (m *IgmpEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.Filter size += 1 * 4 // m.Saddr @@ -361,12 +342,10 @@ func (m *IgmpEvent) Size() int { return size } func (m *IgmpEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(uint32(m.Filter)) buf.EncodeBytes(m.Saddr[:], 4) @@ -394,11 +373,10 @@ func (*IgmpGroupPrefixDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IgmpGroupPrefixDetails) Size() int { +func (m *IgmpGroupPrefixDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Gp.Type size += 1 // m.Gp.Prefix.Address.Af size += 1 * 16 // m.Gp.Prefix.Address.Un @@ -406,16 +384,14 @@ func (m *IgmpGroupPrefixDetails) Size() int { return size } func (m *IgmpGroupPrefixDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Gp.Type)) buf.EncodeUint8(uint8(m.Gp.Prefix.Address.Af)) - buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Gp.Prefix.Len)) + buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Gp.Prefix.Len) return buf.Bytes(), nil } func (m *IgmpGroupPrefixDetails) Unmarshal(b []byte) error { @@ -437,20 +413,17 @@ func (*IgmpGroupPrefixDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IgmpGroupPrefixDump) Size() int { +func (m *IgmpGroupPrefixDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IgmpGroupPrefixDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IgmpGroupPrefixDump) Unmarshal(b []byte) error { @@ -469,11 +442,10 @@ func (*IgmpGroupPrefixSet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IgmpGroupPrefixSet) Size() int { +func (m *IgmpGroupPrefixSet) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Gp.Type size += 1 // m.Gp.Prefix.Address.Af size += 1 * 16 // m.Gp.Prefix.Address.Un @@ -481,16 +453,14 @@ func (m *IgmpGroupPrefixSet) Size() int { return size } func (m *IgmpGroupPrefixSet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Gp.Type)) buf.EncodeUint8(uint8(m.Gp.Prefix.Address.Af)) - buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Gp.Prefix.Len)) + buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Gp.Prefix.Len) return buf.Bytes(), nil } func (m *IgmpGroupPrefixSet) Unmarshal(b []byte) error { @@ -514,27 +484,24 @@ func (*IgmpGroupPrefixSetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IgmpGroupPrefixSetReply) Size() int { +func (m *IgmpGroupPrefixSetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IgmpGroupPrefixSetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IgmpGroupPrefixSetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -550,11 +517,10 @@ func (*IgmpListen) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IgmpListen) Size() int { +func (m *IgmpListen) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Group.Filter size += 1 // m.Group.NSrcs size += 4 // m.Group.SwIfIndex @@ -570,18 +536,16 @@ func (m *IgmpListen) Size() int { return size } func (m *IgmpListen) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Group.Filter)) buf.EncodeUint8(uint8(len(m.Group.Saddrs))) buf.EncodeUint32(uint32(m.Group.SwIfIndex)) buf.EncodeBytes(m.Group.Gaddr[:], 4) for j1 := 0; j1 < len(m.Group.Saddrs); j1++ { - var v1 ip_types.IP4Address + var v1 ip_types.IP4Address // Saddrs if j1 < len(m.Group.Saddrs) { v1 = m.Group.Saddrs[j1] } @@ -595,7 +559,7 @@ func (m *IgmpListen) Unmarshal(b []byte) error { m.Group.NSrcs = buf.DecodeUint8() m.Group.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) copy(m.Group.Gaddr[:], buf.DecodeBytes(4)) - m.Group.Saddrs = make([]ip_types.IP4Address, int(m.Group.NSrcs)) + m.Group.Saddrs = make([]ip_types.IP4Address, m.Group.NSrcs) for j1 := 0; j1 < len(m.Group.Saddrs); j1++ { copy(m.Group.Saddrs[j1][:], buf.DecodeBytes(4)) } @@ -614,27 +578,24 @@ func (*IgmpListenReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IgmpListenReply) Size() int { +func (m *IgmpListenReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IgmpListenReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IgmpListenReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -652,25 +613,22 @@ func (*IgmpProxyDeviceAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IgmpProxyDeviceAddDel) Size() int { +func (m *IgmpProxyDeviceAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Add size += 4 // m.VrfID size += 4 // m.SwIfIndex return size } func (m *IgmpProxyDeviceAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Add)) - buf.EncodeUint32(uint32(m.VrfID)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Add) + buf.EncodeUint32(m.VrfID) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -698,25 +656,22 @@ func (*IgmpProxyDeviceAddDelInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IgmpProxyDeviceAddDelInterface) Size() int { +func (m *IgmpProxyDeviceAddDelInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Add size += 4 // m.VrfID size += 4 // m.SwIfIndex return size } func (m *IgmpProxyDeviceAddDelInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Add) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -742,27 +697,24 @@ func (*IgmpProxyDeviceAddDelInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IgmpProxyDeviceAddDelInterfaceReply) Size() int { +func (m *IgmpProxyDeviceAddDelInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IgmpProxyDeviceAddDelInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IgmpProxyDeviceAddDelInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -778,27 +730,24 @@ func (*IgmpProxyDeviceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IgmpProxyDeviceAddDelReply) Size() int { +func (m *IgmpProxyDeviceAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IgmpProxyDeviceAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IgmpProxyDeviceAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -815,24 +764,21 @@ func (*WantIgmpEvents) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *WantIgmpEvents) Size() int { +func (m *WantIgmpEvents) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Enable size += 4 // m.PID return size } func (m *WantIgmpEvents) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Enable)) - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Enable) + buf.EncodeUint32(m.PID) return buf.Bytes(), nil } func (m *WantIgmpEvents) Unmarshal(b []byte) error { @@ -854,27 +800,24 @@ func (*WantIgmpEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *WantIgmpEventsReply) Size() int { +func (m *WantIgmpEventsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *WantIgmpEventsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *WantIgmpEventsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ikev2/ikev2.ba.go b/binapi/ikev2/ikev2.ba.go index 4f06ed9..5fc68c3 100644 --- a/binapi/ikev2/ikev2.ba.go +++ b/binapi/ikev2/ikev2.ba.go @@ -42,22 +42,19 @@ func (*Ikev2InitiateDelChildSa) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2InitiateDelChildSa) Size() int { +func (m *Ikev2InitiateDelChildSa) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Ispi return size } func (m *Ikev2InitiateDelChildSa) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Ispi)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Ispi) return buf.Bytes(), nil } func (m *Ikev2InitiateDelChildSa) Unmarshal(b []byte) error { @@ -80,27 +77,24 @@ func (*Ikev2InitiateDelChildSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2InitiateDelChildSaReply) Size() int { +func (m *Ikev2InitiateDelChildSaReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2InitiateDelChildSaReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2InitiateDelChildSaReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -116,22 +110,19 @@ func (*Ikev2InitiateDelIkeSa) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2InitiateDelIkeSa) Size() int { +func (m *Ikev2InitiateDelIkeSa) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.Ispi return size } func (m *Ikev2InitiateDelIkeSa) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint64(uint64(m.Ispi)) + buf := codec.NewBuffer(b) + buf.EncodeUint64(m.Ispi) return buf.Bytes(), nil } func (m *Ikev2InitiateDelIkeSa) Unmarshal(b []byte) error { @@ -152,27 +143,24 @@ func (*Ikev2InitiateDelIkeSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2InitiateDelIkeSaReply) Size() int { +func (m *Ikev2InitiateDelIkeSaReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2InitiateDelIkeSaReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2InitiateDelIkeSaReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -188,22 +176,19 @@ func (*Ikev2InitiateRekeyChildSa) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2InitiateRekeyChildSa) Size() int { +func (m *Ikev2InitiateRekeyChildSa) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Ispi return size } func (m *Ikev2InitiateRekeyChildSa) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Ispi)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Ispi) return buf.Bytes(), nil } func (m *Ikev2InitiateRekeyChildSa) Unmarshal(b []byte) error { @@ -226,27 +211,24 @@ func (*Ikev2InitiateRekeyChildSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2InitiateRekeyChildSaReply) Size() int { +func (m *Ikev2InitiateRekeyChildSaReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2InitiateRekeyChildSaReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2InitiateRekeyChildSaReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -262,21 +244,18 @@ func (*Ikev2InitiateSaInit) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2InitiateSaInit) Size() int { +func (m *Ikev2InitiateSaInit) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name return size } func (m *Ikev2InitiateSaInit) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) return buf.Bytes(), nil } @@ -298,27 +277,24 @@ func (*Ikev2InitiateSaInitReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2InitiateSaInitReply) Size() int { +func (m *Ikev2InitiateSaInitReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2InitiateSaInitReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2InitiateSaInitReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -332,20 +308,17 @@ func (*Ikev2PluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2PluginGetVersion) Size() int { +func (m *Ikev2PluginGetVersion) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Ikev2PluginGetVersion) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Ikev2PluginGetVersion) Unmarshal(b []byte) error { @@ -365,24 +338,21 @@ func (*Ikev2PluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2PluginGetVersionReply) Size() int { +func (m *Ikev2PluginGetVersionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Major size += 4 // m.Minor return size } func (m *Ikev2PluginGetVersionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Major)) - buf.EncodeUint32(uint32(m.Minor)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Major) + buf.EncodeUint32(m.Minor) return buf.Bytes(), nil } func (m *Ikev2PluginGetVersionReply) Unmarshal(b []byte) error { @@ -405,22 +375,19 @@ func (*Ikev2ProfileAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2ProfileAddDel) Size() int { +func (m *Ikev2ProfileAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 1 // m.IsAdd return size } func (m *Ikev2ProfileAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil @@ -444,27 +411,24 @@ func (*Ikev2ProfileAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2ProfileAddDelReply) Size() int { +func (m *Ikev2ProfileAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2ProfileAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2ProfileAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -484,11 +448,10 @@ func (*Ikev2ProfileSetAuth) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2ProfileSetAuth) Size() int { +func (m *Ikev2ProfileSetAuth) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 1 // m.AuthMethod size += 1 // m.IsHex @@ -497,17 +460,15 @@ func (m *Ikev2ProfileSetAuth) Size() int { return size } func (m *Ikev2ProfileSetAuth) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) - buf.EncodeUint8(uint8(m.AuthMethod)) + buf.EncodeUint8(m.AuthMethod) buf.EncodeBool(m.IsHex) buf.EncodeUint32(uint32(len(m.Data))) - buf.EncodeBytes(m.Data[:], 0) + buf.EncodeBytes(m.Data, 0) return buf.Bytes(), nil } func (m *Ikev2ProfileSetAuth) Unmarshal(b []byte) error { @@ -516,7 +477,8 @@ func (m *Ikev2ProfileSetAuth) Unmarshal(b []byte) error { m.AuthMethod = buf.DecodeUint8() m.IsHex = buf.DecodeBool() m.DataLen = buf.DecodeUint32() - copy(m.Data[:], buf.DecodeBytes(0)) + m.Data = make([]byte, m.DataLen) + copy(m.Data, buf.DecodeBytes(len(m.Data))) return nil } @@ -532,27 +494,24 @@ func (*Ikev2ProfileSetAuthReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2ProfileSetAuthReply) Size() int { +func (m *Ikev2ProfileSetAuthReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2ProfileSetAuthReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2ProfileSetAuthReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -572,11 +531,10 @@ func (*Ikev2ProfileSetID) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2ProfileSetID) Size() int { +func (m *Ikev2ProfileSetID) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 1 // m.IsLocal size += 1 // m.IDType @@ -585,17 +543,15 @@ func (m *Ikev2ProfileSetID) Size() int { return size } func (m *Ikev2ProfileSetID) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) buf.EncodeBool(m.IsLocal) - buf.EncodeUint8(uint8(m.IDType)) + buf.EncodeUint8(m.IDType) buf.EncodeUint32(uint32(len(m.Data))) - buf.EncodeBytes(m.Data[:], 0) + buf.EncodeBytes(m.Data, 0) return buf.Bytes(), nil } func (m *Ikev2ProfileSetID) Unmarshal(b []byte) error { @@ -604,7 +560,8 @@ func (m *Ikev2ProfileSetID) Unmarshal(b []byte) error { m.IsLocal = buf.DecodeBool() m.IDType = buf.DecodeUint8() m.DataLen = buf.DecodeUint32() - copy(m.Data[:], buf.DecodeBytes(0)) + m.Data = make([]byte, m.DataLen) + copy(m.Data, buf.DecodeBytes(len(m.Data))) return nil } @@ -620,27 +577,24 @@ func (*Ikev2ProfileSetIDReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2ProfileSetIDReply) Size() int { +func (m *Ikev2ProfileSetIDReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2ProfileSetIDReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2ProfileSetIDReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -660,25 +614,22 @@ func (*Ikev2ProfileSetIpsecUDPPort) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2ProfileSetIpsecUDPPort) Size() int { +func (m *Ikev2ProfileSetIpsecUDPPort) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsSet size += 2 // m.Port size += 64 // m.Name return size } func (m *Ikev2ProfileSetIpsecUDPPort) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.IsSet)) - buf.EncodeUint16(uint16(m.Port)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.IsSet) + buf.EncodeUint16(m.Port) buf.EncodeString(m.Name, 64) return buf.Bytes(), nil } @@ -704,27 +655,24 @@ func (*Ikev2ProfileSetIpsecUDPPortReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2ProfileSetIpsecUDPPortReply) Size() int { +func (m *Ikev2ProfileSetIpsecUDPPortReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2ProfileSetIpsecUDPPortReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2ProfileSetIpsecUDPPortReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -741,24 +689,21 @@ func (*Ikev2ProfileSetLiveness) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2ProfileSetLiveness) Size() int { +func (m *Ikev2ProfileSetLiveness) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Period size += 4 // m.MaxRetries return size } func (m *Ikev2ProfileSetLiveness) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Period)) - buf.EncodeUint32(uint32(m.MaxRetries)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Period) + buf.EncodeUint32(m.MaxRetries) return buf.Bytes(), nil } func (m *Ikev2ProfileSetLiveness) Unmarshal(b []byte) error { @@ -782,27 +727,24 @@ func (*Ikev2ProfileSetLivenessReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2ProfileSetLivenessReply) Size() int { +func (m *Ikev2ProfileSetLivenessReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2ProfileSetLivenessReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2ProfileSetLivenessReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -824,11 +766,10 @@ func (*Ikev2ProfileSetTs) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2ProfileSetTs) Size() int { +func (m *Ikev2ProfileSetTs) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 1 // m.IsLocal size += 1 // m.Proto @@ -839,19 +780,17 @@ func (m *Ikev2ProfileSetTs) Size() int { return size } func (m *Ikev2ProfileSetTs) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) buf.EncodeBool(m.IsLocal) - buf.EncodeUint8(uint8(m.Proto)) - buf.EncodeUint16(uint16(m.StartPort)) - buf.EncodeUint16(uint16(m.EndPort)) - buf.EncodeUint32(uint32(m.StartAddr)) - buf.EncodeUint32(uint32(m.EndAddr)) + buf.EncodeUint8(m.Proto) + buf.EncodeUint16(m.StartPort) + buf.EncodeUint16(m.EndPort) + buf.EncodeUint32(m.StartAddr) + buf.EncodeUint32(m.EndAddr) return buf.Bytes(), nil } func (m *Ikev2ProfileSetTs) Unmarshal(b []byte) error { @@ -878,27 +817,24 @@ func (*Ikev2ProfileSetTsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2ProfileSetTsReply) Size() int { +func (m *Ikev2ProfileSetTsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2ProfileSetTsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2ProfileSetTsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -914,21 +850,18 @@ func (*Ikev2ProfileSetUDPEncap) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2ProfileSetUDPEncap) Size() int { +func (m *Ikev2ProfileSetUDPEncap) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name return size } func (m *Ikev2ProfileSetUDPEncap) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) return buf.Bytes(), nil } @@ -952,27 +885,24 @@ func (*Ikev2ProfileSetUDPEncapReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2ProfileSetUDPEncapReply) Size() int { +func (m *Ikev2ProfileSetUDPEncapReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2ProfileSetUDPEncapReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2ProfileSetUDPEncapReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -992,11 +922,10 @@ func (*Ikev2SetEspTransforms) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2SetEspTransforms) Size() int { +func (m *Ikev2SetEspTransforms) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 4 // m.CryptoAlg size += 4 // m.CryptoKeySize @@ -1005,17 +934,15 @@ func (m *Ikev2SetEspTransforms) Size() int { return size } func (m *Ikev2SetEspTransforms) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) - buf.EncodeUint32(uint32(m.CryptoAlg)) - buf.EncodeUint32(uint32(m.CryptoKeySize)) - buf.EncodeUint32(uint32(m.IntegAlg)) - buf.EncodeUint32(uint32(m.DhGroup)) + buf.EncodeUint32(m.CryptoAlg) + buf.EncodeUint32(m.CryptoKeySize) + buf.EncodeUint32(m.IntegAlg) + buf.EncodeUint32(m.DhGroup) return buf.Bytes(), nil } func (m *Ikev2SetEspTransforms) Unmarshal(b []byte) error { @@ -1040,27 +967,24 @@ func (*Ikev2SetEspTransformsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2SetEspTransformsReply) Size() int { +func (m *Ikev2SetEspTransformsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2SetEspTransformsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2SetEspTransformsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1080,11 +1004,10 @@ func (*Ikev2SetIkeTransforms) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2SetIkeTransforms) Size() int { +func (m *Ikev2SetIkeTransforms) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 4 // m.CryptoAlg size += 4 // m.CryptoKeySize @@ -1093,17 +1016,15 @@ func (m *Ikev2SetIkeTransforms) Size() int { return size } func (m *Ikev2SetIkeTransforms) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) - buf.EncodeUint32(uint32(m.CryptoAlg)) - buf.EncodeUint32(uint32(m.CryptoKeySize)) - buf.EncodeUint32(uint32(m.IntegAlg)) - buf.EncodeUint32(uint32(m.DhGroup)) + buf.EncodeUint32(m.CryptoAlg) + buf.EncodeUint32(m.CryptoKeySize) + buf.EncodeUint32(m.IntegAlg) + buf.EncodeUint32(m.DhGroup) return buf.Bytes(), nil } func (m *Ikev2SetIkeTransforms) Unmarshal(b []byte) error { @@ -1128,27 +1049,24 @@ func (*Ikev2SetIkeTransformsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2SetIkeTransformsReply) Size() int { +func (m *Ikev2SetIkeTransformsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2SetIkeTransformsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2SetIkeTransformsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1164,21 +1082,18 @@ func (*Ikev2SetLocalKey) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2SetLocalKey) Size() int { +func (m *Ikev2SetLocalKey) Size() (size int) { if m == nil { return 0 } - var size int size += 256 // m.KeyFile return size } func (m *Ikev2SetLocalKey) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.KeyFile, 256) return buf.Bytes(), nil } @@ -1200,27 +1115,24 @@ func (*Ikev2SetLocalKeyReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2SetLocalKeyReply) Size() int { +func (m *Ikev2SetLocalKeyReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2SetLocalKeyReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2SetLocalKeyReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1238,23 +1150,20 @@ func (*Ikev2SetResponder) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2SetResponder) Size() int { +func (m *Ikev2SetResponder) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 4 // m.SwIfIndex size += 1 * 4 // m.Address return size } func (m *Ikev2SetResponder) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.Address[:], 4) @@ -1280,27 +1189,24 @@ func (*Ikev2SetResponderReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2SetResponderReply) Size() int { +func (m *Ikev2SetResponderReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2SetResponderReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2SetResponderReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1320,11 +1226,10 @@ func (*Ikev2SetSaLifetime) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2SetSaLifetime) Size() int { +func (m *Ikev2SetSaLifetime) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 8 // m.Lifetime size += 4 // m.LifetimeJitter @@ -1333,17 +1238,15 @@ func (m *Ikev2SetSaLifetime) Size() int { return size } func (m *Ikev2SetSaLifetime) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) - buf.EncodeUint64(uint64(m.Lifetime)) - buf.EncodeUint32(uint32(m.LifetimeJitter)) - buf.EncodeUint32(uint32(m.Handover)) - buf.EncodeUint64(uint64(m.LifetimeMaxdata)) + buf.EncodeUint64(m.Lifetime) + buf.EncodeUint32(m.LifetimeJitter) + buf.EncodeUint32(m.Handover) + buf.EncodeUint64(m.LifetimeMaxdata) return buf.Bytes(), nil } func (m *Ikev2SetSaLifetime) Unmarshal(b []byte) error { @@ -1368,27 +1271,24 @@ func (*Ikev2SetSaLifetimeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2SetSaLifetimeReply) Size() int { +func (m *Ikev2SetSaLifetimeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2SetSaLifetimeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2SetSaLifetimeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1405,22 +1305,19 @@ func (*Ikev2SetTunnelInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2SetTunnelInterface) Size() int { +func (m *Ikev2SetTunnelInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 4 // m.SwIfIndex return size } func (m *Ikev2SetTunnelInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -1446,27 +1343,24 @@ func (*Ikev2SetTunnelInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2SetTunnelInterfaceReply) Size() int { +func (m *Ikev2SetTunnelInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ikev2SetTunnelInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ikev2SetTunnelInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/interface/interface.ba.go b/binapi/interface/interface.ba.go index 9c2dd23..822c325 100644 --- a/binapi/interface/interface.ba.go +++ b/binapi/interface/interface.ba.go @@ -46,22 +46,19 @@ func (*CollectDetailedInterfaceStats) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CollectDetailedInterfaceStats) Size() int { +func (m *CollectDetailedInterfaceStats) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.EnableDisable return size } func (m *CollectDetailedInterfaceStats) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.EnableDisable) return buf.Bytes(), nil @@ -87,27 +84,24 @@ func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CollectDetailedInterfaceStatsReply) Size() int { +func (m *CollectDetailedInterfaceStatsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *CollectDetailedInterfaceStatsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *CollectDetailedInterfaceStatsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -123,21 +117,18 @@ func (*CreateLoopback) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CreateLoopback) Size() int { +func (m *CreateLoopback) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 6 // m.MacAddress return size } func (m *CreateLoopback) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.MacAddress[:], 6) return buf.Bytes(), nil } @@ -161,26 +152,23 @@ func (*CreateLoopbackInstance) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CreateLoopbackInstance) Size() int { +func (m *CreateLoopbackInstance) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 6 // m.MacAddress size += 1 // m.IsSpecified size += 4 // m.UserInstance return size } func (m *CreateLoopbackInstance) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.MacAddress[:], 6) buf.EncodeBool(m.IsSpecified) - buf.EncodeUint32(uint32(m.UserInstance)) + buf.EncodeUint32(m.UserInstance) return buf.Bytes(), nil } func (m *CreateLoopbackInstance) Unmarshal(b []byte) error { @@ -204,29 +192,26 @@ func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CreateLoopbackInstanceReply) Size() int { +func (m *CreateLoopbackInstanceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *CreateLoopbackInstanceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *CreateLoopbackInstanceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -244,29 +229,26 @@ func (*CreateLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CreateLoopbackReply) Size() int { +func (m *CreateLoopbackReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *CreateLoopbackReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *CreateLoopbackReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -287,11 +269,10 @@ func (*CreateSubif) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CreateSubif) Size() int { +func (m *CreateSubif) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.SubID size += 4 // m.SubIfFlags @@ -300,17 +281,15 @@ func (m *CreateSubif) Size() int { return size } func (m *CreateSubif) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.SubID)) + buf.EncodeUint32(m.SubID) buf.EncodeUint32(uint32(m.SubIfFlags)) - buf.EncodeUint16(uint16(m.OuterVlanID)) - buf.EncodeUint16(uint16(m.InnerVlanID)) + buf.EncodeUint16(m.OuterVlanID) + buf.EncodeUint16(m.InnerVlanID) return buf.Bytes(), nil } func (m *CreateSubif) Unmarshal(b []byte) error { @@ -336,29 +315,26 @@ func (*CreateSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CreateSubifReply) Size() int { +func (m *CreateSubifReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *CreateSubifReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *CreateSubifReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -376,24 +352,21 @@ func (*CreateVlanSubif) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CreateVlanSubif) Size() int { +func (m *CreateVlanSubif) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.VlanID return size } func (m *CreateVlanSubif) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.VlanID)) + buf.EncodeUint32(m.VlanID) return buf.Bytes(), nil } func (m *CreateVlanSubif) Unmarshal(b []byte) error { @@ -416,29 +389,26 @@ func (*CreateVlanSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CreateVlanSubifReply) Size() int { +func (m *CreateVlanSubifReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *CreateVlanSubifReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *CreateVlanSubifReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -455,21 +425,18 @@ func (*DeleteLoopback) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DeleteLoopback) Size() int { +func (m *DeleteLoopback) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *DeleteLoopback) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -491,27 +458,24 @@ func (*DeleteLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DeleteLoopbackReply) Size() int { +func (m *DeleteLoopbackReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DeleteLoopbackReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DeleteLoopbackReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -527,21 +491,18 @@ func (*DeleteSubif) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DeleteSubif) Size() int { +func (m *DeleteSubif) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *DeleteSubif) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -563,27 +524,24 @@ func (*DeleteSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DeleteSubifReply) Size() int { +func (m *DeleteSubifReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DeleteSubifReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DeleteSubifReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -600,24 +558,21 @@ func (*HwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *HwInterfaceSetMtu) Size() int { +func (m *HwInterfaceSetMtu) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 2 // m.Mtu return size } func (m *HwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint16(uint16(m.Mtu)) + buf.EncodeUint16(m.Mtu) return buf.Bytes(), nil } func (m *HwInterfaceSetMtu) Unmarshal(b []byte) error { @@ -639,27 +594,24 @@ func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *HwInterfaceSetMtuReply) Size() int { +func (m *HwInterfaceSetMtuReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *HwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *HwInterfaceSetMtuReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -676,24 +628,21 @@ func (*InterfaceNameRenumber) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *InterfaceNameRenumber) Size() int { +func (m *InterfaceNameRenumber) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.NewShowDevInstance return size } func (m *InterfaceNameRenumber) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.NewShowDevInstance)) + buf.EncodeUint32(m.NewShowDevInstance) return buf.Bytes(), nil } func (m *InterfaceNameRenumber) Unmarshal(b []byte) error { @@ -715,27 +664,24 @@ func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *InterfaceNameRenumberReply) Size() int { +func (m *InterfaceNameRenumberReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *InterfaceNameRenumberReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *InterfaceNameRenumberReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -754,11 +700,10 @@ func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceAddDelAddress) Size() int { +func (m *SwInterfaceAddDelAddress) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsAdd size += 1 // m.DelAll @@ -768,18 +713,16 @@ func (m *SwInterfaceAddDelAddress) Size() int { return size } func (m *SwInterfaceAddDelAddress) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.DelAll) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) return buf.Bytes(), nil } func (m *SwInterfaceAddDelAddress) Unmarshal(b []byte) error { @@ -807,27 +750,24 @@ func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceAddDelAddressReply) Size() int { +func (m *SwInterfaceAddDelAddressReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceAddDelAddressReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceAddDelAddressReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -847,26 +787,23 @@ func (*SwInterfaceAddDelMacAddress) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceAddDelMacAddress) Size() int { +func (m *SwInterfaceAddDelMacAddress) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 * 6 // m.Addr size += 1 // m.IsAdd return size } func (m *SwInterfaceAddDelMacAddress) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SwIfIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SwIfIndex) buf.EncodeBytes(m.Addr[:], 6) - buf.EncodeUint8(uint8(m.IsAdd)) + buf.EncodeUint8(m.IsAdd) return buf.Bytes(), nil } func (m *SwInterfaceAddDelMacAddress) Unmarshal(b []byte) error { @@ -891,27 +828,24 @@ func (*SwInterfaceAddDelMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceAddDelMacAddressReply) Size() int { +func (m *SwInterfaceAddDelMacAddressReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceAddDelMacAddressReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceAddDelMacAddressReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -927,20 +861,17 @@ func (*SwInterfaceAddressReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceAddressReplaceBegin) Size() int { +func (m *SwInterfaceAddressReplaceBegin) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SwInterfaceAddressReplaceBegin) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SwInterfaceAddressReplaceBegin) Unmarshal(b []byte) error { @@ -961,27 +892,24 @@ func (*SwInterfaceAddressReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceAddressReplaceBeginReply) Size() int { +func (m *SwInterfaceAddressReplaceBeginReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceAddressReplaceBeginReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceAddressReplaceBeginReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -997,20 +925,17 @@ func (*SwInterfaceAddressReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceAddressReplaceEnd) Size() int { +func (m *SwInterfaceAddressReplaceEnd) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SwInterfaceAddressReplaceEnd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SwInterfaceAddressReplaceEnd) Unmarshal(b []byte) error { @@ -1031,27 +956,24 @@ func (*SwInterfaceAddressReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceAddressReplaceEndReply) Size() int { +func (m *SwInterfaceAddressReplaceEndReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceAddressReplaceEndReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceAddressReplaceEndReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1067,21 +989,18 @@ func (*SwInterfaceClearStats) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceClearStats) Size() int { +func (m *SwInterfaceClearStats) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *SwInterfaceClearStats) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -1103,27 +1022,24 @@ func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceClearStatsReply) Size() int { +func (m *SwInterfaceClearStatsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceClearStatsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceClearStatsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1164,11 +1080,10 @@ func (*SwInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceDetails) Size() int { +func (m *SwInterfaceDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.SupSwIfIndex size += 1 * 6 // m.L2Address @@ -1198,41 +1113,39 @@ func (m *SwInterfaceDetails) Size() int { return size } func (m *SwInterfaceDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.SupSwIfIndex)) + buf.EncodeUint32(m.SupSwIfIndex) buf.EncodeBytes(m.L2Address[:], 6) buf.EncodeUint32(uint32(m.Flags)) buf.EncodeUint32(uint32(m.Type)) buf.EncodeUint32(uint32(m.LinkDuplex)) - buf.EncodeUint32(uint32(m.LinkSpeed)) - buf.EncodeUint16(uint16(m.LinkMtu)) + buf.EncodeUint32(m.LinkSpeed) + buf.EncodeUint16(m.LinkMtu) for i := 0; i < 4; i++ { var x uint32 if i < len(m.Mtu) { x = uint32(m.Mtu[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } - buf.EncodeUint32(uint32(m.SubID)) - buf.EncodeUint8(uint8(m.SubNumberOfTags)) - buf.EncodeUint16(uint16(m.SubOuterVlanID)) - buf.EncodeUint16(uint16(m.SubInnerVlanID)) + buf.EncodeUint32(m.SubID) + buf.EncodeUint8(m.SubNumberOfTags) + buf.EncodeUint16(m.SubOuterVlanID) + buf.EncodeUint16(m.SubInnerVlanID) buf.EncodeUint32(uint32(m.SubIfFlags)) - buf.EncodeUint32(uint32(m.VtrOp)) - buf.EncodeUint32(uint32(m.VtrPushDot1q)) - buf.EncodeUint32(uint32(m.VtrTag1)) - buf.EncodeUint32(uint32(m.VtrTag2)) - buf.EncodeUint16(uint16(m.OuterTag)) + buf.EncodeUint32(m.VtrOp) + buf.EncodeUint32(m.VtrPushDot1q) + buf.EncodeUint32(m.VtrTag1) + buf.EncodeUint32(m.VtrTag2) + buf.EncodeUint16(m.OuterTag) buf.EncodeBytes(m.BDmac[:], 6) buf.EncodeBytes(m.BSmac[:], 6) - buf.EncodeUint16(uint16(m.BVlanid)) - buf.EncodeUint32(uint32(m.ISid)) + buf.EncodeUint16(m.BVlanid) + buf.EncodeUint32(m.ISid) buf.EncodeString(m.InterfaceName, 64) buf.EncodeString(m.InterfaceDevType, 64) buf.EncodeString(m.Tag, 64) @@ -1274,7 +1187,7 @@ func (m *SwInterfaceDetails) Unmarshal(b []byte) error { // SwInterfaceDump defines message 'sw_interface_dump'. type SwInterfaceDump struct { - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` NameFilterValid bool `binapi:"bool,name=name_filter_valid" json:"name_filter_valid,omitempty"` NameFilter string `binapi:"string[],name=name_filter" json:"name_filter,omitempty"` } @@ -1286,23 +1199,20 @@ func (*SwInterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceDump) Size() int { +func (m *SwInterfaceDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.NameFilterValid size += 4 + len(m.NameFilter) // m.NameFilter return size } func (m *SwInterfaceDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.NameFilterValid) buf.EncodeString(m.NameFilter, 0) @@ -1331,11 +1241,10 @@ func (*SwInterfaceEvent) GetMessageType() api.MessageType { return api.EventMessage } -func (m *SwInterfaceEvent) Size() int { +func (m *SwInterfaceEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PID size += 4 // m.SwIfIndex size += 4 // m.Flags @@ -1343,13 +1252,11 @@ func (m *SwInterfaceEvent) Size() int { return size } func (m *SwInterfaceEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PID) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(uint32(m.Flags)) buf.EncodeBool(m.Deleted) @@ -1376,21 +1283,18 @@ func (*SwInterfaceGetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceGetMacAddress) Size() int { +func (m *SwInterfaceGetMacAddress) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *SwInterfaceGetMacAddress) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -1415,29 +1319,26 @@ func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceGetMacAddressReply) Size() int { +func (m *SwInterfaceGetMacAddressReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 * 6 // m.MacAddress return size } func (m *SwInterfaceGetMacAddressReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBytes(m.MacAddress[:], 6) return buf.Bytes(), nil } func (m *SwInterfaceGetMacAddressReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() copy(m.MacAddress[:], buf.DecodeBytes(6)) return nil } @@ -1455,22 +1356,19 @@ func (*SwInterfaceGetTable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceGetTable) Size() int { +func (m *SwInterfaceGetTable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 return size } func (m *SwInterfaceGetTable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) return buf.Bytes(), nil @@ -1495,29 +1393,26 @@ func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceGetTableReply) Size() int { +func (m *SwInterfaceGetTableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.VrfID return size } func (m *SwInterfaceGetTableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.VrfID)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.VrfID) return buf.Bytes(), nil } func (m *SwInterfaceGetTableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.VrfID = buf.DecodeUint32() return nil } @@ -1539,11 +1434,10 @@ func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceRxPlacementDetails) Size() int { +func (m *SwInterfaceRxPlacementDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.QueueID size += 4 // m.WorkerID @@ -1551,15 +1445,13 @@ func (m *SwInterfaceRxPlacementDetails) Size() int { return size } func (m *SwInterfaceRxPlacementDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.QueueID)) - buf.EncodeUint32(uint32(m.WorkerID)) + buf.EncodeUint32(m.QueueID) + buf.EncodeUint32(m.WorkerID) buf.EncodeUint32(uint32(m.Mode)) return buf.Bytes(), nil } @@ -1584,21 +1476,18 @@ func (*SwInterfaceRxPlacementDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceRxPlacementDump) Size() int { +func (m *SwInterfaceRxPlacementDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *SwInterfaceRxPlacementDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -1621,22 +1510,19 @@ func (*SwInterfaceSetFlags) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetFlags) Size() int { +func (m *SwInterfaceSetFlags) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.Flags return size } func (m *SwInterfaceSetFlags) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(uint32(m.Flags)) return buf.Bytes(), nil @@ -1660,27 +1546,24 @@ func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetFlagsReply) Size() int { +func (m *SwInterfaceSetFlagsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetFlagsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetFlagsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1699,22 +1582,19 @@ func (*SwInterfaceSetIPDirectedBroadcast) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetIPDirectedBroadcast) Size() int { +func (m *SwInterfaceSetIPDirectedBroadcast) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Enable return size } func (m *SwInterfaceSetIPDirectedBroadcast) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) return buf.Bytes(), nil @@ -1742,27 +1622,24 @@ func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType return api.ReplyMessage } -func (m *SwInterfaceSetIPDirectedBroadcastReply) Size() int { +func (m *SwInterfaceSetIPDirectedBroadcastReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetIPDirectedBroadcastReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetIPDirectedBroadcastReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1779,22 +1656,19 @@ func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetMacAddress) Size() int { +func (m *SwInterfaceSetMacAddress) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 * 6 // m.MacAddress return size } func (m *SwInterfaceSetMacAddress) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.MacAddress[:], 6) return buf.Bytes(), nil @@ -1820,27 +1694,24 @@ func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetMacAddressReply) Size() int { +func (m *SwInterfaceSetMacAddressReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetMacAddressReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetMacAddressReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1857,29 +1728,26 @@ func (*SwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetMtu) Size() int { +func (m *SwInterfaceSetMtu) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 * 4 // m.Mtu return size } func (m *SwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) for i := 0; i < 4; i++ { var x uint32 if i < len(m.Mtu) { x = uint32(m.Mtu[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } @@ -1905,27 +1773,24 @@ func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetMtuReply) Size() int { +func (m *SwInterfaceSetMtuReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetMtuReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1944,11 +1809,10 @@ func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetRxMode) Size() int { +func (m *SwInterfaceSetRxMode) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.QueueIDValid size += 4 // m.QueueID @@ -1956,15 +1820,13 @@ func (m *SwInterfaceSetRxMode) Size() int { return size } func (m *SwInterfaceSetRxMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.QueueIDValid) - buf.EncodeUint32(uint32(m.QueueID)) + buf.EncodeUint32(m.QueueID) buf.EncodeUint32(uint32(m.Mode)) return buf.Bytes(), nil } @@ -1989,27 +1851,24 @@ func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetRxModeReply) Size() int { +func (m *SwInterfaceSetRxModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetRxModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetRxModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2028,11 +1887,10 @@ func (*SwInterfaceSetRxPlacement) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetRxPlacement) Size() int { +func (m *SwInterfaceSetRxPlacement) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.QueueID size += 4 // m.WorkerID @@ -2040,15 +1898,13 @@ func (m *SwInterfaceSetRxPlacement) Size() int { return size } func (m *SwInterfaceSetRxPlacement) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.QueueID)) - buf.EncodeUint32(uint32(m.WorkerID)) + buf.EncodeUint32(m.QueueID) + buf.EncodeUint32(m.WorkerID) buf.EncodeBool(m.IsMain) return buf.Bytes(), nil } @@ -2075,27 +1931,24 @@ func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetRxPlacementReply) Size() int { +func (m *SwInterfaceSetRxPlacementReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetRxPlacementReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetRxPlacementReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2113,26 +1966,23 @@ func (*SwInterfaceSetTable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetTable) Size() int { +func (m *SwInterfaceSetTable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 size += 4 // m.VrfID return size } func (m *SwInterfaceSetTable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) return buf.Bytes(), nil } func (m *SwInterfaceSetTable) Unmarshal(b []byte) error { @@ -2155,27 +2005,24 @@ func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetTableReply) Size() int { +func (m *SwInterfaceSetTableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetTableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetTableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2193,23 +2040,20 @@ func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetUnnumbered) Size() int { +func (m *SwInterfaceSetUnnumbered) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.UnnumberedSwIfIndex size += 1 // m.IsAdd return size } func (m *SwInterfaceSetUnnumbered) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(uint32(m.UnnumberedSwIfIndex)) buf.EncodeBool(m.IsAdd) @@ -2237,27 +2081,24 @@ func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetUnnumberedReply) Size() int { +func (m *SwInterfaceSetUnnumberedReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetUnnumberedReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetUnnumberedReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2275,23 +2116,20 @@ func (*SwInterfaceTagAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceTagAddDel) Size() int { +func (m *SwInterfaceTagAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SwIfIndex size += 64 // m.Tag return size } func (m *SwInterfaceTagAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeString(m.Tag, 64) @@ -2317,27 +2155,24 @@ func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceTagAddDelReply) Size() int { +func (m *SwInterfaceTagAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceTagAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceTagAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2354,24 +2189,21 @@ func (*WantInterfaceEvents) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *WantInterfaceEvents) Size() int { +func (m *WantInterfaceEvents) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.EnableDisable size += 4 // m.PID return size } func (m *WantInterfaceEvents) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.EnableDisable)) - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.EnableDisable) + buf.EncodeUint32(m.PID) return buf.Bytes(), nil } func (m *WantInterfaceEvents) Unmarshal(b []byte) error { @@ -2393,27 +2225,24 @@ func (*WantInterfaceEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *WantInterfaceEventsReply) Size() int { +func (m *WantInterfaceEventsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *WantInterfaceEventsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *WantInterfaceEventsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ioam_cache/ioam_cache.ba.go b/binapi/ioam_cache/ioam_cache.ba.go index d48b15b..2f9f0ef 100644 --- a/binapi/ioam_cache/ioam_cache.ba.go +++ b/binapi/ioam_cache/ioam_cache.ba.go @@ -40,21 +40,18 @@ func (*IoamCacheIP6EnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IoamCacheIP6EnableDisable) Size() int { +func (m *IoamCacheIP6EnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsDisable return size } func (m *IoamCacheIP6EnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsDisable) return buf.Bytes(), nil } @@ -78,27 +75,24 @@ func (*IoamCacheIP6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IoamCacheIP6EnableDisableReply) Size() int { +func (m *IoamCacheIP6EnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IoamCacheIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IoamCacheIP6EnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ioam_export/ioam_export.ba.go b/binapi/ioam_export/ioam_export.ba.go index b95f506..47dd4e2 100644 --- a/binapi/ioam_export/ioam_export.ba.go +++ b/binapi/ioam_export/ioam_export.ba.go @@ -43,23 +43,20 @@ func (*IoamExportIP6EnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IoamExportIP6EnableDisable) Size() int { +func (m *IoamExportIP6EnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsDisable size += 1 * 4 // m.CollectorAddress size += 1 * 4 // m.SrcAddress return size } func (m *IoamExportIP6EnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsDisable) buf.EncodeBytes(m.CollectorAddress[:], 4) buf.EncodeBytes(m.SrcAddress[:], 4) @@ -87,27 +84,24 @@ func (*IoamExportIP6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IoamExportIP6EnableDisableReply) Size() int { +func (m *IoamExportIP6EnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IoamExportIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IoamExportIP6EnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go b/binapi/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go index 819b136..7d1bb35 100644 --- a/binapi/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go +++ b/binapi/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go @@ -41,22 +41,19 @@ func (*VxlanGpeIoamDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGpeIoamDisable) Size() int { +func (m *VxlanGpeIoamDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.ID return size } func (m *VxlanGpeIoamDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.ID) return buf.Bytes(), nil } func (m *VxlanGpeIoamDisable) Unmarshal(b []byte) error { @@ -77,27 +74,24 @@ func (*VxlanGpeIoamDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGpeIoamDisableReply) Size() int { +func (m *VxlanGpeIoamDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VxlanGpeIoamDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VxlanGpeIoamDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -116,11 +110,10 @@ func (*VxlanGpeIoamEnable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGpeIoamEnable) Size() int { +func (m *VxlanGpeIoamEnable) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.ID size += 1 // m.TracePpc size += 1 // m.PowEnable @@ -128,14 +121,12 @@ func (m *VxlanGpeIoamEnable) Size() int { return size } func (m *VxlanGpeIoamEnable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.ID)) - buf.EncodeUint8(uint8(m.TracePpc)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.ID) + buf.EncodeUint8(m.TracePpc) buf.EncodeBool(m.PowEnable) buf.EncodeBool(m.TraceEnable) return buf.Bytes(), nil @@ -161,27 +152,24 @@ func (*VxlanGpeIoamEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGpeIoamEnableReply) Size() int { +func (m *VxlanGpeIoamEnableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VxlanGpeIoamEnableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VxlanGpeIoamEnableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -198,26 +186,23 @@ func (*VxlanGpeIoamTransitDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGpeIoamTransitDisable) Size() int { +func (m *VxlanGpeIoamTransitDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.OuterFibIndex size += 1 // m.DstAddr.Af size += 1 * 16 // m.DstAddr.Un return size } func (m *VxlanGpeIoamTransitDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.OuterFibIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.OuterFibIndex) buf.EncodeUint8(uint8(m.DstAddr.Af)) - buf.EncodeBytes(m.DstAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DstAddr.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *VxlanGpeIoamTransitDisable) Unmarshal(b []byte) error { @@ -242,27 +227,24 @@ func (*VxlanGpeIoamTransitDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGpeIoamTransitDisableReply) Size() int { +func (m *VxlanGpeIoamTransitDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VxlanGpeIoamTransitDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VxlanGpeIoamTransitDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -279,26 +261,23 @@ func (*VxlanGpeIoamTransitEnable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGpeIoamTransitEnable) Size() int { +func (m *VxlanGpeIoamTransitEnable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.OuterFibIndex size += 1 // m.DstAddr.Af size += 1 * 16 // m.DstAddr.Un return size } func (m *VxlanGpeIoamTransitEnable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.OuterFibIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.OuterFibIndex) buf.EncodeUint8(uint8(m.DstAddr.Af)) - buf.EncodeBytes(m.DstAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DstAddr.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *VxlanGpeIoamTransitEnable) Unmarshal(b []byte) error { @@ -323,27 +302,24 @@ func (*VxlanGpeIoamTransitEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGpeIoamTransitEnableReply) Size() int { +func (m *VxlanGpeIoamTransitEnableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VxlanGpeIoamTransitEnableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VxlanGpeIoamTransitEnableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -361,11 +337,10 @@ func (*VxlanGpeIoamVniDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGpeIoamVniDisable) Size() int { +func (m *VxlanGpeIoamVniDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni size += 1 // m.Local.Af size += 1 * 16 // m.Local.Un @@ -374,17 +349,15 @@ func (m *VxlanGpeIoamVniDisable) Size() int { return size } func (m *VxlanGpeIoamVniDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Local.Af)) - buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Remote.Af)) - buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *VxlanGpeIoamVniDisable) Unmarshal(b []byte) error { @@ -411,27 +384,24 @@ func (*VxlanGpeIoamVniDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGpeIoamVniDisableReply) Size() int { +func (m *VxlanGpeIoamVniDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VxlanGpeIoamVniDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VxlanGpeIoamVniDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -449,11 +419,10 @@ func (*VxlanGpeIoamVniEnable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGpeIoamVniEnable) Size() int { +func (m *VxlanGpeIoamVniEnable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni size += 1 // m.Local.Af size += 1 * 16 // m.Local.Un @@ -462,17 +431,15 @@ func (m *VxlanGpeIoamVniEnable) Size() int { return size } func (m *VxlanGpeIoamVniEnable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Local.Af)) - buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Remote.Af)) - buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *VxlanGpeIoamVniEnable) Unmarshal(b []byte) error { @@ -497,27 +464,24 @@ func (*VxlanGpeIoamVniEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGpeIoamVniEnableReply) Size() int { +func (m *VxlanGpeIoamVniEnableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VxlanGpeIoamVniEnableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VxlanGpeIoamVniEnableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ip/ip.ba.go b/binapi/ip/ip.ba.go index 7702c92..df5b593 100644 --- a/binapi/ip/ip.ba.go +++ b/binapi/ip/ip.ba.go @@ -108,22 +108,19 @@ func (*IoamDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IoamDisable) Size() int { +func (m *IoamDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.ID return size } func (m *IoamDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.ID) return buf.Bytes(), nil } func (m *IoamDisable) Unmarshal(b []byte) error { @@ -144,27 +141,24 @@ func (*IoamDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IoamDisableReply) Size() int { +func (m *IoamDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IoamDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IoamDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -185,11 +179,10 @@ func (*IoamEnable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IoamEnable) Size() int { +func (m *IoamEnable) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.ID size += 1 // m.Seqno size += 1 // m.Analyse @@ -199,18 +192,16 @@ func (m *IoamEnable) Size() int { return size } func (m *IoamEnable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.ID) buf.EncodeBool(m.Seqno) buf.EncodeBool(m.Analyse) buf.EncodeBool(m.PotEnable) buf.EncodeBool(m.TraceEnable) - buf.EncodeUint32(uint32(m.NodeID)) + buf.EncodeUint32(m.NodeID) return buf.Bytes(), nil } func (m *IoamEnable) Unmarshal(b []byte) error { @@ -236,27 +227,24 @@ func (*IoamEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IoamEnableReply) Size() int { +func (m *IoamEnableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IoamEnableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IoamEnableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -273,11 +261,10 @@ func (*IPAddressDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPAddressDetails) Size() int { +func (m *IPAddressDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Prefix.Address.Af size += 1 * 16 // m.Prefix.Address.Un @@ -285,16 +272,14 @@ func (m *IPAddressDetails) Size() int { return size } func (m *IPAddressDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) return buf.Bytes(), nil } func (m *IPAddressDetails) Unmarshal(b []byte) error { @@ -319,22 +304,19 @@ func (*IPAddressDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPAddressDump) Size() int { +func (m *IPAddressDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 return size } func (m *IPAddressDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) return buf.Bytes(), nil @@ -360,11 +342,10 @@ func (*IPContainerProxyAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPContainerProxyAddDel) Size() int { +func (m *IPContainerProxyAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Pfx.Address.Af size += 1 * 16 // m.Pfx.Address.Un size += 1 // m.Pfx.Len @@ -373,15 +354,13 @@ func (m *IPContainerProxyAddDel) Size() int { return size } func (m *IPContainerProxyAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Pfx.Address.Af)) - buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Pfx.Len)) + buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Pfx.Len) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil @@ -410,27 +389,24 @@ func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPContainerProxyAddDelReply) Size() int { +func (m *IPContainerProxyAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPContainerProxyAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPContainerProxyAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -447,11 +423,10 @@ func (*IPContainerProxyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPContainerProxyDetails) Size() int { +func (m *IPContainerProxyDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Prefix.Address.Af size += 1 * 16 // m.Prefix.Address.Un @@ -459,16 +434,14 @@ func (m *IPContainerProxyDetails) Size() int { return size } func (m *IPContainerProxyDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) return buf.Bytes(), nil } func (m *IPContainerProxyDetails) Unmarshal(b []byte) error { @@ -490,20 +463,17 @@ func (*IPContainerProxyDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPContainerProxyDump) Size() int { +func (m *IPContainerProxyDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IPContainerProxyDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IPContainerProxyDump) Unmarshal(b []byte) error { @@ -523,22 +493,19 @@ func (*IPDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPDetails) Size() int { +func (m *IPDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 return size } func (m *IPDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) return buf.Bytes(), nil @@ -562,21 +529,18 @@ func (*IPDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPDump) Size() int { +func (m *IPDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsIPv6 return size } func (m *IPDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsIPv6) return buf.Bytes(), nil } @@ -600,11 +564,10 @@ func (*IPMrouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPMrouteAddDel) Size() int { +func (m *IPMrouteAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IsMultipath size += 4 // m.Route.TableID @@ -636,64 +599,53 @@ func (m *IPMrouteAddDel) Size() int { size += 4 // s2.Path.Nh.ClassifyTableIndex size += 1 // s2.Path.NLabels for j4 := 0; j4 < 16; j4++ { - var s4 fib_types.FibMplsLabel - _ = s4 - if j4 < len(s2.Path.LabelStack) { - s4 = s2.Path.LabelStack[j4] - } - size += 1 // s4.IsUniform - size += 4 // s4.Label - size += 1 // s4.TTL - size += 1 // s4.Exp + size += 1 // s2.Path.LabelStack[j4].IsUniform + size += 4 // s2.Path.LabelStack[j4].Label + size += 1 // s2.Path.LabelStack[j4].TTL + size += 1 // s2.Path.LabelStack[j4].Exp } } return size } func (m *IPMrouteAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.IsMultipath) - buf.EncodeUint32(uint32(m.Route.TableID)) - buf.EncodeUint32(uint32(m.Route.EntryFlags)) - buf.EncodeUint32(uint32(m.Route.RpfID)) + buf.EncodeUint32(m.Route.TableID) + buf.EncodeUint32(m.Route.EntryFlags) + buf.EncodeUint32(m.Route.RpfID) buf.EncodeUint8(uint8(m.Route.Prefix.Af)) - buf.EncodeUint16(uint16(m.Route.Prefix.GrpAddressLength)) - buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 0) - buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 0) + buf.EncodeUint16(m.Route.Prefix.GrpAddressLength) + buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 16) + buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(len(m.Route.Paths))) for j1 := 0; j1 < len(m.Route.Paths); j1++ { - var v1 mfib_types.MfibPath + var v1 mfib_types.MfibPath // Paths if j1 < len(m.Route.Paths) { v1 = m.Route.Paths[j1] } buf.EncodeUint32(uint32(v1.ItfFlags)) - buf.EncodeUint32(uint32(v1.Path.SwIfIndex)) - buf.EncodeUint32(uint32(v1.Path.TableID)) - buf.EncodeUint32(uint32(v1.Path.RpfID)) - buf.EncodeUint8(uint8(v1.Path.Weight)) - buf.EncodeUint8(uint8(v1.Path.Preference)) + buf.EncodeUint32(v1.Path.SwIfIndex) + buf.EncodeUint32(v1.Path.TableID) + buf.EncodeUint32(v1.Path.RpfID) + buf.EncodeUint8(v1.Path.Weight) + buf.EncodeUint8(v1.Path.Preference) buf.EncodeUint32(uint32(v1.Path.Type)) buf.EncodeUint32(uint32(v1.Path.Flags)) buf.EncodeUint32(uint32(v1.Path.Proto)) - buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Path.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Path.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Path.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.Path.NLabels)) + buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Path.Nh.ViaLabel) + buf.EncodeUint32(v1.Path.Nh.ObjID) + buf.EncodeUint32(v1.Path.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.Path.NLabels) for j3 := 0; j3 < 16; j3++ { - var v3 fib_types.FibMplsLabel - if j3 < len(v1.Path.LabelStack) { - v3 = v1.Path.LabelStack[j3] - } - buf.EncodeUint8(uint8(v3.IsUniform)) - buf.EncodeUint32(uint32(v3.Label)) - buf.EncodeUint8(uint8(v3.TTL)) - buf.EncodeUint8(uint8(v3.Exp)) + buf.EncodeUint8(v1.Path.LabelStack[j3].IsUniform) + buf.EncodeUint32(v1.Path.LabelStack[j3].Label) + buf.EncodeUint8(v1.Path.LabelStack[j3].TTL) + buf.EncodeUint8(v1.Path.LabelStack[j3].Exp) } } return buf.Bytes(), nil @@ -710,7 +662,7 @@ func (m *IPMrouteAddDel) Unmarshal(b []byte) error { copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16)) copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16)) m.Route.NPaths = buf.DecodeUint8() - m.Route.Paths = make([]mfib_types.MfibPath, int(m.Route.NPaths)) + m.Route.Paths = make([]mfib_types.MfibPath, m.Route.NPaths) for j1 := 0; j1 < len(m.Route.Paths); j1++ { m.Route.Paths[j1].ItfFlags = mfib_types.MfibItfFlags(buf.DecodeUint32()) m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32() @@ -749,29 +701,26 @@ func (*IPMrouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPMrouteAddDelReply) Size() int { +func (m *IPMrouteAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.StatsIndex return size } func (m *IPMrouteAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.StatsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatsIndex) return buf.Bytes(), nil } func (m *IPMrouteAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.StatsIndex = buf.DecodeUint32() return nil } @@ -788,11 +737,10 @@ func (*IPMrouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPMrouteDetails) Size() int { +func (m *IPMrouteDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Route.TableID size += 4 // m.Route.EntryFlags size += 4 // m.Route.RpfID @@ -822,62 +770,51 @@ func (m *IPMrouteDetails) Size() int { size += 4 // s2.Path.Nh.ClassifyTableIndex size += 1 // s2.Path.NLabels for j4 := 0; j4 < 16; j4++ { - var s4 fib_types.FibMplsLabel - _ = s4 - if j4 < len(s2.Path.LabelStack) { - s4 = s2.Path.LabelStack[j4] - } - size += 1 // s4.IsUniform - size += 4 // s4.Label - size += 1 // s4.TTL - size += 1 // s4.Exp + size += 1 // s2.Path.LabelStack[j4].IsUniform + size += 4 // s2.Path.LabelStack[j4].Label + size += 1 // s2.Path.LabelStack[j4].TTL + size += 1 // s2.Path.LabelStack[j4].Exp } } return size } func (m *IPMrouteDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Route.TableID)) - buf.EncodeUint32(uint32(m.Route.EntryFlags)) - buf.EncodeUint32(uint32(m.Route.RpfID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Route.TableID) + buf.EncodeUint32(m.Route.EntryFlags) + buf.EncodeUint32(m.Route.RpfID) buf.EncodeUint8(uint8(m.Route.Prefix.Af)) - buf.EncodeUint16(uint16(m.Route.Prefix.GrpAddressLength)) - buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 0) - buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 0) + buf.EncodeUint16(m.Route.Prefix.GrpAddressLength) + buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 16) + buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(len(m.Route.Paths))) for j1 := 0; j1 < len(m.Route.Paths); j1++ { - var v1 mfib_types.MfibPath + var v1 mfib_types.MfibPath // Paths if j1 < len(m.Route.Paths) { v1 = m.Route.Paths[j1] } buf.EncodeUint32(uint32(v1.ItfFlags)) - buf.EncodeUint32(uint32(v1.Path.SwIfIndex)) - buf.EncodeUint32(uint32(v1.Path.TableID)) - buf.EncodeUint32(uint32(v1.Path.RpfID)) - buf.EncodeUint8(uint8(v1.Path.Weight)) - buf.EncodeUint8(uint8(v1.Path.Preference)) + buf.EncodeUint32(v1.Path.SwIfIndex) + buf.EncodeUint32(v1.Path.TableID) + buf.EncodeUint32(v1.Path.RpfID) + buf.EncodeUint8(v1.Path.Weight) + buf.EncodeUint8(v1.Path.Preference) buf.EncodeUint32(uint32(v1.Path.Type)) buf.EncodeUint32(uint32(v1.Path.Flags)) buf.EncodeUint32(uint32(v1.Path.Proto)) - buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Path.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Path.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Path.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.Path.NLabels)) + buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Path.Nh.ViaLabel) + buf.EncodeUint32(v1.Path.Nh.ObjID) + buf.EncodeUint32(v1.Path.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.Path.NLabels) for j3 := 0; j3 < 16; j3++ { - var v3 fib_types.FibMplsLabel - if j3 < len(v1.Path.LabelStack) { - v3 = v1.Path.LabelStack[j3] - } - buf.EncodeUint8(uint8(v3.IsUniform)) - buf.EncodeUint32(uint32(v3.Label)) - buf.EncodeUint8(uint8(v3.TTL)) - buf.EncodeUint8(uint8(v3.Exp)) + buf.EncodeUint8(v1.Path.LabelStack[j3].IsUniform) + buf.EncodeUint32(v1.Path.LabelStack[j3].Label) + buf.EncodeUint8(v1.Path.LabelStack[j3].TTL) + buf.EncodeUint8(v1.Path.LabelStack[j3].Exp) } } return buf.Bytes(), nil @@ -892,7 +829,7 @@ func (m *IPMrouteDetails) Unmarshal(b []byte) error { copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16)) copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16)) m.Route.NPaths = buf.DecodeUint8() - m.Route.Paths = make([]mfib_types.MfibPath, int(m.Route.NPaths)) + m.Route.Paths = make([]mfib_types.MfibPath, m.Route.NPaths) for j1 := 0; j1 < len(m.Route.Paths); j1++ { m.Route.Paths[j1].ItfFlags = mfib_types.MfibItfFlags(buf.DecodeUint32()) m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32() @@ -930,24 +867,21 @@ func (*IPMrouteDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPMrouteDump) Size() int { +func (m *IPMrouteDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Table.TableID size += 1 // m.Table.IsIP6 size += 64 // m.Table.Name return size } func (m *IPMrouteDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Table.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Table.TableID) buf.EncodeBool(m.Table.IsIP6) buf.EncodeString(m.Table.Name, 64) return buf.Bytes(), nil @@ -972,24 +906,21 @@ func (*IPMtableDetails) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPMtableDetails) Size() int { +func (m *IPMtableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Table.TableID size += 1 // m.Table.IsIP6 size += 64 // m.Table.Name return size } func (m *IPMtableDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Table.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Table.TableID) buf.EncodeBool(m.Table.IsIP6) buf.EncodeString(m.Table.Name, 64) return buf.Bytes(), nil @@ -1012,20 +943,17 @@ func (*IPMtableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPMtableDump) Size() int { +func (m *IPMtableDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IPMtableDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IPMtableDump) Unmarshal(b []byte) error { @@ -1046,24 +974,21 @@ func (*IPPuntPolice) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPPuntPolice) Size() int { +func (m *IPPuntPolice) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PolicerIndex size += 1 // m.IsAdd size += 1 // m.IsIP6 return size } func (m *IPPuntPolice) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PolicerIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PolicerIndex) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.IsIP6) return buf.Bytes(), nil @@ -1088,27 +1013,24 @@ func (*IPPuntPoliceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPPuntPoliceReply) Size() int { +func (m *IPPuntPoliceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPPuntPoliceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPPuntPoliceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1125,11 +1047,10 @@ func (*IPPuntRedirect) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPPuntRedirect) Size() int { +func (m *IPPuntRedirect) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Punt.RxSwIfIndex size += 4 // m.Punt.TxSwIfIndex size += 1 // m.Punt.Nh.Af @@ -1138,16 +1059,14 @@ func (m *IPPuntRedirect) Size() int { return size } func (m *IPPuntRedirect) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex)) buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex)) buf.EncodeUint8(uint8(m.Punt.Nh.Af)) - buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -1173,11 +1092,10 @@ func (*IPPuntRedirectDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPPuntRedirectDetails) Size() int { +func (m *IPPuntRedirectDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Punt.RxSwIfIndex size += 4 // m.Punt.TxSwIfIndex size += 1 // m.Punt.Nh.Af @@ -1185,16 +1103,14 @@ func (m *IPPuntRedirectDetails) Size() int { return size } func (m *IPPuntRedirectDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex)) buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex)) buf.EncodeUint8(uint8(m.Punt.Nh.Af)) - buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *IPPuntRedirectDetails) Unmarshal(b []byte) error { @@ -1219,22 +1135,19 @@ func (*IPPuntRedirectDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPPuntRedirectDump) Size() int { +func (m *IPPuntRedirectDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 return size } func (m *IPPuntRedirectDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) return buf.Bytes(), nil @@ -1258,27 +1171,24 @@ func (*IPPuntRedirectReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPPuntRedirectReply) Size() int { +func (m *IPPuntRedirectReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPPuntRedirectReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPPuntRedirectReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1297,11 +1207,10 @@ func (*IPReassemblyEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPReassemblyEnableDisable) Size() int { +func (m *IPReassemblyEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.EnableIP4 size += 1 // m.EnableIP6 @@ -1309,12 +1218,10 @@ func (m *IPReassemblyEnableDisable) Size() int { return size } func (m *IPReassemblyEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.EnableIP4) buf.EncodeBool(m.EnableIP6) @@ -1344,27 +1251,24 @@ func (*IPReassemblyEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPReassemblyEnableDisableReply) Size() int { +func (m *IPReassemblyEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPReassemblyEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPReassemblyEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1381,22 +1285,19 @@ func (*IPReassemblyGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPReassemblyGet) Size() int { +func (m *IPReassemblyGet) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsIP6 size += 4 // m.Type return size } func (m *IPReassemblyGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsIP6) buf.EncodeUint32(uint32(m.Type)) return buf.Bytes(), nil @@ -1425,11 +1326,10 @@ func (*IPReassemblyGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPReassemblyGetReply) Size() int { +func (m *IPReassemblyGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.TimeoutMs size += 4 // m.MaxReassemblies @@ -1439,23 +1339,21 @@ func (m *IPReassemblyGetReply) Size() int { return size } func (m *IPReassemblyGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.TimeoutMs)) - buf.EncodeUint32(uint32(m.MaxReassemblies)) - buf.EncodeUint32(uint32(m.MaxReassemblyLength)) - buf.EncodeUint32(uint32(m.ExpireWalkIntervalMs)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TimeoutMs) + buf.EncodeUint32(m.MaxReassemblies) + buf.EncodeUint32(m.MaxReassemblyLength) + buf.EncodeUint32(m.ExpireWalkIntervalMs) buf.EncodeBool(m.IsIP6) return buf.Bytes(), nil } func (m *IPReassemblyGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.TimeoutMs = buf.DecodeUint32() m.MaxReassemblies = buf.DecodeUint32() m.MaxReassemblyLength = buf.DecodeUint32() @@ -1481,11 +1379,10 @@ func (*IPReassemblySet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPReassemblySet) Size() int { +func (m *IPReassemblySet) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TimeoutMs size += 4 // m.MaxReassemblies size += 4 // m.MaxReassemblyLength @@ -1495,16 +1392,14 @@ func (m *IPReassemblySet) Size() int { return size } func (m *IPReassemblySet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.TimeoutMs)) - buf.EncodeUint32(uint32(m.MaxReassemblies)) - buf.EncodeUint32(uint32(m.MaxReassemblyLength)) - buf.EncodeUint32(uint32(m.ExpireWalkIntervalMs)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TimeoutMs) + buf.EncodeUint32(m.MaxReassemblies) + buf.EncodeUint32(m.MaxReassemblyLength) + buf.EncodeUint32(m.ExpireWalkIntervalMs) buf.EncodeBool(m.IsIP6) buf.EncodeUint32(uint32(m.Type)) return buf.Bytes(), nil @@ -1532,27 +1427,24 @@ func (*IPReassemblySetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPReassemblySetReply) Size() int { +func (m *IPReassemblySetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPReassemblySetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPReassemblySetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1570,11 +1462,10 @@ func (*IPRouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPRouteAddDel) Size() int { +func (m *IPRouteAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IsMultipath size += 4 // m.Route.TableID @@ -1603,61 +1494,50 @@ func (m *IPRouteAddDel) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *IPRouteAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.IsMultipath) - buf.EncodeUint32(uint32(m.Route.TableID)) - buf.EncodeUint32(uint32(m.Route.StatsIndex)) + buf.EncodeUint32(m.Route.TableID) + buf.EncodeUint32(m.Route.StatsIndex) buf.EncodeUint8(uint8(m.Route.Prefix.Address.Af)) - buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Route.Prefix.Len)) + buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Route.Prefix.Len) buf.EncodeUint8(uint8(len(m.Route.Paths))) for j1 := 0; j1 < len(m.Route.Paths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // Paths if j1 < len(m.Route.Paths) { v1 = m.Route.Paths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -1672,7 +1552,7 @@ func (m *IPRouteAddDel) Unmarshal(b []byte) error { copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Route.Prefix.Len = buf.DecodeUint8() m.Route.NPaths = buf.DecodeUint8() - m.Route.Paths = make([]fib_types.FibPath, int(m.Route.NPaths)) + m.Route.Paths = make([]fib_types.FibPath, m.Route.NPaths) for j1 := 0; j1 < len(m.Route.Paths); j1++ { m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32() m.Route.Paths[j1].TableID = buf.DecodeUint32() @@ -1710,29 +1590,26 @@ func (*IPRouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPRouteAddDelReply) Size() int { +func (m *IPRouteAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.StatsIndex return size } func (m *IPRouteAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.StatsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatsIndex) return buf.Bytes(), nil } func (m *IPRouteAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.StatsIndex = buf.DecodeUint32() return nil } @@ -1749,11 +1626,10 @@ func (*IPRouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPRouteDetails) Size() int { +func (m *IPRouteDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Route.TableID size += 4 // m.Route.StatsIndex size += 1 // m.Route.Prefix.Address.Af @@ -1780,59 +1656,48 @@ func (m *IPRouteDetails) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *IPRouteDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Route.TableID)) - buf.EncodeUint32(uint32(m.Route.StatsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Route.TableID) + buf.EncodeUint32(m.Route.StatsIndex) buf.EncodeUint8(uint8(m.Route.Prefix.Address.Af)) - buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Route.Prefix.Len)) + buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Route.Prefix.Len) buf.EncodeUint8(uint8(len(m.Route.Paths))) for j1 := 0; j1 < len(m.Route.Paths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // Paths if j1 < len(m.Route.Paths) { v1 = m.Route.Paths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -1845,7 +1710,7 @@ func (m *IPRouteDetails) Unmarshal(b []byte) error { copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Route.Prefix.Len = buf.DecodeUint8() m.Route.NPaths = buf.DecodeUint8() - m.Route.Paths = make([]fib_types.FibPath, int(m.Route.NPaths)) + m.Route.Paths = make([]fib_types.FibPath, m.Route.NPaths) for j1 := 0; j1 < len(m.Route.Paths); j1++ { m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32() m.Route.Paths[j1].TableID = buf.DecodeUint32() @@ -1882,24 +1747,21 @@ func (*IPRouteDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPRouteDump) Size() int { +func (m *IPRouteDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Table.TableID size += 1 // m.Table.IsIP6 size += 64 // m.Table.Name return size } func (m *IPRouteDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Table.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Table.TableID) buf.EncodeBool(m.Table.IsIP6) buf.EncodeString(m.Table.Name, 64) return buf.Bytes(), nil @@ -1926,11 +1788,10 @@ func (*IPRouteLookup) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPRouteLookup) Size() int { +func (m *IPRouteLookup) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TableID size += 1 // m.Exact size += 1 // m.Prefix.Address.Af @@ -1939,17 +1800,15 @@ func (m *IPRouteLookup) Size() int { return size } func (m *IPRouteLookup) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.TableID)) - buf.EncodeUint8(uint8(m.Exact)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) + buf.EncodeUint8(m.Exact) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) return buf.Bytes(), nil } func (m *IPRouteLookup) Unmarshal(b []byte) error { @@ -1975,11 +1834,10 @@ func (*IPRouteLookupReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPRouteLookupReply) Size() int { +func (m *IPRouteLookupReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Route.TableID size += 4 // m.Route.StatsIndex @@ -2007,74 +1865,63 @@ func (m *IPRouteLookupReply) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *IPRouteLookupReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.Route.TableID)) - buf.EncodeUint32(uint32(m.Route.StatsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.Route.TableID) + buf.EncodeUint32(m.Route.StatsIndex) buf.EncodeUint8(uint8(m.Route.Prefix.Address.Af)) - buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Route.Prefix.Len)) + buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Route.Prefix.Len) buf.EncodeUint8(uint8(len(m.Route.Paths))) for j1 := 0; j1 < len(m.Route.Paths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // Paths if j1 < len(m.Route.Paths) { v1 = m.Route.Paths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil } func (m *IPRouteLookupReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Route.TableID = buf.DecodeUint32() m.Route.StatsIndex = buf.DecodeUint32() m.Route.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Route.Prefix.Len = buf.DecodeUint8() m.Route.NPaths = buf.DecodeUint8() - m.Route.Paths = make([]fib_types.FibPath, int(m.Route.NPaths)) + m.Route.Paths = make([]fib_types.FibPath, m.Route.NPaths) for j1 := 0; j1 < len(m.Route.Paths); j1++ { m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32() m.Route.Paths[j1].TableID = buf.DecodeUint32() @@ -2118,11 +1965,10 @@ func (*IPSourceAndPortRangeCheckAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPSourceAndPortRangeCheckAddDel) Size() int { +func (m *IPSourceAndPortRangeCheckAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Prefix.Address.Af size += 1 * 16 // m.Prefix.Address.Un @@ -2134,32 +1980,30 @@ func (m *IPSourceAndPortRangeCheckAddDel) Size() int { return size } func (m *IPSourceAndPortRangeCheckAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) - buf.EncodeUint8(uint8(m.NumberOfRanges)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) + buf.EncodeUint8(m.NumberOfRanges) for i := 0; i < 32; i++ { var x uint16 if i < len(m.LowPorts) { x = uint16(m.LowPorts[i]) } - buf.EncodeUint16(uint16(x)) + buf.EncodeUint16(x) } for i := 0; i < 32; i++ { var x uint16 if i < len(m.HighPorts) { x = uint16(m.HighPorts[i]) } - buf.EncodeUint16(uint16(x)) + buf.EncodeUint16(x) } - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) return buf.Bytes(), nil } func (m *IPSourceAndPortRangeCheckAddDel) Unmarshal(b []byte) error { @@ -2195,27 +2039,24 @@ func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPSourceAndPortRangeCheckAddDelReply) Size() int { +func (m *IPSourceAndPortRangeCheckAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPSourceAndPortRangeCheckAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPSourceAndPortRangeCheckAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2240,11 +2081,10 @@ func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageType() api.MessageTyp return api.RequestMessage } -func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Size() int { +func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SwIfIndex size += 4 // m.TCPInVrfID @@ -2254,18 +2094,16 @@ func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Size() int { return size } func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.TCPInVrfID)) - buf.EncodeUint32(uint32(m.TCPOutVrfID)) - buf.EncodeUint32(uint32(m.UDPInVrfID)) - buf.EncodeUint32(uint32(m.UDPOutVrfID)) + buf.EncodeUint32(m.TCPInVrfID) + buf.EncodeUint32(m.TCPOutVrfID) + buf.EncodeUint32(m.UDPInVrfID) + buf.EncodeUint32(m.UDPOutVrfID) return buf.Bytes(), nil } func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Unmarshal(b []byte) error { @@ -2295,27 +2133,24 @@ func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageType() api.Messa return api.ReplyMessage } -func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Size() int { +func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2332,11 +2167,10 @@ func (*IPTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPTableAddDel) Size() int { +func (m *IPTableAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Table.TableID size += 1 // m.Table.IsIP6 @@ -2344,14 +2178,12 @@ func (m *IPTableAddDel) Size() int { return size } func (m *IPTableAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Table.TableID)) + buf.EncodeUint32(m.Table.TableID) buf.EncodeBool(m.Table.IsIP6) buf.EncodeString(m.Table.Name, 64) return buf.Bytes(), nil @@ -2377,27 +2209,24 @@ func (*IPTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPTableAddDelReply) Size() int { +func (m *IPTableAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPTableAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPTableAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2413,24 +2242,21 @@ func (*IPTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPTableDetails) Size() int { +func (m *IPTableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Table.TableID size += 1 // m.Table.IsIP6 size += 64 // m.Table.Name return size } func (m *IPTableDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Table.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Table.TableID) buf.EncodeBool(m.Table.IsIP6) buf.EncodeString(m.Table.Name, 64) return buf.Bytes(), nil @@ -2453,20 +2279,17 @@ func (*IPTableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPTableDump) Size() int { +func (m *IPTableDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IPTableDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IPTableDump) Unmarshal(b []byte) error { @@ -2485,24 +2308,21 @@ func (*IPTableFlush) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPTableFlush) Size() int { +func (m *IPTableFlush) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Table.TableID size += 1 // m.Table.IsIP6 size += 64 // m.Table.Name return size } func (m *IPTableFlush) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Table.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Table.TableID) buf.EncodeBool(m.Table.IsIP6) buf.EncodeString(m.Table.Name, 64) return buf.Bytes(), nil @@ -2527,27 +2347,24 @@ func (*IPTableFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPTableFlushReply) Size() int { +func (m *IPTableFlushReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPTableFlushReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPTableFlushReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2563,24 +2380,21 @@ func (*IPTableReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPTableReplaceBegin) Size() int { +func (m *IPTableReplaceBegin) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Table.TableID size += 1 // m.Table.IsIP6 size += 64 // m.Table.Name return size } func (m *IPTableReplaceBegin) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Table.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Table.TableID) buf.EncodeBool(m.Table.IsIP6) buf.EncodeString(m.Table.Name, 64) return buf.Bytes(), nil @@ -2605,27 +2419,24 @@ func (*IPTableReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPTableReplaceBeginReply) Size() int { +func (m *IPTableReplaceBeginReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPTableReplaceBeginReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPTableReplaceBeginReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2641,24 +2452,21 @@ func (*IPTableReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPTableReplaceEnd) Size() int { +func (m *IPTableReplaceEnd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Table.TableID size += 1 // m.Table.IsIP6 size += 64 // m.Table.Name return size } func (m *IPTableReplaceEnd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Table.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Table.TableID) buf.EncodeBool(m.Table.IsIP6) buf.EncodeString(m.Table.Name, 64) return buf.Bytes(), nil @@ -2683,27 +2491,24 @@ func (*IPTableReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPTableReplaceEndReply) Size() int { +func (m *IPTableReplaceEndReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPTableReplaceEndReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPTableReplaceEndReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2720,22 +2525,19 @@ func (*IPUnnumberedDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPUnnumberedDetails) Size() int { +func (m *IPUnnumberedDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.IPSwIfIndex return size } func (m *IPUnnumberedDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(uint32(m.IPSwIfIndex)) return buf.Bytes(), nil @@ -2749,7 +2551,7 @@ func (m *IPUnnumberedDetails) Unmarshal(b []byte) error { // IPUnnumberedDump defines message 'ip_unnumbered_dump'. type IPUnnumberedDump struct { - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` } func (m *IPUnnumberedDump) Reset() { *m = IPUnnumberedDump{} } @@ -2759,21 +2561,18 @@ func (*IPUnnumberedDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPUnnumberedDump) Size() int { +func (m *IPUnnumberedDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *IPUnnumberedDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -2799,11 +2598,10 @@ func (*MfibSignalDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MfibSignalDetails) Size() int { +func (m *MfibSignalDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.TableID size += 1 // m.Prefix.Af @@ -2815,20 +2613,18 @@ func (m *MfibSignalDetails) Size() int { return size } func (m *MfibSignalDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.TableID)) + buf.EncodeUint32(m.TableID) buf.EncodeUint8(uint8(m.Prefix.Af)) - buf.EncodeUint16(uint16(m.Prefix.GrpAddressLength)) - buf.EncodeBytes(m.Prefix.GrpAddress.XXX_UnionData[:], 0) - buf.EncodeBytes(m.Prefix.SrcAddress.XXX_UnionData[:], 0) - buf.EncodeUint16(uint16(m.IPPacketLen)) - buf.EncodeBytes(m.IPPacketData[:], 256) + buf.EncodeUint16(m.Prefix.GrpAddressLength) + buf.EncodeBytes(m.Prefix.GrpAddress.XXX_UnionData[:], 16) + buf.EncodeBytes(m.Prefix.SrcAddress.XXX_UnionData[:], 16) + buf.EncodeUint16(m.IPPacketLen) + buf.EncodeBytes(m.IPPacketData, 256) return buf.Bytes(), nil } func (m *MfibSignalDetails) Unmarshal(b []byte) error { @@ -2840,7 +2636,8 @@ func (m *MfibSignalDetails) Unmarshal(b []byte) error { copy(m.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16)) copy(m.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16)) m.IPPacketLen = buf.DecodeUint16() - copy(m.IPPacketData[:], buf.DecodeBytes(256)) + m.IPPacketData = make([]byte, 256) + copy(m.IPPacketData, buf.DecodeBytes(len(m.IPPacketData))) return nil } @@ -2854,20 +2651,17 @@ func (*MfibSignalDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MfibSignalDump) Size() int { +func (m *MfibSignalDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *MfibSignalDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *MfibSignalDump) Unmarshal(b []byte) error { @@ -2894,11 +2688,10 @@ func (*SetIPFlowHash) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SetIPFlowHash) Size() int { +func (m *SetIPFlowHash) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.VrfID size += 1 // m.IsIPv6 size += 1 // m.Src @@ -2911,13 +2704,11 @@ func (m *SetIPFlowHash) Size() int { return size } func (m *SetIPFlowHash) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.VrfID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.VrfID) buf.EncodeBool(m.IsIPv6) buf.EncodeBool(m.Src) buf.EncodeBool(m.Dst) @@ -2954,27 +2745,24 @@ func (*SetIPFlowHashReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SetIPFlowHashReply) Size() int { +func (m *SetIPFlowHashReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SetIPFlowHashReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SetIPFlowHashReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2991,22 +2779,19 @@ func (*SwInterfaceIP6EnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceIP6EnableDisable) Size() int { +func (m *SwInterfaceIP6EnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Enable return size } func (m *SwInterfaceIP6EnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) return buf.Bytes(), nil @@ -3032,27 +2817,24 @@ func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceIP6EnableDisableReply) Size() int { +func (m *SwInterfaceIP6EnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceIP6EnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3071,22 +2853,19 @@ func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceIP6SetLinkLocalAddress) Size() int { +func (m *SwInterfaceIP6SetLinkLocalAddress) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 * 16 // m.IP return size } func (m *SwInterfaceIP6SetLinkLocalAddress) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.IP[:], 16) return buf.Bytes(), nil @@ -3114,27 +2893,24 @@ func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageType() api.MessageType return api.ReplyMessage } -func (m *SwInterfaceIP6SetLinkLocalAddressReply) Size() int { +func (m *SwInterfaceIP6SetLinkLocalAddressReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceIP6SetLinkLocalAddressReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceIP6SetLinkLocalAddressReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ip6_nd/ip6_nd.ba.go b/binapi/ip6_nd/ip6_nd.ba.go index a6f35b4..a5f308e 100644 --- a/binapi/ip6_nd/ip6_nd.ba.go +++ b/binapi/ip6_nd/ip6_nd.ba.go @@ -60,11 +60,10 @@ func (*IP6RaEvent) GetMessageType() api.MessageType { return api.EventMessage } -func (m *IP6RaEvent) Size() int { +func (m *IP6RaEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PID size += 4 // m.SwIfIndex size += 1 * 16 // m.RouterAddr @@ -90,32 +89,30 @@ func (m *IP6RaEvent) Size() int { return size } func (m *IP6RaEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PID) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.RouterAddr[:], 16) - buf.EncodeUint8(uint8(m.CurrentHopLimit)) - buf.EncodeUint8(uint8(m.Flags)) - buf.EncodeUint16(uint16(m.RouterLifetimeInSec)) - buf.EncodeUint32(uint32(m.NeighborReachableTimeInMsec)) - buf.EncodeUint32(uint32(m.TimeInMsecBetweenRetransmittedNeighborSolicitations)) + buf.EncodeUint8(m.CurrentHopLimit) + buf.EncodeUint8(m.Flags) + buf.EncodeUint16(m.RouterLifetimeInSec) + buf.EncodeUint32(m.NeighborReachableTimeInMsec) + buf.EncodeUint32(m.TimeInMsecBetweenRetransmittedNeighborSolicitations) buf.EncodeUint32(uint32(len(m.Prefixes))) for j0 := 0; j0 < len(m.Prefixes); j0++ { - var v0 IP6RaPrefixInfo + var v0 IP6RaPrefixInfo // Prefixes if j0 < len(m.Prefixes) { v0 = m.Prefixes[j0] } buf.EncodeUint8(uint8(v0.Prefix.Address.Af)) - buf.EncodeBytes(v0.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(v0.Prefix.Len)) - buf.EncodeUint8(uint8(v0.Flags)) - buf.EncodeUint32(uint32(v0.ValidTime)) - buf.EncodeUint32(uint32(v0.PreferredTime)) + buf.EncodeBytes(v0.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.Prefix.Len) + buf.EncodeUint8(v0.Flags) + buf.EncodeUint32(v0.ValidTime) + buf.EncodeUint32(v0.PreferredTime) } return buf.Bytes(), nil } @@ -130,7 +127,7 @@ func (m *IP6RaEvent) Unmarshal(b []byte) error { m.NeighborReachableTimeInMsec = buf.DecodeUint32() m.TimeInMsecBetweenRetransmittedNeighborSolicitations = buf.DecodeUint32() m.NPrefixes = buf.DecodeUint32() - m.Prefixes = make([]IP6RaPrefixInfo, int(m.NPrefixes)) + m.Prefixes = make([]IP6RaPrefixInfo, m.NPrefixes) for j0 := 0; j0 < len(m.Prefixes); j0++ { m.Prefixes[j0].Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Prefixes[j0].Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -156,23 +153,20 @@ func (*IP6ndProxyAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IP6ndProxyAddDel) Size() int { +func (m *IP6ndProxyAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsAdd size += 1 * 16 // m.IP return size } func (m *IP6ndProxyAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsAdd) buf.EncodeBytes(m.IP[:], 16) @@ -198,27 +192,24 @@ func (*IP6ndProxyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IP6ndProxyAddDelReply) Size() int { +func (m *IP6ndProxyAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IP6ndProxyAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IP6ndProxyAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -235,22 +226,19 @@ func (*IP6ndProxyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IP6ndProxyDetails) Size() int { +func (m *IP6ndProxyDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 * 16 // m.IP return size } func (m *IP6ndProxyDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.IP[:], 16) return buf.Bytes(), nil @@ -272,20 +260,17 @@ func (*IP6ndProxyDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IP6ndProxyDump) Size() int { +func (m *IP6ndProxyDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IP6ndProxyDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IP6ndProxyDump) Unmarshal(b []byte) error { @@ -309,11 +294,10 @@ func (*IP6ndSendRouterSolicitation) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IP6ndSendRouterSolicitation) Size() int { +func (m *IP6ndSendRouterSolicitation) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Irt size += 4 // m.Mrt size += 4 // m.Mrc @@ -323,16 +307,14 @@ func (m *IP6ndSendRouterSolicitation) Size() int { return size } func (m *IP6ndSendRouterSolicitation) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Irt)) - buf.EncodeUint32(uint32(m.Mrt)) - buf.EncodeUint32(uint32(m.Mrc)) - buf.EncodeUint32(uint32(m.Mrd)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Irt) + buf.EncodeUint32(m.Mrt) + buf.EncodeUint32(m.Mrc) + buf.EncodeUint32(m.Mrd) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Stop) return buf.Bytes(), nil @@ -362,27 +344,24 @@ func (*IP6ndSendRouterSolicitationReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IP6ndSendRouterSolicitationReply) Size() int { +func (m *IP6ndSendRouterSolicitationReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IP6ndSendRouterSolicitationReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IP6ndSendRouterSolicitationReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -411,11 +390,10 @@ func (*SwInterfaceIP6ndRaConfig) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceIP6ndRaConfig) Size() int { +func (m *SwInterfaceIP6ndRaConfig) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Suppress size += 1 // m.Managed @@ -433,26 +411,24 @@ func (m *SwInterfaceIP6ndRaConfig) Size() int { return size } func (m *SwInterfaceIP6ndRaConfig) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.Suppress)) - buf.EncodeUint8(uint8(m.Managed)) - buf.EncodeUint8(uint8(m.Other)) - buf.EncodeUint8(uint8(m.LlOption)) - buf.EncodeUint8(uint8(m.SendUnicast)) - buf.EncodeUint8(uint8(m.Cease)) + buf.EncodeUint8(m.Suppress) + buf.EncodeUint8(m.Managed) + buf.EncodeUint8(m.Other) + buf.EncodeUint8(m.LlOption) + buf.EncodeUint8(m.SendUnicast) + buf.EncodeUint8(m.Cease) buf.EncodeBool(m.IsNo) - buf.EncodeUint8(uint8(m.DefaultRouter)) - buf.EncodeUint32(uint32(m.MaxInterval)) - buf.EncodeUint32(uint32(m.MinInterval)) - buf.EncodeUint32(uint32(m.Lifetime)) - buf.EncodeUint32(uint32(m.InitialCount)) - buf.EncodeUint32(uint32(m.InitialInterval)) + buf.EncodeUint8(m.DefaultRouter) + buf.EncodeUint32(m.MaxInterval) + buf.EncodeUint32(m.MinInterval) + buf.EncodeUint32(m.Lifetime) + buf.EncodeUint32(m.InitialCount) + buf.EncodeUint32(m.InitialInterval) return buf.Bytes(), nil } func (m *SwInterfaceIP6ndRaConfig) Unmarshal(b []byte) error { @@ -488,27 +464,24 @@ func (*SwInterfaceIP6ndRaConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceIP6ndRaConfigReply) Size() int { +func (m *SwInterfaceIP6ndRaConfigReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceIP6ndRaConfigReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceIP6ndRaConfigReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -533,11 +506,10 @@ func (*SwInterfaceIP6ndRaPrefix) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceIP6ndRaPrefix) Size() int { +func (m *SwInterfaceIP6ndRaPrefix) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Prefix.Address.Af size += 1 * 16 // m.Prefix.Address.Un @@ -553,24 +525,22 @@ func (m *SwInterfaceIP6ndRaPrefix) Size() int { return size } func (m *SwInterfaceIP6ndRaPrefix) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) buf.EncodeBool(m.UseDefault) buf.EncodeBool(m.NoAdvertise) buf.EncodeBool(m.OffLink) buf.EncodeBool(m.NoAutoconfig) buf.EncodeBool(m.NoOnlink) buf.EncodeBool(m.IsNo) - buf.EncodeUint32(uint32(m.ValLifetime)) - buf.EncodeUint32(uint32(m.PrefLifetime)) + buf.EncodeUint32(m.ValLifetime) + buf.EncodeUint32(m.PrefLifetime) return buf.Bytes(), nil } func (m *SwInterfaceIP6ndRaPrefix) Unmarshal(b []byte) error { @@ -604,27 +574,24 @@ func (*SwInterfaceIP6ndRaPrefixReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceIP6ndRaPrefixReply) Size() int { +func (m *SwInterfaceIP6ndRaPrefixReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceIP6ndRaPrefixReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceIP6ndRaPrefixReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -641,24 +608,21 @@ func (*WantIP6RaEvents) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *WantIP6RaEvents) Size() int { +func (m *WantIP6RaEvents) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable size += 4 // m.PID return size } func (m *WantIP6RaEvents) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) - buf.EncodeUint32(uint32(m.PID)) + buf.EncodeUint32(m.PID) return buf.Bytes(), nil } func (m *WantIP6RaEvents) Unmarshal(b []byte) error { @@ -680,27 +644,24 @@ func (*WantIP6RaEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *WantIP6RaEventsReply) Size() int { +func (m *WantIP6RaEventsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *WantIP6RaEventsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *WantIP6RaEventsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ip_neighbor/ip_neighbor.ba.go b/binapi/ip_neighbor/ip_neighbor.ba.go index 60df4cc..b4da5b1 100644 --- a/binapi/ip_neighbor/ip_neighbor.ba.go +++ b/binapi/ip_neighbor/ip_neighbor.ba.go @@ -104,11 +104,10 @@ func (*IPNeighborAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPNeighborAddDel) Size() int { +func (m *IPNeighborAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Neighbor.SwIfIndex size += 1 // m.Neighbor.Flags @@ -118,18 +117,16 @@ func (m *IPNeighborAddDel) Size() int { return size } func (m *IPNeighborAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex)) buf.EncodeUint8(uint8(m.Neighbor.Flags)) buf.EncodeBytes(m.Neighbor.MacAddress[:], 6) buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af)) - buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *IPNeighborAddDel) Unmarshal(b []byte) error { @@ -156,29 +153,26 @@ func (*IPNeighborAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPNeighborAddDelReply) Size() int { +func (m *IPNeighborAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.StatsIndex return size } func (m *IPNeighborAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.StatsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatsIndex) return buf.Bytes(), nil } func (m *IPNeighborAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.StatsIndex = buf.DecodeUint32() return nil } @@ -198,11 +192,10 @@ func (*IPNeighborConfig) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPNeighborConfig) Size() int { +func (m *IPNeighborConfig) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Af size += 4 // m.MaxNumber size += 4 // m.MaxAge @@ -210,15 +203,13 @@ func (m *IPNeighborConfig) Size() int { return size } func (m *IPNeighborConfig) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Af)) - buf.EncodeUint32(uint32(m.MaxNumber)) - buf.EncodeUint32(uint32(m.MaxAge)) + buf.EncodeUint32(m.MaxNumber) + buf.EncodeUint32(m.MaxAge) buf.EncodeBool(m.Recycle) return buf.Bytes(), nil } @@ -243,27 +234,24 @@ func (*IPNeighborConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPNeighborConfigReply) Size() int { +func (m *IPNeighborConfigReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPNeighborConfigReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPNeighborConfigReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -280,11 +268,10 @@ func (*IPNeighborDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPNeighborDetails) Size() int { +func (m *IPNeighborDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.Age size += 4 // m.Neighbor.SwIfIndex size += 1 // m.Neighbor.Flags @@ -294,23 +281,21 @@ func (m *IPNeighborDetails) Size() int { return size } func (m *IPNeighborDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeFloat64(float64(m.Age)) + buf := codec.NewBuffer(b) + buf.EncodeFloat64(m.Age) buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex)) buf.EncodeUint8(uint8(m.Neighbor.Flags)) buf.EncodeBytes(m.Neighbor.MacAddress[:], 6) buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af)) - buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *IPNeighborDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Age = float64(buf.DecodeFloat64()) + m.Age = buf.DecodeFloat64() m.Neighbor.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8()) copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6)) @@ -321,7 +306,7 @@ func (m *IPNeighborDetails) Unmarshal(b []byte) error { // IPNeighborDump defines message 'ip_neighbor_dump'. type IPNeighborDump struct { - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` } @@ -332,22 +317,19 @@ func (*IPNeighborDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPNeighborDump) Size() int { +func (m *IPNeighborDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Af return size } func (m *IPNeighborDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Af)) return buf.Bytes(), nil @@ -372,11 +354,10 @@ func (*IPNeighborEvent) GetMessageType() api.MessageType { return api.EventMessage } -func (m *IPNeighborEvent) Size() int { +func (m *IPNeighborEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PID size += 4 // m.Neighbor.SwIfIndex size += 1 // m.Neighbor.Flags @@ -386,18 +367,16 @@ func (m *IPNeighborEvent) Size() int { return size } func (m *IPNeighborEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PID) buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex)) buf.EncodeUint8(uint8(m.Neighbor.Flags)) buf.EncodeBytes(m.Neighbor.MacAddress[:], 6) buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af)) - buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *IPNeighborEvent) Unmarshal(b []byte) error { @@ -414,7 +393,7 @@ func (m *IPNeighborEvent) Unmarshal(b []byte) error { // IPNeighborFlush defines message 'ip_neighbor_flush'. type IPNeighborFlush struct { Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` } func (m *IPNeighborFlush) Reset() { *m = IPNeighborFlush{} } @@ -424,22 +403,19 @@ func (*IPNeighborFlush) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPNeighborFlush) Size() int { +func (m *IPNeighborFlush) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Af size += 4 // m.SwIfIndex return size } func (m *IPNeighborFlush) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Af)) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -463,27 +439,24 @@ func (*IPNeighborFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPNeighborFlushReply) Size() int { +func (m *IPNeighborFlushReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPNeighborFlushReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPNeighborFlushReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -497,20 +470,17 @@ func (*IPNeighborReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPNeighborReplaceBegin) Size() int { +func (m *IPNeighborReplaceBegin) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IPNeighborReplaceBegin) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IPNeighborReplaceBegin) Unmarshal(b []byte) error { @@ -529,27 +499,24 @@ func (*IPNeighborReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPNeighborReplaceBeginReply) Size() int { +func (m *IPNeighborReplaceBeginReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPNeighborReplaceBeginReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPNeighborReplaceBeginReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -563,20 +530,17 @@ func (*IPNeighborReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IPNeighborReplaceEnd) Size() int { +func (m *IPNeighborReplaceEnd) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IPNeighborReplaceEnd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IPNeighborReplaceEnd) Unmarshal(b []byte) error { @@ -595,27 +559,24 @@ func (*IPNeighborReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IPNeighborReplaceEndReply) Size() int { +func (m *IPNeighborReplaceEndReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IPNeighborReplaceEndReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IPNeighborReplaceEndReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -624,7 +585,7 @@ type WantIPNeighborEvents struct { Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` IP ip_types.Address `binapi:"address,name=ip" json:"ip,omitempty"` - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` } func (m *WantIPNeighborEvents) Reset() { *m = WantIPNeighborEvents{} } @@ -634,11 +595,10 @@ func (*WantIPNeighborEvents) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *WantIPNeighborEvents) Size() int { +func (m *WantIPNeighborEvents) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable size += 4 // m.PID size += 1 // m.IP.Af @@ -647,16 +607,14 @@ func (m *WantIPNeighborEvents) Size() int { return size } func (m *WantIPNeighborEvents) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) - buf.EncodeUint32(uint32(m.PID)) + buf.EncodeUint32(m.PID) buf.EncodeUint8(uint8(m.IP.Af)) - buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -682,27 +640,24 @@ func (*WantIPNeighborEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *WantIPNeighborEventsReply) Size() int { +func (m *WantIPNeighborEventsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *WantIPNeighborEventsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *WantIPNeighborEventsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ip_types/ip_types.ba.go b/binapi/ip_types/ip_types.ba.go index b9ddb27..9cb2e13 100644 --- a/binapi/ip_types/ip_types.ba.go +++ b/binapi/ip_types/ip_types.ba.go @@ -568,11 +568,11 @@ func AddressUnionIP4(a IP4Address) (u AddressUnion) { return } func (u *AddressUnion) SetIP4(a IP4Address) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) buf.EncodeBytes(a[:], 4) } func (u *AddressUnion) GetIP4() (a IP4Address) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) copy(a[:], buf.DecodeBytes(4)) return } @@ -582,11 +582,11 @@ func AddressUnionIP6(a IP6Address) (u AddressUnion) { return } func (u *AddressUnion) SetIP6(a IP6Address) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) buf.EncodeBytes(a[:], 16) } func (u *AddressUnion) GetIP6() (a IP6Address) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) copy(a[:], buf.DecodeBytes(16)) return } diff --git a/binapi/ipfix_export/ipfix_export.ba.go b/binapi/ipfix_export/ipfix_export.ba.go index 7d548f2..e173058 100644 --- a/binapi/ipfix_export/ipfix_export.ba.go +++ b/binapi/ipfix_export/ipfix_export.ba.go @@ -42,24 +42,21 @@ func (*IpfixClassifyStreamDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixClassifyStreamDetails) Size() int { +func (m *IpfixClassifyStreamDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.DomainID size += 2 // m.SrcPort return size } func (m *IpfixClassifyStreamDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.DomainID)) - buf.EncodeUint16(uint16(m.SrcPort)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.DomainID) + buf.EncodeUint16(m.SrcPort) return buf.Bytes(), nil } func (m *IpfixClassifyStreamDetails) Unmarshal(b []byte) error { @@ -79,20 +76,17 @@ func (*IpfixClassifyStreamDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixClassifyStreamDump) Size() int { +func (m *IpfixClassifyStreamDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpfixClassifyStreamDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IpfixClassifyStreamDump) Unmarshal(b []byte) error { @@ -114,11 +108,10 @@ func (*IpfixClassifyTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixClassifyTableAddDel) Size() int { +func (m *IpfixClassifyTableAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TableID size += 1 // m.IPVersion size += 1 // m.TransportProtocol @@ -126,13 +119,11 @@ func (m *IpfixClassifyTableAddDel) Size() int { return size } func (m *IpfixClassifyTableAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) buf.EncodeUint8(uint8(m.IPVersion)) buf.EncodeUint8(uint8(m.TransportProtocol)) buf.EncodeBool(m.IsAdd) @@ -161,27 +152,24 @@ func (*IpfixClassifyTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixClassifyTableAddDelReply) Size() int { +func (m *IpfixClassifyTableAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpfixClassifyTableAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpfixClassifyTableAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -199,24 +187,21 @@ func (*IpfixClassifyTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixClassifyTableDetails) Size() int { +func (m *IpfixClassifyTableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TableID size += 1 // m.IPVersion size += 1 // m.TransportProtocol return size } func (m *IpfixClassifyTableDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) buf.EncodeUint8(uint8(m.IPVersion)) buf.EncodeUint8(uint8(m.TransportProtocol)) return buf.Bytes(), nil @@ -239,20 +224,17 @@ func (*IpfixClassifyTableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixClassifyTableDump) Size() int { +func (m *IpfixClassifyTableDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpfixClassifyTableDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IpfixClassifyTableDump) Unmarshal(b []byte) error { @@ -277,11 +259,10 @@ func (*IpfixExporterDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixExporterDetails) Size() int { +func (m *IpfixExporterDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.CollectorAddress.Af size += 1 * 16 // m.CollectorAddress.Un size += 2 // m.CollectorPort @@ -294,20 +275,18 @@ func (m *IpfixExporterDetails) Size() int { return size } func (m *IpfixExporterDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.CollectorAddress.Af)) - buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint16(uint16(m.CollectorPort)) + buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.CollectorPort) buf.EncodeUint8(uint8(m.SrcAddress.Af)) - buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint32(uint32(m.PathMtu)) - buf.EncodeUint32(uint32(m.TemplateInterval)) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint32(m.PathMtu) + buf.EncodeUint32(m.TemplateInterval) buf.EncodeBool(m.UDPChecksum) return buf.Bytes(), nil } @@ -335,20 +314,17 @@ func (*IpfixExporterDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixExporterDump) Size() int { +func (m *IpfixExporterDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpfixExporterDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IpfixExporterDump) Unmarshal(b []byte) error { @@ -365,20 +341,17 @@ func (*IpfixFlush) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixFlush) Size() int { +func (m *IpfixFlush) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpfixFlush) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IpfixFlush) Unmarshal(b []byte) error { @@ -397,27 +370,24 @@ func (*IpfixFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixFlushReply) Size() int { +func (m *IpfixFlushReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpfixFlushReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpfixFlushReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -434,24 +404,21 @@ func (*SetIpfixClassifyStream) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SetIpfixClassifyStream) Size() int { +func (m *SetIpfixClassifyStream) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.DomainID size += 2 // m.SrcPort return size } func (m *SetIpfixClassifyStream) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.DomainID)) - buf.EncodeUint16(uint16(m.SrcPort)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.DomainID) + buf.EncodeUint16(m.SrcPort) return buf.Bytes(), nil } func (m *SetIpfixClassifyStream) Unmarshal(b []byte) error { @@ -473,27 +440,24 @@ func (*SetIpfixClassifyStreamReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SetIpfixClassifyStreamReply) Size() int { +func (m *SetIpfixClassifyStreamReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SetIpfixClassifyStreamReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SetIpfixClassifyStreamReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -515,11 +479,10 @@ func (*SetIpfixExporter) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SetIpfixExporter) Size() int { +func (m *SetIpfixExporter) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.CollectorAddress.Af size += 1 * 16 // m.CollectorAddress.Un size += 2 // m.CollectorPort @@ -532,20 +495,18 @@ func (m *SetIpfixExporter) Size() int { return size } func (m *SetIpfixExporter) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.CollectorAddress.Af)) - buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint16(uint16(m.CollectorPort)) + buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.CollectorPort) buf.EncodeUint8(uint8(m.SrcAddress.Af)) - buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint32(uint32(m.PathMtu)) - buf.EncodeUint32(uint32(m.TemplateInterval)) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint32(m.PathMtu) + buf.EncodeUint32(m.TemplateInterval) buf.EncodeBool(m.UDPChecksum) return buf.Bytes(), nil } @@ -575,27 +536,24 @@ func (*SetIpfixExporterReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SetIpfixExporterReply) Size() int { +func (m *SetIpfixExporterReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SetIpfixExporterReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SetIpfixExporterReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ipip/ipip.ba.go b/binapi/ipip/ipip.ba.go index aab72c2..05821cb 100644 --- a/binapi/ipip/ipip.ba.go +++ b/binapi/ipip/ipip.ba.go @@ -62,11 +62,10 @@ func (*Ipip6rdAddTunnel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ipip6rdAddTunnel) Size() int { +func (m *Ipip6rdAddTunnel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.IP6TableID size += 4 // m.IP4TableID size += 1 * 16 // m.IP6Prefix.Address @@ -79,21 +78,19 @@ func (m *Ipip6rdAddTunnel) Size() int { return size } func (m *Ipip6rdAddTunnel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.IP6TableID)) - buf.EncodeUint32(uint32(m.IP4TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.IP6TableID) + buf.EncodeUint32(m.IP4TableID) buf.EncodeBytes(m.IP6Prefix.Address[:], 16) - buf.EncodeUint8(uint8(m.IP6Prefix.Len)) + buf.EncodeUint8(m.IP6Prefix.Len) buf.EncodeBytes(m.IP4Prefix.Address[:], 4) - buf.EncodeUint8(uint8(m.IP4Prefix.Len)) + buf.EncodeUint8(m.IP4Prefix.Len) buf.EncodeBytes(m.IP4Src[:], 4) buf.EncodeBool(m.SecurityCheck) - buf.EncodeUint8(uint8(m.TcTos)) + buf.EncodeUint8(m.TcTos) return buf.Bytes(), nil } func (m *Ipip6rdAddTunnel) Unmarshal(b []byte) error { @@ -123,29 +120,26 @@ func (*Ipip6rdAddTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ipip6rdAddTunnelReply) Size() int { +func (m *Ipip6rdAddTunnelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *Ipip6rdAddTunnelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *Ipip6rdAddTunnelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -162,21 +156,18 @@ func (*Ipip6rdDelTunnel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ipip6rdDelTunnel) Size() int { +func (m *Ipip6rdDelTunnel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *Ipip6rdDelTunnel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -198,27 +189,24 @@ func (*Ipip6rdDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ipip6rdDelTunnelReply) Size() int { +func (m *Ipip6rdDelTunnelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Ipip6rdDelTunnelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Ipip6rdDelTunnelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -234,11 +222,10 @@ func (*IpipAddTunnel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpipAddTunnel) Size() int { +func (m *IpipAddTunnel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Tunnel.Instance size += 1 // m.Tunnel.Src.Af size += 1 * 16 // m.Tunnel.Src.Un @@ -252,19 +239,17 @@ func (m *IpipAddTunnel) Size() int { return size } func (m *IpipAddTunnel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Tunnel.Instance)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Tunnel.Instance) buf.EncodeUint8(uint8(m.Tunnel.Src.Af)) - buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Tunnel.Dst.Af)) - buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex)) - buf.EncodeUint32(uint32(m.Tunnel.TableID)) + buf.EncodeUint32(m.Tunnel.TableID) buf.EncodeUint8(uint8(m.Tunnel.Flags)) buf.EncodeUint8(uint8(m.Tunnel.Mode)) buf.EncodeUint8(uint8(m.Tunnel.Dscp)) @@ -298,29 +283,26 @@ func (*IpipAddTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpipAddTunnelReply) Size() int { +func (m *IpipAddTunnelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *IpipAddTunnelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *IpipAddTunnelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -337,21 +319,18 @@ func (*IpipDelTunnel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpipDelTunnel) Size() int { +func (m *IpipDelTunnel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *IpipDelTunnel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -373,27 +352,24 @@ func (*IpipDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpipDelTunnelReply) Size() int { +func (m *IpipDelTunnelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpipDelTunnelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpipDelTunnelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -409,11 +385,10 @@ func (*IpipTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpipTunnelDetails) Size() int { +func (m *IpipTunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Tunnel.Instance size += 1 // m.Tunnel.Src.Af size += 1 * 16 // m.Tunnel.Src.Un @@ -427,19 +402,17 @@ func (m *IpipTunnelDetails) Size() int { return size } func (m *IpipTunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Tunnel.Instance)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Tunnel.Instance) buf.EncodeUint8(uint8(m.Tunnel.Src.Af)) - buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Tunnel.Dst.Af)) - buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex)) - buf.EncodeUint32(uint32(m.Tunnel.TableID)) + buf.EncodeUint32(m.Tunnel.TableID) buf.EncodeUint8(uint8(m.Tunnel.Flags)) buf.EncodeUint8(uint8(m.Tunnel.Mode)) buf.EncodeUint8(uint8(m.Tunnel.Dscp)) @@ -472,21 +445,18 @@ func (*IpipTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpipTunnelDump) Size() int { +func (m *IpipTunnelDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *IpipTunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } diff --git a/binapi/ipsec/ipsec.ba.go b/binapi/ipsec/ipsec.ba.go index 564c457..6a6abde 100644 --- a/binapi/ipsec/ipsec.ba.go +++ b/binapi/ipsec/ipsec.ba.go @@ -109,11 +109,10 @@ func (*IpsecBackendDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecBackendDetails) Size() int { +func (m *IpsecBackendDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 128 // m.Name size += 4 // m.Protocol size += 1 // m.Index @@ -121,15 +120,13 @@ func (m *IpsecBackendDetails) Size() int { return size } func (m *IpsecBackendDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 128) buf.EncodeUint32(uint32(m.Protocol)) - buf.EncodeUint8(uint8(m.Index)) + buf.EncodeUint8(m.Index) buf.EncodeBool(m.Active) return buf.Bytes(), nil } @@ -152,20 +149,17 @@ func (*IpsecBackendDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecBackendDump) Size() int { +func (m *IpsecBackendDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpsecBackendDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IpsecBackendDump) Unmarshal(b []byte) error { @@ -186,26 +180,23 @@ func (*IpsecInterfaceAddDelSpd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecInterfaceAddDelSpd) Size() int { +func (m *IpsecInterfaceAddDelSpd) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SwIfIndex size += 4 // m.SpdID return size } func (m *IpsecInterfaceAddDelSpd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.SpdID)) + buf.EncodeUint32(m.SpdID) return buf.Bytes(), nil } func (m *IpsecInterfaceAddDelSpd) Unmarshal(b []byte) error { @@ -230,27 +221,24 @@ func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecInterfaceAddDelSpdReply) Size() int { +func (m *IpsecInterfaceAddDelSpdReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpsecInterfaceAddDelSpdReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecInterfaceAddDelSpdReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -272,11 +260,10 @@ func (*IpsecSaDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecSaDetails) Size() int { +func (m *IpsecSaDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Entry.SadID size += 4 // m.Entry.Spi size += 4 // m.Entry.Protocol @@ -304,36 +291,34 @@ func (m *IpsecSaDetails) Size() int { return size } func (m *IpsecSaDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Entry.SadID)) - buf.EncodeUint32(uint32(m.Entry.Spi)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Entry.SadID) + buf.EncodeUint32(m.Entry.Spi) buf.EncodeUint32(uint32(m.Entry.Protocol)) buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm)) - buf.EncodeUint8(uint8(m.Entry.CryptoKey.Length)) - buf.EncodeBytes(m.Entry.CryptoKey.Data[:], 128) + buf.EncodeUint8(m.Entry.CryptoKey.Length) + buf.EncodeBytes(m.Entry.CryptoKey.Data, 128) buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm)) - buf.EncodeUint8(uint8(m.Entry.IntegrityKey.Length)) - buf.EncodeBytes(m.Entry.IntegrityKey.Data[:], 128) + buf.EncodeUint8(m.Entry.IntegrityKey.Length) + buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128) buf.EncodeUint32(uint32(m.Entry.Flags)) buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af)) - buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af)) - buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Entry.TxTableID)) - buf.EncodeUint32(uint32(m.Entry.Salt)) - buf.EncodeUint16(uint16(m.Entry.UDPSrcPort)) - buf.EncodeUint16(uint16(m.Entry.UDPDstPort)) + buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.Entry.TxTableID) + buf.EncodeUint32(m.Entry.Salt) + buf.EncodeUint16(m.Entry.UDPSrcPort) + buf.EncodeUint16(m.Entry.UDPDstPort) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.Salt)) - buf.EncodeUint64(uint64(m.SeqOutbound)) - buf.EncodeUint64(uint64(m.LastSeqInbound)) - buf.EncodeUint64(uint64(m.ReplayWindow)) - buf.EncodeUint32(uint32(m.StatIndex)) + buf.EncodeUint32(m.Salt) + buf.EncodeUint64(m.SeqOutbound) + buf.EncodeUint64(m.LastSeqInbound) + buf.EncodeUint64(m.ReplayWindow) + buf.EncodeUint32(m.StatIndex) return buf.Bytes(), nil } func (m *IpsecSaDetails) Unmarshal(b []byte) error { @@ -343,10 +328,12 @@ func (m *IpsecSaDetails) Unmarshal(b []byte) error { m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32()) m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32()) m.Entry.CryptoKey.Length = buf.DecodeUint8() - copy(m.Entry.CryptoKey.Data[:], buf.DecodeBytes(128)) + m.Entry.CryptoKey.Data = make([]byte, 128) + copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data))) m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32()) m.Entry.IntegrityKey.Length = buf.DecodeUint8() - copy(m.Entry.IntegrityKey.Data[:], buf.DecodeBytes(128)) + m.Entry.IntegrityKey.Data = make([]byte, 128) + copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data))) m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32()) m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -377,22 +364,19 @@ func (*IpsecSaDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecSaDump) Size() int { +func (m *IpsecSaDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SaID return size } func (m *IpsecSaDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SaID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SaID) return buf.Bytes(), nil } func (m *IpsecSaDump) Unmarshal(b []byte) error { @@ -414,11 +398,10 @@ func (*IpsecSadEntryAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecSadEntryAddDel) Size() int { +func (m *IpsecSadEntryAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Entry.SadID size += 4 // m.Entry.Spi @@ -441,31 +424,29 @@ func (m *IpsecSadEntryAddDel) Size() int { return size } func (m *IpsecSadEntryAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Entry.SadID)) - buf.EncodeUint32(uint32(m.Entry.Spi)) + buf.EncodeUint32(m.Entry.SadID) + buf.EncodeUint32(m.Entry.Spi) buf.EncodeUint32(uint32(m.Entry.Protocol)) buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm)) - buf.EncodeUint8(uint8(m.Entry.CryptoKey.Length)) - buf.EncodeBytes(m.Entry.CryptoKey.Data[:], 128) + buf.EncodeUint8(m.Entry.CryptoKey.Length) + buf.EncodeBytes(m.Entry.CryptoKey.Data, 128) buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm)) - buf.EncodeUint8(uint8(m.Entry.IntegrityKey.Length)) - buf.EncodeBytes(m.Entry.IntegrityKey.Data[:], 128) + buf.EncodeUint8(m.Entry.IntegrityKey.Length) + buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128) buf.EncodeUint32(uint32(m.Entry.Flags)) buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af)) - buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af)) - buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Entry.TxTableID)) - buf.EncodeUint32(uint32(m.Entry.Salt)) - buf.EncodeUint16(uint16(m.Entry.UDPSrcPort)) - buf.EncodeUint16(uint16(m.Entry.UDPDstPort)) + buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.Entry.TxTableID) + buf.EncodeUint32(m.Entry.Salt) + buf.EncodeUint16(m.Entry.UDPSrcPort) + buf.EncodeUint16(m.Entry.UDPDstPort) return buf.Bytes(), nil } func (m *IpsecSadEntryAddDel) Unmarshal(b []byte) error { @@ -476,10 +457,12 @@ func (m *IpsecSadEntryAddDel) Unmarshal(b []byte) error { m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32()) m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32()) m.Entry.CryptoKey.Length = buf.DecodeUint8() - copy(m.Entry.CryptoKey.Data[:], buf.DecodeBytes(128)) + m.Entry.CryptoKey.Data = make([]byte, 128) + copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data))) m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32()) m.Entry.IntegrityKey.Length = buf.DecodeUint8() - copy(m.Entry.IntegrityKey.Data[:], buf.DecodeBytes(128)) + m.Entry.IntegrityKey.Data = make([]byte, 128) + copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data))) m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32()) m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -505,29 +488,26 @@ func (*IpsecSadEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecSadEntryAddDelReply) Size() int { +func (m *IpsecSadEntryAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.StatIndex return size } func (m *IpsecSadEntryAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.StatIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatIndex) return buf.Bytes(), nil } func (m *IpsecSadEntryAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.StatIndex = buf.DecodeUint32() return nil } @@ -545,24 +525,21 @@ func (*IpsecSelectBackend) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecSelectBackend) Size() int { +func (m *IpsecSelectBackend) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Protocol size += 1 // m.Index return size } func (m *IpsecSelectBackend) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Protocol)) - buf.EncodeUint8(uint8(m.Index)) + buf.EncodeUint8(m.Index) return buf.Bytes(), nil } func (m *IpsecSelectBackend) Unmarshal(b []byte) error { @@ -584,27 +561,24 @@ func (*IpsecSelectBackendReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecSelectBackendReply) Size() int { +func (m *IpsecSelectBackendReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpsecSelectBackendReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecSelectBackendReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -621,24 +595,21 @@ func (*IpsecSpdAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecSpdAddDel) Size() int { +func (m *IpsecSpdAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SpdID return size } func (m *IpsecSpdAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.SpdID)) + buf.EncodeUint32(m.SpdID) return buf.Bytes(), nil } func (m *IpsecSpdAddDel) Unmarshal(b []byte) error { @@ -660,27 +631,24 @@ func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecSpdAddDelReply) Size() int { +func (m *IpsecSpdAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpsecSpdAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecSpdAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -696,11 +664,10 @@ func (*IpsecSpdDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecSpdDetails) Size() int { +func (m *IpsecSpdDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Entry.SpdID size += 4 // m.Entry.Priority size += 1 // m.Entry.IsOutbound @@ -722,36 +689,34 @@ func (m *IpsecSpdDetails) Size() int { return size } func (m *IpsecSpdDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Entry.SpdID)) - buf.EncodeUint32(uint32(m.Entry.Priority)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Entry.SpdID) + buf.EncodeInt32(m.Entry.Priority) buf.EncodeBool(m.Entry.IsOutbound) - buf.EncodeUint32(uint32(m.Entry.SaID)) + buf.EncodeUint32(m.Entry.SaID) buf.EncodeUint32(uint32(m.Entry.Policy)) - buf.EncodeUint8(uint8(m.Entry.Protocol)) + buf.EncodeUint8(m.Entry.Protocol) buf.EncodeUint8(uint8(m.Entry.RemoteAddressStart.Af)) - buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.RemoteAddressStop.Af)) - buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.LocalAddressStart.Af)) - buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.LocalAddressStop.Af)) - buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 0) - buf.EncodeUint16(uint16(m.Entry.RemotePortStart)) - buf.EncodeUint16(uint16(m.Entry.RemotePortStop)) - buf.EncodeUint16(uint16(m.Entry.LocalPortStart)) - buf.EncodeUint16(uint16(m.Entry.LocalPortStop)) + buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.Entry.RemotePortStart) + buf.EncodeUint16(m.Entry.RemotePortStop) + buf.EncodeUint16(m.Entry.LocalPortStart) + buf.EncodeUint16(m.Entry.LocalPortStop) return buf.Bytes(), nil } func (m *IpsecSpdDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Entry.SpdID = buf.DecodeUint32() - m.Entry.Priority = int32(buf.DecodeUint32()) + m.Entry.Priority = buf.DecodeInt32() m.Entry.IsOutbound = buf.DecodeBool() m.Entry.SaID = buf.DecodeUint32() m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32()) @@ -784,24 +749,21 @@ func (*IpsecSpdDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecSpdDump) Size() int { +func (m *IpsecSpdDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SpdID size += 4 // m.SaID return size } func (m *IpsecSpdDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SpdID)) - buf.EncodeUint32(uint32(m.SaID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SpdID) + buf.EncodeUint32(m.SaID) return buf.Bytes(), nil } func (m *IpsecSpdDump) Unmarshal(b []byte) error { @@ -824,11 +786,10 @@ func (*IpsecSpdEntryAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecSpdEntryAddDel) Size() int { +func (m *IpsecSpdEntryAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Entry.SpdID size += 4 // m.Entry.Priority @@ -851,38 +812,36 @@ func (m *IpsecSpdEntryAddDel) Size() int { return size } func (m *IpsecSpdEntryAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Entry.SpdID)) - buf.EncodeUint32(uint32(m.Entry.Priority)) + buf.EncodeUint32(m.Entry.SpdID) + buf.EncodeInt32(m.Entry.Priority) buf.EncodeBool(m.Entry.IsOutbound) - buf.EncodeUint32(uint32(m.Entry.SaID)) + buf.EncodeUint32(m.Entry.SaID) buf.EncodeUint32(uint32(m.Entry.Policy)) - buf.EncodeUint8(uint8(m.Entry.Protocol)) + buf.EncodeUint8(m.Entry.Protocol) buf.EncodeUint8(uint8(m.Entry.RemoteAddressStart.Af)) - buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.RemoteAddressStop.Af)) - buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.LocalAddressStart.Af)) - buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.LocalAddressStop.Af)) - buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 0) - buf.EncodeUint16(uint16(m.Entry.RemotePortStart)) - buf.EncodeUint16(uint16(m.Entry.RemotePortStop)) - buf.EncodeUint16(uint16(m.Entry.LocalPortStart)) - buf.EncodeUint16(uint16(m.Entry.LocalPortStop)) + buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.Entry.RemotePortStart) + buf.EncodeUint16(m.Entry.RemotePortStop) + buf.EncodeUint16(m.Entry.LocalPortStart) + buf.EncodeUint16(m.Entry.LocalPortStop) return buf.Bytes(), nil } func (m *IpsecSpdEntryAddDel) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.IsAdd = buf.DecodeBool() m.Entry.SpdID = buf.DecodeUint32() - m.Entry.Priority = int32(buf.DecodeUint32()) + m.Entry.Priority = buf.DecodeInt32() m.Entry.IsOutbound = buf.DecodeBool() m.Entry.SaID = buf.DecodeUint32() m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32()) @@ -915,29 +874,26 @@ func (*IpsecSpdEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecSpdEntryAddDelReply) Size() int { +func (m *IpsecSpdEntryAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.StatIndex return size } func (m *IpsecSpdEntryAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.StatIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatIndex) return buf.Bytes(), nil } func (m *IpsecSpdEntryAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.StatIndex = buf.DecodeUint32() return nil } @@ -955,23 +911,20 @@ func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecSpdInterfaceDetails) Size() int { +func (m *IpsecSpdInterfaceDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SpdIndex size += 4 // m.SwIfIndex return size } func (m *IpsecSpdInterfaceDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SpdIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SpdIndex) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -995,24 +948,21 @@ func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecSpdInterfaceDump) Size() int { +func (m *IpsecSpdInterfaceDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SpdIndex size += 1 // m.SpdIndexValid return size } func (m *IpsecSpdInterfaceDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SpdIndex)) - buf.EncodeUint8(uint8(m.SpdIndexValid)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SpdIndex) + buf.EncodeUint8(m.SpdIndexValid) return buf.Bytes(), nil } func (m *IpsecSpdInterfaceDump) Unmarshal(b []byte) error { @@ -1035,24 +985,21 @@ func (*IpsecSpdsDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecSpdsDetails) Size() int { +func (m *IpsecSpdsDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SpdID size += 4 // m.Npolicies return size } func (m *IpsecSpdsDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SpdID)) - buf.EncodeUint32(uint32(m.Npolicies)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SpdID) + buf.EncodeUint32(m.Npolicies) return buf.Bytes(), nil } func (m *IpsecSpdsDetails) Unmarshal(b []byte) error { @@ -1072,20 +1019,17 @@ func (*IpsecSpdsDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecSpdsDump) Size() int { +func (m *IpsecSpdsDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpsecSpdsDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IpsecSpdsDump) Unmarshal(b []byte) error { @@ -1125,11 +1069,10 @@ func (*IpsecTunnelIfAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecTunnelIfAddDel) Size() int { +func (m *IpsecTunnelIfAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Esn size += 1 // m.AntiReplay @@ -1157,36 +1100,34 @@ func (m *IpsecTunnelIfAddDel) Size() int { return size } func (m *IpsecTunnelIfAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.Esn) buf.EncodeBool(m.AntiReplay) buf.EncodeUint8(uint8(m.LocalIP.Af)) - buf.EncodeBytes(m.LocalIP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LocalIP.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.RemoteIP.Af)) - buf.EncodeBytes(m.RemoteIP.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.LocalSpi)) - buf.EncodeUint32(uint32(m.RemoteSpi)) - buf.EncodeUint8(uint8(m.CryptoAlg)) - buf.EncodeUint8(uint8(m.LocalCryptoKeyLen)) - buf.EncodeBytes(m.LocalCryptoKey[:], 128) - buf.EncodeUint8(uint8(m.RemoteCryptoKeyLen)) - buf.EncodeBytes(m.RemoteCryptoKey[:], 128) - buf.EncodeUint8(uint8(m.IntegAlg)) - buf.EncodeUint8(uint8(m.LocalIntegKeyLen)) - buf.EncodeBytes(m.LocalIntegKey[:], 128) - buf.EncodeUint8(uint8(m.RemoteIntegKeyLen)) - buf.EncodeBytes(m.RemoteIntegKey[:], 128) + buf.EncodeBytes(m.RemoteIP.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.LocalSpi) + buf.EncodeUint32(m.RemoteSpi) + buf.EncodeUint8(m.CryptoAlg) + buf.EncodeUint8(m.LocalCryptoKeyLen) + buf.EncodeBytes(m.LocalCryptoKey, 128) + buf.EncodeUint8(m.RemoteCryptoKeyLen) + buf.EncodeBytes(m.RemoteCryptoKey, 128) + buf.EncodeUint8(m.IntegAlg) + buf.EncodeUint8(m.LocalIntegKeyLen) + buf.EncodeBytes(m.LocalIntegKey, 128) + buf.EncodeUint8(m.RemoteIntegKeyLen) + buf.EncodeBytes(m.RemoteIntegKey, 128) buf.EncodeBool(m.Renumber) - buf.EncodeUint32(uint32(m.ShowInstance)) + buf.EncodeUint32(m.ShowInstance) buf.EncodeBool(m.UDPEncap) - buf.EncodeUint32(uint32(m.TxTableID)) - buf.EncodeUint32(uint32(m.Salt)) + buf.EncodeUint32(m.TxTableID) + buf.EncodeUint32(m.Salt) return buf.Bytes(), nil } func (m *IpsecTunnelIfAddDel) Unmarshal(b []byte) error { @@ -1202,14 +1143,18 @@ func (m *IpsecTunnelIfAddDel) Unmarshal(b []byte) error { m.RemoteSpi = buf.DecodeUint32() m.CryptoAlg = buf.DecodeUint8() m.LocalCryptoKeyLen = buf.DecodeUint8() - copy(m.LocalCryptoKey[:], buf.DecodeBytes(128)) + m.LocalCryptoKey = make([]byte, 128) + copy(m.LocalCryptoKey, buf.DecodeBytes(len(m.LocalCryptoKey))) m.RemoteCryptoKeyLen = buf.DecodeUint8() - copy(m.RemoteCryptoKey[:], buf.DecodeBytes(128)) + m.RemoteCryptoKey = make([]byte, 128) + copy(m.RemoteCryptoKey, buf.DecodeBytes(len(m.RemoteCryptoKey))) m.IntegAlg = buf.DecodeUint8() m.LocalIntegKeyLen = buf.DecodeUint8() - copy(m.LocalIntegKey[:], buf.DecodeBytes(128)) + m.LocalIntegKey = make([]byte, 128) + copy(m.LocalIntegKey, buf.DecodeBytes(len(m.LocalIntegKey))) m.RemoteIntegKeyLen = buf.DecodeUint8() - copy(m.RemoteIntegKey[:], buf.DecodeBytes(128)) + m.RemoteIntegKey = make([]byte, 128) + copy(m.RemoteIntegKey, buf.DecodeBytes(len(m.RemoteIntegKey))) m.Renumber = buf.DecodeBool() m.ShowInstance = buf.DecodeUint32() m.UDPEncap = buf.DecodeBool() @@ -1231,29 +1176,26 @@ func (*IpsecTunnelIfAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecTunnelIfAddDelReply) Size() int { +func (m *IpsecTunnelIfAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *IpsecTunnelIfAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *IpsecTunnelIfAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -1272,26 +1214,23 @@ func (*IpsecTunnelIfSetSa) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecTunnelIfSetSa) Size() int { +func (m *IpsecTunnelIfSetSa) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.SaID size += 1 // m.IsOutbound return size } func (m *IpsecTunnelIfSetSa) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.SaID)) - buf.EncodeUint8(uint8(m.IsOutbound)) + buf.EncodeUint32(m.SaID) + buf.EncodeUint8(m.IsOutbound) return buf.Bytes(), nil } func (m *IpsecTunnelIfSetSa) Unmarshal(b []byte) error { @@ -1314,27 +1253,24 @@ func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecTunnelIfSetSaReply) Size() int { +func (m *IpsecTunnelIfSetSaReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpsecTunnelIfSetSaReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecTunnelIfSetSaReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1351,26 +1287,23 @@ func (*IpsecTunnelProtectDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecTunnelProtectDel) Size() int { +func (m *IpsecTunnelProtectDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Nh.Af size += 1 * 16 // m.Nh.Un return size } func (m *IpsecTunnelProtectDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Nh.Af)) - buf.EncodeBytes(m.Nh.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Nh.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *IpsecTunnelProtectDel) Unmarshal(b []byte) error { @@ -1393,27 +1326,24 @@ func (*IpsecTunnelProtectDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecTunnelProtectDelReply) Size() int { +func (m *IpsecTunnelProtectDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpsecTunnelProtectDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecTunnelProtectDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1429,11 +1359,10 @@ func (*IpsecTunnelProtectDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecTunnelProtectDetails) Size() int { +func (m *IpsecTunnelProtectDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Tun.SwIfIndex size += 1 // m.Tun.Nh.Af size += 1 * 16 // m.Tun.Nh.Un @@ -1443,23 +1372,21 @@ func (m *IpsecTunnelProtectDetails) Size() int { return size } func (m *IpsecTunnelProtectDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Tun.SwIfIndex)) buf.EncodeUint8(uint8(m.Tun.Nh.Af)) - buf.EncodeBytes(m.Tun.Nh.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Tun.SaOut)) + buf.EncodeBytes(m.Tun.Nh.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.Tun.SaOut) buf.EncodeUint8(uint8(len(m.Tun.SaIn))) for i := 0; i < len(m.Tun.SaIn); i++ { var x uint32 if i < len(m.Tun.SaIn) { x = uint32(m.Tun.SaIn[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } @@ -1489,21 +1416,18 @@ func (*IpsecTunnelProtectDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecTunnelProtectDump) Size() int { +func (m *IpsecTunnelProtectDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *IpsecTunnelProtectDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -1525,11 +1449,10 @@ func (*IpsecTunnelProtectUpdate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpsecTunnelProtectUpdate) Size() int { +func (m *IpsecTunnelProtectUpdate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Tunnel.SwIfIndex size += 1 // m.Tunnel.Nh.Af size += 1 * 16 // m.Tunnel.Nh.Un @@ -1539,23 +1462,21 @@ func (m *IpsecTunnelProtectUpdate) Size() int { return size } func (m *IpsecTunnelProtectUpdate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex)) buf.EncodeUint8(uint8(m.Tunnel.Nh.Af)) - buf.EncodeBytes(m.Tunnel.Nh.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Tunnel.SaOut)) + buf.EncodeBytes(m.Tunnel.Nh.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.Tunnel.SaOut) buf.EncodeUint8(uint8(len(m.Tunnel.SaIn))) for i := 0; i < len(m.Tunnel.SaIn); i++ { var x uint32 if i < len(m.Tunnel.SaIn) { x = uint32(m.Tunnel.SaIn[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } @@ -1587,27 +1508,24 @@ func (*IpsecTunnelProtectUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpsecTunnelProtectUpdateReply) Size() int { +func (m *IpsecTunnelProtectUpdateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpsecTunnelProtectUpdateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecTunnelProtectUpdateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/ipsec_types/ipsec_types.ba.go b/binapi/ipsec_types/ipsec_types.ba.go index c1d80aa..149c35f 100644 --- a/binapi/ipsec_types/ipsec_types.ba.go +++ b/binapi/ipsec_types/ipsec_types.ba.go @@ -225,8 +225,8 @@ type IpsecSadEntry struct { TunnelDst ip_types.Address `binapi:"address,name=tunnel_dst" json:"tunnel_dst,omitempty"` TxTableID uint32 `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"` Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"` - UDPSrcPort uint16 `binapi:"u16,name=udp_src_port,default=%!s(float64=4500)" json:"udp_src_port,omitempty"` - UDPDstPort uint16 `binapi:"u16,name=udp_dst_port,default=%!s(float64=4500)" json:"udp_dst_port,omitempty"` + UDPSrcPort uint16 `binapi:"u16,name=udp_src_port,default=4500" json:"udp_src_port,omitempty"` + UDPDstPort uint16 `binapi:"u16,name=udp_dst_port,default=4500" json:"udp_dst_port,omitempty"` } // Key defines type 'key'. diff --git a/binapi/l2/l2.ba.go b/binapi/l2/l2.ba.go index 0eb75f2..7413635 100644 --- a/binapi/l2/l2.ba.go +++ b/binapi/l2/l2.ba.go @@ -190,11 +190,10 @@ func (*BdIPMacAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BdIPMacAddDel) Size() int { +func (m *BdIPMacAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Entry.BdID size += 1 // m.Entry.IP.Af @@ -203,16 +202,14 @@ func (m *BdIPMacAddDel) Size() int { return size } func (m *BdIPMacAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Entry.BdID)) + buf.EncodeUint32(m.Entry.BdID) buf.EncodeUint8(uint8(m.Entry.IP.Af)) - buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 16) buf.EncodeBytes(m.Entry.Mac[:], 6) return buf.Bytes(), nil } @@ -238,27 +235,24 @@ func (*BdIPMacAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BdIPMacAddDelReply) Size() int { +func (m *BdIPMacAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BdIPMacAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BdIPMacAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -274,11 +268,10 @@ func (*BdIPMacDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BdIPMacDetails) Size() int { +func (m *BdIPMacDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Entry.BdID size += 1 // m.Entry.IP.Af size += 1 * 16 // m.Entry.IP.Un @@ -286,15 +279,13 @@ func (m *BdIPMacDetails) Size() int { return size } func (m *BdIPMacDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Entry.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Entry.BdID) buf.EncodeUint8(uint8(m.Entry.IP.Af)) - buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 16) buf.EncodeBytes(m.Entry.Mac[:], 6) return buf.Bytes(), nil } @@ -319,22 +310,19 @@ func (*BdIPMacDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BdIPMacDump) Size() int { +func (m *BdIPMacDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID return size } func (m *BdIPMacDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) return buf.Bytes(), nil } func (m *BdIPMacDump) Unmarshal(b []byte) error { @@ -355,22 +343,19 @@ func (*BdIPMacFlush) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BdIPMacFlush) Size() int { +func (m *BdIPMacFlush) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID return size } func (m *BdIPMacFlush) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) return buf.Bytes(), nil } func (m *BdIPMacFlush) Unmarshal(b []byte) error { @@ -391,27 +376,24 @@ func (*BdIPMacFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BdIPMacFlushReply) Size() int { +func (m *BdIPMacFlushReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BdIPMacFlushReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BdIPMacFlushReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -436,11 +418,10 @@ func (*BridgeDomainAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BridgeDomainAddDel) Size() int { +func (m *BridgeDomainAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID size += 1 // m.Flood size += 1 // m.UuFlood @@ -454,20 +435,18 @@ func (m *BridgeDomainAddDel) Size() int { return size } func (m *BridgeDomainAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) buf.EncodeBool(m.Flood) buf.EncodeBool(m.UuFlood) buf.EncodeBool(m.Forward) buf.EncodeBool(m.Learn) buf.EncodeBool(m.ArpTerm) buf.EncodeBool(m.ArpUfwd) - buf.EncodeUint8(uint8(m.MacAge)) + buf.EncodeUint8(m.MacAge) buf.EncodeString(m.BdTag, 64) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil @@ -499,27 +478,24 @@ func (*BridgeDomainAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BridgeDomainAddDelReply) Size() int { +func (m *BridgeDomainAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BridgeDomainAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BridgeDomainAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -547,11 +523,10 @@ func (*BridgeDomainDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BridgeDomainDetails) Size() int { +func (m *BridgeDomainDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID size += 1 // m.Flood size += 1 // m.UuFlood @@ -577,32 +552,30 @@ func (m *BridgeDomainDetails) Size() int { return size } func (m *BridgeDomainDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) buf.EncodeBool(m.Flood) buf.EncodeBool(m.UuFlood) buf.EncodeBool(m.Forward) buf.EncodeBool(m.Learn) buf.EncodeBool(m.ArpTerm) buf.EncodeBool(m.ArpUfwd) - buf.EncodeUint8(uint8(m.MacAge)) + buf.EncodeUint8(m.MacAge) buf.EncodeString(m.BdTag, 64) buf.EncodeUint32(uint32(m.BviSwIfIndex)) buf.EncodeUint32(uint32(m.UuFwdSwIfIndex)) buf.EncodeUint32(uint32(len(m.SwIfDetails))) for j0 := 0; j0 < len(m.SwIfDetails); j0++ { - var v0 BridgeDomainSwIf + var v0 BridgeDomainSwIf // SwIfDetails if j0 < len(m.SwIfDetails) { v0 = m.SwIfDetails[j0] } - buf.EncodeUint32(uint32(v0.Context)) + buf.EncodeUint32(v0.Context) buf.EncodeUint32(uint32(v0.SwIfIndex)) - buf.EncodeUint8(uint8(v0.Shg)) + buf.EncodeUint8(v0.Shg) } return buf.Bytes(), nil } @@ -620,7 +593,7 @@ func (m *BridgeDomainDetails) Unmarshal(b []byte) error { m.BviSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.UuFwdSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.NSwIfs = buf.DecodeUint32() - m.SwIfDetails = make([]BridgeDomainSwIf, int(m.NSwIfs)) + m.SwIfDetails = make([]BridgeDomainSwIf, m.NSwIfs) for j0 := 0; j0 < len(m.SwIfDetails); j0++ { m.SwIfDetails[j0].Context = buf.DecodeUint32() m.SwIfDetails[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) @@ -631,8 +604,8 @@ func (m *BridgeDomainDetails) Unmarshal(b []byte) error { // BridgeDomainDump defines message 'bridge_domain_dump'. type BridgeDomainDump struct { - BdID uint32 `binapi:"u32,name=bd_id,default=%!s(float64=4.294967295e+09)" json:"bd_id,omitempty"` - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + BdID uint32 `binapi:"u32,name=bd_id,default=4294967295" json:"bd_id,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` } func (m *BridgeDomainDump) Reset() { *m = BridgeDomainDump{} } @@ -642,23 +615,20 @@ func (*BridgeDomainDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BridgeDomainDump) Size() int { +func (m *BridgeDomainDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID size += 4 // m.SwIfIndex return size } func (m *BridgeDomainDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -682,24 +652,21 @@ func (*BridgeDomainSetMacAge) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BridgeDomainSetMacAge) Size() int { +func (m *BridgeDomainSetMacAge) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID size += 1 // m.MacAge return size } func (m *BridgeDomainSetMacAge) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) - buf.EncodeUint8(uint8(m.MacAge)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) + buf.EncodeUint8(m.MacAge) return buf.Bytes(), nil } func (m *BridgeDomainSetMacAge) Unmarshal(b []byte) error { @@ -721,27 +688,24 @@ func (*BridgeDomainSetMacAgeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BridgeDomainSetMacAgeReply) Size() int { +func (m *BridgeDomainSetMacAgeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BridgeDomainSetMacAgeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BridgeDomainSetMacAgeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -759,24 +723,21 @@ func (*BridgeFlags) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BridgeFlags) Size() int { +func (m *BridgeFlags) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID size += 1 // m.IsSet size += 4 // m.Flags return size } func (m *BridgeFlags) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) buf.EncodeBool(m.IsSet) buf.EncodeUint32(uint32(m.Flags)) return buf.Bytes(), nil @@ -802,29 +763,26 @@ func (*BridgeFlagsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BridgeFlagsReply) Size() int { +func (m *BridgeFlagsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.ResultingFeatureBitmap return size } func (m *BridgeFlagsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.ResultingFeatureBitmap)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ResultingFeatureBitmap) return buf.Bytes(), nil } func (m *BridgeFlagsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ResultingFeatureBitmap = buf.DecodeUint32() return nil } @@ -832,7 +790,7 @@ func (m *BridgeFlagsReply) Unmarshal(b []byte) error { // BviCreate defines message 'bvi_create'. type BviCreate struct { Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` - UserInstance uint32 `binapi:"u32,name=user_instance,default=%!s(float64=4.294967295e+09)" json:"user_instance,omitempty"` + UserInstance uint32 `binapi:"u32,name=user_instance,default=4294967295" json:"user_instance,omitempty"` } func (m *BviCreate) Reset() { *m = BviCreate{} } @@ -842,24 +800,21 @@ func (*BviCreate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BviCreate) Size() int { +func (m *BviCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 6 // m.Mac size += 4 // m.UserInstance return size } func (m *BviCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.Mac[:], 6) - buf.EncodeUint32(uint32(m.UserInstance)) + buf.EncodeUint32(m.UserInstance) return buf.Bytes(), nil } func (m *BviCreate) Unmarshal(b []byte) error { @@ -882,29 +837,26 @@ func (*BviCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BviCreateReply) Size() int { +func (m *BviCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *BviCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *BviCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -921,21 +873,18 @@ func (*BviDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *BviDelete) Size() int { +func (m *BviDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *BviDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -957,27 +906,24 @@ func (*BviDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *BviDeleteReply) Size() int { +func (m *BviDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *BviDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *BviDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -996,11 +942,10 @@ func (*L2ArpTermEvent) GetMessageType() api.MessageType { return api.EventMessage } -func (m *L2ArpTermEvent) Size() int { +func (m *L2ArpTermEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PID size += 1 // m.IP.Af size += 1 * 16 // m.IP.Un @@ -1009,15 +954,13 @@ func (m *L2ArpTermEvent) Size() int { return size } func (m *L2ArpTermEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PID) buf.EncodeUint8(uint8(m.IP.Af)) - buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.Mac[:], 6) return buf.Bytes(), nil @@ -1042,20 +985,17 @@ func (*L2FibClearTable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2FibClearTable) Size() int { +func (m *L2FibClearTable) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *L2FibClearTable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *L2FibClearTable) Unmarshal(b []byte) error { @@ -1074,27 +1014,24 @@ func (*L2FibClearTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2FibClearTableReply) Size() int { +func (m *L2FibClearTableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2FibClearTableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2FibClearTableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1115,11 +1052,10 @@ func (*L2FibTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2FibTableDetails) Size() int { +func (m *L2FibTableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID size += 1 * 6 // m.Mac size += 4 // m.SwIfIndex @@ -1129,13 +1065,11 @@ func (m *L2FibTableDetails) Size() int { return size } func (m *L2FibTableDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) buf.EncodeBytes(m.Mac[:], 6) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.StaticMac) @@ -1166,22 +1100,19 @@ func (*L2FibTableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2FibTableDump) Size() int { +func (m *L2FibTableDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID return size } func (m *L2FibTableDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) return buf.Bytes(), nil } func (m *L2FibTableDump) Unmarshal(b []byte) error { @@ -1204,26 +1135,23 @@ func (*L2Flags) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2Flags) Size() int { +func (m *L2Flags) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsSet size += 4 // m.FeatureBitmap return size } func (m *L2Flags) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsSet) - buf.EncodeUint32(uint32(m.FeatureBitmap)) + buf.EncodeUint32(m.FeatureBitmap) return buf.Bytes(), nil } func (m *L2Flags) Unmarshal(b []byte) error { @@ -1247,29 +1175,26 @@ func (*L2FlagsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2FlagsReply) Size() int { +func (m *L2FlagsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.ResultingFeatureBitmap return size } func (m *L2FlagsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.ResultingFeatureBitmap)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ResultingFeatureBitmap) return buf.Bytes(), nil } func (m *L2FlagsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ResultingFeatureBitmap = buf.DecodeUint32() return nil } @@ -1287,22 +1212,19 @@ func (*L2InterfaceEfpFilter) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2InterfaceEfpFilter) Size() int { +func (m *L2InterfaceEfpFilter) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.EnableDisable return size } func (m *L2InterfaceEfpFilter) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.EnableDisable) return buf.Bytes(), nil @@ -1326,27 +1248,24 @@ func (*L2InterfaceEfpFilterReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2InterfaceEfpFilterReply) Size() int { +func (m *L2InterfaceEfpFilterReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2InterfaceEfpFilterReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2InterfaceEfpFilterReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1368,11 +1287,10 @@ func (*L2InterfacePbbTagRewrite) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2InterfacePbbTagRewrite) Size() int { +func (m *L2InterfacePbbTagRewrite) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.VtrOp size += 2 // m.OuterTag @@ -1383,19 +1301,17 @@ func (m *L2InterfacePbbTagRewrite) Size() int { return size } func (m *L2InterfacePbbTagRewrite) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.VtrOp)) - buf.EncodeUint16(uint16(m.OuterTag)) + buf.EncodeUint32(m.VtrOp) + buf.EncodeUint16(m.OuterTag) buf.EncodeBytes(m.BDmac[:], 6) buf.EncodeBytes(m.BSmac[:], 6) - buf.EncodeUint16(uint16(m.BVlanid)) - buf.EncodeUint32(uint32(m.ISid)) + buf.EncodeUint16(m.BVlanid) + buf.EncodeUint32(m.ISid) return buf.Bytes(), nil } func (m *L2InterfacePbbTagRewrite) Unmarshal(b []byte) error { @@ -1424,27 +1340,24 @@ func (*L2InterfacePbbTagRewriteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2InterfacePbbTagRewriteReply) Size() int { +func (m *L2InterfacePbbTagRewriteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2InterfacePbbTagRewriteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2InterfacePbbTagRewriteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1464,11 +1377,10 @@ func (*L2InterfaceVlanTagRewrite) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2InterfaceVlanTagRewrite) Size() int { +func (m *L2InterfaceVlanTagRewrite) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.VtrOp size += 4 // m.PushDot1q @@ -1477,17 +1389,15 @@ func (m *L2InterfaceVlanTagRewrite) Size() int { return size } func (m *L2InterfaceVlanTagRewrite) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.VtrOp)) - buf.EncodeUint32(uint32(m.PushDot1q)) - buf.EncodeUint32(uint32(m.Tag1)) - buf.EncodeUint32(uint32(m.Tag2)) + buf.EncodeUint32(m.VtrOp) + buf.EncodeUint32(m.PushDot1q) + buf.EncodeUint32(m.Tag1) + buf.EncodeUint32(m.Tag2) return buf.Bytes(), nil } func (m *L2InterfaceVlanTagRewrite) Unmarshal(b []byte) error { @@ -1514,27 +1424,24 @@ func (*L2InterfaceVlanTagRewriteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2InterfaceVlanTagRewriteReply) Size() int { +func (m *L2InterfaceVlanTagRewriteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2InterfaceVlanTagRewriteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2InterfaceVlanTagRewriteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1552,11 +1459,10 @@ func (*L2MacsEvent) GetMessageType() api.MessageType { return api.EventMessage } -func (m *L2MacsEvent) Size() int { +func (m *L2MacsEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PID size += 4 // m.NMacs for j1 := 0; j1 < len(m.Mac); j1++ { @@ -1573,23 +1479,21 @@ func (m *L2MacsEvent) Size() int { return size } func (m *L2MacsEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PID) buf.EncodeUint32(uint32(len(m.Mac))) for j0 := 0; j0 < len(m.Mac); j0++ { - var v0 MacEntry + var v0 MacEntry // Mac if j0 < len(m.Mac) { v0 = m.Mac[j0] } buf.EncodeUint32(uint32(v0.SwIfIndex)) buf.EncodeBytes(v0.MacAddr[:], 6) buf.EncodeUint32(uint32(v0.Action)) - buf.EncodeUint8(uint8(v0.Flags)) + buf.EncodeUint8(v0.Flags) } return buf.Bytes(), nil } @@ -1597,7 +1501,7 @@ func (m *L2MacsEvent) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.PID = buf.DecodeUint32() m.NMacs = buf.DecodeUint32() - m.Mac = make([]MacEntry, int(m.NMacs)) + m.Mac = make([]MacEntry, m.NMacs) for j0 := 0; j0 < len(m.Mac); j0++ { m.Mac[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) copy(m.Mac[j0].MacAddr[:], buf.DecodeBytes(6)) @@ -1621,23 +1525,20 @@ func (*L2PatchAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2PatchAddDel) Size() int { +func (m *L2PatchAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.RxSwIfIndex size += 4 // m.TxSwIfIndex size += 1 // m.IsAdd return size } func (m *L2PatchAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.RxSwIfIndex)) buf.EncodeUint32(uint32(m.TxSwIfIndex)) buf.EncodeBool(m.IsAdd) @@ -1663,27 +1564,24 @@ func (*L2PatchAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2PatchAddDelReply) Size() int { +func (m *L2PatchAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2PatchAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2PatchAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1700,22 +1598,19 @@ func (*L2XconnectDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2XconnectDetails) Size() int { +func (m *L2XconnectDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.RxSwIfIndex size += 4 // m.TxSwIfIndex return size } func (m *L2XconnectDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.RxSwIfIndex)) buf.EncodeUint32(uint32(m.TxSwIfIndex)) return buf.Bytes(), nil @@ -1737,20 +1632,17 @@ func (*L2XconnectDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2XconnectDump) Size() int { +func (m *L2XconnectDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *L2XconnectDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *L2XconnectDump) Unmarshal(b []byte) error { @@ -1775,11 +1667,10 @@ func (*L2fibAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2fibAddDel) Size() int { +func (m *L2fibAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 6 // m.Mac size += 4 // m.BdID size += 4 // m.SwIfIndex @@ -1790,14 +1681,12 @@ func (m *L2fibAddDel) Size() int { return size } func (m *L2fibAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.Mac[:], 6) - buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeUint32(m.BdID) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.StaticMac) @@ -1829,27 +1718,24 @@ func (*L2fibAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2fibAddDelReply) Size() int { +func (m *L2fibAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2fibAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2fibAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1863,20 +1749,17 @@ func (*L2fibFlushAll) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2fibFlushAll) Size() int { +func (m *L2fibFlushAll) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *L2fibFlushAll) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *L2fibFlushAll) Unmarshal(b []byte) error { @@ -1895,27 +1778,24 @@ func (*L2fibFlushAllReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2fibFlushAllReply) Size() int { +func (m *L2fibFlushAllReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2fibFlushAllReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2fibFlushAllReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1931,22 +1811,19 @@ func (*L2fibFlushBd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2fibFlushBd) Size() int { +func (m *L2fibFlushBd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.BdID return size } func (m *L2fibFlushBd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.BdID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.BdID) return buf.Bytes(), nil } func (m *L2fibFlushBd) Unmarshal(b []byte) error { @@ -1967,27 +1844,24 @@ func (*L2fibFlushBdReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2fibFlushBdReply) Size() int { +func (m *L2fibFlushBdReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2fibFlushBdReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2fibFlushBdReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2003,21 +1877,18 @@ func (*L2fibFlushInt) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2fibFlushInt) Size() int { +func (m *L2fibFlushInt) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *L2fibFlushInt) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -2039,27 +1910,24 @@ func (*L2fibFlushIntReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2fibFlushIntReply) Size() int { +func (m *L2fibFlushIntReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2fibFlushIntReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2fibFlushIntReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2079,11 +1947,10 @@ func (*SwInterfaceSetL2Bridge) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetL2Bridge) Size() int { +func (m *SwInterfaceSetL2Bridge) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.RxSwIfIndex size += 4 // m.BdID size += 4 // m.PortType @@ -2092,16 +1959,14 @@ func (m *SwInterfaceSetL2Bridge) Size() int { return size } func (m *SwInterfaceSetL2Bridge) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.RxSwIfIndex)) - buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeUint32(m.BdID) buf.EncodeUint32(uint32(m.PortType)) - buf.EncodeUint8(uint8(m.Shg)) + buf.EncodeUint8(m.Shg) buf.EncodeBool(m.Enable) return buf.Bytes(), nil } @@ -2129,27 +1994,24 @@ func (*SwInterfaceSetL2BridgeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetL2BridgeReply) Size() int { +func (m *SwInterfaceSetL2BridgeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetL2BridgeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetL2BridgeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2167,23 +2029,20 @@ func (*SwInterfaceSetL2Xconnect) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetL2Xconnect) Size() int { +func (m *SwInterfaceSetL2Xconnect) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.RxSwIfIndex size += 4 // m.TxSwIfIndex size += 1 // m.Enable return size } func (m *SwInterfaceSetL2Xconnect) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.RxSwIfIndex)) buf.EncodeUint32(uint32(m.TxSwIfIndex)) buf.EncodeBool(m.Enable) @@ -2211,34 +2070,31 @@ func (*SwInterfaceSetL2XconnectReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetL2XconnectReply) Size() int { +func (m *SwInterfaceSetL2XconnectReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetL2XconnectReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetL2XconnectReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } // SwInterfaceSetVpath defines message 'sw_interface_set_vpath'. type SwInterfaceSetVpath struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` - Enable bool `binapi:"bool,name=enable,default=%!s(float64=4.294967295e+09)" json:"enable,omitempty"` + Enable bool `binapi:"bool,name=enable,default=4.294967295e+09" json:"enable,omitempty"` } func (m *SwInterfaceSetVpath) Reset() { *m = SwInterfaceSetVpath{} } @@ -2248,22 +2104,19 @@ func (*SwInterfaceSetVpath) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetVpath) Size() int { +func (m *SwInterfaceSetVpath) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Enable return size } func (m *SwInterfaceSetVpath) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) return buf.Bytes(), nil @@ -2287,27 +2140,24 @@ func (*SwInterfaceSetVpathReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetVpathReply) Size() int { +func (m *SwInterfaceSetVpathReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetVpathReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetVpathReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2324,24 +2174,21 @@ func (*WantL2ArpTermEvents) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *WantL2ArpTermEvents) Size() int { +func (m *WantL2ArpTermEvents) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable size += 4 // m.PID return size } func (m *WantL2ArpTermEvents) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) - buf.EncodeUint32(uint32(m.PID)) + buf.EncodeUint32(m.PID) return buf.Bytes(), nil } func (m *WantL2ArpTermEvents) Unmarshal(b []byte) error { @@ -2363,35 +2210,32 @@ func (*WantL2ArpTermEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *WantL2ArpTermEventsReply) Size() int { +func (m *WantL2ArpTermEventsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *WantL2ArpTermEventsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *WantL2ArpTermEventsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } // WantL2MacsEvents defines message 'want_l2_macs_events'. type WantL2MacsEvents struct { - LearnLimit uint32 `binapi:"u32,name=learn_limit,default=%!s(float64=1000)" json:"learn_limit,omitempty"` - ScanDelay uint8 `binapi:"u8,name=scan_delay,default=%!s(float64=10)" json:"scan_delay,omitempty"` - MaxMacsInEvent uint8 `binapi:"u8,name=max_macs_in_event,default=%!s(float64=10)" json:"max_macs_in_event,omitempty"` + LearnLimit uint32 `binapi:"u32,name=learn_limit,default=1000" json:"learn_limit,omitempty"` + ScanDelay uint8 `binapi:"u8,name=scan_delay,default=10" json:"scan_delay,omitempty"` + MaxMacsInEvent uint8 `binapi:"u8,name=max_macs_in_event,default=10" json:"max_macs_in_event,omitempty"` EnableDisable bool `binapi:"bool,name=enable_disable,default=true" json:"enable_disable,omitempty"` PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` } @@ -2403,11 +2247,10 @@ func (*WantL2MacsEvents) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *WantL2MacsEvents) Size() int { +func (m *WantL2MacsEvents) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.LearnLimit size += 1 // m.ScanDelay size += 1 // m.MaxMacsInEvent @@ -2416,17 +2259,15 @@ func (m *WantL2MacsEvents) Size() int { return size } func (m *WantL2MacsEvents) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.LearnLimit)) - buf.EncodeUint8(uint8(m.ScanDelay)) - buf.EncodeUint8(uint8(m.MaxMacsInEvent)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.LearnLimit) + buf.EncodeUint8(m.ScanDelay) + buf.EncodeUint8(m.MaxMacsInEvent) buf.EncodeBool(m.EnableDisable) - buf.EncodeUint32(uint32(m.PID)) + buf.EncodeUint32(m.PID) return buf.Bytes(), nil } func (m *WantL2MacsEvents) Unmarshal(b []byte) error { @@ -2451,27 +2292,24 @@ func (*WantL2MacsEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *WantL2MacsEventsReply) Size() int { +func (m *WantL2MacsEventsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *WantL2MacsEventsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *WantL2MacsEventsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/l2e/l2e.ba.go b/binapi/l2e/l2e.ba.go index ebfb464..c1b2a76 100644 --- a/binapi/l2e/l2e.ba.go +++ b/binapi/l2e/l2e.ba.go @@ -42,22 +42,19 @@ func (*L2Emulation) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2Emulation) Size() int { +func (m *L2Emulation) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Enable return size } func (m *L2Emulation) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) return buf.Bytes(), nil @@ -81,27 +78,24 @@ func (*L2EmulationReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2EmulationReply) Size() int { +func (m *L2EmulationReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2EmulationReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2EmulationReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/l2tp/l2tp.ba.go b/binapi/l2tp/l2tp.ba.go index d83f7dd..6737baa 100644 --- a/binapi/l2tp/l2tp.ba.go +++ b/binapi/l2tp/l2tp.ba.go @@ -82,11 +82,10 @@ func (*L2tpv3CreateTunnel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2tpv3CreateTunnel) Size() int { +func (m *L2tpv3CreateTunnel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.ClientAddress.Af size += 1 * 16 // m.ClientAddress.Un size += 1 // m.OurAddress.Af @@ -100,22 +99,20 @@ func (m *L2tpv3CreateTunnel) Size() int { return size } func (m *L2tpv3CreateTunnel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.ClientAddress.Af)) - buf.EncodeBytes(m.ClientAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.ClientAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.OurAddress.Af)) - buf.EncodeBytes(m.OurAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.LocalSessionID)) - buf.EncodeUint32(uint32(m.RemoteSessionID)) - buf.EncodeUint64(uint64(m.LocalCookie)) - buf.EncodeUint64(uint64(m.RemoteCookie)) + buf.EncodeBytes(m.OurAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.LocalSessionID) + buf.EncodeUint32(m.RemoteSessionID) + buf.EncodeUint64(m.LocalCookie) + buf.EncodeUint64(m.RemoteCookie) buf.EncodeBool(m.L2SublayerPresent) - buf.EncodeUint32(uint32(m.EncapVrfID)) + buf.EncodeUint32(m.EncapVrfID) return buf.Bytes(), nil } func (m *L2tpv3CreateTunnel) Unmarshal(b []byte) error { @@ -146,29 +143,26 @@ func (*L2tpv3CreateTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2tpv3CreateTunnelReply) Size() int { +func (m *L2tpv3CreateTunnelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *L2tpv3CreateTunnelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *L2tpv3CreateTunnelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -188,22 +182,19 @@ func (*L2tpv3InterfaceEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2tpv3InterfaceEnableDisable) Size() int { +func (m *L2tpv3InterfaceEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable size += 4 // m.SwIfIndex return size } func (m *L2tpv3InterfaceEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -229,27 +220,24 @@ func (*L2tpv3InterfaceEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2tpv3InterfaceEnableDisableReply) Size() int { +func (m *L2tpv3InterfaceEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2tpv3InterfaceEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2tpv3InterfaceEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -265,21 +253,18 @@ func (*L2tpv3SetLookupKey) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2tpv3SetLookupKey) Size() int { +func (m *L2tpv3SetLookupKey) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Key return size } func (m *L2tpv3SetLookupKey) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Key)) return buf.Bytes(), nil } @@ -301,27 +286,24 @@ func (*L2tpv3SetLookupKeyReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2tpv3SetLookupKeyReply) Size() int { +func (m *L2tpv3SetLookupKeyReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2tpv3SetLookupKeyReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2tpv3SetLookupKeyReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -339,26 +321,23 @@ func (*L2tpv3SetTunnelCookies) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L2tpv3SetTunnelCookies) Size() int { +func (m *L2tpv3SetTunnelCookies) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 8 // m.NewLocalCookie size += 8 // m.NewRemoteCookie return size } func (m *L2tpv3SetTunnelCookies) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint64(uint64(m.NewLocalCookie)) - buf.EncodeUint64(uint64(m.NewRemoteCookie)) + buf.EncodeUint64(m.NewLocalCookie) + buf.EncodeUint64(m.NewRemoteCookie) return buf.Bytes(), nil } func (m *L2tpv3SetTunnelCookies) Unmarshal(b []byte) error { @@ -381,27 +360,24 @@ func (*L2tpv3SetTunnelCookiesReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L2tpv3SetTunnelCookiesReply) Size() int { +func (m *L2tpv3SetTunnelCookiesReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L2tpv3SetTunnelCookiesReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L2tpv3SetTunnelCookiesReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -425,11 +401,10 @@ func (*SwIfL2tpv3TunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwIfL2tpv3TunnelDetails) Size() int { +func (m *SwIfL2tpv3TunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 64 // m.InterfaceName size += 1 // m.ClientAddress.Af @@ -444,28 +419,26 @@ func (m *SwIfL2tpv3TunnelDetails) Size() int { return size } func (m *SwIfL2tpv3TunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeString(m.InterfaceName, 64) buf.EncodeUint8(uint8(m.ClientAddress.Af)) - buf.EncodeBytes(m.ClientAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.ClientAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.OurAddress.Af)) - buf.EncodeBytes(m.OurAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.LocalSessionID)) - buf.EncodeUint32(uint32(m.RemoteSessionID)) + buf.EncodeBytes(m.OurAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.LocalSessionID) + buf.EncodeUint32(m.RemoteSessionID) for i := 0; i < 2; i++ { var x uint64 if i < len(m.LocalCookie) { x = uint64(m.LocalCookie[i]) } - buf.EncodeUint64(uint64(x)) + buf.EncodeUint64(x) } - buf.EncodeUint64(uint64(m.RemoteCookie)) + buf.EncodeUint64(m.RemoteCookie) buf.EncodeBool(m.L2SublayerPresent) return buf.Bytes(), nil } @@ -498,20 +471,17 @@ func (*SwIfL2tpv3TunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwIfL2tpv3TunnelDump) Size() int { +func (m *SwIfL2tpv3TunnelDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SwIfL2tpv3TunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SwIfL2tpv3TunnelDump) Unmarshal(b []byte) error { diff --git a/binapi/l3xc/l3xc.ba.go b/binapi/l3xc/l3xc.ba.go index ee9ecb0..3dbcfba 100644 --- a/binapi/l3xc/l3xc.ba.go +++ b/binapi/l3xc/l3xc.ba.go @@ -53,22 +53,19 @@ func (*L3xcDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L3xcDel) Size() int { +func (m *L3xcDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIP6 return size } func (m *L3xcDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIP6) return buf.Bytes(), nil @@ -92,27 +89,24 @@ func (*L3xcDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L3xcDelReply) Size() int { +func (m *L3xcDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *L3xcDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *L3xcDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -128,11 +122,10 @@ func (*L3xcDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L3xcDetails) Size() int { +func (m *L3xcDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.L3xc.SwIfIndex size += 1 // m.L3xc.IsIP6 size += 1 // m.L3xc.NPaths @@ -156,56 +149,45 @@ func (m *L3xcDetails) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *L3xcDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.L3xc.SwIfIndex)) buf.EncodeBool(m.L3xc.IsIP6) buf.EncodeUint8(uint8(len(m.L3xc.Paths))) for j1 := 0; j1 < len(m.L3xc.Paths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // Paths if j1 < len(m.L3xc.Paths) { v1 = m.L3xc.Paths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -215,7 +197,7 @@ func (m *L3xcDetails) Unmarshal(b []byte) error { m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.L3xc.IsIP6 = buf.DecodeBool() m.L3xc.NPaths = buf.DecodeUint8() - m.L3xc.Paths = make([]fib_types.FibPath, int(m.L3xc.NPaths)) + m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths) for j1 := 0; j1 < len(m.L3xc.Paths); j1++ { m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32() m.L3xc.Paths[j1].TableID = buf.DecodeUint32() @@ -252,21 +234,18 @@ func (*L3xcDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L3xcDump) Size() int { +func (m *L3xcDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *L3xcDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -286,20 +265,17 @@ func (*L3xcPluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L3xcPluginGetVersion) Size() int { +func (m *L3xcPluginGetVersion) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *L3xcPluginGetVersion) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *L3xcPluginGetVersion) Unmarshal(b []byte) error { @@ -319,24 +295,21 @@ func (*L3xcPluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L3xcPluginGetVersionReply) Size() int { +func (m *L3xcPluginGetVersionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Major size += 4 // m.Minor return size } func (m *L3xcPluginGetVersionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Major)) - buf.EncodeUint32(uint32(m.Minor)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Major) + buf.EncodeUint32(m.Minor) return buf.Bytes(), nil } func (m *L3xcPluginGetVersionReply) Unmarshal(b []byte) error { @@ -358,11 +331,10 @@ func (*L3xcUpdate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *L3xcUpdate) Size() int { +func (m *L3xcUpdate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.L3xc.SwIfIndex size += 1 // m.L3xc.IsIP6 size += 1 // m.L3xc.NPaths @@ -386,56 +358,45 @@ func (m *L3xcUpdate) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *L3xcUpdate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.L3xc.SwIfIndex)) buf.EncodeBool(m.L3xc.IsIP6) buf.EncodeUint8(uint8(len(m.L3xc.Paths))) for j1 := 0; j1 < len(m.L3xc.Paths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // Paths if j1 < len(m.L3xc.Paths) { v1 = m.L3xc.Paths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -445,7 +406,7 @@ func (m *L3xcUpdate) Unmarshal(b []byte) error { m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.L3xc.IsIP6 = buf.DecodeBool() m.L3xc.NPaths = buf.DecodeUint8() - m.L3xc.Paths = make([]fib_types.FibPath, int(m.L3xc.NPaths)) + m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths) for j1 := 0; j1 < len(m.L3xc.Paths); j1++ { m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32() m.L3xc.Paths[j1].TableID = buf.DecodeUint32() @@ -483,29 +444,26 @@ func (*L3xcUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *L3xcUpdateReply) Size() int { +func (m *L3xcUpdateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.StatsIndex return size } func (m *L3xcUpdateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.StatsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatsIndex) return buf.Bytes(), nil } func (m *L3xcUpdateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.StatsIndex = buf.DecodeUint32() return nil } diff --git a/binapi/lacp/lacp.ba.go b/binapi/lacp/lacp.ba.go index 92fd933..f1a9457 100644 --- a/binapi/lacp/lacp.ba.go +++ b/binapi/lacp/lacp.ba.go @@ -60,11 +60,10 @@ func (*SwInterfaceLacpDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceLacpDetails) Size() int { +func (m *SwInterfaceLacpDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 64 // m.InterfaceName size += 4 // m.RxState @@ -87,31 +86,29 @@ func (m *SwInterfaceLacpDetails) Size() int { return size } func (m *SwInterfaceLacpDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeString(m.InterfaceName, 64) - buf.EncodeUint32(uint32(m.RxState)) - buf.EncodeUint32(uint32(m.TxState)) - buf.EncodeUint32(uint32(m.MuxState)) - buf.EncodeUint32(uint32(m.PtxState)) + buf.EncodeUint32(m.RxState) + buf.EncodeUint32(m.TxState) + buf.EncodeUint32(m.MuxState) + buf.EncodeUint32(m.PtxState) buf.EncodeString(m.BondInterfaceName, 64) - buf.EncodeUint16(uint16(m.ActorSystemPriority)) + buf.EncodeUint16(m.ActorSystemPriority) buf.EncodeBytes(m.ActorSystem[:], 6) - buf.EncodeUint16(uint16(m.ActorKey)) - buf.EncodeUint16(uint16(m.ActorPortPriority)) - buf.EncodeUint16(uint16(m.ActorPortNumber)) - buf.EncodeUint8(uint8(m.ActorState)) - buf.EncodeUint16(uint16(m.PartnerSystemPriority)) + buf.EncodeUint16(m.ActorKey) + buf.EncodeUint16(m.ActorPortPriority) + buf.EncodeUint16(m.ActorPortNumber) + buf.EncodeUint8(m.ActorState) + buf.EncodeUint16(m.PartnerSystemPriority) buf.EncodeBytes(m.PartnerSystem[:], 6) - buf.EncodeUint16(uint16(m.PartnerKey)) - buf.EncodeUint16(uint16(m.PartnerPortPriority)) - buf.EncodeUint16(uint16(m.PartnerPortNumber)) - buf.EncodeUint8(uint8(m.PartnerState)) + buf.EncodeUint16(m.PartnerKey) + buf.EncodeUint16(m.PartnerPortPriority) + buf.EncodeUint16(m.PartnerPortNumber) + buf.EncodeUint8(m.PartnerState) return buf.Bytes(), nil } func (m *SwInterfaceLacpDetails) Unmarshal(b []byte) error { @@ -148,20 +145,17 @@ func (*SwInterfaceLacpDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceLacpDump) Size() int { +func (m *SwInterfaceLacpDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SwInterfaceLacpDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SwInterfaceLacpDump) Unmarshal(b []byte) error { diff --git a/binapi/lb/lb.ba.go b/binapi/lb/lb.ba.go index 018ae4d..9fdfc7f 100644 --- a/binapi/lb/lb.ba.go +++ b/binapi/lb/lb.ba.go @@ -34,7 +34,7 @@ const ( // LbAddDelAs defines message 'lb_add_del_as'. type LbAddDelAs struct { Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"` - Protocol uint8 `binapi:"u8,name=protocol,default=%!s(float64=255)" json:"protocol,omitempty"` + Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"` Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` AsAddress ip_types.Address `binapi:"address,name=as_address" json:"as_address,omitempty"` IsDel bool `binapi:"bool,name=is_del" json:"is_del,omitempty"` @@ -48,11 +48,10 @@ func (*LbAddDelAs) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LbAddDelAs) Size() int { +func (m *LbAddDelAs) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Pfx.Address.Af size += 1 * 16 // m.Pfx.Address.Un size += 1 // m.Pfx.Len @@ -65,19 +64,17 @@ func (m *LbAddDelAs) Size() int { return size } func (m *LbAddDelAs) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Pfx.Address.Af)) - buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Pfx.Len)) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.Port)) + buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Pfx.Len) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.Port) buf.EncodeUint8(uint8(m.AsAddress.Af)) - buf.EncodeBytes(m.AsAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.AsAddress.Un.XXX_UnionData[:], 16) buf.EncodeBool(m.IsDel) buf.EncodeBool(m.IsFlush) return buf.Bytes(), nil @@ -108,27 +105,24 @@ func (*LbAddDelAsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LbAddDelAsReply) Size() int { +func (m *LbAddDelAsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LbAddDelAsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LbAddDelAsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -145,22 +139,19 @@ func (*LbAddDelIntfNat4) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LbAddDelIntfNat4) Size() int { +func (m *LbAddDelIntfNat4) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SwIfIndex return size } func (m *LbAddDelIntfNat4) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -184,27 +175,24 @@ func (*LbAddDelIntfNat4Reply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LbAddDelIntfNat4Reply) Size() int { +func (m *LbAddDelIntfNat4Reply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LbAddDelIntfNat4Reply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LbAddDelIntfNat4Reply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -221,22 +209,19 @@ func (*LbAddDelIntfNat6) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LbAddDelIntfNat6) Size() int { +func (m *LbAddDelIntfNat6) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SwIfIndex return size } func (m *LbAddDelIntfNat6) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -260,41 +245,38 @@ func (*LbAddDelIntfNat6Reply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LbAddDelIntfNat6Reply) Size() int { +func (m *LbAddDelIntfNat6Reply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LbAddDelIntfNat6Reply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LbAddDelIntfNat6Reply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } // LbAddDelVip defines message 'lb_add_del_vip'. type LbAddDelVip struct { Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"` - Protocol uint8 `binapi:"u8,name=protocol,default=%!s(float64=255)" json:"protocol,omitempty"` + Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"` Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` Encap lb_types.LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"` Dscp uint8 `binapi:"u8,name=dscp" json:"dscp,omitempty"` Type lb_types.LbSrvType `binapi:"lb_srv_type,name=type" json:"type,omitempty"` TargetPort uint16 `binapi:"u16,name=target_port" json:"target_port,omitempty"` NodePort uint16 `binapi:"u16,name=node_port" json:"node_port,omitempty"` - NewFlowsTableLength uint32 `binapi:"u32,name=new_flows_table_length,default=%!s(float64=1024)" json:"new_flows_table_length,omitempty"` + NewFlowsTableLength uint32 `binapi:"u32,name=new_flows_table_length,default=1024" json:"new_flows_table_length,omitempty"` IsDel bool `binapi:"bool,name=is_del" json:"is_del,omitempty"` } @@ -305,11 +287,10 @@ func (*LbAddDelVip) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LbAddDelVip) Size() int { +func (m *LbAddDelVip) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Pfx.Address.Af size += 1 * 16 // m.Pfx.Address.Un size += 1 // m.Pfx.Len @@ -325,23 +306,21 @@ func (m *LbAddDelVip) Size() int { return size } func (m *LbAddDelVip) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Pfx.Address.Af)) - buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Pfx.Len)) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.Port)) + buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Pfx.Len) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.Port) buf.EncodeUint32(uint32(m.Encap)) - buf.EncodeUint8(uint8(m.Dscp)) + buf.EncodeUint8(m.Dscp) buf.EncodeUint32(uint32(m.Type)) - buf.EncodeUint16(uint16(m.TargetPort)) - buf.EncodeUint16(uint16(m.NodePort)) - buf.EncodeUint32(uint32(m.NewFlowsTableLength)) + buf.EncodeUint16(m.TargetPort) + buf.EncodeUint16(m.NodePort) + buf.EncodeUint32(m.NewFlowsTableLength) buf.EncodeBool(m.IsDel) return buf.Bytes(), nil } @@ -374,27 +353,24 @@ func (*LbAddDelVipReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LbAddDelVipReply) Size() int { +func (m *LbAddDelVipReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LbAddDelVipReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LbAddDelVipReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -413,11 +389,10 @@ func (*LbAsDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LbAsDetails) Size() int { +func (m *LbAsDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Vip.Pfx.Address.Af size += 1 * 16 // m.Vip.Pfx.Address.Un size += 1 // m.Vip.Pfx.Len @@ -430,21 +405,19 @@ func (m *LbAsDetails) Size() int { return size } func (m *LbAsDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af)) - buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Vip.Pfx.Len)) + buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Vip.Pfx.Len) buf.EncodeUint8(uint8(m.Vip.Protocol)) - buf.EncodeUint16(uint16(m.Vip.Port)) + buf.EncodeUint16(m.Vip.Port) buf.EncodeUint8(uint8(m.AppSrv.Af)) - buf.EncodeBytes(m.AppSrv.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Flags)) - buf.EncodeUint32(uint32(m.InUseSince)) + buf.EncodeBytes(m.AppSrv.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Flags) + buf.EncodeUint32(m.InUseSince) return buf.Bytes(), nil } func (m *LbAsDetails) Unmarshal(b []byte) error { @@ -475,11 +448,10 @@ func (*LbAsDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LbAsDump) Size() int { +func (m *LbAsDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Pfx.Address.Af size += 1 * 16 // m.Pfx.Address.Un size += 1 // m.Pfx.Len @@ -488,17 +460,15 @@ func (m *LbAsDump) Size() int { return size } func (m *LbAsDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Pfx.Address.Af)) - buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Pfx.Len)) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.Port)) + buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Pfx.Len) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.Port) return buf.Bytes(), nil } func (m *LbAsDump) Unmarshal(b []byte) error { @@ -515,8 +485,8 @@ func (m *LbAsDump) Unmarshal(b []byte) error { type LbConf struct { IP4SrcAddress ip_types.IP4Address `binapi:"ip4_address,name=ip4_src_address" json:"ip4_src_address,omitempty"` IP6SrcAddress ip_types.IP6Address `binapi:"ip6_address,name=ip6_src_address" json:"ip6_src_address,omitempty"` - StickyBucketsPerCore uint32 `binapi:"u32,name=sticky_buckets_per_core,default=%!s(float64=4.294967295e+09)" json:"sticky_buckets_per_core,omitempty"` - FlowTimeout uint32 `binapi:"u32,name=flow_timeout,default=%!s(float64=4.294967295e+09)" json:"flow_timeout,omitempty"` + StickyBucketsPerCore uint32 `binapi:"u32,name=sticky_buckets_per_core,default=4294967295" json:"sticky_buckets_per_core,omitempty"` + FlowTimeout uint32 `binapi:"u32,name=flow_timeout,default=4294967295" json:"flow_timeout,omitempty"` } func (m *LbConf) Reset() { *m = LbConf{} } @@ -526,11 +496,10 @@ func (*LbConf) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LbConf) Size() int { +func (m *LbConf) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IP4SrcAddress size += 1 * 16 // m.IP6SrcAddress size += 4 // m.StickyBucketsPerCore @@ -538,16 +507,14 @@ func (m *LbConf) Size() int { return size } func (m *LbConf) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IP4SrcAddress[:], 4) buf.EncodeBytes(m.IP6SrcAddress[:], 16) - buf.EncodeUint32(uint32(m.StickyBucketsPerCore)) - buf.EncodeUint32(uint32(m.FlowTimeout)) + buf.EncodeUint32(m.StickyBucketsPerCore) + buf.EncodeUint32(m.FlowTimeout) return buf.Bytes(), nil } func (m *LbConf) Unmarshal(b []byte) error { @@ -571,27 +538,24 @@ func (*LbConfReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LbConfReply) Size() int { +func (m *LbConfReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LbConfReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LbConfReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -609,11 +573,10 @@ func (*LbFlushVip) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LbFlushVip) Size() int { +func (m *LbFlushVip) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Pfx.Address.Af size += 1 * 16 // m.Pfx.Address.Un size += 1 // m.Pfx.Len @@ -622,17 +585,15 @@ func (m *LbFlushVip) Size() int { return size } func (m *LbFlushVip) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Pfx.Address.Af)) - buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Pfx.Len)) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.Port)) + buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Pfx.Len) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.Port) return buf.Bytes(), nil } func (m *LbFlushVip) Unmarshal(b []byte) error { @@ -657,27 +618,24 @@ func (*LbFlushVipReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LbFlushVipReply) Size() int { +func (m *LbFlushVipReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LbFlushVipReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LbFlushVipReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -698,11 +656,10 @@ func (*LbVipDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LbVipDetails) Size() int { +func (m *LbVipDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Vip.Pfx.Address.Af size += 1 * 16 // m.Vip.Pfx.Address.Un size += 1 // m.Vip.Pfx.Len @@ -716,22 +673,20 @@ func (m *LbVipDetails) Size() int { return size } func (m *LbVipDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af)) - buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Vip.Pfx.Len)) + buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Vip.Pfx.Len) buf.EncodeUint8(uint8(m.Vip.Protocol)) - buf.EncodeUint16(uint16(m.Vip.Port)) + buf.EncodeUint16(m.Vip.Port) buf.EncodeUint32(uint32(m.Encap)) buf.EncodeUint8(uint8(m.Dscp)) buf.EncodeUint32(uint32(m.SrvType)) - buf.EncodeUint16(uint16(m.TargetPort)) - buf.EncodeUint16(uint16(m.FlowTableLength)) + buf.EncodeUint16(m.TargetPort) + buf.EncodeUint16(m.FlowTableLength) return buf.Bytes(), nil } func (m *LbVipDetails) Unmarshal(b []byte) error { @@ -753,7 +708,7 @@ func (m *LbVipDetails) Unmarshal(b []byte) error { type LbVipDump struct { Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"` PfxMatcher ip_types.PrefixMatcher `binapi:"prefix_matcher,name=pfx_matcher" json:"pfx_matcher,omitempty"` - Protocol uint8 `binapi:"u8,name=protocol,default=%!s(float64=255)" json:"protocol,omitempty"` + Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"` Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` } @@ -764,11 +719,10 @@ func (*LbVipDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LbVipDump) Size() int { +func (m *LbVipDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Pfx.Address.Af size += 1 * 16 // m.Pfx.Address.Un size += 1 // m.Pfx.Len @@ -779,19 +733,17 @@ func (m *LbVipDump) Size() int { return size } func (m *LbVipDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Pfx.Address.Af)) - buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Pfx.Len)) - buf.EncodeUint8(uint8(m.PfxMatcher.Le)) - buf.EncodeUint8(uint8(m.PfxMatcher.Ge)) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.Port)) + buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Pfx.Len) + buf.EncodeUint8(m.PfxMatcher.Le) + buf.EncodeUint8(m.PfxMatcher.Ge) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.Port) return buf.Bytes(), nil } func (m *LbVipDump) Unmarshal(b []byte) error { diff --git a/binapi/lisp/lisp.ba.go b/binapi/lisp/lisp.ba.go index a152648..3358e61 100644 --- a/binapi/lisp/lisp.ba.go +++ b/binapi/lisp/lisp.ba.go @@ -86,11 +86,10 @@ func (*LispAddDelAdjacency) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispAddDelAdjacency) Size() int { +func (m *LispAddDelAdjacency) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Vni size += 1 // m.Reid.Type @@ -100,18 +99,16 @@ func (m *LispAddDelAdjacency) Size() int { return size } func (m *LispAddDelAdjacency) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Reid.Type)) - buf.EncodeBytes(m.Reid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Reid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.Leid.Type)) - buf.EncodeBytes(m.Leid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Leid.Address.XXX_UnionData[:], 6) return buf.Bytes(), nil } func (m *LispAddDelAdjacency) Unmarshal(b []byte) error { @@ -137,27 +134,24 @@ func (*LispAddDelAdjacencyReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispAddDelAdjacencyReply) Size() int { +func (m *LispAddDelAdjacencyReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispAddDelAdjacencyReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispAddDelAdjacencyReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -177,11 +171,10 @@ func (*LispAddDelLocalEid) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispAddDelLocalEid) Size() int { +func (m *LispAddDelLocalEid) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Eid.Type size += 1 * 6 // m.Eid.Address @@ -192,19 +185,17 @@ func (m *LispAddDelLocalEid) Size() int { return size } func (m *LispAddDelLocalEid) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Eid.Type)) - buf.EncodeBytes(m.Eid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Eid.Address.XXX_UnionData[:], 6) buf.EncodeString(m.LocatorSetName, 64) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Key.ID)) - buf.EncodeBytes(m.Key.Key[:], 64) + buf.EncodeBytes(m.Key.Key, 64) return buf.Bytes(), nil } func (m *LispAddDelLocalEid) Unmarshal(b []byte) error { @@ -215,7 +206,8 @@ func (m *LispAddDelLocalEid) Unmarshal(b []byte) error { m.LocatorSetName = buf.DecodeString(64) m.Vni = buf.DecodeUint32() m.Key.ID = lisp_types.HmacKeyID(buf.DecodeUint8()) - copy(m.Key.Key[:], buf.DecodeBytes(64)) + m.Key.Key = make([]byte, 64) + copy(m.Key.Key, buf.DecodeBytes(len(m.Key.Key))) return nil } @@ -231,27 +223,24 @@ func (*LispAddDelLocalEidReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispAddDelLocalEidReply) Size() int { +func (m *LispAddDelLocalEidReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispAddDelLocalEidReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispAddDelLocalEidReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -271,11 +260,10 @@ func (*LispAddDelLocator) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispAddDelLocator) Size() int { +func (m *LispAddDelLocator) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.LocatorSetName size += 4 // m.SwIfIndex @@ -284,17 +272,15 @@ func (m *LispAddDelLocator) Size() int { return size } func (m *LispAddDelLocator) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.LocatorSetName, 64) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.Priority)) - buf.EncodeUint8(uint8(m.Weight)) + buf.EncodeUint8(m.Priority) + buf.EncodeUint8(m.Weight) return buf.Bytes(), nil } func (m *LispAddDelLocator) Unmarshal(b []byte) error { @@ -319,27 +305,24 @@ func (*LispAddDelLocatorReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispAddDelLocatorReply) Size() int { +func (m *LispAddDelLocatorReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispAddDelLocatorReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispAddDelLocatorReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -358,11 +341,10 @@ func (*LispAddDelLocatorSet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispAddDelLocatorSet) Size() int { +func (m *LispAddDelLocatorSet) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.LocatorSetName size += 4 // m.LocatorNum @@ -379,23 +361,21 @@ func (m *LispAddDelLocatorSet) Size() int { return size } func (m *LispAddDelLocatorSet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.LocatorSetName, 64) buf.EncodeUint32(uint32(len(m.Locators))) for j0 := 0; j0 < len(m.Locators); j0++ { - var v0 lisp_types.LocalLocator + var v0 lisp_types.LocalLocator // Locators if j0 < len(m.Locators) { v0 = m.Locators[j0] } buf.EncodeUint32(uint32(v0.SwIfIndex)) - buf.EncodeUint8(uint8(v0.Priority)) - buf.EncodeUint8(uint8(v0.Weight)) + buf.EncodeUint8(v0.Priority) + buf.EncodeUint8(v0.Weight) } return buf.Bytes(), nil } @@ -404,7 +384,7 @@ func (m *LispAddDelLocatorSet) Unmarshal(b []byte) error { m.IsAdd = buf.DecodeBool() m.LocatorSetName = buf.DecodeString(64) m.LocatorNum = buf.DecodeUint32() - m.Locators = make([]lisp_types.LocalLocator, int(m.LocatorNum)) + m.Locators = make([]lisp_types.LocalLocator, m.LocatorNum) for j0 := 0; j0 < len(m.Locators); j0++ { m.Locators[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Locators[j0].Priority = buf.DecodeUint8() @@ -426,29 +406,26 @@ func (*LispAddDelLocatorSetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispAddDelLocatorSetReply) Size() int { +func (m *LispAddDelLocatorSetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.LsIndex return size } func (m *LispAddDelLocatorSetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.LsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.LsIndex) return buf.Bytes(), nil } func (m *LispAddDelLocatorSetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.LsIndex = buf.DecodeUint32() return nil } @@ -468,22 +445,19 @@ func (*LispAddDelMapRequestItrRlocs) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispAddDelMapRequestItrRlocs) Size() int { +func (m *LispAddDelMapRequestItrRlocs) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.LocatorSetName return size } func (m *LispAddDelMapRequestItrRlocs) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.LocatorSetName, 64) return buf.Bytes(), nil @@ -509,27 +483,24 @@ func (*LispAddDelMapRequestItrRlocsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispAddDelMapRequestItrRlocsReply) Size() int { +func (m *LispAddDelMapRequestItrRlocsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispAddDelMapRequestItrRlocsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispAddDelMapRequestItrRlocsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -546,26 +517,23 @@ func (*LispAddDelMapResolver) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispAddDelMapResolver) Size() int { +func (m *LispAddDelMapResolver) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un return size } func (m *LispAddDelMapResolver) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *LispAddDelMapResolver) Unmarshal(b []byte) error { @@ -588,27 +556,24 @@ func (*LispAddDelMapResolverReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispAddDelMapResolverReply) Size() int { +func (m *LispAddDelMapResolverReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispAddDelMapResolverReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispAddDelMapResolverReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -625,26 +590,23 @@ func (*LispAddDelMapServer) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispAddDelMapServer) Size() int { +func (m *LispAddDelMapServer) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un return size } func (m *LispAddDelMapServer) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *LispAddDelMapServer) Unmarshal(b []byte) error { @@ -667,27 +629,24 @@ func (*LispAddDelMapServerReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispAddDelMapServerReply) Size() int { +func (m *LispAddDelMapServerReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispAddDelMapServerReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispAddDelMapServerReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -711,11 +670,10 @@ func (*LispAddDelRemoteMapping) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispAddDelRemoteMapping) Size() int { +func (m *LispAddDelRemoteMapping) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IsSrcDst size += 1 // m.DelAll @@ -740,31 +698,29 @@ func (m *LispAddDelRemoteMapping) Size() int { return size } func (m *LispAddDelRemoteMapping) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.IsSrcDst) buf.EncodeBool(m.DelAll) - buf.EncodeUint32(uint32(m.Vni)) - buf.EncodeUint8(uint8(m.Action)) + buf.EncodeUint32(m.Vni) + buf.EncodeUint8(m.Action) buf.EncodeUint8(uint8(m.Deid.Type)) - buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.Seid.Type)) - buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 6) buf.EncodeUint32(uint32(len(m.Rlocs))) for j0 := 0; j0 < len(m.Rlocs); j0++ { - var v0 lisp_types.RemoteLocator + var v0 lisp_types.RemoteLocator // Rlocs if j0 < len(m.Rlocs) { v0 = m.Rlocs[j0] } - buf.EncodeUint8(uint8(v0.Priority)) - buf.EncodeUint8(uint8(v0.Weight)) + buf.EncodeUint8(v0.Priority) + buf.EncodeUint8(v0.Weight) buf.EncodeUint8(uint8(v0.IPAddress.Af)) - buf.EncodeBytes(v0.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.IPAddress.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -780,7 +736,7 @@ func (m *LispAddDelRemoteMapping) Unmarshal(b []byte) error { m.Seid.Type = lisp_types.EidType(buf.DecodeUint8()) copy(m.Seid.Address.XXX_UnionData[:], buf.DecodeBytes(6)) m.RlocNum = buf.DecodeUint32() - m.Rlocs = make([]lisp_types.RemoteLocator, int(m.RlocNum)) + m.Rlocs = make([]lisp_types.RemoteLocator, m.RlocNum) for j0 := 0; j0 < len(m.Rlocs); j0++ { m.Rlocs[j0].Priority = buf.DecodeUint8() m.Rlocs[j0].Weight = buf.DecodeUint8() @@ -804,27 +760,24 @@ func (*LispAddDelRemoteMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispAddDelRemoteMappingReply) Size() int { +func (m *LispAddDelRemoteMappingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispAddDelRemoteMappingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispAddDelRemoteMappingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -840,22 +793,19 @@ func (*LispAdjacenciesGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispAdjacenciesGet) Size() int { +func (m *LispAdjacenciesGet) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni return size } func (m *LispAdjacenciesGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *LispAdjacenciesGet) Unmarshal(b []byte) error { @@ -878,11 +828,10 @@ func (*LispAdjacenciesGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispAdjacenciesGetReply) Size() int { +func (m *LispAdjacenciesGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count for j1 := 0; j1 < len(m.Adjacencies); j1++ { @@ -899,31 +848,29 @@ func (m *LispAdjacenciesGetReply) Size() int { return size } func (m *LispAdjacenciesGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.Adjacencies))) for j0 := 0; j0 < len(m.Adjacencies); j0++ { - var v0 LispAdjacency + var v0 LispAdjacency // Adjacencies if j0 < len(m.Adjacencies) { v0 = m.Adjacencies[j0] } buf.EncodeUint8(uint8(v0.Reid.Type)) - buf.EncodeBytes(v0.Reid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Reid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(v0.Leid.Type)) - buf.EncodeBytes(v0.Leid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Leid.Address.XXX_UnionData[:], 6) } return buf.Bytes(), nil } func (m *LispAdjacenciesGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() - m.Adjacencies = make([]LispAdjacency, int(m.Count)) + m.Adjacencies = make([]LispAdjacency, m.Count) for j0 := 0; j0 < len(m.Adjacencies); j0++ { m.Adjacencies[j0].Reid.Type = lisp_types.EidType(buf.DecodeUint8()) copy(m.Adjacencies[j0].Reid.Address.XXX_UnionData[:], buf.DecodeBytes(6)) @@ -948,11 +895,10 @@ func (*LispEidTableAddDelMap) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispEidTableAddDelMap) Size() int { +func (m *LispEidTableAddDelMap) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Vni size += 4 // m.DpTable @@ -960,15 +906,13 @@ func (m *LispEidTableAddDelMap) Size() int { return size } func (m *LispEidTableAddDelMap) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Vni)) - buf.EncodeUint32(uint32(m.DpTable)) + buf.EncodeUint32(m.Vni) + buf.EncodeUint32(m.DpTable) buf.EncodeBool(m.IsL2) return buf.Bytes(), nil } @@ -993,27 +937,24 @@ func (*LispEidTableAddDelMapReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispEidTableAddDelMapReply) Size() int { +func (m *LispEidTableAddDelMapReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispEidTableAddDelMapReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispEidTableAddDelMapReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1038,11 +979,10 @@ func (*LispEidTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispEidTableDetails) Size() int { +func (m *LispEidTableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.LocatorSetIndex size += 1 // m.Action size += 1 // m.IsLocal @@ -1059,25 +999,23 @@ func (m *LispEidTableDetails) Size() int { return size } func (m *LispEidTableDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.LocatorSetIndex)) - buf.EncodeUint8(uint8(m.Action)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.LocatorSetIndex) + buf.EncodeUint8(m.Action) buf.EncodeBool(m.IsLocal) buf.EncodeBool(m.IsSrcDst) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Deid.Type)) - buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.Seid.Type)) - buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.TTL)) - buf.EncodeUint8(uint8(m.Authoritative)) + buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 6) + buf.EncodeUint32(m.TTL) + buf.EncodeUint8(m.Authoritative) buf.EncodeUint8(uint8(m.Key.ID)) - buf.EncodeBytes(m.Key.Key[:], 64) + buf.EncodeBytes(m.Key.Key, 64) return buf.Bytes(), nil } func (m *LispEidTableDetails) Unmarshal(b []byte) error { @@ -1094,7 +1032,8 @@ func (m *LispEidTableDetails) Unmarshal(b []byte) error { m.TTL = buf.DecodeUint32() m.Authoritative = buf.DecodeUint8() m.Key.ID = lisp_types.HmacKeyID(buf.DecodeUint8()) - copy(m.Key.Key[:], buf.DecodeBytes(64)) + m.Key.Key = make([]byte, 64) + copy(m.Key.Key, buf.DecodeBytes(len(m.Key.Key))) return nil } @@ -1114,11 +1053,10 @@ func (*LispEidTableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispEidTableDump) Size() int { +func (m *LispEidTableDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EidSet size += 1 // m.PrefixLength size += 4 // m.Vni @@ -1128,17 +1066,15 @@ func (m *LispEidTableDump) Size() int { return size } func (m *LispEidTableDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.EidSet)) - buf.EncodeUint8(uint8(m.PrefixLength)) - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.EidSet) + buf.EncodeUint8(m.PrefixLength) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Eid.Type)) - buf.EncodeBytes(m.Eid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Eid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.Filter)) return buf.Bytes(), nil } @@ -1166,24 +1102,21 @@ func (*LispEidTableMapDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispEidTableMapDetails) Size() int { +func (m *LispEidTableMapDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni size += 4 // m.DpTable return size } func (m *LispEidTableMapDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) - buf.EncodeUint32(uint32(m.DpTable)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) + buf.EncodeUint32(m.DpTable) return buf.Bytes(), nil } func (m *LispEidTableMapDetails) Unmarshal(b []byte) error { @@ -1205,21 +1138,18 @@ func (*LispEidTableMapDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispEidTableMapDump) Size() int { +func (m *LispEidTableMapDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsL2 return size } func (m *LispEidTableMapDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsL2) return buf.Bytes(), nil } @@ -1241,22 +1171,19 @@ func (*LispEidTableVniDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispEidTableVniDetails) Size() int { +func (m *LispEidTableVniDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni return size } func (m *LispEidTableVniDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *LispEidTableVniDetails) Unmarshal(b []byte) error { @@ -1275,20 +1202,17 @@ func (*LispEidTableVniDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispEidTableVniDump) Size() int { +func (m *LispEidTableVniDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *LispEidTableVniDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *LispEidTableVniDump) Unmarshal(b []byte) error { @@ -1307,21 +1231,18 @@ func (*LispEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispEnableDisable) Size() int { +func (m *LispEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *LispEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -1343,27 +1264,24 @@ func (*LispEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispEnableDisableReply) Size() int { +func (m *LispEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1377,20 +1295,17 @@ func (*LispGetMapRequestItrRlocs) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispGetMapRequestItrRlocs) Size() int { +func (m *LispGetMapRequestItrRlocs) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *LispGetMapRequestItrRlocs) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *LispGetMapRequestItrRlocs) Unmarshal(b []byte) error { @@ -1412,29 +1327,26 @@ func (*LispGetMapRequestItrRlocsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispGetMapRequestItrRlocsReply) Size() int { +func (m *LispGetMapRequestItrRlocsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 64 // m.LocatorSetName return size } func (m *LispGetMapRequestItrRlocsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeString(m.LocatorSetName, 64) return buf.Bytes(), nil } func (m *LispGetMapRequestItrRlocsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.LocatorSetName = buf.DecodeString(64) return nil } @@ -1455,11 +1367,10 @@ func (*LispLocatorDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispLocatorDetails) Size() int { +func (m *LispLocatorDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Local size += 4 // m.SwIfIndex size += 1 // m.IPAddress.Af @@ -1469,18 +1380,16 @@ func (m *LispLocatorDetails) Size() int { return size } func (m *LispLocatorDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Local)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Local) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Priority)) - buf.EncodeUint8(uint8(m.Weight)) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Priority) + buf.EncodeUint8(m.Weight) return buf.Bytes(), nil } func (m *LispLocatorDetails) Unmarshal(b []byte) error { @@ -1508,26 +1417,23 @@ func (*LispLocatorDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispLocatorDump) Size() int { +func (m *LispLocatorDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.LsIndex size += 64 // m.LsName size += 1 // m.IsIndexSet return size } func (m *LispLocatorDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.LsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.LsIndex) buf.EncodeString(m.LsName, 64) - buf.EncodeUint8(uint8(m.IsIndexSet)) + buf.EncodeUint8(m.IsIndexSet) return buf.Bytes(), nil } func (m *LispLocatorDump) Unmarshal(b []byte) error { @@ -1551,23 +1457,20 @@ func (*LispLocatorSetDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispLocatorSetDetails) Size() int { +func (m *LispLocatorSetDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.LsIndex size += 64 // m.LsName return size } func (m *LispLocatorSetDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.LsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.LsIndex) buf.EncodeString(m.LsName, 64) return buf.Bytes(), nil } @@ -1590,21 +1493,18 @@ func (*LispLocatorSetDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispLocatorSetDump) Size() int { +func (m *LispLocatorSetDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Filter return size } func (m *LispLocatorSetDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Filter)) return buf.Bytes(), nil } @@ -1628,21 +1528,18 @@ func (*LispMapRegisterEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispMapRegisterEnableDisable) Size() int { +func (m *LispMapRegisterEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *LispMapRegisterEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -1666,27 +1563,24 @@ func (*LispMapRegisterEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispMapRegisterEnableDisableReply) Size() int { +func (m *LispMapRegisterEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispMapRegisterEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispMapRegisterEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1702,21 +1596,18 @@ func (*LispMapRequestMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispMapRequestMode) Size() int { +func (m *LispMapRequestMode) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsSrcDst return size } func (m *LispMapRequestMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsSrcDst) return buf.Bytes(), nil } @@ -1738,27 +1629,24 @@ func (*LispMapRequestModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispMapRequestModeReply) Size() int { +func (m *LispMapRequestModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispMapRequestModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispMapRequestModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1774,24 +1662,21 @@ func (*LispMapResolverDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispMapResolverDetails) Size() int { +func (m *LispMapResolverDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un return size } func (m *LispMapResolverDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *LispMapResolverDetails) Unmarshal(b []byte) error { @@ -1811,20 +1696,17 @@ func (*LispMapResolverDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispMapResolverDump) Size() int { +func (m *LispMapResolverDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *LispMapResolverDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *LispMapResolverDump) Unmarshal(b []byte) error { @@ -1843,24 +1725,21 @@ func (*LispMapServerDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispMapServerDetails) Size() int { +func (m *LispMapServerDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un return size } func (m *LispMapServerDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *LispMapServerDetails) Unmarshal(b []byte) error { @@ -1880,20 +1759,17 @@ func (*LispMapServerDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispMapServerDump) Size() int { +func (m *LispMapServerDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *LispMapServerDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *LispMapServerDump) Unmarshal(b []byte) error { @@ -1913,22 +1789,19 @@ func (*LispPitrSetLocatorSet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispPitrSetLocatorSet) Size() int { +func (m *LispPitrSetLocatorSet) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.LsName return size } func (m *LispPitrSetLocatorSet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.LsName, 64) return buf.Bytes(), nil @@ -1952,27 +1825,24 @@ func (*LispPitrSetLocatorSetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispPitrSetLocatorSetReply) Size() int { +func (m *LispPitrSetLocatorSetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispPitrSetLocatorSetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispPitrSetLocatorSetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1988,21 +1858,18 @@ func (*LispRlocProbeEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispRlocProbeEnableDisable) Size() int { +func (m *LispRlocProbeEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *LispRlocProbeEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -2026,27 +1893,24 @@ func (*LispRlocProbeEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispRlocProbeEnableDisableReply) Size() int { +func (m *LispRlocProbeEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispRlocProbeEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispRlocProbeEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2063,25 +1927,22 @@ func (*LispUsePetr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LispUsePetr) Size() int { +func (m *LispUsePetr) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un size += 1 // m.IsAdd return size } func (m *LispUsePetr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -2105,27 +1966,24 @@ func (*LispUsePetrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LispUsePetrReply) Size() int { +func (m *LispUsePetrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LispUsePetrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LispUsePetrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2139,20 +1997,17 @@ func (*ShowLispMapRegisterState) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowLispMapRegisterState) Size() int { +func (m *ShowLispMapRegisterState) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowLispMapRegisterState) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowLispMapRegisterState) Unmarshal(b []byte) error { @@ -2174,29 +2029,26 @@ func (*ShowLispMapRegisterStateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowLispMapRegisterStateReply) Size() int { +func (m *ShowLispMapRegisterStateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsEnabled return size } func (m *ShowLispMapRegisterStateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsEnabled) return buf.Bytes(), nil } func (m *ShowLispMapRegisterStateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsEnabled = buf.DecodeBool() return nil } @@ -2211,20 +2063,17 @@ func (*ShowLispMapRequestMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowLispMapRequestMode) Size() int { +func (m *ShowLispMapRequestMode) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowLispMapRequestMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowLispMapRequestMode) Unmarshal(b []byte) error { @@ -2246,29 +2095,26 @@ func (*ShowLispMapRequestModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowLispMapRequestModeReply) Size() int { +func (m *ShowLispMapRequestModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsSrcDst return size } func (m *ShowLispMapRequestModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsSrcDst) return buf.Bytes(), nil } func (m *ShowLispMapRequestModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsSrcDst = buf.DecodeBool() return nil } @@ -2283,20 +2129,17 @@ func (*ShowLispPitr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowLispPitr) Size() int { +func (m *ShowLispPitr) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowLispPitr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowLispPitr) Unmarshal(b []byte) error { @@ -2317,31 +2160,28 @@ func (*ShowLispPitrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowLispPitrReply) Size() int { +func (m *ShowLispPitrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsEnabled size += 64 // m.LocatorSetName return size } func (m *ShowLispPitrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsEnabled) buf.EncodeString(m.LocatorSetName, 64) return buf.Bytes(), nil } func (m *ShowLispPitrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsEnabled = buf.DecodeBool() m.LocatorSetName = buf.DecodeString(64) return nil @@ -2357,20 +2197,17 @@ func (*ShowLispRlocProbeState) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowLispRlocProbeState) Size() int { +func (m *ShowLispRlocProbeState) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowLispRlocProbeState) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowLispRlocProbeState) Unmarshal(b []byte) error { @@ -2392,29 +2229,26 @@ func (*ShowLispRlocProbeStateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowLispRlocProbeStateReply) Size() int { +func (m *ShowLispRlocProbeStateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsEnabled return size } func (m *ShowLispRlocProbeStateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsEnabled) return buf.Bytes(), nil } func (m *ShowLispRlocProbeStateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsEnabled = buf.DecodeBool() return nil } @@ -2429,20 +2263,17 @@ func (*ShowLispStatus) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowLispStatus) Size() int { +func (m *ShowLispStatus) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowLispStatus) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowLispStatus) Unmarshal(b []byte) error { @@ -2463,31 +2294,28 @@ func (*ShowLispStatusReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowLispStatusReply) Size() int { +func (m *ShowLispStatusReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsLispEnabled size += 1 // m.IsGpeEnabled return size } func (m *ShowLispStatusReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsLispEnabled) buf.EncodeBool(m.IsGpeEnabled) return buf.Bytes(), nil } func (m *ShowLispStatusReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsLispEnabled = buf.DecodeBool() m.IsGpeEnabled = buf.DecodeBool() return nil @@ -2503,20 +2331,17 @@ func (*ShowLispUsePetr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowLispUsePetr) Size() int { +func (m *ShowLispUsePetr) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowLispUsePetr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowLispUsePetr) Unmarshal(b []byte) error { @@ -2537,11 +2362,10 @@ func (*ShowLispUsePetrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowLispUsePetrReply) Size() int { +func (m *ShowLispUsePetrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsPetrEnable size += 1 // m.IPAddress.Af @@ -2549,21 +2373,19 @@ func (m *ShowLispUsePetrReply) Size() int { return size } func (m *ShowLispUsePetrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsPetrEnable) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *ShowLispUsePetrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsPetrEnable = buf.DecodeBool() m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) diff --git a/binapi/lisp_gpe/lisp_gpe.ba.go b/binapi/lisp_gpe/lisp_gpe.ba.go index bd817a3..4bc7783 100644 --- a/binapi/lisp_gpe/lisp_gpe.ba.go +++ b/binapi/lisp_gpe/lisp_gpe.ba.go @@ -75,11 +75,10 @@ func (*GpeAddDelFwdEntry) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeAddDelFwdEntry) Size() int { +func (m *GpeAddDelFwdEntry) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.RmtEid.Type size += 1 * 6 // m.RmtEid.Address @@ -102,29 +101,27 @@ func (m *GpeAddDelFwdEntry) Size() int { return size } func (m *GpeAddDelFwdEntry) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.RmtEid.Type)) - buf.EncodeBytes(m.RmtEid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.RmtEid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.LclEid.Type)) - buf.EncodeBytes(m.LclEid.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Vni)) - buf.EncodeUint32(uint32(m.DpTable)) - buf.EncodeUint8(uint8(m.Action)) + buf.EncodeBytes(m.LclEid.Address.XXX_UnionData[:], 6) + buf.EncodeUint32(m.Vni) + buf.EncodeUint32(m.DpTable) + buf.EncodeUint8(m.Action) buf.EncodeUint32(uint32(len(m.Locs))) for j0 := 0; j0 < len(m.Locs); j0++ { - var v0 GpeLocator + var v0 GpeLocator // Locs if j0 < len(m.Locs) { v0 = m.Locs[j0] } - buf.EncodeUint8(uint8(v0.Weight)) + buf.EncodeUint8(v0.Weight) buf.EncodeUint8(uint8(v0.Addr.Af)) - buf.EncodeBytes(v0.Addr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Addr.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -139,7 +136,7 @@ func (m *GpeAddDelFwdEntry) Unmarshal(b []byte) error { m.DpTable = buf.DecodeUint32() m.Action = buf.DecodeUint8() m.LocNum = buf.DecodeUint32() - m.Locs = make([]GpeLocator, int(m.LocNum)) + m.Locs = make([]GpeLocator, m.LocNum) for j0 := 0; j0 < len(m.Locs); j0++ { m.Locs[j0].Weight = buf.DecodeUint8() m.Locs[j0].Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) @@ -161,29 +158,26 @@ func (*GpeAddDelFwdEntryReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeAddDelFwdEntryReply) Size() int { +func (m *GpeAddDelFwdEntryReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.FwdEntryIndex return size } func (m *GpeAddDelFwdEntryReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.FwdEntryIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.FwdEntryIndex) return buf.Bytes(), nil } func (m *GpeAddDelFwdEntryReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.FwdEntryIndex = buf.DecodeUint32() return nil } @@ -203,11 +197,10 @@ func (*GpeAddDelIface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeAddDelIface) Size() int { +func (m *GpeAddDelIface) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IsL2 size += 4 // m.DpTable @@ -215,16 +208,14 @@ func (m *GpeAddDelIface) Size() int { return size } func (m *GpeAddDelIface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.IsL2) - buf.EncodeUint32(uint32(m.DpTable)) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.DpTable) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *GpeAddDelIface) Unmarshal(b []byte) error { @@ -248,27 +239,24 @@ func (*GpeAddDelIfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeAddDelIfaceReply) Size() int { +func (m *GpeAddDelIfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GpeAddDelIfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GpeAddDelIfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -287,11 +275,10 @@ func (*GpeAddDelNativeFwdRpath) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeAddDelNativeFwdRpath) Size() int { +func (m *GpeAddDelNativeFwdRpath) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.TableID size += 4 // m.NhSwIfIndex @@ -300,17 +287,15 @@ func (m *GpeAddDelNativeFwdRpath) Size() int { return size } func (m *GpeAddDelNativeFwdRpath) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.TableID)) + buf.EncodeUint32(m.TableID) buf.EncodeUint32(uint32(m.NhSwIfIndex)) buf.EncodeUint8(uint8(m.NhAddr.Af)) - buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *GpeAddDelNativeFwdRpath) Unmarshal(b []byte) error { @@ -337,27 +322,24 @@ func (*GpeAddDelNativeFwdRpathReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeAddDelNativeFwdRpathReply) Size() int { +func (m *GpeAddDelNativeFwdRpathReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GpeAddDelNativeFwdRpathReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GpeAddDelNativeFwdRpathReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -373,21 +355,18 @@ func (*GpeEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeEnableDisable) Size() int { +func (m *GpeEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *GpeEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -409,27 +388,24 @@ func (*GpeEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeEnableDisableReply) Size() int { +func (m *GpeEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GpeEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GpeEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -445,22 +421,19 @@ func (*GpeFwdEntriesGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeFwdEntriesGet) Size() int { +func (m *GpeFwdEntriesGet) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni return size } func (m *GpeFwdEntriesGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *GpeFwdEntriesGet) Unmarshal(b []byte) error { @@ -483,11 +456,10 @@ func (*GpeFwdEntriesGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeFwdEntriesGetReply) Size() int { +func (m *GpeFwdEntriesGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count for j1 := 0; j1 < len(m.Entries); j1++ { @@ -508,35 +480,33 @@ func (m *GpeFwdEntriesGetReply) Size() int { return size } func (m *GpeFwdEntriesGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.Entries))) for j0 := 0; j0 < len(m.Entries); j0++ { - var v0 GpeFwdEntry + var v0 GpeFwdEntry // Entries if j0 < len(m.Entries) { v0 = m.Entries[j0] } - buf.EncodeUint32(uint32(v0.FwdEntryIndex)) - buf.EncodeUint32(uint32(v0.DpTable)) + buf.EncodeUint32(v0.FwdEntryIndex) + buf.EncodeUint32(v0.DpTable) buf.EncodeUint8(uint8(v0.Leid.Type)) - buf.EncodeBytes(v0.Leid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Leid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(v0.Reid.Type)) - buf.EncodeBytes(v0.Reid.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v0.Vni)) - buf.EncodeUint8(uint8(v0.Action)) + buf.EncodeBytes(v0.Reid.Address.XXX_UnionData[:], 6) + buf.EncodeUint32(v0.Vni) + buf.EncodeUint8(v0.Action) } return buf.Bytes(), nil } func (m *GpeFwdEntriesGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() - m.Entries = make([]GpeFwdEntry, int(m.Count)) + m.Entries = make([]GpeFwdEntry, m.Count) for j0 := 0; j0 < len(m.Entries); j0++ { m.Entries[j0].FwdEntryIndex = buf.DecodeUint32() m.Entries[j0].DpTable = buf.DecodeUint32() @@ -563,11 +533,10 @@ func (*GpeFwdEntryPathDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeFwdEntryPathDetails) Size() int { +func (m *GpeFwdEntryPathDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.LclLoc.Weight size += 1 // m.LclLoc.Addr.Af size += 1 * 16 // m.LclLoc.Addr.Un @@ -577,18 +546,16 @@ func (m *GpeFwdEntryPathDetails) Size() int { return size } func (m *GpeFwdEntryPathDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.LclLoc.Weight)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.LclLoc.Weight) buf.EncodeUint8(uint8(m.LclLoc.Addr.Af)) - buf.EncodeBytes(m.LclLoc.Addr.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.RmtLoc.Weight)) + buf.EncodeBytes(m.LclLoc.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.RmtLoc.Weight) buf.EncodeUint8(uint8(m.RmtLoc.Addr.Af)) - buf.EncodeBytes(m.RmtLoc.Addr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.RmtLoc.Addr.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *GpeFwdEntryPathDetails) Unmarshal(b []byte) error { @@ -614,22 +581,19 @@ func (*GpeFwdEntryPathDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeFwdEntryPathDump) Size() int { +func (m *GpeFwdEntryPathDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.FwdEntryIndex return size } func (m *GpeFwdEntryPathDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.FwdEntryIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.FwdEntryIndex) return buf.Bytes(), nil } func (m *GpeFwdEntryPathDump) Unmarshal(b []byte) error { @@ -648,20 +612,17 @@ func (*GpeFwdEntryVnisGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeFwdEntryVnisGet) Size() int { +func (m *GpeFwdEntryVnisGet) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GpeFwdEntryVnisGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GpeFwdEntryVnisGet) Unmarshal(b []byte) error { @@ -682,37 +643,34 @@ func (*GpeFwdEntryVnisGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeFwdEntryVnisGetReply) Size() int { +func (m *GpeFwdEntryVnisGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count size += 4 * len(m.Vnis) // m.Vnis return size } func (m *GpeFwdEntryVnisGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.Vnis))) for i := 0; i < len(m.Vnis); i++ { var x uint32 if i < len(m.Vnis) { x = uint32(m.Vnis[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } func (m *GpeFwdEntryVnisGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() m.Vnis = make([]uint32, m.Count) for i := 0; i < len(m.Vnis); i++ { @@ -731,20 +689,17 @@ func (*GpeGetEncapMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeGetEncapMode) Size() int { +func (m *GpeGetEncapMode) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GpeGetEncapMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GpeGetEncapMode) Unmarshal(b []byte) error { @@ -764,29 +719,26 @@ func (*GpeGetEncapModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeGetEncapModeReply) Size() int { +func (m *GpeGetEncapModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.EncapMode return size } func (m *GpeGetEncapModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint8(uint8(m.EncapMode)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint8(m.EncapMode) return buf.Bytes(), nil } func (m *GpeGetEncapModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.EncapMode = buf.DecodeUint8() return nil } @@ -803,21 +755,18 @@ func (*GpeNativeFwdRpathsGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeNativeFwdRpathsGet) Size() int { +func (m *GpeNativeFwdRpathsGet) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsIP4 return size } func (m *GpeNativeFwdRpathsGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsIP4) return buf.Bytes(), nil } @@ -841,11 +790,10 @@ func (*GpeNativeFwdRpathsGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeNativeFwdRpathsGetReply) Size() int { +func (m *GpeNativeFwdRpathsGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count for j1 := 0; j1 < len(m.Entries); j1++ { @@ -862,31 +810,29 @@ func (m *GpeNativeFwdRpathsGetReply) Size() int { return size } func (m *GpeNativeFwdRpathsGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.Entries))) for j0 := 0; j0 < len(m.Entries); j0++ { - var v0 GpeNativeFwdRpath + var v0 GpeNativeFwdRpath // Entries if j0 < len(m.Entries) { v0 = m.Entries[j0] } - buf.EncodeUint32(uint32(v0.FibIndex)) + buf.EncodeUint32(v0.FibIndex) buf.EncodeUint32(uint32(v0.NhSwIfIndex)) buf.EncodeUint8(uint8(v0.NhAddr.Af)) - buf.EncodeBytes(v0.NhAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.NhAddr.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } func (m *GpeNativeFwdRpathsGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() - m.Entries = make([]GpeNativeFwdRpath, int(m.Count)) + m.Entries = make([]GpeNativeFwdRpath, m.Count) for j0 := 0; j0 < len(m.Entries); j0++ { m.Entries[j0].FibIndex = buf.DecodeUint32() m.Entries[j0].NhSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) @@ -908,21 +854,18 @@ func (*GpeSetEncapMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GpeSetEncapMode) Size() int { +func (m *GpeSetEncapMode) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsVxlan return size } func (m *GpeSetEncapMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsVxlan) return buf.Bytes(), nil } @@ -944,27 +887,24 @@ func (*GpeSetEncapModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GpeSetEncapModeReply) Size() int { +func (m *GpeSetEncapModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *GpeSetEncapModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *GpeSetEncapModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/lisp_types/lisp_types.ba.go b/binapi/lisp_types/lisp_types.ba.go index 6bae4b7..49b2c3d 100644 --- a/binapi/lisp_types/lisp_types.ba.go +++ b/binapi/lisp_types/lisp_types.ba.go @@ -133,13 +133,13 @@ func EidAddressPrefix(a ip_types.Prefix) (u EidAddress) { return } func (u *EidAddress) SetPrefix(a ip_types.Prefix) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) buf.EncodeUint8(uint8(a.Address.Af)) - buf.EncodeBytes(a.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(a.Len)) + buf.EncodeBytes(a.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(a.Len) } func (u *EidAddress) GetPrefix() (a ip_types.Prefix) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) a.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(a.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) a.Len = buf.DecodeUint8() @@ -151,11 +151,11 @@ func EidAddressMac(a ethernet_types.MacAddress) (u EidAddress) { return } func (u *EidAddress) SetMac(a ethernet_types.MacAddress) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) buf.EncodeBytes(a[:], 6) } func (u *EidAddress) GetMac() (a ethernet_types.MacAddress) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) copy(a[:], buf.DecodeBytes(6)) return } @@ -165,12 +165,12 @@ func EidAddressNsh(a Nsh) (u EidAddress) { return } func (u *EidAddress) SetNsh(a Nsh) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) - buf.EncodeUint32(uint32(a.Spi)) - buf.EncodeUint8(uint8(a.Si)) + buf := codec.NewBuffer(u.XXX_UnionData[:]) + buf.EncodeUint32(a.Spi) + buf.EncodeUint8(a.Si) } func (u *EidAddress) GetNsh() (a Nsh) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) a.Spi = buf.DecodeUint32() a.Si = buf.DecodeUint8() return diff --git a/binapi/lldp/lldp.ba.go b/binapi/lldp/lldp.ba.go index a9bae7f..a8769b5 100644 --- a/binapi/lldp/lldp.ba.go +++ b/binapi/lldp/lldp.ba.go @@ -44,25 +44,22 @@ func (*LldpConfig) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LldpConfig) Size() int { +func (m *LldpConfig) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TxHold size += 4 // m.TxInterval size += 4 + len(m.SystemName) // m.SystemName return size } func (m *LldpConfig) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.TxHold)) - buf.EncodeUint32(uint32(m.TxInterval)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TxHold) + buf.EncodeUint32(m.TxInterval) buf.EncodeString(m.SystemName, 0) return buf.Bytes(), nil } @@ -86,27 +83,24 @@ func (*LldpConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LldpConfigReply) Size() int { +func (m *LldpConfigReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *LldpConfigReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *LldpConfigReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -127,11 +121,10 @@ func (*SwInterfaceSetLldp) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetLldp) Size() int { +func (m *SwInterfaceSetLldp) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 * 4 // m.MgmtIP4 size += 1 * 16 // m.MgmtIP6 @@ -141,16 +134,14 @@ func (m *SwInterfaceSetLldp) Size() int { return size } func (m *SwInterfaceSetLldp) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.MgmtIP4[:], 4) buf.EncodeBytes(m.MgmtIP6[:], 16) - buf.EncodeBytes(m.MgmtOid[:], 128) + buf.EncodeBytes(m.MgmtOid, 128) buf.EncodeBool(m.Enable) buf.EncodeString(m.PortDesc, 0) return buf.Bytes(), nil @@ -160,7 +151,8 @@ func (m *SwInterfaceSetLldp) Unmarshal(b []byte) error { m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) copy(m.MgmtIP4[:], buf.DecodeBytes(4)) copy(m.MgmtIP6[:], buf.DecodeBytes(16)) - copy(m.MgmtOid[:], buf.DecodeBytes(128)) + m.MgmtOid = make([]byte, 128) + copy(m.MgmtOid, buf.DecodeBytes(len(m.MgmtOid))) m.Enable = buf.DecodeBool() m.PortDesc = buf.DecodeString(0) return nil @@ -178,27 +170,24 @@ func (*SwInterfaceSetLldpReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetLldpReply) Size() int { +func (m *SwInterfaceSetLldpReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetLldpReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetLldpReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/mactime/mactime.ba.go b/binapi/mactime/mactime.ba.go index 4019d70..deb7472 100644 --- a/binapi/mactime/mactime.ba.go +++ b/binapi/mactime/mactime.ba.go @@ -64,11 +64,10 @@ func (*MactimeAddDelRange) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MactimeAddDelRange) Size() int { +func (m *MactimeAddDelRange) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Drop size += 1 // m.Allow @@ -90,28 +89,26 @@ func (m *MactimeAddDelRange) Size() int { return size } func (m *MactimeAddDelRange) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.Drop) buf.EncodeBool(m.Allow) - buf.EncodeUint8(uint8(m.AllowQuota)) + buf.EncodeUint8(m.AllowQuota) buf.EncodeBool(m.NoUDP10001) - buf.EncodeUint64(uint64(m.DataQuota)) + buf.EncodeUint64(m.DataQuota) buf.EncodeBytes(m.MacAddress[:], 6) buf.EncodeString(m.DeviceName, 64) buf.EncodeUint32(uint32(len(m.Ranges))) for j0 := 0; j0 < len(m.Ranges); j0++ { - var v0 TimeRange + var v0 TimeRange // Ranges if j0 < len(m.Ranges) { v0 = m.Ranges[j0] } - buf.EncodeFloat64(float64(v0.Start)) - buf.EncodeFloat64(float64(v0.End)) + buf.EncodeFloat64(v0.Start) + buf.EncodeFloat64(v0.End) } return buf.Bytes(), nil } @@ -126,10 +123,10 @@ func (m *MactimeAddDelRange) Unmarshal(b []byte) error { copy(m.MacAddress[:], buf.DecodeBytes(6)) m.DeviceName = buf.DecodeString(64) m.Count = buf.DecodeUint32() - m.Ranges = make([]TimeRange, int(m.Count)) + m.Ranges = make([]TimeRange, m.Count) for j0 := 0; j0 < len(m.Ranges); j0++ { - m.Ranges[j0].Start = float64(buf.DecodeFloat64()) - m.Ranges[j0].End = float64(buf.DecodeFloat64()) + m.Ranges[j0].Start = buf.DecodeFloat64() + m.Ranges[j0].End = buf.DecodeFloat64() } return nil } @@ -146,27 +143,24 @@ func (*MactimeAddDelRangeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MactimeAddDelRangeReply) Size() int { +func (m *MactimeAddDelRangeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MactimeAddDelRangeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MactimeAddDelRangeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -189,11 +183,10 @@ func (*MactimeDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MactimeDetails) Size() int { +func (m *MactimeDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PoolIndex size += 1 * 6 // m.MacAddress size += 8 // m.DataQuota @@ -213,26 +206,24 @@ func (m *MactimeDetails) Size() int { return size } func (m *MactimeDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PoolIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PoolIndex) buf.EncodeBytes(m.MacAddress[:], 6) - buf.EncodeUint64(uint64(m.DataQuota)) - buf.EncodeUint64(uint64(m.DataUsedInRange)) - buf.EncodeUint32(uint32(m.Flags)) + buf.EncodeUint64(m.DataQuota) + buf.EncodeUint64(m.DataUsedInRange) + buf.EncodeUint32(m.Flags) buf.EncodeString(m.DeviceName, 64) buf.EncodeUint32(uint32(len(m.Ranges))) for j0 := 0; j0 < len(m.Ranges); j0++ { - var v0 MactimeTimeRange + var v0 MactimeTimeRange // Ranges if j0 < len(m.Ranges) { v0 = m.Ranges[j0] } - buf.EncodeFloat64(float64(v0.Start)) - buf.EncodeFloat64(float64(v0.End)) + buf.EncodeFloat64(v0.Start) + buf.EncodeFloat64(v0.End) } return buf.Bytes(), nil } @@ -245,10 +236,10 @@ func (m *MactimeDetails) Unmarshal(b []byte) error { m.Flags = buf.DecodeUint32() m.DeviceName = buf.DecodeString(64) m.Nranges = buf.DecodeUint32() - m.Ranges = make([]MactimeTimeRange, int(m.Nranges)) + m.Ranges = make([]MactimeTimeRange, m.Nranges) for j0 := 0; j0 < len(m.Ranges); j0++ { - m.Ranges[j0].Start = float64(buf.DecodeFloat64()) - m.Ranges[j0].End = float64(buf.DecodeFloat64()) + m.Ranges[j0].Start = buf.DecodeFloat64() + m.Ranges[j0].End = buf.DecodeFloat64() } return nil } @@ -265,22 +256,19 @@ func (*MactimeDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MactimeDump) Size() int { +func (m *MactimeDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.MyTableEpoch return size } func (m *MactimeDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.MyTableEpoch)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.MyTableEpoch) return buf.Bytes(), nil } func (m *MactimeDump) Unmarshal(b []byte) error { @@ -302,29 +290,26 @@ func (*MactimeDumpReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MactimeDumpReply) Size() int { +func (m *MactimeDumpReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.TableEpoch return size } func (m *MactimeDumpReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.TableEpoch)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableEpoch) return buf.Bytes(), nil } func (m *MactimeDumpReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.TableEpoch = buf.DecodeUint32() return nil } @@ -342,22 +327,19 @@ func (*MactimeEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MactimeEnableDisable) Size() int { +func (m *MactimeEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable size += 4 // m.SwIfIndex return size } func (m *MactimeEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -381,27 +363,24 @@ func (*MactimeEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MactimeEnableDisableReply) Size() int { +func (m *MactimeEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MactimeEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MactimeEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/map/map.ba.go b/binapi/map/map.ba.go index fc3c733..b906284 100644 --- a/binapi/map/map.ba.go +++ b/binapi/map/map.ba.go @@ -45,11 +45,10 @@ func (*MapAddDelRule) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapAddDelRule) Size() int { +func (m *MapAddDelRule) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Index size += 1 // m.IsAdd size += 1 * 16 // m.IP6Dst @@ -57,16 +56,14 @@ func (m *MapAddDelRule) Size() int { return size } func (m *MapAddDelRule) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Index)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Index) buf.EncodeBool(m.IsAdd) buf.EncodeBytes(m.IP6Dst[:], 16) - buf.EncodeUint16(uint16(m.Psid)) + buf.EncodeUint16(m.Psid) return buf.Bytes(), nil } func (m *MapAddDelRule) Unmarshal(b []byte) error { @@ -90,27 +87,24 @@ func (*MapAddDelRuleReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapAddDelRuleReply) Size() int { +func (m *MapAddDelRuleReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapAddDelRuleReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapAddDelRuleReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -122,7 +116,7 @@ type MapAddDomain struct { EaBitsLen uint8 `binapi:"u8,name=ea_bits_len" json:"ea_bits_len,omitempty"` PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"` PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"` - Mtu uint16 `binapi:"u16,name=mtu,default=%!s(float64=1280)" json:"mtu,omitempty"` + Mtu uint16 `binapi:"u16,name=mtu,default=1280" json:"mtu,omitempty"` Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` } @@ -133,11 +127,10 @@ func (*MapAddDomain) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapAddDomain) Size() int { +func (m *MapAddDomain) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.IP6Prefix.Address size += 1 // m.IP6Prefix.Len size += 1 * 4 // m.IP4Prefix.Address @@ -152,22 +145,20 @@ func (m *MapAddDomain) Size() int { return size } func (m *MapAddDomain) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IP6Prefix.Address[:], 16) - buf.EncodeUint8(uint8(m.IP6Prefix.Len)) + buf.EncodeUint8(m.IP6Prefix.Len) buf.EncodeBytes(m.IP4Prefix.Address[:], 4) - buf.EncodeUint8(uint8(m.IP4Prefix.Len)) + buf.EncodeUint8(m.IP4Prefix.Len) buf.EncodeBytes(m.IP6Src.Address[:], 16) - buf.EncodeUint8(uint8(m.IP6Src.Len)) - buf.EncodeUint8(uint8(m.EaBitsLen)) - buf.EncodeUint8(uint8(m.PsidOffset)) - buf.EncodeUint8(uint8(m.PsidLength)) - buf.EncodeUint16(uint16(m.Mtu)) + buf.EncodeUint8(m.IP6Src.Len) + buf.EncodeUint8(m.EaBitsLen) + buf.EncodeUint8(m.PsidOffset) + buf.EncodeUint8(m.PsidLength) + buf.EncodeUint16(m.Mtu) buf.EncodeString(m.Tag, 64) return buf.Bytes(), nil } @@ -200,30 +191,27 @@ func (*MapAddDomainReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapAddDomainReply) Size() int { +func (m *MapAddDomainReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Index size += 4 // m.Retval return size } func (m *MapAddDomainReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Index)) - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Index) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapAddDomainReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Index = buf.DecodeUint32() - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -239,22 +227,19 @@ func (*MapDelDomain) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapDelDomain) Size() int { +func (m *MapDelDomain) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Index return size } func (m *MapDelDomain) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Index)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Index) return buf.Bytes(), nil } func (m *MapDelDomain) Unmarshal(b []byte) error { @@ -275,27 +260,24 @@ func (*MapDelDomainReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapDelDomainReply) Size() int { +func (m *MapDelDomainReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapDelDomainReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapDelDomainReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -320,11 +302,10 @@ func (*MapDomainDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapDomainDetails) Size() int { +func (m *MapDomainDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.DomainIndex size += 1 * 16 // m.IP6Prefix.Address size += 1 // m.IP6Prefix.Len @@ -341,24 +322,22 @@ func (m *MapDomainDetails) Size() int { return size } func (m *MapDomainDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.DomainIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.DomainIndex) buf.EncodeBytes(m.IP6Prefix.Address[:], 16) - buf.EncodeUint8(uint8(m.IP6Prefix.Len)) + buf.EncodeUint8(m.IP6Prefix.Len) buf.EncodeBytes(m.IP4Prefix.Address[:], 4) - buf.EncodeUint8(uint8(m.IP4Prefix.Len)) + buf.EncodeUint8(m.IP4Prefix.Len) buf.EncodeBytes(m.IP6Src.Address[:], 16) - buf.EncodeUint8(uint8(m.IP6Src.Len)) - buf.EncodeUint8(uint8(m.EaBitsLen)) - buf.EncodeUint8(uint8(m.PsidOffset)) - buf.EncodeUint8(uint8(m.PsidLength)) - buf.EncodeUint8(uint8(m.Flags)) - buf.EncodeUint16(uint16(m.Mtu)) + buf.EncodeUint8(m.IP6Src.Len) + buf.EncodeUint8(m.EaBitsLen) + buf.EncodeUint8(m.PsidOffset) + buf.EncodeUint8(m.PsidLength) + buf.EncodeUint8(m.Flags) + buf.EncodeUint16(m.Mtu) buf.EncodeString(m.Tag, 64) return buf.Bytes(), nil } @@ -390,20 +369,17 @@ func (*MapDomainDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapDomainDump) Size() int { +func (m *MapDomainDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *MapDomainDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *MapDomainDump) Unmarshal(b []byte) error { @@ -424,23 +400,20 @@ func (*MapIfEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapIfEnableDisable) Size() int { +func (m *MapIfEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsEnable size += 1 // m.IsTranslation return size } func (m *MapIfEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsEnable) buf.EncodeBool(m.IsTranslation) @@ -466,27 +439,24 @@ func (*MapIfEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapIfEnableDisableReply) Size() int { +func (m *MapIfEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapIfEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapIfEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -504,23 +474,20 @@ func (*MapParamAddDelPreResolve) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapParamAddDelPreResolve) Size() int { +func (m *MapParamAddDelPreResolve) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 * 4 // m.IP4NhAddress size += 1 * 16 // m.IP6NhAddress return size } func (m *MapParamAddDelPreResolve) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBytes(m.IP4NhAddress[:], 4) buf.EncodeBytes(m.IP6NhAddress[:], 16) @@ -548,27 +515,24 @@ func (*MapParamAddDelPreResolveReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapParamAddDelPreResolveReply) Size() int { +func (m *MapParamAddDelPreResolveReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapParamAddDelPreResolveReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapParamAddDelPreResolveReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -582,20 +546,17 @@ func (*MapParamGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapParamGet) Size() int { +func (m *MapParamGet) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *MapParamGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *MapParamGet) Unmarshal(b []byte) error { @@ -628,11 +589,10 @@ func (*MapParamGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapParamGetReply) Size() int { +func (m *MapParamGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.FragInner size += 1 // m.FragIgnoreDf @@ -651,32 +611,30 @@ func (m *MapParamGetReply) Size() int { return size } func (m *MapParamGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint8(uint8(m.FragInner)) - buf.EncodeUint8(uint8(m.FragIgnoreDf)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint8(m.FragInner) + buf.EncodeUint8(m.FragIgnoreDf) buf.EncodeBytes(m.ICMPIP4ErrRelaySrc[:], 4) buf.EncodeBool(m.ICMP6EnableUnreachable) buf.EncodeBytes(m.IP4NhAddress[:], 4) buf.EncodeBytes(m.IP6NhAddress[:], 16) - buf.EncodeUint16(uint16(m.IP4LifetimeMs)) - buf.EncodeUint16(uint16(m.IP4PoolSize)) - buf.EncodeUint32(uint32(m.IP4Buffers)) - buf.EncodeFloat64(float64(m.IP4HtRatio)) + buf.EncodeUint16(m.IP4LifetimeMs) + buf.EncodeUint16(m.IP4PoolSize) + buf.EncodeUint32(m.IP4Buffers) + buf.EncodeFloat64(m.IP4HtRatio) buf.EncodeBool(m.SecCheckEnable) buf.EncodeBool(m.SecCheckFragments) buf.EncodeBool(m.TcCopy) - buf.EncodeUint8(uint8(m.TcClass)) + buf.EncodeUint8(m.TcClass) return buf.Bytes(), nil } func (m *MapParamGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.FragInner = buf.DecodeUint8() m.FragIgnoreDf = buf.DecodeUint8() copy(m.ICMPIP4ErrRelaySrc[:], buf.DecodeBytes(4)) @@ -686,7 +644,7 @@ func (m *MapParamGetReply) Unmarshal(b []byte) error { m.IP4LifetimeMs = buf.DecodeUint16() m.IP4PoolSize = buf.DecodeUint16() m.IP4Buffers = buf.DecodeUint32() - m.IP4HtRatio = float64(buf.DecodeFloat64()) + m.IP4HtRatio = buf.DecodeFloat64() m.SecCheckEnable = buf.DecodeBool() m.SecCheckFragments = buf.DecodeBool() m.TcCopy = buf.DecodeBool() @@ -707,22 +665,19 @@ func (*MapParamSetFragmentation) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapParamSetFragmentation) Size() int { +func (m *MapParamSetFragmentation) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Inner size += 1 // m.IgnoreDf return size } func (m *MapParamSetFragmentation) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Inner) buf.EncodeBool(m.IgnoreDf) return buf.Bytes(), nil @@ -748,27 +703,24 @@ func (*MapParamSetFragmentationReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapParamSetFragmentationReply) Size() int { +func (m *MapParamSetFragmentationReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapParamSetFragmentationReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapParamSetFragmentationReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -784,21 +736,18 @@ func (*MapParamSetICMP) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapParamSetICMP) Size() int { +func (m *MapParamSetICMP) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IP4ErrRelaySrc return size } func (m *MapParamSetICMP) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IP4ErrRelaySrc[:], 4) return buf.Bytes(), nil } @@ -820,21 +769,18 @@ func (*MapParamSetICMP6) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapParamSetICMP6) Size() int { +func (m *MapParamSetICMP6) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableUnreachable return size } func (m *MapParamSetICMP6) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableUnreachable) return buf.Bytes(), nil } @@ -856,27 +802,24 @@ func (*MapParamSetICMP6Reply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapParamSetICMP6Reply) Size() int { +func (m *MapParamSetICMP6Reply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapParamSetICMP6Reply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapParamSetICMP6Reply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -892,27 +835,24 @@ func (*MapParamSetICMPReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapParamSetICMPReply) Size() int { +func (m *MapParamSetICMPReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapParamSetICMPReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapParamSetICMPReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -929,22 +869,19 @@ func (*MapParamSetSecurityCheck) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapParamSetSecurityCheck) Size() int { +func (m *MapParamSetSecurityCheck) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable size += 1 // m.Fragments return size } func (m *MapParamSetSecurityCheck) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) buf.EncodeBool(m.Fragments) return buf.Bytes(), nil @@ -970,27 +907,24 @@ func (*MapParamSetSecurityCheckReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapParamSetSecurityCheckReply) Size() int { +func (m *MapParamSetSecurityCheckReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapParamSetSecurityCheckReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapParamSetSecurityCheckReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1006,22 +940,19 @@ func (*MapParamSetTCP) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapParamSetTCP) Size() int { +func (m *MapParamSetTCP) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.TCPMss return size } func (m *MapParamSetTCP) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.TCPMss)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.TCPMss) return buf.Bytes(), nil } func (m *MapParamSetTCP) Unmarshal(b []byte) error { @@ -1042,27 +973,24 @@ func (*MapParamSetTCPReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapParamSetTCPReply) Size() int { +func (m *MapParamSetTCPReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapParamSetTCPReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapParamSetTCPReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1079,24 +1007,21 @@ func (*MapParamSetTrafficClass) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapParamSetTrafficClass) Size() int { +func (m *MapParamSetTrafficClass) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Copy size += 1 // m.TcClass return size } func (m *MapParamSetTrafficClass) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Copy) - buf.EncodeUint8(uint8(m.TcClass)) + buf.EncodeUint8(m.TcClass) return buf.Bytes(), nil } func (m *MapParamSetTrafficClass) Unmarshal(b []byte) error { @@ -1120,27 +1045,24 @@ func (*MapParamSetTrafficClassReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapParamSetTrafficClassReply) Size() int { +func (m *MapParamSetTrafficClassReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MapParamSetTrafficClassReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MapParamSetTrafficClassReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1157,24 +1079,21 @@ func (*MapRuleDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapRuleDetails) Size() int { +func (m *MapRuleDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.IP6Dst size += 2 // m.Psid return size } func (m *MapRuleDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IP6Dst[:], 16) - buf.EncodeUint16(uint16(m.Psid)) + buf.EncodeUint16(m.Psid) return buf.Bytes(), nil } func (m *MapRuleDetails) Unmarshal(b []byte) error { @@ -1196,22 +1115,19 @@ func (*MapRuleDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapRuleDump) Size() int { +func (m *MapRuleDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.DomainIndex return size } func (m *MapRuleDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.DomainIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.DomainIndex) return buf.Bytes(), nil } func (m *MapRuleDump) Unmarshal(b []byte) error { @@ -1230,20 +1146,17 @@ func (*MapSummaryStats) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MapSummaryStats) Size() int { +func (m *MapSummaryStats) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *MapSummaryStats) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *MapSummaryStats) Unmarshal(b []byte) error { @@ -1267,11 +1180,10 @@ func (*MapSummaryStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MapSummaryStatsReply) Size() int { +func (m *MapSummaryStatsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 8 // m.TotalBindings size += 8 * 2 // m.TotalPkts @@ -1281,41 +1193,39 @@ func (m *MapSummaryStatsReply) Size() int { return size } func (m *MapSummaryStatsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint64(uint64(m.TotalBindings)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint64(m.TotalBindings) for i := 0; i < 2; i++ { var x uint64 if i < len(m.TotalPkts) { x = uint64(m.TotalPkts[i]) } - buf.EncodeUint64(uint64(x)) + buf.EncodeUint64(x) } for i := 0; i < 2; i++ { var x uint64 if i < len(m.TotalBytes) { x = uint64(m.TotalBytes[i]) } - buf.EncodeUint64(uint64(x)) + buf.EncodeUint64(x) } - buf.EncodeUint64(uint64(m.TotalIP4Fragments)) + buf.EncodeUint64(m.TotalIP4Fragments) for i := 0; i < 2; i++ { var x uint64 if i < len(m.TotalSecurityCheck) { x = uint64(m.TotalSecurityCheck[i]) } - buf.EncodeUint64(uint64(x)) + buf.EncodeUint64(x) } return buf.Bytes(), nil } func (m *MapSummaryStatsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.TotalBindings = buf.DecodeUint64() m.TotalPkts = make([]uint64, 2) for i := 0; i < len(m.TotalPkts); i++ { diff --git a/binapi/mdata/mdata.ba.go b/binapi/mdata/mdata.ba.go index aba1dee..d4715f7 100644 --- a/binapi/mdata/mdata.ba.go +++ b/binapi/mdata/mdata.ba.go @@ -41,21 +41,18 @@ func (*MdataEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MdataEnableDisable) Size() int { +func (m *MdataEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable return size } func (m *MdataEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) return buf.Bytes(), nil } @@ -77,27 +74,24 @@ func (*MdataEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MdataEnableDisableReply) Size() int { +func (m *MdataEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MdataEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MdataEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/memclnt/memclnt.ba.go b/binapi/memclnt/memclnt.ba.go index 915379c..3bbf88d 100644 --- a/binapi/memclnt/memclnt.ba.go +++ b/binapi/memclnt/memclnt.ba.go @@ -53,20 +53,17 @@ func (*APIVersions) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *APIVersions) Size() int { +func (m *APIVersions) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *APIVersions) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *APIVersions) Unmarshal(b []byte) error { @@ -87,11 +84,10 @@ func (*APIVersionsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *APIVersionsReply) Size() int { +func (m *APIVersionsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count for j1 := 0; j1 < len(m.APIVersions); j1++ { @@ -108,31 +104,29 @@ func (m *APIVersionsReply) Size() int { return size } func (m *APIVersionsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.APIVersions))) for j0 := 0; j0 < len(m.APIVersions); j0++ { - var v0 ModuleVersion + var v0 ModuleVersion // APIVersions if j0 < len(m.APIVersions) { v0 = m.APIVersions[j0] } - buf.EncodeUint32(uint32(v0.Major)) - buf.EncodeUint32(uint32(v0.Minor)) - buf.EncodeUint32(uint32(v0.Patch)) + buf.EncodeUint32(v0.Major) + buf.EncodeUint32(v0.Minor) + buf.EncodeUint32(v0.Patch) buf.EncodeString(v0.Name, 64) } return buf.Bytes(), nil } func (m *APIVersionsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() - m.APIVersions = make([]ModuleVersion, int(m.Count)) + m.APIVersions = make([]ModuleVersion, m.Count) for j0 := 0; j0 < len(m.APIVersions); j0++ { m.APIVersions[j0].Major = buf.DecodeUint32() m.APIVersions[j0].Minor = buf.DecodeUint32() @@ -154,21 +148,18 @@ func (*GetFirstMsgID) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GetFirstMsgID) Size() int { +func (m *GetFirstMsgID) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name return size } func (m *GetFirstMsgID) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) return buf.Bytes(), nil } @@ -191,29 +182,26 @@ func (*GetFirstMsgIDReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GetFirstMsgIDReply) Size() int { +func (m *GetFirstMsgIDReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 2 // m.FirstMsgID return size } func (m *GetFirstMsgIDReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint16(uint16(m.FirstMsgID)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint16(m.FirstMsgID) return buf.Bytes(), nil } func (m *GetFirstMsgIDReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.FirstMsgID = buf.DecodeUint16() return nil } @@ -233,11 +221,10 @@ func (*MemclntCreate) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MemclntCreate) Size() int { +func (m *MemclntCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.CtxQuota size += 8 // m.InputQueue size += 64 // m.Name @@ -245,27 +232,25 @@ func (m *MemclntCreate) Size() int { return size } func (m *MemclntCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.CtxQuota)) - buf.EncodeUint64(uint64(m.InputQueue)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.CtxQuota) + buf.EncodeUint64(m.InputQueue) buf.EncodeString(m.Name, 64) for i := 0; i < 8; i++ { var x uint32 if i < len(m.APIVersions) { x = uint32(m.APIVersions[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } func (m *MemclntCreate) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.CtxQuota = int32(buf.DecodeUint32()) + m.CtxQuota = buf.DecodeInt32() m.InputQueue = buf.DecodeUint64() m.Name = buf.DecodeString(64) m.APIVersions = make([]uint32, 8) @@ -290,11 +275,10 @@ func (*MemclntCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MemclntCreateReply) Size() int { +func (m *MemclntCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Response size += 8 // m.Handle size += 4 // m.Index @@ -302,21 +286,19 @@ func (m *MemclntCreateReply) Size() int { return size } func (m *MemclntCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Response)) - buf.EncodeUint64(uint64(m.Handle)) - buf.EncodeUint32(uint32(m.Index)) - buf.EncodeUint64(uint64(m.MessageTable)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Response) + buf.EncodeUint64(m.Handle) + buf.EncodeUint32(m.Index) + buf.EncodeUint64(m.MessageTable) return buf.Bytes(), nil } func (m *MemclntCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Response = int32(buf.DecodeUint32()) + m.Response = buf.DecodeInt32() m.Handle = buf.DecodeUint64() m.Index = buf.DecodeUint32() m.MessageTable = buf.DecodeUint64() @@ -337,25 +319,22 @@ func (*MemclntDelete) GetMessageType() api.MessageType { return api.OtherMessage } -func (m *MemclntDelete) Size() int { +func (m *MemclntDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Index size += 8 // m.Handle size += 1 // m.DoCleanup return size } func (m *MemclntDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Index)) - buf.EncodeUint64(uint64(m.Handle)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Index) + buf.EncodeUint64(m.Handle) buf.EncodeBool(m.DoCleanup) return buf.Bytes(), nil } @@ -380,29 +359,26 @@ func (*MemclntDeleteReply) GetMessageType() api.MessageType { return api.OtherMessage } -func (m *MemclntDeleteReply) Size() int { +func (m *MemclntDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Response size += 8 // m.Handle return size } func (m *MemclntDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Response)) - buf.EncodeUint64(uint64(m.Handle)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Response) + buf.EncodeUint64(m.Handle) return buf.Bytes(), nil } func (m *MemclntDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Response = int32(buf.DecodeUint32()) + m.Response = buf.DecodeInt32() m.Handle = buf.DecodeUint64() return nil } @@ -417,20 +393,17 @@ func (*MemclntKeepalive) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MemclntKeepalive) Size() int { +func (m *MemclntKeepalive) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *MemclntKeepalive) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *MemclntKeepalive) Unmarshal(b []byte) error { @@ -449,27 +422,24 @@ func (*MemclntKeepaliveReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MemclntKeepaliveReply) Size() int { +func (m *MemclntKeepaliveReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MemclntKeepaliveReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MemclntKeepaliveReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -485,22 +455,19 @@ func (*MemclntReadTimeout) GetMessageType() api.MessageType { return api.OtherMessage } -func (m *MemclntReadTimeout) Size() int { +func (m *MemclntReadTimeout) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Dummy return size } func (m *MemclntReadTimeout) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Dummy)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Dummy) return buf.Bytes(), nil } func (m *MemclntReadTimeout) Unmarshal(b []byte) error { @@ -521,22 +488,19 @@ func (*MemclntRxThreadSuspend) GetMessageType() api.MessageType { return api.OtherMessage } -func (m *MemclntRxThreadSuspend) Size() int { +func (m *MemclntRxThreadSuspend) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Dummy return size } func (m *MemclntRxThreadSuspend) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Dummy)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Dummy) return buf.Bytes(), nil } func (m *MemclntRxThreadSuspend) Unmarshal(b []byte) error { @@ -562,11 +526,10 @@ func (*RPCCall) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *RPCCall) Size() int { +func (m *RPCCall) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.Function size += 1 // m.Multicast size += 1 // m.NeedBarrierSync @@ -576,18 +539,16 @@ func (m *RPCCall) Size() int { return size } func (m *RPCCall) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint64(uint64(m.Function)) - buf.EncodeUint8(uint8(m.Multicast)) - buf.EncodeUint8(uint8(m.NeedBarrierSync)) - buf.EncodeUint8(uint8(m.SendReply)) + buf := codec.NewBuffer(b) + buf.EncodeUint64(m.Function) + buf.EncodeUint8(m.Multicast) + buf.EncodeUint8(m.NeedBarrierSync) + buf.EncodeUint8(m.SendReply) buf.EncodeUint32(uint32(len(m.Data))) - buf.EncodeBytes(m.Data[:], 0) + buf.EncodeBytes(m.Data, 0) return buf.Bytes(), nil } func (m *RPCCall) Unmarshal(b []byte) error { @@ -597,7 +558,8 @@ func (m *RPCCall) Unmarshal(b []byte) error { m.NeedBarrierSync = buf.DecodeUint8() m.SendReply = buf.DecodeUint8() m.DataLen = buf.DecodeUint32() - copy(m.Data[:], buf.DecodeBytes(0)) + m.Data = make([]byte, m.DataLen) + copy(m.Data, buf.DecodeBytes(len(m.Data))) return nil } @@ -613,27 +575,24 @@ func (*RPCCallReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *RPCCallReply) Size() int { +func (m *RPCCallReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *RPCCallReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *RPCCallReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -649,22 +608,19 @@ func (*RxThreadExit) GetMessageType() api.MessageType { return api.OtherMessage } -func (m *RxThreadExit) Size() int { +func (m *RxThreadExit) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Dummy return size } func (m *RxThreadExit) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Dummy)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Dummy) return buf.Bytes(), nil } func (m *RxThreadExit) Unmarshal(b []byte) error { @@ -687,31 +643,28 @@ func (*SockInitShm) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SockInitShm) Size() int { +func (m *SockInitShm) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.RequestedSize size += 1 // m.Nitems size += 8 * len(m.Configs) // m.Configs return size } func (m *SockInitShm) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.RequestedSize)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.RequestedSize) buf.EncodeUint8(uint8(len(m.Configs))) for i := 0; i < len(m.Configs); i++ { var x uint64 if i < len(m.Configs) { x = uint64(m.Configs[i]) } - buf.EncodeUint64(uint64(x)) + buf.EncodeUint64(x) } return buf.Bytes(), nil } @@ -738,27 +691,24 @@ func (*SockInitShmReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SockInitShmReply) Size() int { +func (m *SockInitShmReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SockInitShmReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SockInitShmReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -774,21 +724,18 @@ func (*SockclntCreate) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SockclntCreate) Size() int { +func (m *SockclntCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name return size } func (m *SockclntCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) return buf.Bytes(), nil } @@ -813,11 +760,10 @@ func (*SockclntCreateReply) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SockclntCreateReply) Size() int { +func (m *SockclntCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Response size += 4 // m.Index size += 2 // m.Count @@ -833,31 +779,29 @@ func (m *SockclntCreateReply) Size() int { return size } func (m *SockclntCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Response)) - buf.EncodeUint32(uint32(m.Index)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Response) + buf.EncodeUint32(m.Index) buf.EncodeUint16(uint16(len(m.MessageTable))) for j0 := 0; j0 < len(m.MessageTable); j0++ { - var v0 MessageTableEntry + var v0 MessageTableEntry // MessageTable if j0 < len(m.MessageTable) { v0 = m.MessageTable[j0] } - buf.EncodeUint16(uint16(v0.Index)) + buf.EncodeUint16(v0.Index) buf.EncodeString(v0.Name, 64) } return buf.Bytes(), nil } func (m *SockclntCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Response = int32(buf.DecodeUint32()) + m.Response = buf.DecodeInt32() m.Index = buf.DecodeUint32() m.Count = buf.DecodeUint16() - m.MessageTable = make([]MessageTableEntry, int(m.Count)) + m.MessageTable = make([]MessageTableEntry, m.Count) for j0 := 0; j0 < len(m.MessageTable); j0++ { m.MessageTable[j0].Index = buf.DecodeUint16() m.MessageTable[j0].Name = buf.DecodeString(64) @@ -877,22 +821,19 @@ func (*SockclntDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SockclntDelete) Size() int { +func (m *SockclntDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Index return size } func (m *SockclntDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Index)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Index) return buf.Bytes(), nil } func (m *SockclntDelete) Unmarshal(b []byte) error { @@ -913,27 +854,24 @@ func (*SockclntDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SockclntDeleteReply) Size() int { +func (m *SockclntDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Response return size } func (m *SockclntDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Response)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Response) return buf.Bytes(), nil } func (m *SockclntDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Response = int32(buf.DecodeUint32()) + m.Response = buf.DecodeInt32() return nil } @@ -951,26 +889,23 @@ func (*TracePluginMsgIds) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TracePluginMsgIds) Size() int { +func (m *TracePluginMsgIds) Size() (size int) { if m == nil { return 0 } - var size int size += 128 // m.PluginName size += 2 // m.FirstMsgID size += 2 // m.LastMsgID return size } func (m *TracePluginMsgIds) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.PluginName, 128) - buf.EncodeUint16(uint16(m.FirstMsgID)) - buf.EncodeUint16(uint16(m.LastMsgID)) + buf.EncodeUint16(m.FirstMsgID) + buf.EncodeUint16(m.LastMsgID) return buf.Bytes(), nil } func (m *TracePluginMsgIds) Unmarshal(b []byte) error { diff --git a/binapi/memif/memif.ba.go b/binapi/memif/memif.ba.go index be5d392..adc41b6 100644 --- a/binapi/memif/memif.ba.go +++ b/binapi/memif/memif.ba.go @@ -111,11 +111,10 @@ func (*MemifCreate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MemifCreate) Size() int { +func (m *MemifCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Role size += 4 // m.Mode size += 1 // m.RxQueues @@ -130,20 +129,18 @@ func (m *MemifCreate) Size() int { return size } func (m *MemifCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Role)) buf.EncodeUint32(uint32(m.Mode)) - buf.EncodeUint8(uint8(m.RxQueues)) - buf.EncodeUint8(uint8(m.TxQueues)) - buf.EncodeUint32(uint32(m.ID)) - buf.EncodeUint32(uint32(m.SocketID)) - buf.EncodeUint32(uint32(m.RingSize)) - buf.EncodeUint16(uint16(m.BufferSize)) + buf.EncodeUint8(m.RxQueues) + buf.EncodeUint8(m.TxQueues) + buf.EncodeUint32(m.ID) + buf.EncodeUint32(m.SocketID) + buf.EncodeUint32(m.RingSize) + buf.EncodeUint16(m.BufferSize) buf.EncodeBool(m.NoZeroCopy) buf.EncodeBytes(m.HwAddr[:], 6) buf.EncodeString(m.Secret, 24) @@ -178,29 +175,26 @@ func (*MemifCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MemifCreateReply) Size() int { +func (m *MemifCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *MemifCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *MemifCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -217,21 +211,18 @@ func (*MemifDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MemifDelete) Size() int { +func (m *MemifDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *MemifDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -253,27 +244,24 @@ func (*MemifDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MemifDeleteReply) Size() int { +func (m *MemifDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MemifDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MemifDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -299,11 +287,10 @@ func (*MemifDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MemifDetails) Size() int { +func (m *MemifDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 * 6 // m.HwAddr size += 4 // m.ID @@ -318,21 +305,19 @@ func (m *MemifDetails) Size() int { return size } func (m *MemifDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.HwAddr[:], 6) - buf.EncodeUint32(uint32(m.ID)) + buf.EncodeUint32(m.ID) buf.EncodeUint32(uint32(m.Role)) buf.EncodeUint32(uint32(m.Mode)) buf.EncodeBool(m.ZeroCopy) - buf.EncodeUint32(uint32(m.SocketID)) - buf.EncodeUint32(uint32(m.RingSize)) - buf.EncodeUint16(uint16(m.BufferSize)) + buf.EncodeUint32(m.SocketID) + buf.EncodeUint32(m.RingSize) + buf.EncodeUint16(m.BufferSize) buf.EncodeUint32(uint32(m.Flags)) buf.EncodeString(m.IfName, 64) return buf.Bytes(), nil @@ -363,20 +348,17 @@ func (*MemifDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MemifDump) Size() int { +func (m *MemifDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *MemifDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *MemifDump) Unmarshal(b []byte) error { @@ -397,25 +379,22 @@ func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MemifSocketFilenameAddDel) Size() int { +func (m *MemifSocketFilenameAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SocketID size += 108 // m.SocketFilename return size } func (m *MemifSocketFilenameAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.SocketID)) + buf.EncodeUint32(m.SocketID) buf.EncodeString(m.SocketFilename, 108) return buf.Bytes(), nil } @@ -441,27 +420,24 @@ func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MemifSocketFilenameAddDelReply) Size() int { +func (m *MemifSocketFilenameAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MemifSocketFilenameAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MemifSocketFilenameAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -478,23 +454,20 @@ func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MemifSocketFilenameDetails) Size() int { +func (m *MemifSocketFilenameDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SocketID size += 108 // m.SocketFilename return size } func (m *MemifSocketFilenameDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SocketID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SocketID) buf.EncodeString(m.SocketFilename, 108) return buf.Bytes(), nil } @@ -515,20 +488,17 @@ func (*MemifSocketFilenameDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MemifSocketFilenameDump) Size() int { +func (m *MemifSocketFilenameDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *MemifSocketFilenameDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *MemifSocketFilenameDump) Unmarshal(b []byte) error { diff --git a/binapi/mpls/mpls.ba.go b/binapi/mpls/mpls.ba.go index 4656a9a..9443728 100644 --- a/binapi/mpls/mpls.ba.go +++ b/binapi/mpls/mpls.ba.go @@ -76,11 +76,10 @@ func (*MplsIPBindUnbind) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MplsIPBindUnbind) Size() int { +func (m *MplsIPBindUnbind) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.MbMplsTableID size += 4 // m.MbLabel size += 4 // m.MbIPTableID @@ -91,19 +90,17 @@ func (m *MplsIPBindUnbind) Size() int { return size } func (m *MplsIPBindUnbind) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.MbMplsTableID)) - buf.EncodeUint32(uint32(m.MbLabel)) - buf.EncodeUint32(uint32(m.MbIPTableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.MbMplsTableID) + buf.EncodeUint32(m.MbLabel) + buf.EncodeUint32(m.MbIPTableID) buf.EncodeBool(m.MbIsBind) buf.EncodeUint8(uint8(m.MbPrefix.Address.Af)) - buf.EncodeBytes(m.MbPrefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.MbPrefix.Len)) + buf.EncodeBytes(m.MbPrefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.MbPrefix.Len) return buf.Bytes(), nil } func (m *MplsIPBindUnbind) Unmarshal(b []byte) error { @@ -130,27 +127,24 @@ func (*MplsIPBindUnbindReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MplsIPBindUnbindReply) Size() int { +func (m *MplsIPBindUnbindReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MplsIPBindUnbindReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MplsIPBindUnbindReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -168,11 +162,10 @@ func (*MplsRouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MplsRouteAddDel) Size() int { +func (m *MplsRouteAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.MrIsAdd size += 1 // m.MrIsMultipath size += 4 // m.MrRoute.MrTableID @@ -201,61 +194,50 @@ func (m *MplsRouteAddDel) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *MplsRouteAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.MrIsAdd) buf.EncodeBool(m.MrIsMultipath) - buf.EncodeUint32(uint32(m.MrRoute.MrTableID)) - buf.EncodeUint32(uint32(m.MrRoute.MrLabel)) - buf.EncodeUint8(uint8(m.MrRoute.MrEos)) - buf.EncodeUint8(uint8(m.MrRoute.MrEosProto)) + buf.EncodeUint32(m.MrRoute.MrTableID) + buf.EncodeUint32(m.MrRoute.MrLabel) + buf.EncodeUint8(m.MrRoute.MrEos) + buf.EncodeUint8(m.MrRoute.MrEosProto) buf.EncodeBool(m.MrRoute.MrIsMulticast) buf.EncodeUint8(uint8(len(m.MrRoute.MrPaths))) for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // MrPaths if j1 < len(m.MrRoute.MrPaths) { v1 = m.MrRoute.MrPaths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -270,7 +252,7 @@ func (m *MplsRouteAddDel) Unmarshal(b []byte) error { m.MrRoute.MrEosProto = buf.DecodeUint8() m.MrRoute.MrIsMulticast = buf.DecodeBool() m.MrRoute.MrNPaths = buf.DecodeUint8() - m.MrRoute.MrPaths = make([]fib_types.FibPath, int(m.MrRoute.MrNPaths)) + m.MrRoute.MrPaths = make([]fib_types.FibPath, m.MrRoute.MrNPaths) for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ { m.MrRoute.MrPaths[j1].SwIfIndex = buf.DecodeUint32() m.MrRoute.MrPaths[j1].TableID = buf.DecodeUint32() @@ -308,29 +290,26 @@ func (*MplsRouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MplsRouteAddDelReply) Size() int { +func (m *MplsRouteAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.StatsIndex return size } func (m *MplsRouteAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.StatsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatsIndex) return buf.Bytes(), nil } func (m *MplsRouteAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.StatsIndex = buf.DecodeUint32() return nil } @@ -347,11 +326,10 @@ func (*MplsRouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MplsRouteDetails) Size() int { +func (m *MplsRouteDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.MrRoute.MrTableID size += 4 // m.MrRoute.MrLabel size += 1 // m.MrRoute.MrEos @@ -378,59 +356,48 @@ func (m *MplsRouteDetails) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *MplsRouteDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.MrRoute.MrTableID)) - buf.EncodeUint32(uint32(m.MrRoute.MrLabel)) - buf.EncodeUint8(uint8(m.MrRoute.MrEos)) - buf.EncodeUint8(uint8(m.MrRoute.MrEosProto)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.MrRoute.MrTableID) + buf.EncodeUint32(m.MrRoute.MrLabel) + buf.EncodeUint8(m.MrRoute.MrEos) + buf.EncodeUint8(m.MrRoute.MrEosProto) buf.EncodeBool(m.MrRoute.MrIsMulticast) buf.EncodeUint8(uint8(len(m.MrRoute.MrPaths))) for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // MrPaths if j1 < len(m.MrRoute.MrPaths) { v1 = m.MrRoute.MrPaths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -443,7 +410,7 @@ func (m *MplsRouteDetails) Unmarshal(b []byte) error { m.MrRoute.MrEosProto = buf.DecodeUint8() m.MrRoute.MrIsMulticast = buf.DecodeBool() m.MrRoute.MrNPaths = buf.DecodeUint8() - m.MrRoute.MrPaths = make([]fib_types.FibPath, int(m.MrRoute.MrNPaths)) + m.MrRoute.MrPaths = make([]fib_types.FibPath, m.MrRoute.MrNPaths) for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ { m.MrRoute.MrPaths[j1].SwIfIndex = buf.DecodeUint32() m.MrRoute.MrPaths[j1].TableID = buf.DecodeUint32() @@ -480,23 +447,20 @@ func (*MplsRouteDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MplsRouteDump) Size() int { +func (m *MplsRouteDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Table.MtTableID size += 64 // m.Table.MtName return size } func (m *MplsRouteDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Table.MtTableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Table.MtTableID) buf.EncodeString(m.Table.MtName, 64) return buf.Bytes(), nil } @@ -520,25 +484,22 @@ func (*MplsTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MplsTableAddDel) Size() int { +func (m *MplsTableAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.MtIsAdd size += 4 // m.MtTable.MtTableID size += 64 // m.MtTable.MtName return size } func (m *MplsTableAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.MtIsAdd) - buf.EncodeUint32(uint32(m.MtTable.MtTableID)) + buf.EncodeUint32(m.MtTable.MtTableID) buf.EncodeString(m.MtTable.MtName, 64) return buf.Bytes(), nil } @@ -562,27 +523,24 @@ func (*MplsTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MplsTableAddDelReply) Size() int { +func (m *MplsTableAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MplsTableAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *MplsTableAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -598,23 +556,20 @@ func (*MplsTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MplsTableDetails) Size() int { +func (m *MplsTableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.MtTable.MtTableID size += 64 // m.MtTable.MtName return size } func (m *MplsTableDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.MtTable.MtTableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.MtTable.MtTableID) buf.EncodeString(m.MtTable.MtName, 64) return buf.Bytes(), nil } @@ -635,20 +590,17 @@ func (*MplsTableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MplsTableDump) Size() int { +func (m *MplsTableDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *MplsTableDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *MplsTableDump) Unmarshal(b []byte) error { @@ -668,11 +620,10 @@ func (*MplsTunnelAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MplsTunnelAddDel) Size() int { +func (m *MplsTunnelAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.MtIsAdd size += 4 // m.MtTunnel.MtSwIfIndex size += 4 // m.MtTunnel.MtTunnelIndex @@ -700,60 +651,49 @@ func (m *MplsTunnelAddDel) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *MplsTunnelAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.MtIsAdd) buf.EncodeUint32(uint32(m.MtTunnel.MtSwIfIndex)) - buf.EncodeUint32(uint32(m.MtTunnel.MtTunnelIndex)) + buf.EncodeUint32(m.MtTunnel.MtTunnelIndex) buf.EncodeBool(m.MtTunnel.MtL2Only) buf.EncodeBool(m.MtTunnel.MtIsMulticast) buf.EncodeString(m.MtTunnel.MtTag, 64) buf.EncodeUint8(uint8(len(m.MtTunnel.MtPaths))) for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // MtPaths if j1 < len(m.MtTunnel.MtPaths) { v1 = m.MtTunnel.MtPaths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -767,7 +707,7 @@ func (m *MplsTunnelAddDel) Unmarshal(b []byte) error { m.MtTunnel.MtIsMulticast = buf.DecodeBool() m.MtTunnel.MtTag = buf.DecodeString(64) m.MtTunnel.MtNPaths = buf.DecodeUint8() - m.MtTunnel.MtPaths = make([]fib_types.FibPath, int(m.MtTunnel.MtNPaths)) + m.MtTunnel.MtPaths = make([]fib_types.FibPath, m.MtTunnel.MtNPaths) for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ { m.MtTunnel.MtPaths[j1].SwIfIndex = buf.DecodeUint32() m.MtTunnel.MtPaths[j1].TableID = buf.DecodeUint32() @@ -806,31 +746,28 @@ func (*MplsTunnelAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MplsTunnelAddDelReply) Size() int { +func (m *MplsTunnelAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex size += 4 // m.TunnelIndex return size } func (m *MplsTunnelAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.TunnelIndex)) + buf.EncodeUint32(m.TunnelIndex) return buf.Bytes(), nil } func (m *MplsTunnelAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.TunnelIndex = buf.DecodeUint32() return nil @@ -848,11 +785,10 @@ func (*MplsTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MplsTunnelDetails) Size() int { +func (m *MplsTunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.MtTunnel.MtSwIfIndex size += 4 // m.MtTunnel.MtTunnelIndex size += 1 // m.MtTunnel.MtL2Only @@ -879,59 +815,48 @@ func (m *MplsTunnelDetails) Size() int { size += 4 // s2.Nh.ClassifyTableIndex size += 1 // s2.NLabels for j3 := 0; j3 < 16; j3++ { - var s3 fib_types.FibMplsLabel - _ = s3 - if j3 < len(s2.LabelStack) { - s3 = s2.LabelStack[j3] - } - size += 1 // s3.IsUniform - size += 4 // s3.Label - size += 1 // s3.TTL - size += 1 // s3.Exp + size += 1 // s2.LabelStack[j3].IsUniform + size += 4 // s2.LabelStack[j3].Label + size += 1 // s2.LabelStack[j3].TTL + size += 1 // s2.LabelStack[j3].Exp } } return size } func (m *MplsTunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.MtTunnel.MtSwIfIndex)) - buf.EncodeUint32(uint32(m.MtTunnel.MtTunnelIndex)) + buf.EncodeUint32(m.MtTunnel.MtTunnelIndex) buf.EncodeBool(m.MtTunnel.MtL2Only) buf.EncodeBool(m.MtTunnel.MtIsMulticast) buf.EncodeString(m.MtTunnel.MtTag, 64) buf.EncodeUint8(uint8(len(m.MtTunnel.MtPaths))) for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ { - var v1 fib_types.FibPath + var v1 fib_types.FibPath // MtPaths if j1 < len(m.MtTunnel.MtPaths) { v1 = m.MtTunnel.MtPaths[j1] } - buf.EncodeUint32(uint32(v1.SwIfIndex)) - buf.EncodeUint32(uint32(v1.TableID)) - buf.EncodeUint32(uint32(v1.RpfID)) - buf.EncodeUint8(uint8(v1.Weight)) - buf.EncodeUint8(uint8(v1.Preference)) + buf.EncodeUint32(v1.SwIfIndex) + buf.EncodeUint32(v1.TableID) + buf.EncodeUint32(v1.RpfID) + buf.EncodeUint8(v1.Weight) + buf.EncodeUint8(v1.Preference) buf.EncodeUint32(uint32(v1.Type)) buf.EncodeUint32(uint32(v1.Flags)) buf.EncodeUint32(uint32(v1.Proto)) - buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(v1.Nh.ViaLabel)) - buf.EncodeUint32(uint32(v1.Nh.ObjID)) - buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex)) - buf.EncodeUint8(uint8(v1.NLabels)) + buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v1.Nh.ViaLabel) + buf.EncodeUint32(v1.Nh.ObjID) + buf.EncodeUint32(v1.Nh.ClassifyTableIndex) + buf.EncodeUint8(v1.NLabels) for j2 := 0; j2 < 16; j2++ { - var v2 fib_types.FibMplsLabel - if j2 < len(v1.LabelStack) { - v2 = v1.LabelStack[j2] - } - buf.EncodeUint8(uint8(v2.IsUniform)) - buf.EncodeUint32(uint32(v2.Label)) - buf.EncodeUint8(uint8(v2.TTL)) - buf.EncodeUint8(uint8(v2.Exp)) + buf.EncodeUint8(v1.LabelStack[j2].IsUniform) + buf.EncodeUint32(v1.LabelStack[j2].Label) + buf.EncodeUint8(v1.LabelStack[j2].TTL) + buf.EncodeUint8(v1.LabelStack[j2].Exp) } } return buf.Bytes(), nil @@ -944,7 +869,7 @@ func (m *MplsTunnelDetails) Unmarshal(b []byte) error { m.MtTunnel.MtIsMulticast = buf.DecodeBool() m.MtTunnel.MtTag = buf.DecodeString(64) m.MtTunnel.MtNPaths = buf.DecodeUint8() - m.MtTunnel.MtPaths = make([]fib_types.FibPath, int(m.MtTunnel.MtNPaths)) + m.MtTunnel.MtPaths = make([]fib_types.FibPath, m.MtTunnel.MtNPaths) for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ { m.MtTunnel.MtPaths[j1].SwIfIndex = buf.DecodeUint32() m.MtTunnel.MtPaths[j1].TableID = buf.DecodeUint32() @@ -971,7 +896,7 @@ func (m *MplsTunnelDetails) Unmarshal(b []byte) error { // MplsTunnelDump defines message 'mpls_tunnel_dump'. type MplsTunnelDump struct { - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` } func (m *MplsTunnelDump) Reset() { *m = MplsTunnelDump{} } @@ -981,21 +906,18 @@ func (*MplsTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MplsTunnelDump) Size() int { +func (m *MplsTunnelDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *MplsTunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -1018,22 +940,19 @@ func (*SwInterfaceSetMplsEnable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetMplsEnable) Size() int { +func (m *SwInterfaceSetMplsEnable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Enable return size } func (m *SwInterfaceSetMplsEnable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) return buf.Bytes(), nil @@ -1059,27 +978,24 @@ func (*SwInterfaceSetMplsEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetMplsEnableReply) Size() int { +func (m *SwInterfaceSetMplsEnableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetMplsEnableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetMplsEnableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/nat/nat.ba.go b/binapi/nat/nat.ba.go index 75a9f98..811ed63 100644 --- a/binapi/nat/nat.ba.go +++ b/binapi/nat/nat.ba.go @@ -163,11 +163,10 @@ func (*Nat44AddDelAddressRange) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44AddDelAddressRange) Size() int { +func (m *Nat44AddDelAddressRange) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.FirstIPAddress size += 1 * 4 // m.LastIPAddress size += 4 // m.VrfID @@ -176,15 +175,13 @@ func (m *Nat44AddDelAddressRange) Size() int { return size } func (m *Nat44AddDelAddressRange) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.FirstIPAddress[:], 4) buf.EncodeBytes(m.LastIPAddress[:], 4) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Flags)) return buf.Bytes(), nil @@ -213,27 +210,24 @@ func (*Nat44AddDelAddressRangeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44AddDelAddressRangeReply) Size() int { +func (m *Nat44AddDelAddressRangeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44AddDelAddressRangeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44AddDelAddressRangeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -256,11 +250,10 @@ func (*Nat44AddDelIdentityMapping) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44AddDelIdentityMapping) Size() int { +func (m *Nat44AddDelIdentityMapping) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Flags size += 1 * 4 // m.IPAddress @@ -272,19 +265,17 @@ func (m *Nat44AddDelIdentityMapping) Size() int { return size } func (m *Nat44AddDelIdentityMapping) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeBytes(m.IPAddress[:], 4) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.Port)) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.Port) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) buf.EncodeString(m.Tag, 64) return buf.Bytes(), nil } @@ -315,27 +306,24 @@ func (*Nat44AddDelIdentityMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44AddDelIdentityMappingReply) Size() int { +func (m *Nat44AddDelIdentityMappingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44AddDelIdentityMappingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44AddDelIdentityMappingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -353,23 +341,20 @@ func (*Nat44AddDelInterfaceAddr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44AddDelInterfaceAddr) Size() int { +func (m *Nat44AddDelInterfaceAddr) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SwIfIndex size += 1 // m.Flags return size } func (m *Nat44AddDelInterfaceAddr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Flags)) @@ -397,27 +382,24 @@ func (*Nat44AddDelInterfaceAddrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44AddDelInterfaceAddrReply) Size() int { +func (m *Nat44AddDelInterfaceAddrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44AddDelInterfaceAddrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44AddDelInterfaceAddrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -441,11 +423,10 @@ func (*Nat44AddDelLbStaticMapping) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44AddDelLbStaticMapping) Size() int { +func (m *Nat44AddDelLbStaticMapping) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Flags size += 1 * 4 // m.ExternalAddr @@ -468,29 +449,27 @@ func (m *Nat44AddDelLbStaticMapping) Size() int { return size } func (m *Nat44AddDelLbStaticMapping) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeBytes(m.ExternalAddr[:], 4) - buf.EncodeUint16(uint16(m.ExternalPort)) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint32(uint32(m.Affinity)) + buf.EncodeUint16(m.ExternalPort) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint32(m.Affinity) buf.EncodeString(m.Tag, 64) buf.EncodeUint32(uint32(len(m.Locals))) for j0 := 0; j0 < len(m.Locals); j0++ { - var v0 Nat44LbAddrPort + var v0 Nat44LbAddrPort // Locals if j0 < len(m.Locals) { v0 = m.Locals[j0] } buf.EncodeBytes(v0.Addr[:], 4) - buf.EncodeUint16(uint16(v0.Port)) - buf.EncodeUint8(uint8(v0.Probability)) - buf.EncodeUint32(uint32(v0.VrfID)) + buf.EncodeUint16(v0.Port) + buf.EncodeUint8(v0.Probability) + buf.EncodeUint32(v0.VrfID) } return buf.Bytes(), nil } @@ -504,7 +483,7 @@ func (m *Nat44AddDelLbStaticMapping) Unmarshal(b []byte) error { m.Affinity = buf.DecodeUint32() m.Tag = buf.DecodeString(64) m.LocalNum = buf.DecodeUint32() - m.Locals = make([]Nat44LbAddrPort, int(m.LocalNum)) + m.Locals = make([]Nat44LbAddrPort, m.LocalNum) for j0 := 0; j0 < len(m.Locals); j0++ { copy(m.Locals[j0].Addr[:], buf.DecodeBytes(4)) m.Locals[j0].Port = buf.DecodeUint16() @@ -528,27 +507,24 @@ func (*Nat44AddDelLbStaticMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44AddDelLbStaticMappingReply) Size() int { +func (m *Nat44AddDelLbStaticMappingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44AddDelLbStaticMappingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44AddDelLbStaticMappingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -573,11 +549,10 @@ func (*Nat44AddDelStaticMapping) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44AddDelStaticMapping) Size() int { +func (m *Nat44AddDelStaticMapping) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Flags size += 1 * 4 // m.LocalIPAddress @@ -591,21 +566,19 @@ func (m *Nat44AddDelStaticMapping) Size() int { return size } func (m *Nat44AddDelStaticMapping) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeBytes(m.LocalIPAddress[:], 4) buf.EncodeBytes(m.ExternalIPAddress[:], 4) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.LocalPort)) - buf.EncodeUint16(uint16(m.ExternalPort)) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.LocalPort) + buf.EncodeUint16(m.ExternalPort) buf.EncodeUint32(uint32(m.ExternalSwIfIndex)) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) buf.EncodeString(m.Tag, 64) return buf.Bytes(), nil } @@ -638,27 +611,24 @@ func (*Nat44AddDelStaticMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44AddDelStaticMappingReply) Size() int { +func (m *Nat44AddDelStaticMappingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44AddDelStaticMappingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44AddDelStaticMappingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -676,26 +646,23 @@ func (*Nat44AddressDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44AddressDetails) Size() int { +func (m *Nat44AddressDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IPAddress size += 1 // m.Flags size += 4 // m.VrfID return size } func (m *Nat44AddressDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IPAddress[:], 4) buf.EncodeUint8(uint8(m.Flags)) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) return buf.Bytes(), nil } func (m *Nat44AddressDetails) Unmarshal(b []byte) error { @@ -716,20 +683,17 @@ func (*Nat44AddressDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44AddressDump) Size() int { +func (m *Nat44AddressDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44AddressDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44AddressDump) Unmarshal(b []byte) error { @@ -754,11 +718,10 @@ func (*Nat44DelSession) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44DelSession) Size() int { +func (m *Nat44DelSession) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.Address size += 1 // m.Protocol size += 2 // m.Port @@ -769,19 +732,17 @@ func (m *Nat44DelSession) Size() int { return size } func (m *Nat44DelSession) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.Address[:], 4) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.Port)) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.Port) + buf.EncodeUint32(m.VrfID) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeBytes(m.ExtHostAddress[:], 4) - buf.EncodeUint16(uint16(m.ExtHostPort)) + buf.EncodeUint16(m.ExtHostPort) return buf.Bytes(), nil } func (m *Nat44DelSession) Unmarshal(b []byte) error { @@ -808,27 +769,24 @@ func (*Nat44DelSessionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44DelSessionReply) Size() int { +func (m *Nat44DelSessionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44DelSessionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44DelSessionReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -845,24 +803,21 @@ func (*Nat44DelUser) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44DelUser) Size() int { +func (m *Nat44DelUser) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IPAddress size += 4 // m.FibIndex return size } func (m *Nat44DelUser) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IPAddress[:], 4) - buf.EncodeUint32(uint32(m.FibIndex)) + buf.EncodeUint32(m.FibIndex) return buf.Bytes(), nil } func (m *Nat44DelUser) Unmarshal(b []byte) error { @@ -884,27 +839,24 @@ func (*Nat44DelUserReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44DelUserReply) Size() int { +func (m *Nat44DelUserReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44DelUserReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44DelUserReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -922,21 +874,18 @@ func (*Nat44ForwardingEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44ForwardingEnableDisable) Size() int { +func (m *Nat44ForwardingEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable return size } func (m *Nat44ForwardingEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) return buf.Bytes(), nil } @@ -960,27 +909,24 @@ func (*Nat44ForwardingEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44ForwardingEnableDisableReply) Size() int { +func (m *Nat44ForwardingEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44ForwardingEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44ForwardingEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -994,20 +940,17 @@ func (*Nat44ForwardingIsEnabled) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44ForwardingIsEnabled) Size() int { +func (m *Nat44ForwardingIsEnabled) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44ForwardingIsEnabled) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44ForwardingIsEnabled) Unmarshal(b []byte) error { @@ -1028,21 +971,18 @@ func (*Nat44ForwardingIsEnabledReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44ForwardingIsEnabledReply) Size() int { +func (m *Nat44ForwardingIsEnabledReply) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enabled return size } func (m *Nat44ForwardingIsEnabledReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enabled) return buf.Bytes(), nil } @@ -1070,11 +1010,10 @@ func (*Nat44IdentityMappingDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44IdentityMappingDetails) Size() int { +func (m *Nat44IdentityMappingDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Flags size += 1 * 4 // m.IPAddress size += 1 // m.Protocol @@ -1085,18 +1024,16 @@ func (m *Nat44IdentityMappingDetails) Size() int { return size } func (m *Nat44IdentityMappingDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeBytes(m.IPAddress[:], 4) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.Port)) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.Port) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) buf.EncodeString(m.Tag, 64) return buf.Bytes(), nil } @@ -1122,20 +1059,17 @@ func (*Nat44IdentityMappingDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44IdentityMappingDump) Size() int { +func (m *Nat44IdentityMappingDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44IdentityMappingDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44IdentityMappingDump) Unmarshal(b []byte) error { @@ -1156,23 +1090,20 @@ func (*Nat44InterfaceAddDelFeature) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44InterfaceAddDelFeature) Size() int { +func (m *Nat44InterfaceAddDelFeature) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Flags size += 4 // m.SwIfIndex return size } func (m *Nat44InterfaceAddDelFeature) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeUint32(uint32(m.SwIfIndex)) @@ -1200,27 +1131,24 @@ func (*Nat44InterfaceAddDelFeatureReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44InterfaceAddDelFeatureReply) Size() int { +func (m *Nat44InterfaceAddDelFeatureReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44InterfaceAddDelFeatureReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44InterfaceAddDelFeatureReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1240,23 +1168,20 @@ func (*Nat44InterfaceAddDelOutputFeature) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44InterfaceAddDelOutputFeature) Size() int { +func (m *Nat44InterfaceAddDelOutputFeature) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Flags size += 4 // m.SwIfIndex return size } func (m *Nat44InterfaceAddDelOutputFeature) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeUint32(uint32(m.SwIfIndex)) @@ -1286,27 +1211,24 @@ func (*Nat44InterfaceAddDelOutputFeatureReply) GetMessageType() api.MessageType return api.ReplyMessage } -func (m *Nat44InterfaceAddDelOutputFeatureReply) Size() int { +func (m *Nat44InterfaceAddDelOutputFeatureReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44InterfaceAddDelOutputFeatureReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44InterfaceAddDelOutputFeatureReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1323,22 +1245,19 @@ func (*Nat44InterfaceAddrDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44InterfaceAddrDetails) Size() int { +func (m *Nat44InterfaceAddrDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Flags return size } func (m *Nat44InterfaceAddrDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Flags)) return buf.Bytes(), nil @@ -1360,20 +1279,17 @@ func (*Nat44InterfaceAddrDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44InterfaceAddrDump) Size() int { +func (m *Nat44InterfaceAddrDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44InterfaceAddrDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44InterfaceAddrDump) Unmarshal(b []byte) error { @@ -1393,22 +1309,19 @@ func (*Nat44InterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44InterfaceDetails) Size() int { +func (m *Nat44InterfaceDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Flags size += 4 // m.SwIfIndex return size } func (m *Nat44InterfaceDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -1430,20 +1343,17 @@ func (*Nat44InterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44InterfaceDump) Size() int { +func (m *Nat44InterfaceDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44InterfaceDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44InterfaceDump) Unmarshal(b []byte) error { @@ -1465,22 +1375,19 @@ func (*Nat44InterfaceOutputFeatureDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44InterfaceOutputFeatureDetails) Size() int { +func (m *Nat44InterfaceOutputFeatureDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Flags size += 4 // m.SwIfIndex return size } func (m *Nat44InterfaceOutputFeatureDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -1504,20 +1411,17 @@ func (*Nat44InterfaceOutputFeatureDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44InterfaceOutputFeatureDump) Size() int { +func (m *Nat44InterfaceOutputFeatureDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44InterfaceOutputFeatureDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44InterfaceOutputFeatureDump) Unmarshal(b []byte) error { @@ -1542,11 +1446,10 @@ func (*Nat44LbStaticMappingAddDelLocal) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44LbStaticMappingAddDelLocal) Size() int { +func (m *Nat44LbStaticMappingAddDelLocal) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 * 4 // m.ExternalAddr size += 2 // m.ExternalPort @@ -1558,20 +1461,18 @@ func (m *Nat44LbStaticMappingAddDelLocal) Size() int { return size } func (m *Nat44LbStaticMappingAddDelLocal) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBytes(m.ExternalAddr[:], 4) - buf.EncodeUint16(uint16(m.ExternalPort)) - buf.EncodeUint8(uint8(m.Protocol)) + buf.EncodeUint16(m.ExternalPort) + buf.EncodeUint8(m.Protocol) buf.EncodeBytes(m.Local.Addr[:], 4) - buf.EncodeUint16(uint16(m.Local.Port)) - buf.EncodeUint8(uint8(m.Local.Probability)) - buf.EncodeUint32(uint32(m.Local.VrfID)) + buf.EncodeUint16(m.Local.Port) + buf.EncodeUint8(m.Local.Probability) + buf.EncodeUint32(m.Local.VrfID) return buf.Bytes(), nil } func (m *Nat44LbStaticMappingAddDelLocal) Unmarshal(b []byte) error { @@ -1601,27 +1502,24 @@ func (*Nat44LbStaticMappingAddDelLocalReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44LbStaticMappingAddDelLocalReply) Size() int { +func (m *Nat44LbStaticMappingAddDelLocalReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44LbStaticMappingAddDelLocalReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44LbStaticMappingAddDelLocalReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1644,11 +1542,10 @@ func (*Nat44LbStaticMappingDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44LbStaticMappingDetails) Size() int { +func (m *Nat44LbStaticMappingDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.ExternalAddr size += 2 // m.ExternalPort size += 1 // m.Protocol @@ -1670,28 +1567,26 @@ func (m *Nat44LbStaticMappingDetails) Size() int { return size } func (m *Nat44LbStaticMappingDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.ExternalAddr[:], 4) - buf.EncodeUint16(uint16(m.ExternalPort)) - buf.EncodeUint8(uint8(m.Protocol)) + buf.EncodeUint16(m.ExternalPort) + buf.EncodeUint8(m.Protocol) buf.EncodeUint8(uint8(m.Flags)) - buf.EncodeUint32(uint32(m.Affinity)) + buf.EncodeUint32(m.Affinity) buf.EncodeString(m.Tag, 64) buf.EncodeUint32(uint32(len(m.Locals))) for j0 := 0; j0 < len(m.Locals); j0++ { - var v0 Nat44LbAddrPort + var v0 Nat44LbAddrPort // Locals if j0 < len(m.Locals) { v0 = m.Locals[j0] } buf.EncodeBytes(v0.Addr[:], 4) - buf.EncodeUint16(uint16(v0.Port)) - buf.EncodeUint8(uint8(v0.Probability)) - buf.EncodeUint32(uint32(v0.VrfID)) + buf.EncodeUint16(v0.Port) + buf.EncodeUint8(v0.Probability) + buf.EncodeUint32(v0.VrfID) } return buf.Bytes(), nil } @@ -1704,7 +1599,7 @@ func (m *Nat44LbStaticMappingDetails) Unmarshal(b []byte) error { m.Affinity = buf.DecodeUint32() m.Tag = buf.DecodeString(64) m.LocalNum = buf.DecodeUint32() - m.Locals = make([]Nat44LbAddrPort, int(m.LocalNum)) + m.Locals = make([]Nat44LbAddrPort, m.LocalNum) for j0 := 0; j0 < len(m.Locals); j0++ { copy(m.Locals[j0].Addr[:], buf.DecodeBytes(4)) m.Locals[j0].Port = buf.DecodeUint16() @@ -1724,20 +1619,17 @@ func (*Nat44LbStaticMappingDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44LbStaticMappingDump) Size() int { +func (m *Nat44LbStaticMappingDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44LbStaticMappingDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44LbStaticMappingDump) Unmarshal(b []byte) error { @@ -1754,20 +1646,17 @@ func (*Nat44SessionCleanup) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44SessionCleanup) Size() int { +func (m *Nat44SessionCleanup) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44SessionCleanup) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44SessionCleanup) Unmarshal(b []byte) error { @@ -1786,27 +1675,24 @@ func (*Nat44SessionCleanupReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44SessionCleanupReply) Size() int { +func (m *Nat44SessionCleanupReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44SessionCleanupReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44SessionCleanupReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1823,24 +1709,21 @@ func (*Nat44SetSessionLimit) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44SetSessionLimit) Size() int { +func (m *Nat44SetSessionLimit) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SessionLimit size += 4 // m.VrfID return size } func (m *Nat44SetSessionLimit) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SessionLimit)) - buf.EncodeUint32(uint32(m.VrfID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SessionLimit) + buf.EncodeUint32(m.VrfID) return buf.Bytes(), nil } func (m *Nat44SetSessionLimit) Unmarshal(b []byte) error { @@ -1862,27 +1745,24 @@ func (*Nat44SetSessionLimitReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44SetSessionLimitReply) Size() int { +func (m *Nat44SetSessionLimitReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat44SetSessionLimitReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat44SetSessionLimitReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1906,11 +1786,10 @@ func (*Nat44StaticMappingDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44StaticMappingDetails) Size() int { +func (m *Nat44StaticMappingDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Flags size += 1 * 4 // m.LocalIPAddress size += 1 * 4 // m.ExternalIPAddress @@ -1923,20 +1802,18 @@ func (m *Nat44StaticMappingDetails) Size() int { return size } func (m *Nat44StaticMappingDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeBytes(m.LocalIPAddress[:], 4) buf.EncodeBytes(m.ExternalIPAddress[:], 4) - buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint16(uint16(m.LocalPort)) - buf.EncodeUint16(uint16(m.ExternalPort)) + buf.EncodeUint8(m.Protocol) + buf.EncodeUint16(m.LocalPort) + buf.EncodeUint16(m.ExternalPort) buf.EncodeUint32(uint32(m.ExternalSwIfIndex)) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) buf.EncodeString(m.Tag, 64) return buf.Bytes(), nil } @@ -1964,20 +1841,17 @@ func (*Nat44StaticMappingDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44StaticMappingDump) Size() int { +func (m *Nat44StaticMappingDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44StaticMappingDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44StaticMappingDump) Unmarshal(b []byte) error { @@ -1999,11 +1873,10 @@ func (*Nat44UserDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44UserDetails) Size() int { +func (m *Nat44UserDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.VrfID size += 1 * 4 // m.IPAddress size += 4 // m.Nsessions @@ -2011,16 +1884,14 @@ func (m *Nat44UserDetails) Size() int { return size } func (m *Nat44UserDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.VrfID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.VrfID) buf.EncodeBytes(m.IPAddress[:], 4) - buf.EncodeUint32(uint32(m.Nsessions)) - buf.EncodeUint32(uint32(m.Nstaticsessions)) + buf.EncodeUint32(m.Nsessions) + buf.EncodeUint32(m.Nstaticsessions) return buf.Bytes(), nil } func (m *Nat44UserDetails) Unmarshal(b []byte) error { @@ -2042,20 +1913,17 @@ func (*Nat44UserDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44UserDump) Size() int { +func (m *Nat44UserDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat44UserDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat44UserDump) Unmarshal(b []byte) error { @@ -2086,11 +1954,10 @@ func (*Nat44UserSessionDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat44UserSessionDetails) Size() int { +func (m *Nat44UserSessionDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.OutsideIPAddress size += 2 // m.OutsidePort size += 1 * 4 // m.InsideIPAddress @@ -2107,25 +1974,23 @@ func (m *Nat44UserSessionDetails) Size() int { return size } func (m *Nat44UserSessionDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.OutsideIPAddress[:], 4) - buf.EncodeUint16(uint16(m.OutsidePort)) + buf.EncodeUint16(m.OutsidePort) buf.EncodeBytes(m.InsideIPAddress[:], 4) - buf.EncodeUint16(uint16(m.InsidePort)) - buf.EncodeUint16(uint16(m.Protocol)) + buf.EncodeUint16(m.InsidePort) + buf.EncodeUint16(m.Protocol) buf.EncodeUint8(uint8(m.Flags)) - buf.EncodeUint64(uint64(m.LastHeard)) - buf.EncodeUint64(uint64(m.TotalBytes)) - buf.EncodeUint32(uint32(m.TotalPkts)) + buf.EncodeUint64(m.LastHeard) + buf.EncodeUint64(m.TotalBytes) + buf.EncodeUint32(m.TotalPkts) buf.EncodeBytes(m.ExtHostAddress[:], 4) - buf.EncodeUint16(uint16(m.ExtHostPort)) + buf.EncodeUint16(m.ExtHostPort) buf.EncodeBytes(m.ExtHostNatAddress[:], 4) - buf.EncodeUint16(uint16(m.ExtHostNatPort)) + buf.EncodeUint16(m.ExtHostNatPort) return buf.Bytes(), nil } func (m *Nat44UserSessionDetails) Unmarshal(b []byte) error { @@ -2159,24 +2024,21 @@ func (*Nat44UserSessionDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat44UserSessionDump) Size() int { +func (m *Nat44UserSessionDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IPAddress size += 4 // m.VrfID return size } func (m *Nat44UserSessionDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IPAddress[:], 4) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) return buf.Bytes(), nil } func (m *Nat44UserSessionDump) Unmarshal(b []byte) error { @@ -2200,23 +2062,20 @@ func (*Nat64AddDelInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64AddDelInterface) Size() int { +func (m *Nat64AddDelInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Flags size += 4 // m.SwIfIndex return size } func (m *Nat64AddDelInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeUint32(uint32(m.SwIfIndex)) @@ -2243,22 +2102,19 @@ func (*Nat64AddDelInterfaceAddr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64AddDelInterfaceAddr) Size() int { +func (m *Nat64AddDelInterfaceAddr) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SwIfIndex return size } func (m *Nat64AddDelInterfaceAddr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -2284,27 +2140,24 @@ func (*Nat64AddDelInterfaceAddrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64AddDelInterfaceAddrReply) Size() int { +func (m *Nat64AddDelInterfaceAddrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat64AddDelInterfaceAddrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat64AddDelInterfaceAddrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2320,27 +2173,24 @@ func (*Nat64AddDelInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64AddDelInterfaceReply) Size() int { +func (m *Nat64AddDelInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat64AddDelInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat64AddDelInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2359,11 +2209,10 @@ func (*Nat64AddDelPoolAddrRange) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64AddDelPoolAddrRange) Size() int { +func (m *Nat64AddDelPoolAddrRange) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.StartAddr size += 1 * 4 // m.EndAddr size += 4 // m.VrfID @@ -2371,15 +2220,13 @@ func (m *Nat64AddDelPoolAddrRange) Size() int { return size } func (m *Nat64AddDelPoolAddrRange) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.StartAddr[:], 4) buf.EncodeBytes(m.EndAddr[:], 4) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -2406,27 +2253,24 @@ func (*Nat64AddDelPoolAddrRangeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64AddDelPoolAddrRangeReply) Size() int { +func (m *Nat64AddDelPoolAddrRangeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat64AddDelPoolAddrRangeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat64AddDelPoolAddrRangeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2444,11 +2288,10 @@ func (*Nat64AddDelPrefix) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64AddDelPrefix) Size() int { +func (m *Nat64AddDelPrefix) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.Prefix.Address size += 1 // m.Prefix.Len size += 4 // m.VrfID @@ -2456,15 +2299,13 @@ func (m *Nat64AddDelPrefix) Size() int { return size } func (m *Nat64AddDelPrefix) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.Prefix.Address[:], 16) - buf.EncodeUint8(uint8(m.Prefix.Len)) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint8(m.Prefix.Len) + buf.EncodeUint32(m.VrfID) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -2489,27 +2330,24 @@ func (*Nat64AddDelPrefixReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64AddDelPrefixReply) Size() int { +func (m *Nat64AddDelPrefixReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat64AddDelPrefixReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat64AddDelPrefixReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2531,11 +2369,10 @@ func (*Nat64AddDelStaticBib) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64AddDelStaticBib) Size() int { +func (m *Nat64AddDelStaticBib) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.IAddr size += 1 * 4 // m.OAddr size += 2 // m.IPort @@ -2546,18 +2383,16 @@ func (m *Nat64AddDelStaticBib) Size() int { return size } func (m *Nat64AddDelStaticBib) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IAddr[:], 16) buf.EncodeBytes(m.OAddr[:], 4) - buf.EncodeUint16(uint16(m.IPort)) - buf.EncodeUint16(uint16(m.OPort)) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint8(uint8(m.Proto)) + buf.EncodeUint16(m.IPort) + buf.EncodeUint16(m.OPort) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint8(m.Proto) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -2585,27 +2420,24 @@ func (*Nat64AddDelStaticBibReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64AddDelStaticBibReply) Size() int { +func (m *Nat64AddDelStaticBibReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat64AddDelStaticBibReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat64AddDelStaticBibReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2628,11 +2460,10 @@ func (*Nat64BibDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64BibDetails) Size() int { +func (m *Nat64BibDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.IAddr size += 1 * 4 // m.OAddr size += 2 // m.IPort @@ -2644,20 +2475,18 @@ func (m *Nat64BibDetails) Size() int { return size } func (m *Nat64BibDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IAddr[:], 16) buf.EncodeBytes(m.OAddr[:], 4) - buf.EncodeUint16(uint16(m.IPort)) - buf.EncodeUint16(uint16(m.OPort)) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint8(uint8(m.Proto)) + buf.EncodeUint16(m.IPort) + buf.EncodeUint16(m.OPort) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint8(m.Proto) buf.EncodeUint8(uint8(m.Flags)) - buf.EncodeUint32(uint32(m.SesNum)) + buf.EncodeUint32(m.SesNum) return buf.Bytes(), nil } func (m *Nat64BibDetails) Unmarshal(b []byte) error { @@ -2685,22 +2514,19 @@ func (*Nat64BibDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64BibDump) Size() int { +func (m *Nat64BibDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Proto return size } func (m *Nat64BibDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Proto)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Proto) return buf.Bytes(), nil } func (m *Nat64BibDump) Unmarshal(b []byte) error { @@ -2722,22 +2548,19 @@ func (*Nat64InterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64InterfaceDetails) Size() int { +func (m *Nat64InterfaceDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Flags size += 4 // m.SwIfIndex return size } func (m *Nat64InterfaceDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -2759,20 +2582,17 @@ func (*Nat64InterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64InterfaceDump) Size() int { +func (m *Nat64InterfaceDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat64InterfaceDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat64InterfaceDump) Unmarshal(b []byte) error { @@ -2792,24 +2612,21 @@ func (*Nat64PoolAddrDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64PoolAddrDetails) Size() int { +func (m *Nat64PoolAddrDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.Address size += 4 // m.VrfID return size } func (m *Nat64PoolAddrDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.Address[:], 4) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) return buf.Bytes(), nil } func (m *Nat64PoolAddrDetails) Unmarshal(b []byte) error { @@ -2829,20 +2646,17 @@ func (*Nat64PoolAddrDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64PoolAddrDump) Size() int { +func (m *Nat64PoolAddrDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat64PoolAddrDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat64PoolAddrDump) Unmarshal(b []byte) error { @@ -2862,26 +2676,23 @@ func (*Nat64PrefixDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64PrefixDetails) Size() int { +func (m *Nat64PrefixDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.Prefix.Address size += 1 // m.Prefix.Len size += 4 // m.VrfID return size } func (m *Nat64PrefixDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.Prefix.Address[:], 16) - buf.EncodeUint8(uint8(m.Prefix.Len)) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint8(m.Prefix.Len) + buf.EncodeUint32(m.VrfID) return buf.Bytes(), nil } func (m *Nat64PrefixDetails) Unmarshal(b []byte) error { @@ -2902,20 +2713,17 @@ func (*Nat64PrefixDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64PrefixDump) Size() int { +func (m *Nat64PrefixDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat64PrefixDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat64PrefixDump) Unmarshal(b []byte) error { @@ -2942,11 +2750,10 @@ func (*Nat64StDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat64StDetails) Size() int { +func (m *Nat64StDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.IlAddr size += 1 * 4 // m.OlAddr size += 2 // m.IlPort @@ -2959,21 +2766,19 @@ func (m *Nat64StDetails) Size() int { return size } func (m *Nat64StDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IlAddr[:], 16) buf.EncodeBytes(m.OlAddr[:], 4) - buf.EncodeUint16(uint16(m.IlPort)) - buf.EncodeUint16(uint16(m.OlPort)) + buf.EncodeUint16(m.IlPort) + buf.EncodeUint16(m.OlPort) buf.EncodeBytes(m.IrAddr[:], 16) buf.EncodeBytes(m.OrAddr[:], 4) - buf.EncodeUint16(uint16(m.RPort)) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint8(uint8(m.Proto)) + buf.EncodeUint16(m.RPort) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint8(m.Proto) return buf.Bytes(), nil } func (m *Nat64StDetails) Unmarshal(b []byte) error { @@ -3002,22 +2807,19 @@ func (*Nat64StDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat64StDump) Size() int { +func (m *Nat64StDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Proto return size } func (m *Nat64StDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Proto)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Proto) return buf.Bytes(), nil } func (m *Nat64StDump) Unmarshal(b []byte) error { @@ -3040,23 +2842,20 @@ func (*Nat66AddDelInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat66AddDelInterface) Size() int { +func (m *Nat66AddDelInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Flags size += 4 // m.SwIfIndex return size } func (m *Nat66AddDelInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeUint32(uint32(m.SwIfIndex)) @@ -3082,27 +2881,24 @@ func (*Nat66AddDelInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat66AddDelInterfaceReply) Size() int { +func (m *Nat66AddDelInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat66AddDelInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat66AddDelInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3121,11 +2917,10 @@ func (*Nat66AddDelStaticMapping) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat66AddDelStaticMapping) Size() int { +func (m *Nat66AddDelStaticMapping) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 * 16 // m.LocalIPAddress size += 1 * 16 // m.ExternalIPAddress @@ -3133,16 +2928,14 @@ func (m *Nat66AddDelStaticMapping) Size() int { return size } func (m *Nat66AddDelStaticMapping) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBytes(m.LocalIPAddress[:], 16) buf.EncodeBytes(m.ExternalIPAddress[:], 16) - buf.EncodeUint32(uint32(m.VrfID)) + buf.EncodeUint32(m.VrfID) return buf.Bytes(), nil } func (m *Nat66AddDelStaticMapping) Unmarshal(b []byte) error { @@ -3168,27 +2961,24 @@ func (*Nat66AddDelStaticMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat66AddDelStaticMappingReply) Size() int { +func (m *Nat66AddDelStaticMappingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Nat66AddDelStaticMappingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Nat66AddDelStaticMappingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3205,22 +2995,19 @@ func (*Nat66InterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat66InterfaceDetails) Size() int { +func (m *Nat66InterfaceDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Flags size += 4 // m.SwIfIndex return size } func (m *Nat66InterfaceDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -3242,20 +3029,17 @@ func (*Nat66InterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat66InterfaceDump) Size() int { +func (m *Nat66InterfaceDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat66InterfaceDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat66InterfaceDump) Unmarshal(b []byte) error { @@ -3278,11 +3062,10 @@ func (*Nat66StaticMappingDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Nat66StaticMappingDetails) Size() int { +func (m *Nat66StaticMappingDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.LocalIPAddress size += 1 * 16 // m.ExternalIPAddress size += 4 // m.VrfID @@ -3291,17 +3074,15 @@ func (m *Nat66StaticMappingDetails) Size() int { return size } func (m *Nat66StaticMappingDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.LocalIPAddress[:], 16) buf.EncodeBytes(m.ExternalIPAddress[:], 16) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint64(uint64(m.TotalBytes)) - buf.EncodeUint64(uint64(m.TotalPkts)) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint64(m.TotalBytes) + buf.EncodeUint64(m.TotalPkts) return buf.Bytes(), nil } func (m *Nat66StaticMappingDetails) Unmarshal(b []byte) error { @@ -3324,20 +3105,17 @@ func (*Nat66StaticMappingDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Nat66StaticMappingDump) Size() int { +func (m *Nat66StaticMappingDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Nat66StaticMappingDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Nat66StaticMappingDump) Unmarshal(b []byte) error { @@ -3354,20 +3132,17 @@ func (*NatControlPing) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatControlPing) Size() int { +func (m *NatControlPing) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatControlPing) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatControlPing) Unmarshal(b []byte) error { @@ -3388,31 +3163,28 @@ func (*NatControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatControlPingReply) Size() int { +func (m *NatControlPingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.ClientIndex size += 4 // m.VpePID return size } func (m *NatControlPingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.ClientIndex)) - buf.EncodeUint32(uint32(m.VpePID)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ClientIndex) + buf.EncodeUint32(m.VpePID) return buf.Bytes(), nil } func (m *NatControlPingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ClientIndex = buf.DecodeUint32() m.VpePID = buf.DecodeUint32() return nil @@ -3434,11 +3206,10 @@ func (*NatDetAddDelMap) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatDetAddDelMap) Size() int { +func (m *NatDetAddDelMap) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 * 4 // m.InAddr size += 1 // m.InPlen @@ -3447,17 +3218,15 @@ func (m *NatDetAddDelMap) Size() int { return size } func (m *NatDetAddDelMap) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBytes(m.InAddr[:], 4) - buf.EncodeUint8(uint8(m.InPlen)) + buf.EncodeUint8(m.InPlen) buf.EncodeBytes(m.OutAddr[:], 4) - buf.EncodeUint8(uint8(m.OutPlen)) + buf.EncodeUint8(m.OutPlen) return buf.Bytes(), nil } func (m *NatDetAddDelMap) Unmarshal(b []byte) error { @@ -3482,27 +3251,24 @@ func (*NatDetAddDelMapReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatDetAddDelMapReply) Size() int { +func (m *NatDetAddDelMapReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatDetAddDelMapReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatDetAddDelMapReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3521,11 +3287,10 @@ func (*NatDetCloseSessionIn) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatDetCloseSessionIn) Size() int { +func (m *NatDetCloseSessionIn) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.InAddr size += 2 // m.InPort size += 1 * 4 // m.ExtAddr @@ -3533,16 +3298,14 @@ func (m *NatDetCloseSessionIn) Size() int { return size } func (m *NatDetCloseSessionIn) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.InAddr[:], 4) - buf.EncodeUint16(uint16(m.InPort)) + buf.EncodeUint16(m.InPort) buf.EncodeBytes(m.ExtAddr[:], 4) - buf.EncodeUint16(uint16(m.ExtPort)) + buf.EncodeUint16(m.ExtPort) return buf.Bytes(), nil } func (m *NatDetCloseSessionIn) Unmarshal(b []byte) error { @@ -3566,27 +3329,24 @@ func (*NatDetCloseSessionInReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatDetCloseSessionInReply) Size() int { +func (m *NatDetCloseSessionInReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatDetCloseSessionInReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatDetCloseSessionInReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3605,11 +3365,10 @@ func (*NatDetCloseSessionOut) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatDetCloseSessionOut) Size() int { +func (m *NatDetCloseSessionOut) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.OutAddr size += 2 // m.OutPort size += 1 * 4 // m.ExtAddr @@ -3617,16 +3376,14 @@ func (m *NatDetCloseSessionOut) Size() int { return size } func (m *NatDetCloseSessionOut) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.OutAddr[:], 4) - buf.EncodeUint16(uint16(m.OutPort)) + buf.EncodeUint16(m.OutPort) buf.EncodeBytes(m.ExtAddr[:], 4) - buf.EncodeUint16(uint16(m.ExtPort)) + buf.EncodeUint16(m.ExtPort) return buf.Bytes(), nil } func (m *NatDetCloseSessionOut) Unmarshal(b []byte) error { @@ -3650,27 +3407,24 @@ func (*NatDetCloseSessionOutReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatDetCloseSessionOutReply) Size() int { +func (m *NatDetCloseSessionOutReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatDetCloseSessionOutReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatDetCloseSessionOutReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3686,21 +3440,18 @@ func (*NatDetForward) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatDetForward) Size() int { +func (m *NatDetForward) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.InAddr return size } func (m *NatDetForward) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.InAddr[:], 4) return buf.Bytes(), nil } @@ -3725,11 +3476,10 @@ func (*NatDetForwardReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatDetForwardReply) Size() int { +func (m *NatDetForwardReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 2 // m.OutPortLo size += 2 // m.OutPortHi @@ -3737,21 +3487,19 @@ func (m *NatDetForwardReply) Size() int { return size } func (m *NatDetForwardReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint16(uint16(m.OutPortLo)) - buf.EncodeUint16(uint16(m.OutPortHi)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint16(m.OutPortLo) + buf.EncodeUint16(m.OutPortHi) buf.EncodeBytes(m.OutAddr[:], 4) return buf.Bytes(), nil } func (m *NatDetForwardReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.OutPortLo = buf.DecodeUint16() m.OutPortHi = buf.DecodeUint16() copy(m.OutAddr[:], buf.DecodeBytes(4)) @@ -3776,11 +3524,10 @@ func (*NatDetMapDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatDetMapDetails) Size() int { +func (m *NatDetMapDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.InAddr size += 1 // m.InPlen size += 1 * 4 // m.OutAddr @@ -3791,19 +3538,17 @@ func (m *NatDetMapDetails) Size() int { return size } func (m *NatDetMapDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.InAddr[:], 4) - buf.EncodeUint8(uint8(m.InPlen)) + buf.EncodeUint8(m.InPlen) buf.EncodeBytes(m.OutAddr[:], 4) - buf.EncodeUint8(uint8(m.OutPlen)) - buf.EncodeUint32(uint32(m.SharingRatio)) - buf.EncodeUint16(uint16(m.PortsPerHost)) - buf.EncodeUint32(uint32(m.SesNum)) + buf.EncodeUint8(m.OutPlen) + buf.EncodeUint32(m.SharingRatio) + buf.EncodeUint16(m.PortsPerHost) + buf.EncodeUint32(m.SesNum) return buf.Bytes(), nil } func (m *NatDetMapDetails) Unmarshal(b []byte) error { @@ -3828,20 +3573,17 @@ func (*NatDetMapDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatDetMapDump) Size() int { +func (m *NatDetMapDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatDetMapDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatDetMapDump) Unmarshal(b []byte) error { @@ -3861,23 +3603,20 @@ func (*NatDetReverse) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatDetReverse) Size() int { +func (m *NatDetReverse) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.OutPort size += 1 * 4 // m.OutAddr return size } func (m *NatDetReverse) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.OutPort)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.OutPort) buf.EncodeBytes(m.OutAddr[:], 4) return buf.Bytes(), nil } @@ -3901,29 +3640,26 @@ func (*NatDetReverseReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatDetReverseReply) Size() int { +func (m *NatDetReverseReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 * 4 // m.InAddr return size } func (m *NatDetReverseReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBytes(m.InAddr[:], 4) return buf.Bytes(), nil } func (m *NatDetReverseReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() copy(m.InAddr[:], buf.DecodeBytes(4)) return nil } @@ -3945,11 +3681,10 @@ func (*NatDetSessionDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatDetSessionDetails) Size() int { +func (m *NatDetSessionDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.InPort size += 1 * 4 // m.ExtAddr size += 2 // m.ExtPort @@ -3959,18 +3694,16 @@ func (m *NatDetSessionDetails) Size() int { return size } func (m *NatDetSessionDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.InPort)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.InPort) buf.EncodeBytes(m.ExtAddr[:], 4) - buf.EncodeUint16(uint16(m.ExtPort)) - buf.EncodeUint16(uint16(m.OutPort)) - buf.EncodeUint8(uint8(m.State)) - buf.EncodeUint32(uint32(m.Expire)) + buf.EncodeUint16(m.ExtPort) + buf.EncodeUint16(m.OutPort) + buf.EncodeUint8(m.State) + buf.EncodeUint32(m.Expire) return buf.Bytes(), nil } func (m *NatDetSessionDetails) Unmarshal(b []byte) error { @@ -3996,21 +3729,18 @@ func (*NatDetSessionDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatDetSessionDump) Size() int { +func (m *NatDetSessionDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.UserAddr return size } func (m *NatDetSessionDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.UserAddr[:], 4) return buf.Bytes(), nil } @@ -4030,20 +3760,17 @@ func (*NatGetAddrAndPortAllocAlg) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatGetAddrAndPortAllocAlg) Size() int { +func (m *NatGetAddrAndPortAllocAlg) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatGetAddrAndPortAllocAlg) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatGetAddrAndPortAllocAlg) Unmarshal(b []byte) error { @@ -4070,11 +3797,10 @@ func (*NatGetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatGetAddrAndPortAllocAlgReply) Size() int { +func (m *NatGetAddrAndPortAllocAlgReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.Alg size += 1 // m.PsidOffset @@ -4085,24 +3811,22 @@ func (m *NatGetAddrAndPortAllocAlgReply) Size() int { return size } func (m *NatGetAddrAndPortAllocAlgReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint8(uint8(m.Alg)) - buf.EncodeUint8(uint8(m.PsidOffset)) - buf.EncodeUint8(uint8(m.PsidLength)) - buf.EncodeUint16(uint16(m.Psid)) - buf.EncodeUint16(uint16(m.StartPort)) - buf.EncodeUint16(uint16(m.EndPort)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint8(m.Alg) + buf.EncodeUint8(m.PsidOffset) + buf.EncodeUint8(m.PsidLength) + buf.EncodeUint16(m.Psid) + buf.EncodeUint16(m.StartPort) + buf.EncodeUint16(m.EndPort) return buf.Bytes(), nil } func (m *NatGetAddrAndPortAllocAlgReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Alg = buf.DecodeUint8() m.PsidOffset = buf.DecodeUint8() m.PsidLength = buf.DecodeUint8() @@ -4122,20 +3846,17 @@ func (*NatGetMssClamping) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatGetMssClamping) Size() int { +func (m *NatGetMssClamping) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatGetMssClamping) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatGetMssClamping) Unmarshal(b []byte) error { @@ -4156,31 +3877,28 @@ func (*NatGetMssClampingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatGetMssClampingReply) Size() int { +func (m *NatGetMssClampingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 2 // m.MssValue size += 1 // m.Enable return size } func (m *NatGetMssClampingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint16(uint16(m.MssValue)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint16(m.MssValue) buf.EncodeBool(m.Enable) return buf.Bytes(), nil } func (m *NatGetMssClampingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.MssValue = buf.DecodeUint16() m.Enable = buf.DecodeBool() return nil @@ -4196,20 +3914,17 @@ func (*NatGetTimeouts) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatGetTimeouts) Size() int { +func (m *NatGetTimeouts) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatGetTimeouts) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatGetTimeouts) Unmarshal(b []byte) error { @@ -4232,11 +3947,10 @@ func (*NatGetTimeoutsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatGetTimeoutsReply) Size() int { +func (m *NatGetTimeoutsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.UDP size += 4 // m.TCPEstablished @@ -4245,22 +3959,20 @@ func (m *NatGetTimeoutsReply) Size() int { return size } func (m *NatGetTimeoutsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.UDP)) - buf.EncodeUint32(uint32(m.TCPEstablished)) - buf.EncodeUint32(uint32(m.TCPTransitory)) - buf.EncodeUint32(uint32(m.ICMP)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.UDP) + buf.EncodeUint32(m.TCPEstablished) + buf.EncodeUint32(m.TCPTransitory) + buf.EncodeUint32(m.ICMP) return buf.Bytes(), nil } func (m *NatGetTimeoutsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.UDP = buf.DecodeUint32() m.TCPEstablished = buf.DecodeUint32() m.TCPTransitory = buf.DecodeUint32() @@ -4278,20 +3990,17 @@ func (*NatHaFlush) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatHaFlush) Size() int { +func (m *NatHaFlush) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatHaFlush) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatHaFlush) Unmarshal(b []byte) error { @@ -4310,27 +4019,24 @@ func (*NatHaFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatHaFlushReply) Size() int { +func (m *NatHaFlushReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatHaFlushReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatHaFlushReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -4344,20 +4050,17 @@ func (*NatHaGetFailover) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatHaGetFailover) Size() int { +func (m *NatHaGetFailover) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatHaGetFailover) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatHaGetFailover) Unmarshal(b []byte) error { @@ -4379,11 +4082,10 @@ func (*NatHaGetFailoverReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatHaGetFailoverReply) Size() int { +func (m *NatHaGetFailoverReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 * 4 // m.IPAddress size += 2 // m.Port @@ -4391,21 +4093,19 @@ func (m *NatHaGetFailoverReply) Size() int { return size } func (m *NatHaGetFailoverReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBytes(m.IPAddress[:], 4) - buf.EncodeUint16(uint16(m.Port)) - buf.EncodeUint32(uint32(m.SessionRefreshInterval)) + buf.EncodeUint16(m.Port) + buf.EncodeUint32(m.SessionRefreshInterval) return buf.Bytes(), nil } func (m *NatHaGetFailoverReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() copy(m.IPAddress[:], buf.DecodeBytes(4)) m.Port = buf.DecodeUint16() m.SessionRefreshInterval = buf.DecodeUint32() @@ -4422,20 +4122,17 @@ func (*NatHaGetListener) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatHaGetListener) Size() int { +func (m *NatHaGetListener) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatHaGetListener) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatHaGetListener) Unmarshal(b []byte) error { @@ -4457,11 +4154,10 @@ func (*NatHaGetListenerReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatHaGetListenerReply) Size() int { +func (m *NatHaGetListenerReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 * 4 // m.IPAddress size += 2 // m.Port @@ -4469,21 +4165,19 @@ func (m *NatHaGetListenerReply) Size() int { return size } func (m *NatHaGetListenerReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBytes(m.IPAddress[:], 4) - buf.EncodeUint16(uint16(m.Port)) - buf.EncodeUint32(uint32(m.PathMtu)) + buf.EncodeUint16(m.Port) + buf.EncodeUint32(m.PathMtu) return buf.Bytes(), nil } func (m *NatHaGetListenerReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() copy(m.IPAddress[:], buf.DecodeBytes(4)) m.Port = buf.DecodeUint16() m.PathMtu = buf.DecodeUint32() @@ -4503,24 +4197,21 @@ func (*NatHaResync) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatHaResync) Size() int { +func (m *NatHaResync) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.WantResyncEvent size += 4 // m.PID return size } func (m *NatHaResync) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.WantResyncEvent)) - buf.EncodeUint32(uint32(m.PID)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.WantResyncEvent) + buf.EncodeUint32(m.PID) return buf.Bytes(), nil } func (m *NatHaResync) Unmarshal(b []byte) error { @@ -4543,24 +4234,21 @@ func (*NatHaResyncCompletedEvent) GetMessageType() api.MessageType { return api.EventMessage } -func (m *NatHaResyncCompletedEvent) Size() int { +func (m *NatHaResyncCompletedEvent) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PID size += 4 // m.MissedCount return size } func (m *NatHaResyncCompletedEvent) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PID)) - buf.EncodeUint32(uint32(m.MissedCount)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PID) + buf.EncodeUint32(m.MissedCount) return buf.Bytes(), nil } func (m *NatHaResyncCompletedEvent) Unmarshal(b []byte) error { @@ -4582,27 +4270,24 @@ func (*NatHaResyncReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatHaResyncReply) Size() int { +func (m *NatHaResyncReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatHaResyncReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatHaResyncReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -4620,26 +4305,23 @@ func (*NatHaSetFailover) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatHaSetFailover) Size() int { +func (m *NatHaSetFailover) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IPAddress size += 2 // m.Port size += 4 // m.SessionRefreshInterval return size } func (m *NatHaSetFailover) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IPAddress[:], 4) - buf.EncodeUint16(uint16(m.Port)) - buf.EncodeUint32(uint32(m.SessionRefreshInterval)) + buf.EncodeUint16(m.Port) + buf.EncodeUint32(m.SessionRefreshInterval) return buf.Bytes(), nil } func (m *NatHaSetFailover) Unmarshal(b []byte) error { @@ -4662,27 +4344,24 @@ func (*NatHaSetFailoverReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatHaSetFailoverReply) Size() int { +func (m *NatHaSetFailoverReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatHaSetFailoverReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatHaSetFailoverReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -4700,26 +4379,23 @@ func (*NatHaSetListener) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatHaSetListener) Size() int { +func (m *NatHaSetListener) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.IPAddress size += 2 // m.Port size += 4 // m.PathMtu return size } func (m *NatHaSetListener) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.IPAddress[:], 4) - buf.EncodeUint16(uint16(m.Port)) - buf.EncodeUint32(uint32(m.PathMtu)) + buf.EncodeUint16(m.Port) + buf.EncodeUint32(m.PathMtu) return buf.Bytes(), nil } func (m *NatHaSetListener) Unmarshal(b []byte) error { @@ -4742,27 +4418,24 @@ func (*NatHaSetListenerReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatHaSetListenerReply) Size() int { +func (m *NatHaSetListenerReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatHaSetListenerReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatHaSetListenerReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -4780,25 +4453,22 @@ func (*NatIpfixEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatIpfixEnableDisable) Size() int { +func (m *NatIpfixEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.DomainID size += 2 // m.SrcPort size += 1 // m.Enable return size } func (m *NatIpfixEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.DomainID)) - buf.EncodeUint16(uint16(m.SrcPort)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.DomainID) + buf.EncodeUint16(m.SrcPort) buf.EncodeBool(m.Enable) return buf.Bytes(), nil } @@ -4822,27 +4492,24 @@ func (*NatIpfixEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatIpfixEnableDisableReply) Size() int { +func (m *NatIpfixEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatIpfixEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatIpfixEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -4863,11 +4530,10 @@ func (*NatSetAddrAndPortAllocAlg) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatSetAddrAndPortAllocAlg) Size() int { +func (m *NatSetAddrAndPortAllocAlg) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Alg size += 1 // m.PsidOffset size += 1 // m.PsidLength @@ -4877,18 +4543,16 @@ func (m *NatSetAddrAndPortAllocAlg) Size() int { return size } func (m *NatSetAddrAndPortAllocAlg) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint8(uint8(m.Alg)) - buf.EncodeUint8(uint8(m.PsidOffset)) - buf.EncodeUint8(uint8(m.PsidLength)) - buf.EncodeUint16(uint16(m.Psid)) - buf.EncodeUint16(uint16(m.StartPort)) - buf.EncodeUint16(uint16(m.EndPort)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Alg) + buf.EncodeUint8(m.PsidOffset) + buf.EncodeUint8(m.PsidLength) + buf.EncodeUint16(m.Psid) + buf.EncodeUint16(m.StartPort) + buf.EncodeUint16(m.EndPort) return buf.Bytes(), nil } func (m *NatSetAddrAndPortAllocAlg) Unmarshal(b []byte) error { @@ -4916,27 +4580,24 @@ func (*NatSetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatSetAddrAndPortAllocAlgReply) Size() int { +func (m *NatSetAddrAndPortAllocAlgReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatSetAddrAndPortAllocAlgReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatSetAddrAndPortAllocAlgReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -4952,21 +4613,18 @@ func (*NatSetLogLevel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatSetLogLevel) Size() int { +func (m *NatSetLogLevel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.LogLevel return size } func (m *NatSetLogLevel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.LogLevel)) return buf.Bytes(), nil } @@ -4988,27 +4646,24 @@ func (*NatSetLogLevelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatSetLogLevelReply) Size() int { +func (m *NatSetLogLevelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatSetLogLevelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatSetLogLevelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -5025,23 +4680,20 @@ func (*NatSetMssClamping) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatSetMssClamping) Size() int { +func (m *NatSetMssClamping) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.MssValue size += 1 // m.Enable return size } func (m *NatSetMssClamping) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.MssValue)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.MssValue) buf.EncodeBool(m.Enable) return buf.Bytes(), nil } @@ -5064,27 +4716,24 @@ func (*NatSetMssClampingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatSetMssClampingReply) Size() int { +func (m *NatSetMssClampingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatSetMssClampingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatSetMssClampingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -5103,11 +4752,10 @@ func (*NatSetTimeouts) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatSetTimeouts) Size() int { +func (m *NatSetTimeouts) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.UDP size += 4 // m.TCPEstablished size += 4 // m.TCPTransitory @@ -5115,16 +4763,14 @@ func (m *NatSetTimeouts) Size() int { return size } func (m *NatSetTimeouts) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) - } - buf.EncodeUint32(uint32(m.UDP)) - buf.EncodeUint32(uint32(m.TCPEstablished)) - buf.EncodeUint32(uint32(m.TCPTransitory)) - buf.EncodeUint32(uint32(m.ICMP)) + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.UDP) + buf.EncodeUint32(m.TCPEstablished) + buf.EncodeUint32(m.TCPTransitory) + buf.EncodeUint32(m.ICMP) return buf.Bytes(), nil } func (m *NatSetTimeouts) Unmarshal(b []byte) error { @@ -5148,27 +4794,24 @@ func (*NatSetTimeoutsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatSetTimeoutsReply) Size() int { +func (m *NatSetTimeoutsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatSetTimeoutsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatSetTimeoutsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -5184,22 +4827,19 @@ func (*NatSetWorkers) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatSetWorkers) Size() int { +func (m *NatSetWorkers) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.WorkerMask return size } func (m *NatSetWorkers) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint64(uint64(m.WorkerMask)) + buf := codec.NewBuffer(b) + buf.EncodeUint64(m.WorkerMask) return buf.Bytes(), nil } func (m *NatSetWorkers) Unmarshal(b []byte) error { @@ -5220,27 +4860,24 @@ func (*NatSetWorkersReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatSetWorkersReply) Size() int { +func (m *NatSetWorkersReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NatSetWorkersReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NatSetWorkersReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -5254,20 +4891,17 @@ func (*NatShowConfig) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatShowConfig) Size() int { +func (m *NatShowConfig) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatShowConfig) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatShowConfig) Unmarshal(b []byte) error { @@ -5303,11 +4937,10 @@ func (*NatShowConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatShowConfigReply) Size() int { +func (m *NatShowConfigReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.StaticMappingOnly size += 1 // m.StaticMappingConnectionTracking @@ -5329,35 +4962,33 @@ func (m *NatShowConfigReply) Size() int { return size } func (m *NatShowConfigReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.StaticMappingOnly) buf.EncodeBool(m.StaticMappingConnectionTracking) buf.EncodeBool(m.Deterministic) buf.EncodeBool(m.EndpointDependent) buf.EncodeBool(m.Out2inDpo) buf.EncodeBool(m.DsliteCe) - buf.EncodeUint32(uint32(m.TranslationBuckets)) - buf.EncodeUint32(uint32(m.TranslationMemorySize)) - buf.EncodeUint32(uint32(m.UserBuckets)) - buf.EncodeUint64(uint64(m.UserMemorySize)) - buf.EncodeUint32(uint32(m.MaxTranslationsPerUser)) - buf.EncodeUint32(uint32(m.OutsideVrfID)) - buf.EncodeUint32(uint32(m.InsideVrfID)) - buf.EncodeUint32(uint32(m.Nat64BibBuckets)) - buf.EncodeUint64(uint64(m.Nat64BibMemorySize)) - buf.EncodeUint32(uint32(m.Nat64StBuckets)) - buf.EncodeUint64(uint64(m.Nat64StMemorySize)) + buf.EncodeUint32(m.TranslationBuckets) + buf.EncodeUint32(m.TranslationMemorySize) + buf.EncodeUint32(m.UserBuckets) + buf.EncodeUint64(m.UserMemorySize) + buf.EncodeUint32(m.MaxTranslationsPerUser) + buf.EncodeUint32(m.OutsideVrfID) + buf.EncodeUint32(m.InsideVrfID) + buf.EncodeUint32(m.Nat64BibBuckets) + buf.EncodeUint64(m.Nat64BibMemorySize) + buf.EncodeUint32(m.Nat64StBuckets) + buf.EncodeUint64(m.Nat64StMemorySize) return buf.Bytes(), nil } func (m *NatShowConfigReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.StaticMappingOnly = buf.DecodeBool() m.StaticMappingConnectionTracking = buf.DecodeBool() m.Deterministic = buf.DecodeBool() @@ -5392,25 +5023,22 @@ func (*NatWorkerDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NatWorkerDetails) Size() int { +func (m *NatWorkerDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.WorkerIndex size += 4 // m.LcoreID size += 64 // m.Name return size } func (m *NatWorkerDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.WorkerIndex)) - buf.EncodeUint32(uint32(m.LcoreID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.WorkerIndex) + buf.EncodeUint32(m.LcoreID) buf.EncodeString(m.Name, 64) return buf.Bytes(), nil } @@ -5432,20 +5060,17 @@ func (*NatWorkerDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NatWorkerDump) Size() int { +func (m *NatWorkerDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *NatWorkerDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *NatWorkerDump) Unmarshal(b []byte) error { diff --git a/binapi/nsh/nsh.ba.go b/binapi/nsh/nsh.ba.go index a918c98..5897a90 100644 --- a/binapi/nsh/nsh.ba.go +++ b/binapi/nsh/nsh.ba.go @@ -53,11 +53,10 @@ func (*NshAddDelEntry) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NshAddDelEntry) Size() int { +func (m *NshAddDelEntry) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.NspNsi size += 1 // m.MdType @@ -74,25 +73,23 @@ func (m *NshAddDelEntry) Size() int { return size } func (m *NshAddDelEntry) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.NspNsi)) - buf.EncodeUint8(uint8(m.MdType)) - buf.EncodeUint8(uint8(m.VerOC)) - buf.EncodeUint8(uint8(m.TTL)) - buf.EncodeUint8(uint8(m.Length)) - buf.EncodeUint8(uint8(m.NextProtocol)) - buf.EncodeUint32(uint32(m.C1)) - buf.EncodeUint32(uint32(m.C2)) - buf.EncodeUint32(uint32(m.C3)) - buf.EncodeUint32(uint32(m.C4)) - buf.EncodeUint8(uint8(m.TlvLength)) - buf.EncodeBytes(m.Tlv[:], 248) + buf.EncodeUint32(m.NspNsi) + buf.EncodeUint8(m.MdType) + buf.EncodeUint8(m.VerOC) + buf.EncodeUint8(m.TTL) + buf.EncodeUint8(m.Length) + buf.EncodeUint8(m.NextProtocol) + buf.EncodeUint32(m.C1) + buf.EncodeUint32(m.C2) + buf.EncodeUint32(m.C3) + buf.EncodeUint32(m.C4) + buf.EncodeUint8(m.TlvLength) + buf.EncodeBytes(m.Tlv, 248) return buf.Bytes(), nil } func (m *NshAddDelEntry) Unmarshal(b []byte) error { @@ -109,7 +106,8 @@ func (m *NshAddDelEntry) Unmarshal(b []byte) error { m.C3 = buf.DecodeUint32() m.C4 = buf.DecodeUint32() m.TlvLength = buf.DecodeUint8() - copy(m.Tlv[:], buf.DecodeBytes(248)) + m.Tlv = make([]byte, 248) + copy(m.Tlv, buf.DecodeBytes(len(m.Tlv))) return nil } @@ -126,29 +124,26 @@ func (*NshAddDelEntryReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NshAddDelEntryReply) Size() int { +func (m *NshAddDelEntryReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.EntryIndex return size } func (m *NshAddDelEntryReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.EntryIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.EntryIndex) return buf.Bytes(), nil } func (m *NshAddDelEntryReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.EntryIndex = buf.DecodeUint32() return nil } @@ -171,11 +166,10 @@ func (*NshAddDelMap) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NshAddDelMap) Size() int { +func (m *NshAddDelMap) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.NspNsi size += 4 // m.MappedNspNsi @@ -186,19 +180,17 @@ func (m *NshAddDelMap) Size() int { return size } func (m *NshAddDelMap) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.NspNsi)) - buf.EncodeUint32(uint32(m.MappedNspNsi)) - buf.EncodeUint32(uint32(m.NshAction)) + buf.EncodeUint32(m.NspNsi) + buf.EncodeUint32(m.MappedNspNsi) + buf.EncodeUint32(m.NshAction) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(uint32(m.RxSwIfIndex)) - buf.EncodeUint32(uint32(m.NextNode)) + buf.EncodeUint32(m.NextNode) return buf.Bytes(), nil } func (m *NshAddDelMap) Unmarshal(b []byte) error { @@ -226,29 +218,26 @@ func (*NshAddDelMapReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NshAddDelMapReply) Size() int { +func (m *NshAddDelMapReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.MapIndex return size } func (m *NshAddDelMapReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.MapIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.MapIndex) return buf.Bytes(), nil } func (m *NshAddDelMapReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.MapIndex = buf.DecodeUint32() return nil } @@ -277,11 +266,10 @@ func (*NshEntryDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NshEntryDetails) Size() int { +func (m *NshEntryDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.EntryIndex size += 4 // m.NspNsi size += 1 // m.MdType @@ -298,25 +286,23 @@ func (m *NshEntryDetails) Size() int { return size } func (m *NshEntryDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.EntryIndex)) - buf.EncodeUint32(uint32(m.NspNsi)) - buf.EncodeUint8(uint8(m.MdType)) - buf.EncodeUint8(uint8(m.VerOC)) - buf.EncodeUint8(uint8(m.TTL)) - buf.EncodeUint8(uint8(m.Length)) - buf.EncodeUint8(uint8(m.NextProtocol)) - buf.EncodeUint32(uint32(m.C1)) - buf.EncodeUint32(uint32(m.C2)) - buf.EncodeUint32(uint32(m.C3)) - buf.EncodeUint32(uint32(m.C4)) - buf.EncodeUint8(uint8(m.TlvLength)) - buf.EncodeBytes(m.Tlv[:], 248) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.EntryIndex) + buf.EncodeUint32(m.NspNsi) + buf.EncodeUint8(m.MdType) + buf.EncodeUint8(m.VerOC) + buf.EncodeUint8(m.TTL) + buf.EncodeUint8(m.Length) + buf.EncodeUint8(m.NextProtocol) + buf.EncodeUint32(m.C1) + buf.EncodeUint32(m.C2) + buf.EncodeUint32(m.C3) + buf.EncodeUint32(m.C4) + buf.EncodeUint8(m.TlvLength) + buf.EncodeBytes(m.Tlv, 248) return buf.Bytes(), nil } func (m *NshEntryDetails) Unmarshal(b []byte) error { @@ -333,7 +319,8 @@ func (m *NshEntryDetails) Unmarshal(b []byte) error { m.C3 = buf.DecodeUint32() m.C4 = buf.DecodeUint32() m.TlvLength = buf.DecodeUint8() - copy(m.Tlv[:], buf.DecodeBytes(248)) + m.Tlv = make([]byte, 248) + copy(m.Tlv, buf.DecodeBytes(len(m.Tlv))) return nil } @@ -349,22 +336,19 @@ func (*NshEntryDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NshEntryDump) Size() int { +func (m *NshEntryDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.EntryIndex return size } func (m *NshEntryDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.EntryIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.EntryIndex) return buf.Bytes(), nil } func (m *NshEntryDump) Unmarshal(b []byte) error { @@ -391,11 +375,10 @@ func (*NshMapDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NshMapDetails) Size() int { +func (m *NshMapDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.MapIndex size += 4 // m.NspNsi size += 4 // m.MappedNspNsi @@ -406,19 +389,17 @@ func (m *NshMapDetails) Size() int { return size } func (m *NshMapDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.MapIndex)) - buf.EncodeUint32(uint32(m.NspNsi)) - buf.EncodeUint32(uint32(m.MappedNspNsi)) - buf.EncodeUint32(uint32(m.NshAction)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.MapIndex) + buf.EncodeUint32(m.NspNsi) + buf.EncodeUint32(m.MappedNspNsi) + buf.EncodeUint32(m.NshAction) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(uint32(m.RxSwIfIndex)) - buf.EncodeUint32(uint32(m.NextNode)) + buf.EncodeUint32(m.NextNode) return buf.Bytes(), nil } func (m *NshMapDetails) Unmarshal(b []byte) error { @@ -445,22 +426,19 @@ func (*NshMapDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NshMapDump) Size() int { +func (m *NshMapDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.MapIndex return size } func (m *NshMapDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.MapIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.MapIndex) return buf.Bytes(), nil } func (m *NshMapDump) Unmarshal(b []byte) error { diff --git a/binapi/nsim/nsim.ba.go b/binapi/nsim/nsim.ba.go index 5b751b8..fb540ac 100644 --- a/binapi/nsim/nsim.ba.go +++ b/binapi/nsim/nsim.ba.go @@ -44,11 +44,10 @@ func (*NsimConfigure) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NsimConfigure) Size() int { +func (m *NsimConfigure) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.DelayInUsec size += 4 // m.AveragePacketSize size += 8 // m.BandwidthInBitsPerSecond @@ -56,16 +55,14 @@ func (m *NsimConfigure) Size() int { return size } func (m *NsimConfigure) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.DelayInUsec)) - buf.EncodeUint32(uint32(m.AveragePacketSize)) - buf.EncodeUint64(uint64(m.BandwidthInBitsPerSecond)) - buf.EncodeUint32(uint32(m.PacketsPerDrop)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.DelayInUsec) + buf.EncodeUint32(m.AveragePacketSize) + buf.EncodeUint64(m.BandwidthInBitsPerSecond) + buf.EncodeUint32(m.PacketsPerDrop) return buf.Bytes(), nil } func (m *NsimConfigure) Unmarshal(b []byte) error { @@ -89,27 +86,24 @@ func (*NsimConfigureReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NsimConfigureReply) Size() int { +func (m *NsimConfigureReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NsimConfigureReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NsimConfigureReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -129,23 +123,20 @@ func (*NsimCrossConnectEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NsimCrossConnectEnableDisable) Size() int { +func (m *NsimCrossConnectEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable size += 4 // m.SwIfIndex0 size += 4 // m.SwIfIndex1 return size } func (m *NsimCrossConnectEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) buf.EncodeUint32(uint32(m.SwIfIndex0)) buf.EncodeUint32(uint32(m.SwIfIndex1)) @@ -173,27 +164,24 @@ func (*NsimCrossConnectEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NsimCrossConnectEnableDisableReply) Size() int { +func (m *NsimCrossConnectEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NsimCrossConnectEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NsimCrossConnectEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -212,22 +200,19 @@ func (*NsimOutputFeatureEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *NsimOutputFeatureEnableDisable) Size() int { +func (m *NsimOutputFeatureEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable size += 4 // m.SwIfIndex return size } func (m *NsimOutputFeatureEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -253,27 +238,24 @@ func (*NsimOutputFeatureEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *NsimOutputFeatureEnableDisableReply) Size() int { +func (m *NsimOutputFeatureEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *NsimOutputFeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *NsimOutputFeatureEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/oddbuf/oddbuf.ba.go b/binapi/oddbuf/oddbuf.ba.go index ceceaae..c6f3e21 100644 --- a/binapi/oddbuf/oddbuf.ba.go +++ b/binapi/oddbuf/oddbuf.ba.go @@ -42,22 +42,19 @@ func (*OddbufEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OddbufEnableDisable) Size() int { +func (m *OddbufEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable size += 4 // m.SwIfIndex return size } func (m *OddbufEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EnableDisable) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil @@ -81,27 +78,24 @@ func (*OddbufEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OddbufEnableDisableReply) Size() int { +func (m *OddbufEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OddbufEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OddbufEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/one/one.ba.go b/binapi/one/one.ba.go index 259e3f2..fa3b5af 100644 --- a/binapi/one/one.ba.go +++ b/binapi/one/one.ba.go @@ -125,11 +125,10 @@ func (*OneAddDelAdjacency) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelAdjacency) Size() int { +func (m *OneAddDelAdjacency) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Vni size += 1 // m.Reid.Type @@ -139,18 +138,16 @@ func (m *OneAddDelAdjacency) Size() int { return size } func (m *OneAddDelAdjacency) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.IsAdd)) - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.IsAdd) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Reid.Type)) - buf.EncodeBytes(m.Reid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Reid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.Leid.Type)) - buf.EncodeBytes(m.Leid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Leid.Address.XXX_UnionData[:], 6) return buf.Bytes(), nil } func (m *OneAddDelAdjacency) Unmarshal(b []byte) error { @@ -176,27 +173,24 @@ func (*OneAddDelAdjacencyReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelAdjacencyReply) Size() int { +func (m *OneAddDelAdjacencyReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneAddDelAdjacencyReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneAddDelAdjacencyReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -214,11 +208,10 @@ func (*OneAddDelL2ArpEntry) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelL2ArpEntry) Size() int { +func (m *OneAddDelL2ArpEntry) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Bd size += 1 * 6 // m.Entry.Mac @@ -226,14 +219,12 @@ func (m *OneAddDelL2ArpEntry) Size() int { return size } func (m *OneAddDelL2ArpEntry) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Bd)) + buf.EncodeUint32(m.Bd) buf.EncodeBytes(m.Entry.Mac[:], 6) buf.EncodeBytes(m.Entry.IP4[:], 4) return buf.Bytes(), nil @@ -259,27 +250,24 @@ func (*OneAddDelL2ArpEntryReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelL2ArpEntryReply) Size() int { +func (m *OneAddDelL2ArpEntryReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneAddDelL2ArpEntryReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneAddDelL2ArpEntryReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -299,11 +287,10 @@ func (*OneAddDelLocalEid) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelLocalEid) Size() int { +func (m *OneAddDelLocalEid) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Eid.Type size += 1 * 6 // m.Eid.Address @@ -314,19 +301,17 @@ func (m *OneAddDelLocalEid) Size() int { return size } func (m *OneAddDelLocalEid) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Eid.Type)) - buf.EncodeBytes(m.Eid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Eid.Address.XXX_UnionData[:], 6) buf.EncodeString(m.LocatorSetName, 64) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Key.ID)) - buf.EncodeBytes(m.Key.Key[:], 64) + buf.EncodeBytes(m.Key.Key, 64) return buf.Bytes(), nil } func (m *OneAddDelLocalEid) Unmarshal(b []byte) error { @@ -337,7 +322,8 @@ func (m *OneAddDelLocalEid) Unmarshal(b []byte) error { m.LocatorSetName = buf.DecodeString(64) m.Vni = buf.DecodeUint32() m.Key.ID = lisp_types.HmacKeyID(buf.DecodeUint8()) - copy(m.Key.Key[:], buf.DecodeBytes(64)) + m.Key.Key = make([]byte, 64) + copy(m.Key.Key, buf.DecodeBytes(len(m.Key.Key))) return nil } @@ -353,27 +339,24 @@ func (*OneAddDelLocalEidReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelLocalEidReply) Size() int { +func (m *OneAddDelLocalEidReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneAddDelLocalEidReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneAddDelLocalEidReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -393,11 +376,10 @@ func (*OneAddDelLocator) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelLocator) Size() int { +func (m *OneAddDelLocator) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.LocatorSetName size += 4 // m.SwIfIndex @@ -406,17 +388,15 @@ func (m *OneAddDelLocator) Size() int { return size } func (m *OneAddDelLocator) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.LocatorSetName, 64) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.Priority)) - buf.EncodeUint8(uint8(m.Weight)) + buf.EncodeUint8(m.Priority) + buf.EncodeUint8(m.Weight) return buf.Bytes(), nil } func (m *OneAddDelLocator) Unmarshal(b []byte) error { @@ -441,27 +421,24 @@ func (*OneAddDelLocatorReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelLocatorReply) Size() int { +func (m *OneAddDelLocatorReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneAddDelLocatorReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneAddDelLocatorReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -480,11 +457,10 @@ func (*OneAddDelLocatorSet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelLocatorSet) Size() int { +func (m *OneAddDelLocatorSet) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.LocatorSetName size += 4 // m.LocatorNum @@ -501,23 +477,21 @@ func (m *OneAddDelLocatorSet) Size() int { return size } func (m *OneAddDelLocatorSet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.LocatorSetName, 64) buf.EncodeUint32(uint32(len(m.Locators))) for j0 := 0; j0 < len(m.Locators); j0++ { - var v0 lisp_types.LocalLocator + var v0 lisp_types.LocalLocator // Locators if j0 < len(m.Locators) { v0 = m.Locators[j0] } buf.EncodeUint32(uint32(v0.SwIfIndex)) - buf.EncodeUint8(uint8(v0.Priority)) - buf.EncodeUint8(uint8(v0.Weight)) + buf.EncodeUint8(v0.Priority) + buf.EncodeUint8(v0.Weight) } return buf.Bytes(), nil } @@ -526,7 +500,7 @@ func (m *OneAddDelLocatorSet) Unmarshal(b []byte) error { m.IsAdd = buf.DecodeBool() m.LocatorSetName = buf.DecodeString(64) m.LocatorNum = buf.DecodeUint32() - m.Locators = make([]lisp_types.LocalLocator, int(m.LocatorNum)) + m.Locators = make([]lisp_types.LocalLocator, m.LocatorNum) for j0 := 0; j0 < len(m.Locators); j0++ { m.Locators[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Locators[j0].Priority = buf.DecodeUint8() @@ -548,29 +522,26 @@ func (*OneAddDelLocatorSetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelLocatorSetReply) Size() int { +func (m *OneAddDelLocatorSetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.LsIndex return size } func (m *OneAddDelLocatorSetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.LsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.LsIndex) return buf.Bytes(), nil } func (m *OneAddDelLocatorSetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.LsIndex = buf.DecodeUint32() return nil } @@ -590,22 +561,19 @@ func (*OneAddDelMapRequestItrRlocs) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelMapRequestItrRlocs) Size() int { +func (m *OneAddDelMapRequestItrRlocs) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.LocatorSetName return size } func (m *OneAddDelMapRequestItrRlocs) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.LocatorSetName, 64) return buf.Bytes(), nil @@ -631,27 +599,24 @@ func (*OneAddDelMapRequestItrRlocsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelMapRequestItrRlocsReply) Size() int { +func (m *OneAddDelMapRequestItrRlocsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneAddDelMapRequestItrRlocsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneAddDelMapRequestItrRlocsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -668,26 +633,23 @@ func (*OneAddDelMapResolver) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelMapResolver) Size() int { +func (m *OneAddDelMapResolver) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un return size } func (m *OneAddDelMapResolver) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *OneAddDelMapResolver) Unmarshal(b []byte) error { @@ -710,27 +672,24 @@ func (*OneAddDelMapResolverReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelMapResolverReply) Size() int { +func (m *OneAddDelMapResolverReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneAddDelMapResolverReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneAddDelMapResolverReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -747,26 +706,23 @@ func (*OneAddDelMapServer) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelMapServer) Size() int { +func (m *OneAddDelMapServer) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un return size } func (m *OneAddDelMapServer) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *OneAddDelMapServer) Unmarshal(b []byte) error { @@ -789,27 +745,24 @@ func (*OneAddDelMapServerReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelMapServerReply) Size() int { +func (m *OneAddDelMapServerReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneAddDelMapServerReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneAddDelMapServerReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -827,11 +780,10 @@ func (*OneAddDelNdpEntry) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelNdpEntry) Size() int { +func (m *OneAddDelNdpEntry) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Bd size += 1 * 6 // m.Entry.Mac @@ -839,14 +791,12 @@ func (m *OneAddDelNdpEntry) Size() int { return size } func (m *OneAddDelNdpEntry) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Bd)) + buf.EncodeUint32(m.Bd) buf.EncodeBytes(m.Entry.Mac[:], 6) buf.EncodeBytes(m.Entry.IP6[:], 16) return buf.Bytes(), nil @@ -872,27 +822,24 @@ func (*OneAddDelNdpEntryReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelNdpEntryReply) Size() int { +func (m *OneAddDelNdpEntryReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneAddDelNdpEntryReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneAddDelNdpEntryReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -916,11 +863,10 @@ func (*OneAddDelRemoteMapping) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAddDelRemoteMapping) Size() int { +func (m *OneAddDelRemoteMapping) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.IsSrcDst size += 1 // m.DelAll @@ -945,31 +891,29 @@ func (m *OneAddDelRemoteMapping) Size() int { return size } func (m *OneAddDelRemoteMapping) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.IsSrcDst) buf.EncodeBool(m.DelAll) - buf.EncodeUint32(uint32(m.Vni)) - buf.EncodeUint8(uint8(m.Action)) + buf.EncodeUint32(m.Vni) + buf.EncodeUint8(m.Action) buf.EncodeUint8(uint8(m.Deid.Type)) - buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.Seid.Type)) - buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 6) buf.EncodeUint32(uint32(len(m.Rlocs))) for j0 := 0; j0 < len(m.Rlocs); j0++ { - var v0 lisp_types.RemoteLocator + var v0 lisp_types.RemoteLocator // Rlocs if j0 < len(m.Rlocs) { v0 = m.Rlocs[j0] } - buf.EncodeUint8(uint8(v0.Priority)) - buf.EncodeUint8(uint8(v0.Weight)) + buf.EncodeUint8(v0.Priority) + buf.EncodeUint8(v0.Weight) buf.EncodeUint8(uint8(v0.IPAddress.Af)) - buf.EncodeBytes(v0.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.IPAddress.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -985,7 +929,7 @@ func (m *OneAddDelRemoteMapping) Unmarshal(b []byte) error { m.Seid.Type = lisp_types.EidType(buf.DecodeUint8()) copy(m.Seid.Address.XXX_UnionData[:], buf.DecodeBytes(6)) m.RlocNum = buf.DecodeUint32() - m.Rlocs = make([]lisp_types.RemoteLocator, int(m.RlocNum)) + m.Rlocs = make([]lisp_types.RemoteLocator, m.RlocNum) for j0 := 0; j0 < len(m.Rlocs); j0++ { m.Rlocs[j0].Priority = buf.DecodeUint8() m.Rlocs[j0].Weight = buf.DecodeUint8() @@ -1009,27 +953,24 @@ func (*OneAddDelRemoteMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAddDelRemoteMappingReply) Size() int { +func (m *OneAddDelRemoteMappingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneAddDelRemoteMappingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneAddDelRemoteMappingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1045,22 +986,19 @@ func (*OneAdjacenciesGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneAdjacenciesGet) Size() int { +func (m *OneAdjacenciesGet) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni return size } func (m *OneAdjacenciesGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *OneAdjacenciesGet) Unmarshal(b []byte) error { @@ -1083,11 +1021,10 @@ func (*OneAdjacenciesGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneAdjacenciesGetReply) Size() int { +func (m *OneAdjacenciesGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count for j1 := 0; j1 < len(m.Adjacencies); j1++ { @@ -1104,31 +1041,29 @@ func (m *OneAdjacenciesGetReply) Size() int { return size } func (m *OneAdjacenciesGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.Adjacencies))) for j0 := 0; j0 < len(m.Adjacencies); j0++ { - var v0 OneAdjacency + var v0 OneAdjacency // Adjacencies if j0 < len(m.Adjacencies) { v0 = m.Adjacencies[j0] } buf.EncodeUint8(uint8(v0.Reid.Type)) - buf.EncodeBytes(v0.Reid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Reid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(v0.Leid.Type)) - buf.EncodeBytes(v0.Leid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Leid.Address.XXX_UnionData[:], 6) } return buf.Bytes(), nil } func (m *OneAdjacenciesGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() - m.Adjacencies = make([]OneAdjacency, int(m.Count)) + m.Adjacencies = make([]OneAdjacency, m.Count) for j0 := 0; j0 < len(m.Adjacencies); j0++ { m.Adjacencies[j0].Reid.Type = lisp_types.EidType(buf.DecodeUint8()) copy(m.Adjacencies[j0].Reid.Address.XXX_UnionData[:], buf.DecodeBytes(6)) @@ -1153,11 +1088,10 @@ func (*OneEidTableAddDelMap) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneEidTableAddDelMap) Size() int { +func (m *OneEidTableAddDelMap) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Vni size += 4 // m.DpTable @@ -1165,15 +1099,13 @@ func (m *OneEidTableAddDelMap) Size() int { return size } func (m *OneEidTableAddDelMap) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Vni)) - buf.EncodeUint32(uint32(m.DpTable)) + buf.EncodeUint32(m.Vni) + buf.EncodeUint32(m.DpTable) buf.EncodeBool(m.IsL2) return buf.Bytes(), nil } @@ -1198,27 +1130,24 @@ func (*OneEidTableAddDelMapReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneEidTableAddDelMapReply) Size() int { +func (m *OneEidTableAddDelMapReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneEidTableAddDelMapReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneEidTableAddDelMapReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1243,11 +1172,10 @@ func (*OneEidTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneEidTableDetails) Size() int { +func (m *OneEidTableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.LocatorSetIndex size += 1 // m.Action size += 1 // m.IsLocal @@ -1264,25 +1192,23 @@ func (m *OneEidTableDetails) Size() int { return size } func (m *OneEidTableDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.LocatorSetIndex)) - buf.EncodeUint8(uint8(m.Action)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.LocatorSetIndex) + buf.EncodeUint8(m.Action) buf.EncodeBool(m.IsLocal) buf.EncodeBool(m.IsSrcDst) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Deid.Type)) - buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.Seid.Type)) - buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.TTL)) - buf.EncodeUint8(uint8(m.Authoritative)) + buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 6) + buf.EncodeUint32(m.TTL) + buf.EncodeUint8(m.Authoritative) buf.EncodeUint8(uint8(m.Key.ID)) - buf.EncodeBytes(m.Key.Key[:], 64) + buf.EncodeBytes(m.Key.Key, 64) return buf.Bytes(), nil } func (m *OneEidTableDetails) Unmarshal(b []byte) error { @@ -1299,7 +1225,8 @@ func (m *OneEidTableDetails) Unmarshal(b []byte) error { m.TTL = buf.DecodeUint32() m.Authoritative = buf.DecodeUint8() m.Key.ID = lisp_types.HmacKeyID(buf.DecodeUint8()) - copy(m.Key.Key[:], buf.DecodeBytes(64)) + m.Key.Key = make([]byte, 64) + copy(m.Key.Key, buf.DecodeBytes(len(m.Key.Key))) return nil } @@ -1318,11 +1245,10 @@ func (*OneEidTableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneEidTableDump) Size() int { +func (m *OneEidTableDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EidSet size += 4 // m.Vni size += 1 // m.Eid.Type @@ -1331,16 +1257,14 @@ func (m *OneEidTableDump) Size() int { return size } func (m *OneEidTableDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.EidSet) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Eid.Type)) - buf.EncodeBytes(m.Eid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Eid.Address.XXX_UnionData[:], 6) buf.EncodeUint32(uint32(m.Filter)) return buf.Bytes(), nil } @@ -1367,24 +1291,21 @@ func (*OneEidTableMapDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneEidTableMapDetails) Size() int { +func (m *OneEidTableMapDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni size += 4 // m.DpTable return size } func (m *OneEidTableMapDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) - buf.EncodeUint32(uint32(m.DpTable)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) + buf.EncodeUint32(m.DpTable) return buf.Bytes(), nil } func (m *OneEidTableMapDetails) Unmarshal(b []byte) error { @@ -1406,21 +1327,18 @@ func (*OneEidTableMapDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneEidTableMapDump) Size() int { +func (m *OneEidTableMapDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsL2 return size } func (m *OneEidTableMapDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsL2) return buf.Bytes(), nil } @@ -1442,22 +1360,19 @@ func (*OneEidTableVniDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneEidTableVniDetails) Size() int { +func (m *OneEidTableVniDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni return size } func (m *OneEidTableVniDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *OneEidTableVniDetails) Unmarshal(b []byte) error { @@ -1476,20 +1391,17 @@ func (*OneEidTableVniDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneEidTableVniDump) Size() int { +func (m *OneEidTableVniDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneEidTableVniDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneEidTableVniDump) Unmarshal(b []byte) error { @@ -1508,21 +1420,18 @@ func (*OneEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneEnableDisable) Size() int { +func (m *OneEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *OneEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -1544,21 +1453,18 @@ func (*OneEnableDisablePetrMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneEnableDisablePetrMode) Size() int { +func (m *OneEnableDisablePetrMode) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *OneEnableDisablePetrMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -1582,27 +1488,24 @@ func (*OneEnableDisablePetrModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneEnableDisablePetrModeReply) Size() int { +func (m *OneEnableDisablePetrModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneEnableDisablePetrModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneEnableDisablePetrModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1618,21 +1521,18 @@ func (*OneEnableDisablePitrMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneEnableDisablePitrMode) Size() int { +func (m *OneEnableDisablePitrMode) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *OneEnableDisablePitrMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -1656,27 +1556,24 @@ func (*OneEnableDisablePitrModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneEnableDisablePitrModeReply) Size() int { +func (m *OneEnableDisablePitrModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneEnableDisablePitrModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneEnableDisablePitrModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1692,27 +1589,24 @@ func (*OneEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneEnableDisableReply) Size() int { +func (m *OneEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1728,21 +1622,18 @@ func (*OneEnableDisableXtrMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneEnableDisableXtrMode) Size() int { +func (m *OneEnableDisableXtrMode) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *OneEnableDisableXtrMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -1766,27 +1657,24 @@ func (*OneEnableDisableXtrModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneEnableDisableXtrModeReply) Size() int { +func (m *OneEnableDisableXtrModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneEnableDisableXtrModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneEnableDisableXtrModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1800,20 +1688,17 @@ func (*OneGetMapRequestItrRlocs) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneGetMapRequestItrRlocs) Size() int { +func (m *OneGetMapRequestItrRlocs) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneGetMapRequestItrRlocs) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneGetMapRequestItrRlocs) Unmarshal(b []byte) error { @@ -1835,29 +1720,26 @@ func (*OneGetMapRequestItrRlocsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneGetMapRequestItrRlocsReply) Size() int { +func (m *OneGetMapRequestItrRlocsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 64 // m.LocatorSetName return size } func (m *OneGetMapRequestItrRlocsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeString(m.LocatorSetName, 64) return buf.Bytes(), nil } func (m *OneGetMapRequestItrRlocsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.LocatorSetName = buf.DecodeString(64) return nil } @@ -1872,20 +1754,17 @@ func (*OneGetTransportProtocol) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneGetTransportProtocol) Size() int { +func (m *OneGetTransportProtocol) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneGetTransportProtocol) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneGetTransportProtocol) Unmarshal(b []byte) error { @@ -1907,29 +1786,26 @@ func (*OneGetTransportProtocolReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneGetTransportProtocolReply) Size() int { +func (m *OneGetTransportProtocolReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.Protocol return size } func (m *OneGetTransportProtocolReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint8(uint8(m.Protocol)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint8(m.Protocol) return buf.Bytes(), nil } func (m *OneGetTransportProtocolReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Protocol = buf.DecodeUint8() return nil } @@ -1944,20 +1820,17 @@ func (*OneL2ArpBdGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneL2ArpBdGet) Size() int { +func (m *OneL2ArpBdGet) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneL2ArpBdGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneL2ArpBdGet) Unmarshal(b []byte) error { @@ -1978,37 +1851,34 @@ func (*OneL2ArpBdGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneL2ArpBdGetReply) Size() int { +func (m *OneL2ArpBdGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count size += 4 * len(m.BridgeDomains) // m.BridgeDomains return size } func (m *OneL2ArpBdGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.BridgeDomains))) for i := 0; i < len(m.BridgeDomains); i++ { var x uint32 if i < len(m.BridgeDomains) { x = uint32(m.BridgeDomains[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } func (m *OneL2ArpBdGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() m.BridgeDomains = make([]uint32, m.Count) for i := 0; i < len(m.BridgeDomains); i++ { @@ -2029,22 +1899,19 @@ func (*OneL2ArpEntriesGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneL2ArpEntriesGet) Size() int { +func (m *OneL2ArpEntriesGet) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Bd return size } func (m *OneL2ArpEntriesGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Bd)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Bd) return buf.Bytes(), nil } func (m *OneL2ArpEntriesGet) Unmarshal(b []byte) error { @@ -2067,11 +1934,10 @@ func (*OneL2ArpEntriesGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneL2ArpEntriesGetReply) Size() int { +func (m *OneL2ArpEntriesGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count for j1 := 0; j1 < len(m.Entries); j1++ { @@ -2086,16 +1952,14 @@ func (m *OneL2ArpEntriesGetReply) Size() int { return size } func (m *OneL2ArpEntriesGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.Entries))) for j0 := 0; j0 < len(m.Entries); j0++ { - var v0 OneL2ArpEntry + var v0 OneL2ArpEntry // Entries if j0 < len(m.Entries) { v0 = m.Entries[j0] } @@ -2106,9 +1970,9 @@ func (m *OneL2ArpEntriesGetReply) Marshal(b []byte) ([]byte, error) { } func (m *OneL2ArpEntriesGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() - m.Entries = make([]OneL2ArpEntry, int(m.Count)) + m.Entries = make([]OneL2ArpEntry, m.Count) for j0 := 0; j0 < len(m.Entries); j0++ { copy(m.Entries[j0].Mac[:], buf.DecodeBytes(6)) copy(m.Entries[j0].IP4[:], buf.DecodeBytes(4)) @@ -2132,11 +1996,10 @@ func (*OneLocatorDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneLocatorDetails) Size() int { +func (m *OneLocatorDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Local size += 4 // m.SwIfIndex size += 1 // m.IPAddress.Af @@ -2146,18 +2009,16 @@ func (m *OneLocatorDetails) Size() int { return size } func (m *OneLocatorDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Local)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Local) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Priority)) - buf.EncodeUint8(uint8(m.Weight)) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Priority) + buf.EncodeUint8(m.Weight) return buf.Bytes(), nil } func (m *OneLocatorDetails) Unmarshal(b []byte) error { @@ -2185,24 +2046,21 @@ func (*OneLocatorDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneLocatorDump) Size() int { +func (m *OneLocatorDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.LsIndex size += 64 // m.LsName size += 1 // m.IsIndexSet return size } func (m *OneLocatorDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.LsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.LsIndex) buf.EncodeString(m.LsName, 64) buf.EncodeBool(m.IsIndexSet) return buf.Bytes(), nil @@ -2228,23 +2086,20 @@ func (*OneLocatorSetDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneLocatorSetDetails) Size() int { +func (m *OneLocatorSetDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.LsIndex size += 64 // m.LsName return size } func (m *OneLocatorSetDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.LsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.LsIndex) buf.EncodeString(m.LsName, 64) return buf.Bytes(), nil } @@ -2267,21 +2122,18 @@ func (*OneLocatorSetDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneLocatorSetDump) Size() int { +func (m *OneLocatorSetDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Filter return size } func (m *OneLocatorSetDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Filter)) return buf.Bytes(), nil } @@ -2303,21 +2155,18 @@ func (*OneMapRegisterEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneMapRegisterEnableDisable) Size() int { +func (m *OneMapRegisterEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *OneMapRegisterEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -2341,27 +2190,24 @@ func (*OneMapRegisterEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneMapRegisterEnableDisableReply) Size() int { +func (m *OneMapRegisterEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneMapRegisterEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneMapRegisterEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2379,22 +2225,19 @@ func (*OneMapRegisterFallbackThreshold) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneMapRegisterFallbackThreshold) Size() int { +func (m *OneMapRegisterFallbackThreshold) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Value return size } func (m *OneMapRegisterFallbackThreshold) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Value)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Value) return buf.Bytes(), nil } func (m *OneMapRegisterFallbackThreshold) Unmarshal(b []byte) error { @@ -2417,27 +2260,24 @@ func (*OneMapRegisterFallbackThresholdReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneMapRegisterFallbackThresholdReply) Size() int { +func (m *OneMapRegisterFallbackThresholdReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneMapRegisterFallbackThresholdReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneMapRegisterFallbackThresholdReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2453,22 +2293,19 @@ func (*OneMapRegisterSetTTL) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneMapRegisterSetTTL) Size() int { +func (m *OneMapRegisterSetTTL) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TTL return size } func (m *OneMapRegisterSetTTL) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.TTL)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TTL) return buf.Bytes(), nil } func (m *OneMapRegisterSetTTL) Unmarshal(b []byte) error { @@ -2489,27 +2326,24 @@ func (*OneMapRegisterSetTTLReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneMapRegisterSetTTLReply) Size() int { +func (m *OneMapRegisterSetTTLReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneMapRegisterSetTTLReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneMapRegisterSetTTLReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2525,21 +2359,18 @@ func (*OneMapRequestMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneMapRequestMode) Size() int { +func (m *OneMapRequestMode) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Mode return size } func (m *OneMapRequestMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Mode)) return buf.Bytes(), nil } @@ -2561,27 +2392,24 @@ func (*OneMapRequestModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneMapRequestModeReply) Size() int { +func (m *OneMapRequestModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneMapRequestModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneMapRequestModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2597,24 +2425,21 @@ func (*OneMapResolverDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneMapResolverDetails) Size() int { +func (m *OneMapResolverDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un return size } func (m *OneMapResolverDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *OneMapResolverDetails) Unmarshal(b []byte) error { @@ -2634,20 +2459,17 @@ func (*OneMapResolverDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneMapResolverDump) Size() int { +func (m *OneMapResolverDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneMapResolverDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneMapResolverDump) Unmarshal(b []byte) error { @@ -2666,24 +2488,21 @@ func (*OneMapServerDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneMapServerDetails) Size() int { +func (m *OneMapServerDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un return size } func (m *OneMapServerDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *OneMapServerDetails) Unmarshal(b []byte) error { @@ -2703,20 +2522,17 @@ func (*OneMapServerDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneMapServerDump) Size() int { +func (m *OneMapServerDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneMapServerDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneMapServerDump) Unmarshal(b []byte) error { @@ -2733,20 +2549,17 @@ func (*OneNdpBdGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneNdpBdGet) Size() int { +func (m *OneNdpBdGet) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneNdpBdGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneNdpBdGet) Unmarshal(b []byte) error { @@ -2767,37 +2580,34 @@ func (*OneNdpBdGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneNdpBdGetReply) Size() int { +func (m *OneNdpBdGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count size += 4 * len(m.BridgeDomains) // m.BridgeDomains return size } func (m *OneNdpBdGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.BridgeDomains))) for i := 0; i < len(m.BridgeDomains); i++ { var x uint32 if i < len(m.BridgeDomains) { x = uint32(m.BridgeDomains[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } func (m *OneNdpBdGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() m.BridgeDomains = make([]uint32, m.Count) for i := 0; i < len(m.BridgeDomains); i++ { @@ -2818,22 +2628,19 @@ func (*OneNdpEntriesGet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneNdpEntriesGet) Size() int { +func (m *OneNdpEntriesGet) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Bd return size } func (m *OneNdpEntriesGet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Bd)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Bd) return buf.Bytes(), nil } func (m *OneNdpEntriesGet) Unmarshal(b []byte) error { @@ -2856,11 +2663,10 @@ func (*OneNdpEntriesGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneNdpEntriesGetReply) Size() int { +func (m *OneNdpEntriesGetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count for j1 := 0; j1 < len(m.Entries); j1++ { @@ -2875,16 +2681,14 @@ func (m *OneNdpEntriesGetReply) Size() int { return size } func (m *OneNdpEntriesGetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.Entries))) for j0 := 0; j0 < len(m.Entries); j0++ { - var v0 OneNdpEntry + var v0 OneNdpEntry // Entries if j0 < len(m.Entries) { v0 = m.Entries[j0] } @@ -2895,9 +2699,9 @@ func (m *OneNdpEntriesGetReply) Marshal(b []byte) ([]byte, error) { } func (m *OneNdpEntriesGetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() - m.Entries = make([]OneNdpEntry, int(m.Count)) + m.Entries = make([]OneNdpEntry, m.Count) for j0 := 0; j0 < len(m.Entries); j0++ { copy(m.Entries[j0].Mac[:], buf.DecodeBytes(6)) copy(m.Entries[j0].IP6[:], buf.DecodeBytes(16)) @@ -2918,22 +2722,19 @@ func (*OneNshSetLocatorSet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneNshSetLocatorSet) Size() int { +func (m *OneNshSetLocatorSet) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.LsName return size } func (m *OneNshSetLocatorSet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.LsName, 64) return buf.Bytes(), nil @@ -2957,27 +2758,24 @@ func (*OneNshSetLocatorSetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneNshSetLocatorSetReply) Size() int { +func (m *OneNshSetLocatorSetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneNshSetLocatorSetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneNshSetLocatorSetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -2994,22 +2792,19 @@ func (*OnePitrSetLocatorSet) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OnePitrSetLocatorSet) Size() int { +func (m *OnePitrSetLocatorSet) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.LsName return size } func (m *OnePitrSetLocatorSet) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.LsName, 64) return buf.Bytes(), nil @@ -3033,27 +2828,24 @@ func (*OnePitrSetLocatorSetReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OnePitrSetLocatorSetReply) Size() int { +func (m *OnePitrSetLocatorSetReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OnePitrSetLocatorSetReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OnePitrSetLocatorSetReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3069,21 +2861,18 @@ func (*OneRlocProbeEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneRlocProbeEnableDisable) Size() int { +func (m *OneRlocProbeEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *OneRlocProbeEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -3107,27 +2896,24 @@ func (*OneRlocProbeEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneRlocProbeEnableDisableReply) Size() int { +func (m *OneRlocProbeEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneRlocProbeEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneRlocProbeEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3143,22 +2929,19 @@ func (*OneSetTransportProtocol) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneSetTransportProtocol) Size() int { +func (m *OneSetTransportProtocol) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Protocol return size } func (m *OneSetTransportProtocol) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.Protocol)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Protocol) return buf.Bytes(), nil } func (m *OneSetTransportProtocol) Unmarshal(b []byte) error { @@ -3181,27 +2964,24 @@ func (*OneSetTransportProtocolReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneSetTransportProtocolReply) Size() int { +func (m *OneSetTransportProtocolReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneSetTransportProtocolReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneSetTransportProtocolReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3215,20 +2995,17 @@ func (*OneShowPetrMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneShowPetrMode) Size() int { +func (m *OneShowPetrMode) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneShowPetrMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneShowPetrMode) Unmarshal(b []byte) error { @@ -3248,29 +3025,26 @@ func (*OneShowPetrModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneShowPetrModeReply) Size() int { +func (m *OneShowPetrModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsEnable return size } func (m *OneShowPetrModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } func (m *OneShowPetrModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsEnable = buf.DecodeBool() return nil } @@ -3285,20 +3059,17 @@ func (*OneShowPitrMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneShowPitrMode) Size() int { +func (m *OneShowPitrMode) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneShowPitrMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneShowPitrMode) Unmarshal(b []byte) error { @@ -3318,29 +3089,26 @@ func (*OneShowPitrModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneShowPitrModeReply) Size() int { +func (m *OneShowPitrModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsEnable return size } func (m *OneShowPitrModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } func (m *OneShowPitrModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsEnable = buf.DecodeBool() return nil } @@ -3355,20 +3123,17 @@ func (*OneShowXtrMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneShowXtrMode) Size() int { +func (m *OneShowXtrMode) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneShowXtrMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneShowXtrMode) Unmarshal(b []byte) error { @@ -3388,29 +3153,26 @@ func (*OneShowXtrModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneShowXtrModeReply) Size() int { +func (m *OneShowXtrModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsEnable return size } func (m *OneShowXtrModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } func (m *OneShowXtrModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsEnable = buf.DecodeBool() return nil } @@ -3433,11 +3195,10 @@ func (*OneStatsDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneStatsDetails) Size() int { +func (m *OneStatsDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Vni size += 1 // m.Deid.Type size += 1 * 6 // m.Deid.Address @@ -3452,23 +3213,21 @@ func (m *OneStatsDetails) Size() int { return size } func (m *OneStatsDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Vni)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Deid.Type)) - buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Deid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.Seid.Type)) - buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Seid.Address.XXX_UnionData[:], 6) buf.EncodeUint8(uint8(m.Rloc.Af)) - buf.EncodeBytes(m.Rloc.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Rloc.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Lloc.Af)) - buf.EncodeBytes(m.Lloc.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.PktCount)) - buf.EncodeUint32(uint32(m.Bytes)) + buf.EncodeBytes(m.Lloc.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.PktCount) + buf.EncodeUint32(m.Bytes) return buf.Bytes(), nil } func (m *OneStatsDetails) Unmarshal(b []byte) error { @@ -3497,20 +3256,17 @@ func (*OneStatsDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneStatsDump) Size() int { +func (m *OneStatsDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneStatsDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneStatsDump) Unmarshal(b []byte) error { @@ -3529,21 +3285,18 @@ func (*OneStatsEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneStatsEnableDisable) Size() int { +func (m *OneStatsEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *OneStatsEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -3565,27 +3318,24 @@ func (*OneStatsEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneStatsEnableDisableReply) Size() int { +func (m *OneStatsEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneStatsEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneStatsEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3599,20 +3349,17 @@ func (*OneStatsFlush) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneStatsFlush) Size() int { +func (m *OneStatsFlush) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *OneStatsFlush) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *OneStatsFlush) Unmarshal(b []byte) error { @@ -3631,27 +3378,24 @@ func (*OneStatsFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneStatsFlushReply) Size() int { +func (m *OneStatsFlushReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneStatsFlushReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneStatsFlushReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3668,25 +3412,22 @@ func (*OneUsePetr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *OneUsePetr) Size() int { +func (m *OneUsePetr) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un size += 1 // m.IsAdd return size } func (m *OneUsePetr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -3710,27 +3451,24 @@ func (*OneUsePetrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *OneUsePetrReply) Size() int { +func (m *OneUsePetrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *OneUsePetrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *OneUsePetrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -3746,20 +3484,17 @@ func (*ShowOneMapRegisterFallbackThreshold) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOneMapRegisterFallbackThreshold) Size() int { +func (m *ShowOneMapRegisterFallbackThreshold) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOneMapRegisterFallbackThreshold) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOneMapRegisterFallbackThreshold) Unmarshal(b []byte) error { @@ -3783,29 +3518,26 @@ func (*ShowOneMapRegisterFallbackThresholdReply) GetMessageType() api.MessageTyp return api.ReplyMessage } -func (m *ShowOneMapRegisterFallbackThresholdReply) Size() int { +func (m *ShowOneMapRegisterFallbackThresholdReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Value return size } func (m *ShowOneMapRegisterFallbackThresholdReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.Value)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.Value) return buf.Bytes(), nil } func (m *ShowOneMapRegisterFallbackThresholdReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Value = buf.DecodeUint32() return nil } @@ -3820,20 +3552,17 @@ func (*ShowOneMapRegisterState) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOneMapRegisterState) Size() int { +func (m *ShowOneMapRegisterState) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOneMapRegisterState) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOneMapRegisterState) Unmarshal(b []byte) error { @@ -3855,29 +3584,26 @@ func (*ShowOneMapRegisterStateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowOneMapRegisterStateReply) Size() int { +func (m *ShowOneMapRegisterStateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsEnable return size } func (m *ShowOneMapRegisterStateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } func (m *ShowOneMapRegisterStateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsEnable = buf.DecodeBool() return nil } @@ -3892,20 +3618,17 @@ func (*ShowOneMapRegisterTTL) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOneMapRegisterTTL) Size() int { +func (m *ShowOneMapRegisterTTL) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOneMapRegisterTTL) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOneMapRegisterTTL) Unmarshal(b []byte) error { @@ -3925,29 +3648,26 @@ func (*ShowOneMapRegisterTTLReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowOneMapRegisterTTLReply) Size() int { +func (m *ShowOneMapRegisterTTLReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.TTL return size } func (m *ShowOneMapRegisterTTLReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.TTL)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TTL) return buf.Bytes(), nil } func (m *ShowOneMapRegisterTTLReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.TTL = buf.DecodeUint32() return nil } @@ -3962,20 +3682,17 @@ func (*ShowOneMapRequestMode) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOneMapRequestMode) Size() int { +func (m *ShowOneMapRequestMode) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOneMapRequestMode) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOneMapRequestMode) Unmarshal(b []byte) error { @@ -3995,29 +3712,26 @@ func (*ShowOneMapRequestModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowOneMapRequestModeReply) Size() int { +func (m *ShowOneMapRequestModeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Mode return size } func (m *ShowOneMapRequestModeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.Mode)) return buf.Bytes(), nil } func (m *ShowOneMapRequestModeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Mode = OneMapMode(buf.DecodeUint32()) return nil } @@ -4032,20 +3746,17 @@ func (*ShowOneNshMapping) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOneNshMapping) Size() int { +func (m *ShowOneNshMapping) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOneNshMapping) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOneNshMapping) Unmarshal(b []byte) error { @@ -4066,31 +3777,28 @@ func (*ShowOneNshMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowOneNshMappingReply) Size() int { +func (m *ShowOneNshMappingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsSet size += 64 // m.LocatorSetName return size } func (m *ShowOneNshMappingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsSet) buf.EncodeString(m.LocatorSetName, 64) return buf.Bytes(), nil } func (m *ShowOneNshMappingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsSet = buf.DecodeBool() m.LocatorSetName = buf.DecodeString(64) return nil @@ -4106,20 +3814,17 @@ func (*ShowOnePitr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOnePitr) Size() int { +func (m *ShowOnePitr) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOnePitr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOnePitr) Unmarshal(b []byte) error { @@ -4140,31 +3845,28 @@ func (*ShowOnePitrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowOnePitrReply) Size() int { +func (m *ShowOnePitrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.Status size += 64 // m.LocatorSetName return size } func (m *ShowOnePitrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.Status) buf.EncodeString(m.LocatorSetName, 64) return buf.Bytes(), nil } func (m *ShowOnePitrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Status = buf.DecodeBool() m.LocatorSetName = buf.DecodeString(64) return nil @@ -4180,20 +3882,17 @@ func (*ShowOneRlocProbeState) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOneRlocProbeState) Size() int { +func (m *ShowOneRlocProbeState) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOneRlocProbeState) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOneRlocProbeState) Unmarshal(b []byte) error { @@ -4213,29 +3912,26 @@ func (*ShowOneRlocProbeStateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowOneRlocProbeStateReply) Size() int { +func (m *ShowOneRlocProbeStateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsEnable return size } func (m *ShowOneRlocProbeStateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } func (m *ShowOneRlocProbeStateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsEnable = buf.DecodeBool() return nil } @@ -4250,20 +3946,17 @@ func (*ShowOneStatsEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOneStatsEnableDisable) Size() int { +func (m *ShowOneStatsEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOneStatsEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOneStatsEnableDisable) Unmarshal(b []byte) error { @@ -4285,29 +3978,26 @@ func (*ShowOneStatsEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowOneStatsEnableDisableReply) Size() int { +func (m *ShowOneStatsEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.IsEnable return size } func (m *ShowOneStatsEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } func (m *ShowOneStatsEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.IsEnable = buf.DecodeBool() return nil } @@ -4322,20 +4012,17 @@ func (*ShowOneStatus) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOneStatus) Size() int { +func (m *ShowOneStatus) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOneStatus) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOneStatus) Unmarshal(b []byte) error { @@ -4356,31 +4043,28 @@ func (*ShowOneStatusReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowOneStatusReply) Size() int { +func (m *ShowOneStatusReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.FeatureStatus size += 1 // m.GpeStatus return size } func (m *ShowOneStatusReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.FeatureStatus) buf.EncodeBool(m.GpeStatus) return buf.Bytes(), nil } func (m *ShowOneStatusReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.FeatureStatus = buf.DecodeBool() m.GpeStatus = buf.DecodeBool() return nil @@ -4396,20 +4080,17 @@ func (*ShowOneUsePetr) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowOneUsePetr) Size() int { +func (m *ShowOneUsePetr) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowOneUsePetr) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowOneUsePetr) Unmarshal(b []byte) error { @@ -4430,11 +4111,10 @@ func (*ShowOneUsePetrReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowOneUsePetrReply) Size() int { +func (m *ShowOneUsePetrReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.Status size += 1 // m.IPAddress.Af @@ -4442,21 +4122,19 @@ func (m *ShowOneUsePetrReply) Size() int { return size } func (m *ShowOneUsePetrReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBool(m.Status) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *ShowOneUsePetrReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Status = buf.DecodeBool() m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) diff --git a/binapi/p2p_ethernet/p2p_ethernet.ba.go b/binapi/p2p_ethernet/p2p_ethernet.ba.go index 5435390..2f76041 100644 --- a/binapi/p2p_ethernet/p2p_ethernet.ba.go +++ b/binapi/p2p_ethernet/p2p_ethernet.ba.go @@ -44,25 +44,22 @@ func (*P2pEthernetAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *P2pEthernetAdd) Size() int { +func (m *P2pEthernetAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ParentIfIndex size += 4 // m.SubifID size += 1 * 6 // m.RemoteMac return size } func (m *P2pEthernetAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.ParentIfIndex)) - buf.EncodeUint32(uint32(m.SubifID)) + buf.EncodeUint32(m.SubifID) buf.EncodeBytes(m.RemoteMac[:], 6) return buf.Bytes(), nil } @@ -87,29 +84,26 @@ func (*P2pEthernetAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *P2pEthernetAddReply) Size() int { +func (m *P2pEthernetAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *P2pEthernetAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *P2pEthernetAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -127,22 +121,19 @@ func (*P2pEthernetDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *P2pEthernetDel) Size() int { +func (m *P2pEthernetDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ParentIfIndex size += 1 * 6 // m.RemoteMac return size } func (m *P2pEthernetDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.ParentIfIndex)) buf.EncodeBytes(m.RemoteMac[:], 6) return buf.Bytes(), nil @@ -166,27 +157,24 @@ func (*P2pEthernetDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *P2pEthernetDelReply) Size() int { +func (m *P2pEthernetDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *P2pEthernetDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *P2pEthernetDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/pg/pg.ba.go b/binapi/pg/pg.ba.go index 2f45135..9a522c2 100644 --- a/binapi/pg/pg.ba.go +++ b/binapi/pg/pg.ba.go @@ -44,11 +44,10 @@ func (*PgCapture) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PgCapture) Size() int { +func (m *PgCapture) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.InterfaceID size += 1 // m.IsEnabled size += 4 // m.Count @@ -56,15 +55,13 @@ func (m *PgCapture) Size() int { return size } func (m *PgCapture) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.InterfaceID)) buf.EncodeBool(m.IsEnabled) - buf.EncodeUint32(uint32(m.Count)) + buf.EncodeUint32(m.Count) buf.EncodeString(m.PcapFileName, 0) return buf.Bytes(), nil } @@ -89,27 +86,24 @@ func (*PgCaptureReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PgCaptureReply) Size() int { +func (m *PgCaptureReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *PgCaptureReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *PgCaptureReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -127,26 +121,23 @@ func (*PgCreateInterface) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PgCreateInterface) Size() int { +func (m *PgCreateInterface) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.InterfaceID size += 1 // m.GsoEnabled size += 4 // m.GsoSize return size } func (m *PgCreateInterface) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.InterfaceID)) buf.EncodeBool(m.GsoEnabled) - buf.EncodeUint32(uint32(m.GsoSize)) + buf.EncodeUint32(m.GsoSize) return buf.Bytes(), nil } func (m *PgCreateInterface) Unmarshal(b []byte) error { @@ -170,29 +161,26 @@ func (*PgCreateInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PgCreateInterfaceReply) Size() int { +func (m *PgCreateInterfaceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *PgCreateInterfaceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *PgCreateInterfaceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -210,22 +198,19 @@ func (*PgEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PgEnableDisable) Size() int { +func (m *PgEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnabled size += 4 + len(m.StreamName) // m.StreamName return size } func (m *PgEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnabled) buf.EncodeString(m.StreamName, 0) return buf.Bytes(), nil @@ -249,27 +234,24 @@ func (*PgEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PgEnableDisableReply) Size() int { +func (m *PgEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *PgEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *PgEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/pipe/pipe.ba.go b/binapi/pipe/pipe.ba.go index 24881cc..6123059 100644 --- a/binapi/pipe/pipe.ba.go +++ b/binapi/pipe/pipe.ba.go @@ -42,24 +42,21 @@ func (*PipeCreate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PipeCreate) Size() int { +func (m *PipeCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsSpecified size += 4 // m.UserInstance return size } func (m *PipeCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsSpecified) - buf.EncodeUint32(uint32(m.UserInstance)) + buf.EncodeUint32(m.UserInstance) return buf.Bytes(), nil } func (m *PipeCreate) Unmarshal(b []byte) error { @@ -83,44 +80,32 @@ func (*PipeCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PipeCreateReply) Size() int { +func (m *PipeCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex for j1 := 0; j1 < 2; j1++ { - var s1 interface_types.InterfaceIndex - _ = s1 - if j1 < len(m.PipeSwIfIndex) { - s1 = m.PipeSwIfIndex[j1] - } - size += 4 // s1 + size += 4 // m.PipeSwIfIndex[j1] } return size } func (m *PipeCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) for j0 := 0; j0 < 2; j0++ { - var v0 interface_types.InterfaceIndex - if j0 < len(m.PipeSwIfIndex) { - v0 = m.PipeSwIfIndex[j0] - } - buf.EncodeUint32(uint32(v0)) + buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0])) } return buf.Bytes(), nil } func (m *PipeCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) for j0 := 0; j0 < 2; j0++ { m.PipeSwIfIndex[j0] = interface_types.InterfaceIndex(buf.DecodeUint32()) @@ -140,21 +125,18 @@ func (*PipeDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PipeDelete) Size() int { +func (m *PipeDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *PipeDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -176,27 +158,24 @@ func (*PipeDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PipeDeleteReply) Size() int { +func (m *PipeDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *PipeDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *PipeDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -214,39 +193,27 @@ func (*PipeDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PipeDetails) Size() int { +func (m *PipeDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex for j1 := 0; j1 < 2; j1++ { - var s1 interface_types.InterfaceIndex - _ = s1 - if j1 < len(m.PipeSwIfIndex) { - s1 = m.PipeSwIfIndex[j1] - } - size += 4 // s1 + size += 4 // m.PipeSwIfIndex[j1] } size += 4 // m.Instance return size } func (m *PipeDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) for j0 := 0; j0 < 2; j0++ { - var v0 interface_types.InterfaceIndex - if j0 < len(m.PipeSwIfIndex) { - v0 = m.PipeSwIfIndex[j0] - } - buf.EncodeUint32(uint32(v0)) + buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0])) } - buf.EncodeUint32(uint32(m.Instance)) + buf.EncodeUint32(m.Instance) return buf.Bytes(), nil } func (m *PipeDetails) Unmarshal(b []byte) error { @@ -269,20 +236,17 @@ func (*PipeDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PipeDump) Size() int { +func (m *PipeDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *PipeDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *PipeDump) Unmarshal(b []byte) error { diff --git a/binapi/policer/policer.ba.go b/binapi/policer/policer.ba.go index f529a38..1314dce 100644 --- a/binapi/policer/policer.ba.go +++ b/binapi/policer/policer.ba.go @@ -53,11 +53,10 @@ func (*PolicerAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PolicerAddDel) Size() int { +func (m *PolicerAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 64 // m.Name size += 4 // m.Cir @@ -77,28 +76,26 @@ func (m *PolicerAddDel) Size() int { return size } func (m *PolicerAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.Name, 64) - buf.EncodeUint32(uint32(m.Cir)) - buf.EncodeUint32(uint32(m.Eir)) - buf.EncodeUint64(uint64(m.Cb)) - buf.EncodeUint64(uint64(m.Eb)) + buf.EncodeUint32(m.Cir) + buf.EncodeUint32(m.Eir) + buf.EncodeUint64(m.Cb) + buf.EncodeUint64(m.Eb) buf.EncodeUint8(uint8(m.RateType)) buf.EncodeUint8(uint8(m.RoundType)) buf.EncodeUint8(uint8(m.Type)) buf.EncodeBool(m.ColorAware) buf.EncodeUint8(uint8(m.ConformAction.Type)) - buf.EncodeUint8(uint8(m.ConformAction.Dscp)) + buf.EncodeUint8(m.ConformAction.Dscp) buf.EncodeUint8(uint8(m.ExceedAction.Type)) - buf.EncodeUint8(uint8(m.ExceedAction.Dscp)) + buf.EncodeUint8(m.ExceedAction.Dscp) buf.EncodeUint8(uint8(m.ViolateAction.Type)) - buf.EncodeUint8(uint8(m.ViolateAction.Dscp)) + buf.EncodeUint8(m.ViolateAction.Dscp) return buf.Bytes(), nil } func (m *PolicerAddDel) Unmarshal(b []byte) error { @@ -135,29 +132,26 @@ func (*PolicerAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PolicerAddDelReply) Size() int { +func (m *PolicerAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.PolicerIndex return size } func (m *PolicerAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.PolicerIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.PolicerIndex) return buf.Bytes(), nil } func (m *PolicerAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.PolicerIndex = buf.DecodeUint32() return nil } @@ -194,11 +188,10 @@ func (*PolicerDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PolicerDetails) Size() int { +func (m *PolicerDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.Name size += 4 // m.Cir size += 4 // m.Eir @@ -226,36 +219,34 @@ func (m *PolicerDetails) Size() int { return size } func (m *PolicerDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 64) - buf.EncodeUint32(uint32(m.Cir)) - buf.EncodeUint32(uint32(m.Eir)) - buf.EncodeUint64(uint64(m.Cb)) - buf.EncodeUint64(uint64(m.Eb)) + buf.EncodeUint32(m.Cir) + buf.EncodeUint32(m.Eir) + buf.EncodeUint64(m.Cb) + buf.EncodeUint64(m.Eb) buf.EncodeUint8(uint8(m.RateType)) buf.EncodeUint8(uint8(m.RoundType)) buf.EncodeUint8(uint8(m.Type)) buf.EncodeUint8(uint8(m.ConformAction.Type)) - buf.EncodeUint8(uint8(m.ConformAction.Dscp)) + buf.EncodeUint8(m.ConformAction.Dscp) buf.EncodeUint8(uint8(m.ExceedAction.Type)) - buf.EncodeUint8(uint8(m.ExceedAction.Dscp)) + buf.EncodeUint8(m.ExceedAction.Dscp) buf.EncodeUint8(uint8(m.ViolateAction.Type)) - buf.EncodeUint8(uint8(m.ViolateAction.Dscp)) + buf.EncodeUint8(m.ViolateAction.Dscp) buf.EncodeBool(m.SingleRate) buf.EncodeBool(m.ColorAware) - buf.EncodeUint32(uint32(m.Scale)) - buf.EncodeUint32(uint32(m.CirTokensPerPeriod)) - buf.EncodeUint32(uint32(m.PirTokensPerPeriod)) - buf.EncodeUint32(uint32(m.CurrentLimit)) - buf.EncodeUint32(uint32(m.CurrentBucket)) - buf.EncodeUint32(uint32(m.ExtendedLimit)) - buf.EncodeUint32(uint32(m.ExtendedBucket)) - buf.EncodeUint64(uint64(m.LastUpdateTime)) + buf.EncodeUint32(m.Scale) + buf.EncodeUint32(m.CirTokensPerPeriod) + buf.EncodeUint32(m.PirTokensPerPeriod) + buf.EncodeUint32(m.CurrentLimit) + buf.EncodeUint32(m.CurrentBucket) + buf.EncodeUint32(m.ExtendedLimit) + buf.EncodeUint32(m.ExtendedBucket) + buf.EncodeUint64(m.LastUpdateTime) return buf.Bytes(), nil } func (m *PolicerDetails) Unmarshal(b []byte) error { @@ -300,22 +291,19 @@ func (*PolicerDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PolicerDump) Size() int { +func (m *PolicerDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.MatchNameValid size += 64 // m.MatchName return size } func (m *PolicerDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.MatchNameValid) buf.EncodeString(m.MatchName, 64) return buf.Bytes(), nil diff --git a/binapi/pot/pot.ba.go b/binapi/pot/pot.ba.go index f037a53..2c2d1f4 100644 --- a/binapi/pot/pot.ba.go +++ b/binapi/pot/pot.ba.go @@ -41,23 +41,20 @@ func (*PotProfileActivate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PotProfileActivate) Size() int { +func (m *PotProfileActivate) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.ID size += 4 + len(m.ListName) // m.ListName return size } func (m *PotProfileActivate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.ID) buf.EncodeString(m.ListName, 0) return buf.Bytes(), nil } @@ -80,27 +77,24 @@ func (*PotProfileActivateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PotProfileActivateReply) Size() int { +func (m *PotProfileActivateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *PotProfileActivateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *PotProfileActivateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -124,11 +118,10 @@ func (*PotProfileAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PotProfileAdd) Size() int { +func (m *PotProfileAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.ID size += 1 // m.Validator size += 8 // m.SecretKey @@ -141,20 +134,18 @@ func (m *PotProfileAdd) Size() int { return size } func (m *PotProfileAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.ID)) - buf.EncodeUint8(uint8(m.Validator)) - buf.EncodeUint64(uint64(m.SecretKey)) - buf.EncodeUint64(uint64(m.SecretShare)) - buf.EncodeUint64(uint64(m.Prime)) - buf.EncodeUint8(uint8(m.MaxBits)) - buf.EncodeUint64(uint64(m.Lpc)) - buf.EncodeUint64(uint64(m.PolynomialPublic)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.ID) + buf.EncodeUint8(m.Validator) + buf.EncodeUint64(m.SecretKey) + buf.EncodeUint64(m.SecretShare) + buf.EncodeUint64(m.Prime) + buf.EncodeUint8(m.MaxBits) + buf.EncodeUint64(m.Lpc) + buf.EncodeUint64(m.PolynomialPublic) buf.EncodeString(m.ListName, 0) return buf.Bytes(), nil } @@ -184,27 +175,24 @@ func (*PotProfileAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PotProfileAddReply) Size() int { +func (m *PotProfileAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *PotProfileAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *PotProfileAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -220,21 +208,18 @@ func (*PotProfileDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PotProfileDel) Size() int { +func (m *PotProfileDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 + len(m.ListName) // m.ListName return size } func (m *PotProfileDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.ListName, 0) return buf.Bytes(), nil } @@ -256,27 +241,24 @@ func (*PotProfileDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PotProfileDelReply) Size() int { +func (m *PotProfileDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *PotProfileDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *PotProfileDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -300,11 +282,10 @@ func (*PotProfileShowConfigDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PotProfileShowConfigDetails) Size() int { +func (m *PotProfileShowConfigDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.ID size += 1 // m.Validator @@ -317,26 +298,24 @@ func (m *PotProfileShowConfigDetails) Size() int { return size } func (m *PotProfileShowConfigDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint8(uint8(m.ID)) - buf.EncodeUint8(uint8(m.Validator)) - buf.EncodeUint64(uint64(m.SecretKey)) - buf.EncodeUint64(uint64(m.SecretShare)) - buf.EncodeUint64(uint64(m.Prime)) - buf.EncodeUint64(uint64(m.BitMask)) - buf.EncodeUint64(uint64(m.Lpc)) - buf.EncodeUint64(uint64(m.PolynomialPublic)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint8(m.ID) + buf.EncodeUint8(m.Validator) + buf.EncodeUint64(m.SecretKey) + buf.EncodeUint64(m.SecretShare) + buf.EncodeUint64(m.Prime) + buf.EncodeUint64(m.BitMask) + buf.EncodeUint64(m.Lpc) + buf.EncodeUint64(m.PolynomialPublic) return buf.Bytes(), nil } func (m *PotProfileShowConfigDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ID = buf.DecodeUint8() m.Validator = buf.DecodeUint8() m.SecretKey = buf.DecodeUint64() @@ -360,22 +339,19 @@ func (*PotProfileShowConfigDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PotProfileShowConfigDump) Size() int { +func (m *PotProfileShowConfigDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.ID return size } func (m *PotProfileShowConfigDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.ID) return buf.Bytes(), nil } func (m *PotProfileShowConfigDump) Unmarshal(b []byte) error { diff --git a/binapi/pppoe/pppoe.ba.go b/binapi/pppoe/pppoe.ba.go index 0b7cafb..e01d3b5 100644 --- a/binapi/pppoe/pppoe.ba.go +++ b/binapi/pppoe/pppoe.ba.go @@ -47,11 +47,10 @@ func (*PppoeAddDelSession) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PppoeAddDelSession) Size() int { +func (m *PppoeAddDelSession) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 2 // m.SessionID size += 1 // m.ClientIP.Af @@ -61,17 +60,15 @@ func (m *PppoeAddDelSession) Size() int { return size } func (m *PppoeAddDelSession) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint16(uint16(m.SessionID)) + buf.EncodeUint16(m.SessionID) buf.EncodeUint8(uint8(m.ClientIP.Af)) - buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.DecapVrfID)) + buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.DecapVrfID) buf.EncodeBytes(m.ClientMac[:], 6) return buf.Bytes(), nil } @@ -99,29 +96,26 @@ func (*PppoeAddDelSessionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PppoeAddDelSessionReply) Size() int { +func (m *PppoeAddDelSessionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *PppoeAddDelSessionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *PppoeAddDelSessionReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -144,11 +138,10 @@ func (*PppoeSessionDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PppoeSessionDetails) Size() int { +func (m *PppoeSessionDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 2 // m.SessionID size += 1 // m.ClientIP.Af @@ -160,18 +153,16 @@ func (m *PppoeSessionDetails) Size() int { return size } func (m *PppoeSessionDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint16(uint16(m.SessionID)) + buf.EncodeUint16(m.SessionID) buf.EncodeUint8(uint8(m.ClientIP.Af)) - buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.EncapIfIndex)) - buf.EncodeUint32(uint32(m.DecapVrfID)) + buf.EncodeUint32(m.DecapVrfID) buf.EncodeBytes(m.LocalMac[:], 6) buf.EncodeBytes(m.ClientMac[:], 6) return buf.Bytes(), nil @@ -201,21 +192,18 @@ func (*PppoeSessionDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PppoeSessionDump) Size() int { +func (m *PppoeSessionDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *PppoeSessionDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } diff --git a/binapi/punt/punt.ba.go b/binapi/punt/punt.ba.go index 53af1a3..18ff678 100644 --- a/binapi/punt/punt.ba.go +++ b/binapi/punt/punt.ba.go @@ -106,11 +106,11 @@ func PuntUnionException(a PuntException) (u PuntUnion) { return } func (u *PuntUnion) SetException(a PuntException) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) - buf.EncodeUint32(uint32(a.ID)) + buf := codec.NewBuffer(u.XXX_UnionData[:]) + buf.EncodeUint32(a.ID) } func (u *PuntUnion) GetException() (a PuntException) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) a.ID = buf.DecodeUint32() return } @@ -120,13 +120,13 @@ func PuntUnionL4(a PuntL4) (u PuntUnion) { return } func (u *PuntUnion) SetL4(a PuntL4) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) buf.EncodeUint8(uint8(a.Af)) buf.EncodeUint8(uint8(a.Protocol)) - buf.EncodeUint16(uint16(a.Port)) + buf.EncodeUint16(a.Port) } func (u *PuntUnion) GetL4() (a PuntL4) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) a.Af = ip_types.AddressFamily(buf.DecodeUint8()) a.Protocol = ip_types.IPProto(buf.DecodeUint8()) a.Port = buf.DecodeUint16() @@ -138,12 +138,12 @@ func PuntUnionIPProto(a PuntIPProto) (u PuntUnion) { return } func (u *PuntUnion) SetIPProto(a PuntIPProto) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) buf.EncodeUint8(uint8(a.Af)) buf.EncodeUint8(uint8(a.Protocol)) } func (u *PuntUnion) GetIPProto() (a PuntIPProto) { - var buf = codec.NewBuffer(u.XXX_UnionData[:]) + buf := codec.NewBuffer(u.XXX_UnionData[:]) a.Af = ip_types.AddressFamily(buf.DecodeUint8()) a.Protocol = ip_types.IPProto(buf.DecodeUint8()) return @@ -161,23 +161,20 @@ func (*PuntReasonDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PuntReasonDetails) Size() int { +func (m *PuntReasonDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Reason.ID size += 4 + len(m.Reason.Name) // m.Reason.Name return size } func (m *PuntReasonDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Reason.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Reason.ID) buf.EncodeString(m.Reason.Name, 0) return buf.Bytes(), nil } @@ -200,23 +197,20 @@ func (*PuntReasonDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PuntReasonDump) Size() int { +func (m *PuntReasonDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Reason.ID size += 4 + len(m.Reason.Name) // m.Reason.Name return size } func (m *PuntReasonDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Reason.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Reason.ID) buf.EncodeString(m.Reason.Name, 0) return buf.Bytes(), nil } @@ -239,24 +233,21 @@ func (*PuntSocketDeregister) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PuntSocketDeregister) Size() int { +func (m *PuntSocketDeregister) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Punt.Type size += 1 * 4 // m.Punt.Punt return size } func (m *PuntSocketDeregister) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Punt.Type)) - buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 4) return buf.Bytes(), nil } func (m *PuntSocketDeregister) Unmarshal(b []byte) error { @@ -278,27 +269,24 @@ func (*PuntSocketDeregisterReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PuntSocketDeregisterReply) Size() int { +func (m *PuntSocketDeregisterReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *PuntSocketDeregisterReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *PuntSocketDeregisterReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -315,25 +303,22 @@ func (*PuntSocketDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PuntSocketDetails) Size() int { +func (m *PuntSocketDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Punt.Type size += 1 * 4 // m.Punt.Punt size += 108 // m.Pathname return size } func (m *PuntSocketDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Punt.Type)) - buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 4) buf.EncodeString(m.Pathname, 108) return buf.Bytes(), nil } @@ -357,21 +342,18 @@ func (*PuntSocketDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PuntSocketDump) Size() int { +func (m *PuntSocketDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Type return size } func (m *PuntSocketDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Type)) return buf.Bytes(), nil } @@ -395,11 +377,10 @@ func (*PuntSocketRegister) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *PuntSocketRegister) Size() int { +func (m *PuntSocketRegister) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.HeaderVersion size += 4 // m.Punt.Type size += 1 * 4 // m.Punt.Punt @@ -407,15 +388,13 @@ func (m *PuntSocketRegister) Size() int { return size } func (m *PuntSocketRegister) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.HeaderVersion)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.HeaderVersion) buf.EncodeUint32(uint32(m.Punt.Type)) - buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 4) buf.EncodeString(m.Pathname, 108) return buf.Bytes(), nil } @@ -441,29 +420,26 @@ func (*PuntSocketRegisterReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *PuntSocketRegisterReply) Size() int { +func (m *PuntSocketRegisterReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 108 // m.Pathname return size } func (m *PuntSocketRegisterReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeString(m.Pathname, 108) return buf.Bytes(), nil } func (m *PuntSocketRegisterReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Pathname = buf.DecodeString(108) return nil } @@ -481,26 +457,23 @@ func (*SetPunt) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SetPunt) Size() int { +func (m *SetPunt) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Punt.Type size += 1 * 4 // m.Punt.Punt return size } func (m *SetPunt) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.Punt.Type)) - buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 4) return buf.Bytes(), nil } func (m *SetPunt) Unmarshal(b []byte) error { @@ -523,27 +496,24 @@ func (*SetPuntReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SetPuntReply) Size() int { +func (m *SetPuntReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SetPuntReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SetPuntReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/qos/qos.ba.go b/binapi/qos/qos.ba.go index 9ff70dd..2f889fd 100644 --- a/binapi/qos/qos.ba.go +++ b/binapi/qos/qos.ba.go @@ -109,22 +109,19 @@ func (*QosEgressMapDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *QosEgressMapDelete) Size() int { +func (m *QosEgressMapDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ID return size } func (m *QosEgressMapDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ID) return buf.Bytes(), nil } func (m *QosEgressMapDelete) Unmarshal(b []byte) error { @@ -145,27 +142,24 @@ func (*QosEgressMapDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosEgressMapDeleteReply) Size() int { +func (m *QosEgressMapDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *QosEgressMapDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *QosEgressMapDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -181,36 +175,24 @@ func (*QosEgressMapDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosEgressMapDetails) Size() int { +func (m *QosEgressMapDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Map.ID for j2 := 0; j2 < 4; j2++ { - var s2 QosEgressMapRow - _ = s2 - if j2 < len(m.Map.Rows) { - s2 = m.Map.Rows[j2] - } - size += 1 * 256 // s2.Outputs + size += 1 * 256 // m.Map.Rows[j2].Outputs } return size } func (m *QosEgressMapDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Map.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Map.ID) for j1 := 0; j1 < 4; j1++ { - var v1 QosEgressMapRow - if j1 < len(m.Map.Rows) { - v1 = m.Map.Rows[j1] - } - buf.EncodeBytes(v1.Outputs[:], 256) + buf.EncodeBytes(m.Map.Rows[j1].Outputs, 256) } return buf.Bytes(), nil } @@ -218,7 +200,8 @@ func (m *QosEgressMapDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Map.ID = buf.DecodeUint32() for j1 := 0; j1 < 4; j1++ { - copy(m.Map.Rows[j1].Outputs[:], buf.DecodeBytes(256)) + m.Map.Rows[j1].Outputs = make([]byte, 256) + copy(m.Map.Rows[j1].Outputs, buf.DecodeBytes(len(m.Map.Rows[j1].Outputs))) } return nil } @@ -233,20 +216,17 @@ func (*QosEgressMapDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *QosEgressMapDump) Size() int { +func (m *QosEgressMapDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *QosEgressMapDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *QosEgressMapDump) Unmarshal(b []byte) error { @@ -265,36 +245,24 @@ func (*QosEgressMapUpdate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *QosEgressMapUpdate) Size() int { +func (m *QosEgressMapUpdate) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Map.ID for j2 := 0; j2 < 4; j2++ { - var s2 QosEgressMapRow - _ = s2 - if j2 < len(m.Map.Rows) { - s2 = m.Map.Rows[j2] - } - size += 1 * 256 // s2.Outputs + size += 1 * 256 // m.Map.Rows[j2].Outputs } return size } func (m *QosEgressMapUpdate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Map.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Map.ID) for j1 := 0; j1 < 4; j1++ { - var v1 QosEgressMapRow - if j1 < len(m.Map.Rows) { - v1 = m.Map.Rows[j1] - } - buf.EncodeBytes(v1.Outputs[:], 256) + buf.EncodeBytes(m.Map.Rows[j1].Outputs, 256) } return buf.Bytes(), nil } @@ -302,7 +270,8 @@ func (m *QosEgressMapUpdate) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Map.ID = buf.DecodeUint32() for j1 := 0; j1 < 4; j1++ { - copy(m.Map.Rows[j1].Outputs[:], buf.DecodeBytes(256)) + m.Map.Rows[j1].Outputs = make([]byte, 256) + copy(m.Map.Rows[j1].Outputs, buf.DecodeBytes(len(m.Map.Rows[j1].Outputs))) } return nil } @@ -319,27 +288,24 @@ func (*QosEgressMapUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosEgressMapUpdateReply) Size() int { +func (m *QosEgressMapUpdateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *QosEgressMapUpdateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *QosEgressMapUpdateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -355,25 +321,22 @@ func (*QosMarkDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosMarkDetails) Size() int { +func (m *QosMarkDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Mark.SwIfIndex size += 4 // m.Mark.MapID size += 1 // m.Mark.OutputSource return size } func (m *QosMarkDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Mark.SwIfIndex)) - buf.EncodeUint32(uint32(m.Mark.MapID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Mark.SwIfIndex) + buf.EncodeUint32(m.Mark.MapID) buf.EncodeUint8(uint8(m.Mark.OutputSource)) return buf.Bytes(), nil } @@ -397,27 +360,24 @@ func (*QosMarkDetailsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosMarkDetailsReply) Size() int { +func (m *QosMarkDetailsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *QosMarkDetailsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *QosMarkDetailsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -433,21 +393,18 @@ func (*QosMarkDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *QosMarkDump) Size() int { +func (m *QosMarkDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *QosMarkDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -470,11 +427,10 @@ func (*QosMarkEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *QosMarkEnableDisable) Size() int { +func (m *QosMarkEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable size += 4 // m.Mark.SwIfIndex size += 4 // m.Mark.MapID @@ -482,15 +438,13 @@ func (m *QosMarkEnableDisable) Size() int { return size } func (m *QosMarkEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) - buf.EncodeUint32(uint32(m.Mark.SwIfIndex)) - buf.EncodeUint32(uint32(m.Mark.MapID)) + buf.EncodeUint32(m.Mark.SwIfIndex) + buf.EncodeUint32(m.Mark.MapID) buf.EncodeUint8(uint8(m.Mark.OutputSource)) return buf.Bytes(), nil } @@ -515,27 +469,24 @@ func (*QosMarkEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosMarkEnableDisableReply) Size() int { +func (m *QosMarkEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *QosMarkEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *QosMarkEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -551,22 +502,19 @@ func (*QosRecordDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosRecordDetails) Size() int { +func (m *QosRecordDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Record.SwIfIndex size += 1 // m.Record.InputSource return size } func (m *QosRecordDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Record.SwIfIndex)) buf.EncodeUint8(uint8(m.Record.InputSource)) return buf.Bytes(), nil @@ -588,20 +536,17 @@ func (*QosRecordDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *QosRecordDump) Size() int { +func (m *QosRecordDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *QosRecordDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *QosRecordDump) Unmarshal(b []byte) error { @@ -621,23 +566,20 @@ func (*QosRecordEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *QosRecordEnableDisable) Size() int { +func (m *QosRecordEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable size += 4 // m.Record.SwIfIndex size += 1 // m.Record.InputSource return size } func (m *QosRecordEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) buf.EncodeUint32(uint32(m.Record.SwIfIndex)) buf.EncodeUint8(uint8(m.Record.InputSource)) @@ -663,27 +605,24 @@ func (*QosRecordEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosRecordEnableDisableReply) Size() int { +func (m *QosRecordEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *QosRecordEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *QosRecordEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -699,26 +638,23 @@ func (*QosStoreDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosStoreDetails) Size() int { +func (m *QosStoreDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Store.SwIfIndex size += 1 // m.Store.InputSource size += 1 // m.Store.Value return size } func (m *QosStoreDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Store.SwIfIndex)) buf.EncodeUint8(uint8(m.Store.InputSource)) - buf.EncodeUint8(uint8(m.Store.Value)) + buf.EncodeUint8(m.Store.Value) return buf.Bytes(), nil } func (m *QosStoreDetails) Unmarshal(b []byte) error { @@ -739,20 +675,17 @@ func (*QosStoreDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *QosStoreDump) Size() int { +func (m *QosStoreDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *QosStoreDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *QosStoreDump) Unmarshal(b []byte) error { @@ -772,11 +705,10 @@ func (*QosStoreEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *QosStoreEnableDisable) Size() int { +func (m *QosStoreEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable size += 4 // m.Store.SwIfIndex size += 1 // m.Store.InputSource @@ -784,16 +716,14 @@ func (m *QosStoreEnableDisable) Size() int { return size } func (m *QosStoreEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) buf.EncodeUint32(uint32(m.Store.SwIfIndex)) buf.EncodeUint8(uint8(m.Store.InputSource)) - buf.EncodeUint8(uint8(m.Store.Value)) + buf.EncodeUint8(m.Store.Value) return buf.Bytes(), nil } func (m *QosStoreEnableDisable) Unmarshal(b []byte) error { @@ -817,27 +747,24 @@ func (*QosStoreEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *QosStoreEnableDisableReply) Size() int { +func (m *QosStoreEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *QosStoreEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *QosStoreEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/rd_cp/rd_cp.ba.go b/binapi/rd_cp/rd_cp.ba.go index 7fefd79..8cafa0f 100644 --- a/binapi/rd_cp/rd_cp.ba.go +++ b/binapi/rd_cp/rd_cp.ba.go @@ -43,23 +43,20 @@ func (*IP6NdAddressAutoconfig) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IP6NdAddressAutoconfig) Size() int { +func (m *IP6NdAddressAutoconfig) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Enable size += 1 // m.InstallDefaultRoutes return size } func (m *IP6NdAddressAutoconfig) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) buf.EncodeBool(m.InstallDefaultRoutes) @@ -85,27 +82,24 @@ func (*IP6NdAddressAutoconfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IP6NdAddressAutoconfigReply) Size() int { +func (m *IP6NdAddressAutoconfigReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IP6NdAddressAutoconfigReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IP6NdAddressAutoconfigReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/rdma/rdma.ba.go b/binapi/rdma/rdma.ba.go index 43ab597..001fefe 100644 --- a/binapi/rdma/rdma.ba.go +++ b/binapi/rdma/rdma.ba.go @@ -65,10 +65,10 @@ func (x RdmaMode) String() string { type RdmaCreate struct { HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` Name string `binapi:"string[64],name=name" json:"name,omitempty"` - RxqNum uint16 `binapi:"u16,name=rxq_num,default=%!s(float64=1)" json:"rxq_num,omitempty"` - RxqSize uint16 `binapi:"u16,name=rxq_size,default=%!s(float64=1024)" json:"rxq_size,omitempty"` - TxqSize uint16 `binapi:"u16,name=txq_size,default=%!s(float64=1024)" json:"txq_size,omitempty"` - Mode RdmaMode `binapi:"rdma_mode,name=mode,default=%!s(float64=0)" json:"mode,omitempty"` + RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"` + RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"` + TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"` + Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"` } func (m *RdmaCreate) Reset() { *m = RdmaCreate{} } @@ -78,11 +78,10 @@ func (*RdmaCreate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *RdmaCreate) Size() int { +func (m *RdmaCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.HostIf size += 64 // m.Name size += 2 // m.RxqNum @@ -92,17 +91,15 @@ func (m *RdmaCreate) Size() int { return size } func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.HostIf, 64) buf.EncodeString(m.Name, 64) - buf.EncodeUint16(uint16(m.RxqNum)) - buf.EncodeUint16(uint16(m.RxqSize)) - buf.EncodeUint16(uint16(m.TxqSize)) + buf.EncodeUint16(m.RxqNum) + buf.EncodeUint16(m.RxqSize) + buf.EncodeUint16(m.TxqSize) buf.EncodeUint32(uint32(m.Mode)) return buf.Bytes(), nil } @@ -130,29 +127,26 @@ func (*RdmaCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *RdmaCreateReply) Size() int { +func (m *RdmaCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *RdmaCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -169,21 +163,18 @@ func (*RdmaDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *RdmaDelete) Size() int { +func (m *RdmaDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -205,27 +196,24 @@ func (*RdmaDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *RdmaDeleteReply) Size() int { +func (m *RdmaDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *RdmaDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/session/session.ba.go b/binapi/session/session.ba.go index 1da2733..6e20c49 100644 --- a/binapi/session/session.ba.go +++ b/binapi/session/session.ba.go @@ -112,33 +112,31 @@ func (*AppAddCertKeyPair) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AppAddCertKeyPair) Size() int { +func (m *AppAddCertKeyPair) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.CertLen size += 2 // m.CertkeyLen size += 1 * len(m.Certkey) // m.Certkey return size } func (m *AppAddCertKeyPair) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.CertLen)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.CertLen) buf.EncodeUint16(uint16(len(m.Certkey))) - buf.EncodeBytes(m.Certkey[:], 0) + buf.EncodeBytes(m.Certkey, 0) return buf.Bytes(), nil } func (m *AppAddCertKeyPair) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.CertLen = buf.DecodeUint16() m.CertkeyLen = buf.DecodeUint16() - copy(m.Certkey[:], buf.DecodeBytes(0)) + m.Certkey = make([]byte, m.CertkeyLen) + copy(m.Certkey, buf.DecodeBytes(len(m.Certkey))) return nil } @@ -155,29 +153,26 @@ func (*AppAddCertKeyPairReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AppAddCertKeyPairReply) Size() int { +func (m *AppAddCertKeyPairReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Index return size } func (m *AppAddCertKeyPairReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.Index)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.Index) return buf.Bytes(), nil } func (m *AppAddCertKeyPairReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Index = buf.DecodeUint32() return nil } @@ -195,28 +190,25 @@ func (*AppAttach) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AppAttach) Size() int { +func (m *AppAttach) Size() (size int) { if m == nil { return 0 } - var size int size += 8 * 18 // m.Options size += 4 + len(m.NamespaceID) // m.NamespaceID return size } func (m *AppAttach) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) for i := 0; i < 18; i++ { var x uint64 if i < len(m.Options) { x = uint64(m.Options[i]) } - buf.EncodeUint64(uint64(x)) + buf.EncodeUint64(x) } buf.EncodeString(m.NamespaceID, 0) return buf.Bytes(), nil @@ -252,11 +244,10 @@ func (*AppAttachReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AppAttachReply) Size() int { +func (m *AppAttachReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 8 // m.AppMq size += 8 // m.VppCtrlMq @@ -270,27 +261,25 @@ func (m *AppAttachReply) Size() int { return size } func (m *AppAttachReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint64(uint64(m.AppMq)) - buf.EncodeUint64(uint64(m.VppCtrlMq)) - buf.EncodeUint8(uint8(m.VppCtrlMqThread)) - buf.EncodeUint32(uint32(m.AppIndex)) - buf.EncodeUint8(uint8(m.NFds)) - buf.EncodeUint8(uint8(m.FdFlags)) - buf.EncodeUint32(uint32(m.SegmentSize)) - buf.EncodeUint64(uint64(m.SegmentHandle)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint64(m.AppMq) + buf.EncodeUint64(m.VppCtrlMq) + buf.EncodeUint8(m.VppCtrlMqThread) + buf.EncodeUint32(m.AppIndex) + buf.EncodeUint8(m.NFds) + buf.EncodeUint8(m.FdFlags) + buf.EncodeUint32(m.SegmentSize) + buf.EncodeUint64(m.SegmentHandle) buf.EncodeString(m.SegmentName, 0) return buf.Bytes(), nil } func (m *AppAttachReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.AppMq = buf.DecodeUint64() m.VppCtrlMq = buf.DecodeUint64() m.VppCtrlMqThread = buf.DecodeUint8() @@ -315,22 +304,19 @@ func (*AppDelCertKeyPair) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AppDelCertKeyPair) Size() int { +func (m *AppDelCertKeyPair) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Index return size } func (m *AppDelCertKeyPair) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Index)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Index) return buf.Bytes(), nil } func (m *AppDelCertKeyPair) Unmarshal(b []byte) error { @@ -351,34 +337,31 @@ func (*AppDelCertKeyPairReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AppDelCertKeyPairReply) Size() int { +func (m *AppDelCertKeyPairReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *AppDelCertKeyPairReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *AppDelCertKeyPairReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } // AppNamespaceAddDel defines message 'app_namespace_add_del'. type AppNamespaceAddDel struct { Secret uint64 `binapi:"u64,name=secret" json:"secret,omitempty"` - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` IP4FibID uint32 `binapi:"u32,name=ip4_fib_id" json:"ip4_fib_id,omitempty"` IP6FibID uint32 `binapi:"u32,name=ip6_fib_id" json:"ip6_fib_id,omitempty"` NamespaceID string `binapi:"string[],name=namespace_id" json:"namespace_id,omitempty"` @@ -391,11 +374,10 @@ func (*AppNamespaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AppNamespaceAddDel) Size() int { +func (m *AppNamespaceAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.Secret size += 4 // m.SwIfIndex size += 4 // m.IP4FibID @@ -404,16 +386,14 @@ func (m *AppNamespaceAddDel) Size() int { return size } func (m *AppNamespaceAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint64(uint64(m.Secret)) + buf := codec.NewBuffer(b) + buf.EncodeUint64(m.Secret) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.IP4FibID)) - buf.EncodeUint32(uint32(m.IP6FibID)) + buf.EncodeUint32(m.IP4FibID) + buf.EncodeUint32(m.IP6FibID) buf.EncodeString(m.NamespaceID, 0) return buf.Bytes(), nil } @@ -440,29 +420,26 @@ func (*AppNamespaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AppNamespaceAddDelReply) Size() int { +func (m *AppNamespaceAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.AppnsIndex return size } func (m *AppNamespaceAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.AppnsIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.AppnsIndex) return buf.Bytes(), nil } func (m *AppNamespaceAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.AppnsIndex = buf.DecodeUint32() return nil } @@ -481,25 +458,22 @@ func (*AppWorkerAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AppWorkerAddDel) Size() int { +func (m *AppWorkerAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.AppIndex size += 4 // m.WrkIndex size += 1 // m.IsAdd return size } func (m *AppWorkerAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.AppIndex)) - buf.EncodeUint32(uint32(m.WrkIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.AppIndex) + buf.EncodeUint32(m.WrkIndex) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -530,11 +504,10 @@ func (*AppWorkerAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AppWorkerAddDelReply) Size() int { +func (m *AppWorkerAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.WrkIndex size += 8 // m.AppEventQueueAddress @@ -546,25 +519,23 @@ func (m *AppWorkerAddDelReply) Size() int { return size } func (m *AppWorkerAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.WrkIndex)) - buf.EncodeUint64(uint64(m.AppEventQueueAddress)) - buf.EncodeUint8(uint8(m.NFds)) - buf.EncodeUint8(uint8(m.FdFlags)) - buf.EncodeUint64(uint64(m.SegmentHandle)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.WrkIndex) + buf.EncodeUint64(m.AppEventQueueAddress) + buf.EncodeUint8(m.NFds) + buf.EncodeUint8(m.FdFlags) + buf.EncodeUint64(m.SegmentHandle) buf.EncodeBool(m.IsAdd) buf.EncodeString(m.SegmentName, 0) return buf.Bytes(), nil } func (m *AppWorkerAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.WrkIndex = buf.DecodeUint32() m.AppEventQueueAddress = buf.DecodeUint64() m.NFds = buf.DecodeUint8() @@ -585,20 +556,17 @@ func (*ApplicationDetach) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ApplicationDetach) Size() int { +func (m *ApplicationDetach) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ApplicationDetach) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ApplicationDetach) Unmarshal(b []byte) error { @@ -617,27 +585,24 @@ func (*ApplicationDetachReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ApplicationDetachReply) Size() int { +func (m *ApplicationDetachReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ApplicationDetachReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ApplicationDetachReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -655,33 +620,31 @@ func (*ApplicationTLSCertAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ApplicationTLSCertAdd) Size() int { +func (m *ApplicationTLSCertAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.AppIndex size += 2 // m.CertLen size += 1 * len(m.Cert) // m.Cert return size } func (m *ApplicationTLSCertAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.AppIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.AppIndex) buf.EncodeUint16(uint16(len(m.Cert))) - buf.EncodeBytes(m.Cert[:], 0) + buf.EncodeBytes(m.Cert, 0) return buf.Bytes(), nil } func (m *ApplicationTLSCertAdd) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.AppIndex = buf.DecodeUint32() m.CertLen = buf.DecodeUint16() - copy(m.Cert[:], buf.DecodeBytes(0)) + m.Cert = make([]byte, m.CertLen) + copy(m.Cert, buf.DecodeBytes(len(m.Cert))) return nil } @@ -697,27 +660,24 @@ func (*ApplicationTLSCertAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ApplicationTLSCertAddReply) Size() int { +func (m *ApplicationTLSCertAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ApplicationTLSCertAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ApplicationTLSCertAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -735,33 +695,31 @@ func (*ApplicationTLSKeyAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ApplicationTLSKeyAdd) Size() int { +func (m *ApplicationTLSKeyAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.AppIndex size += 2 // m.KeyLen size += 1 * len(m.Key) // m.Key return size } func (m *ApplicationTLSKeyAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.AppIndex)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.AppIndex) buf.EncodeUint16(uint16(len(m.Key))) - buf.EncodeBytes(m.Key[:], 0) + buf.EncodeBytes(m.Key, 0) return buf.Bytes(), nil } func (m *ApplicationTLSKeyAdd) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.AppIndex = buf.DecodeUint32() m.KeyLen = buf.DecodeUint16() - copy(m.Key[:], buf.DecodeBytes(0)) + m.Key = make([]byte, m.KeyLen) + copy(m.Key, buf.DecodeBytes(len(m.Key))) return nil } @@ -777,27 +735,24 @@ func (*ApplicationTLSKeyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ApplicationTLSKeyAddReply) Size() int { +func (m *ApplicationTLSKeyAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ApplicationTLSKeyAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ApplicationTLSKeyAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -813,21 +768,18 @@ func (*SessionEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SessionEnableDisable) Size() int { +func (m *SessionEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable return size } func (m *SessionEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) return buf.Bytes(), nil } @@ -849,27 +801,24 @@ func (*SessionEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SessionEnableDisableReply) Size() int { +func (m *SessionEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SessionEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SessionEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -894,11 +843,10 @@ func (*SessionRuleAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SessionRuleAddDel) Size() int { +func (m *SessionRuleAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.TransportProto size += 1 // m.Lcl.Address.Af size += 1 * 16 // m.Lcl.Address.Un @@ -916,24 +864,22 @@ func (m *SessionRuleAddDel) Size() int { return size } func (m *SessionRuleAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.TransportProto)) buf.EncodeUint8(uint8(m.Lcl.Address.Af)) - buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Lcl.Len)) + buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Lcl.Len) buf.EncodeUint8(uint8(m.Rmt.Address.Af)) - buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Rmt.Len)) - buf.EncodeUint16(uint16(m.LclPort)) - buf.EncodeUint16(uint16(m.RmtPort)) - buf.EncodeUint32(uint32(m.ActionIndex)) + buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Rmt.Len) + buf.EncodeUint16(m.LclPort) + buf.EncodeUint16(m.RmtPort) + buf.EncodeUint32(m.ActionIndex) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.AppnsIndex)) + buf.EncodeUint32(m.AppnsIndex) buf.EncodeUint32(uint32(m.Scope)) buf.EncodeString(m.Tag, 64) return buf.Bytes(), nil @@ -969,27 +915,24 @@ func (*SessionRuleAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SessionRuleAddDelReply) Size() int { +func (m *SessionRuleAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SessionRuleAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SessionRuleAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -1013,11 +956,10 @@ func (*SessionRulesDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SessionRulesDetails) Size() int { +func (m *SessionRulesDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.TransportProto size += 1 // m.Lcl.Address.Af size += 1 * 16 // m.Lcl.Address.Un @@ -1034,23 +976,21 @@ func (m *SessionRulesDetails) Size() int { return size } func (m *SessionRulesDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.TransportProto)) buf.EncodeUint8(uint8(m.Lcl.Address.Af)) - buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Lcl.Len)) + buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Lcl.Len) buf.EncodeUint8(uint8(m.Rmt.Address.Af)) - buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Rmt.Len)) - buf.EncodeUint16(uint16(m.LclPort)) - buf.EncodeUint16(uint16(m.RmtPort)) - buf.EncodeUint32(uint32(m.ActionIndex)) - buf.EncodeUint32(uint32(m.AppnsIndex)) + buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Rmt.Len) + buf.EncodeUint16(m.LclPort) + buf.EncodeUint16(m.RmtPort) + buf.EncodeUint32(m.ActionIndex) + buf.EncodeUint32(m.AppnsIndex) buf.EncodeUint32(uint32(m.Scope)) buf.EncodeString(m.Tag, 64) return buf.Bytes(), nil @@ -1083,20 +1023,17 @@ func (*SessionRulesDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SessionRulesDump) Size() int { +func (m *SessionRulesDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SessionRulesDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SessionRulesDump) Unmarshal(b []byte) error { diff --git a/binapi/span/span.ba.go b/binapi/span/span.ba.go index 156a1d7..2dcbc37 100644 --- a/binapi/span/span.ba.go +++ b/binapi/span/span.ba.go @@ -79,11 +79,10 @@ func (*SwInterfaceSpanDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSpanDetails) Size() int { +func (m *SwInterfaceSpanDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndexFrom size += 4 // m.SwIfIndexTo size += 4 // m.State @@ -91,12 +90,10 @@ func (m *SwInterfaceSpanDetails) Size() int { return size } func (m *SwInterfaceSpanDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndexFrom)) buf.EncodeUint32(uint32(m.SwIfIndexTo)) buf.EncodeUint32(uint32(m.State)) @@ -124,21 +121,18 @@ func (*SwInterfaceSpanDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSpanDump) Size() int { +func (m *SwInterfaceSpanDump) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsL2 return size } func (m *SwInterfaceSpanDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsL2) return buf.Bytes(), nil } @@ -165,11 +159,10 @@ func (*SwInterfaceSpanEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSpanEnableDisable) Size() int { +func (m *SwInterfaceSpanEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndexFrom size += 4 // m.SwIfIndexTo size += 4 // m.State @@ -177,12 +170,10 @@ func (m *SwInterfaceSpanEnableDisable) Size() int { return size } func (m *SwInterfaceSpanEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndexFrom)) buf.EncodeUint32(uint32(m.SwIfIndexTo)) buf.EncodeUint32(uint32(m.State)) @@ -212,27 +203,24 @@ func (*SwInterfaceSpanEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSpanEnableDisableReply) Size() int { +func (m *SwInterfaceSpanEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSpanEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSpanEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/sr/sr.ba.go b/binapi/sr/sr.ba.go index d26f89b..2b98b8a 100644 --- a/binapi/sr/sr.ba.go +++ b/binapi/sr/sr.ba.go @@ -41,11 +41,11 @@ type Srv6SidList struct { // SrLocalsidAddDel defines message 'sr_localsid_add_del'. type SrLocalsidAddDel struct { - IsDel bool `binapi:"bool,name=is_del,default=%!s(bool=false)" json:"is_del,omitempty"` + IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"` Localsid ip_types.IP6Address `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"` EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"` Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"` - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"` FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"` @@ -58,11 +58,10 @@ func (*SrLocalsidAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrLocalsidAddDel) Size() int { +func (m *SrLocalsidAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsDel size += 1 * 16 // m.Localsid size += 1 // m.EndPsp @@ -75,21 +74,19 @@ func (m *SrLocalsidAddDel) Size() int { return size } func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsDel) buf.EncodeBytes(m.Localsid[:], 16) buf.EncodeBool(m.EndPsp) buf.EncodeUint8(uint8(m.Behavior)) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.VlanIndex)) - buf.EncodeUint32(uint32(m.FibTable)) + buf.EncodeUint32(m.VlanIndex) + buf.EncodeUint32(m.FibTable) buf.EncodeUint8(uint8(m.NhAddr.Af)) - buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *SrLocalsidAddDel) Unmarshal(b []byte) error { @@ -118,27 +115,24 @@ func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrLocalsidAddDelReply) Size() int { +func (m *SrLocalsidAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -160,11 +154,10 @@ func (*SrLocalsidsDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrLocalsidsDetails) Size() int { +func (m *SrLocalsidsDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.Addr size += 1 // m.EndPsp size += 1 // m.Behavior @@ -176,20 +169,18 @@ func (m *SrLocalsidsDetails) Size() int { return size } func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.Addr[:], 16) buf.EncodeBool(m.EndPsp) buf.EncodeUint8(uint8(m.Behavior)) - buf.EncodeUint32(uint32(m.FibTable)) - buf.EncodeUint32(uint32(m.VlanIndex)) + buf.EncodeUint32(m.FibTable) + buf.EncodeUint32(m.VlanIndex) buf.EncodeUint8(uint8(m.XconnectNhAddr.Af)) - buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.XconnectIfaceOrVrfTable)) + buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.XconnectIfaceOrVrfTable) return buf.Bytes(), nil } func (m *SrLocalsidsDetails) Unmarshal(b []byte) error { @@ -215,20 +206,17 @@ func (*SrLocalsidsDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrLocalsidsDump) Size() int { +func (m *SrLocalsidsDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SrLocalsidsDump) Unmarshal(b []byte) error { @@ -252,11 +240,10 @@ func (*SrPoliciesDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrPoliciesDetails) Size() int { +func (m *SrPoliciesDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.Bsid size += 1 // m.IsSpray size += 1 // m.IsEncap @@ -271,41 +258,30 @@ func (m *SrPoliciesDetails) Size() int { size += 1 // s1.NumSids size += 4 // s1.Weight for j2 := 0; j2 < 16; j2++ { - var s2 ip_types.IP6Address - _ = s2 - if j2 < len(s1.Sids) { - s2 = s1.Sids[j2] - } - size += 1 * 16 // s2 + size += 1 * 16 // s1.Sids[j2] } } return size } func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.Bsid[:], 16) buf.EncodeBool(m.IsSpray) buf.EncodeBool(m.IsEncap) - buf.EncodeUint32(uint32(m.FibTable)) + buf.EncodeUint32(m.FibTable) buf.EncodeUint8(uint8(len(m.SidLists))) for j0 := 0; j0 < len(m.SidLists); j0++ { - var v0 Srv6SidList + var v0 Srv6SidList // SidLists if j0 < len(m.SidLists) { v0 = m.SidLists[j0] } - buf.EncodeUint8(uint8(v0.NumSids)) - buf.EncodeUint32(uint32(v0.Weight)) + buf.EncodeUint8(v0.NumSids) + buf.EncodeUint32(v0.Weight) for j1 := 0; j1 < 16; j1++ { - var v1 ip_types.IP6Address - if j1 < len(v0.Sids) { - v1 = v0.Sids[j1] - } - buf.EncodeBytes(v1[:], 16) + buf.EncodeBytes(v0.Sids[j1][:], 16) } } return buf.Bytes(), nil @@ -317,7 +293,7 @@ func (m *SrPoliciesDetails) Unmarshal(b []byte) error { m.IsEncap = buf.DecodeBool() m.FibTable = buf.DecodeUint32() m.NumSidLists = buf.DecodeUint8() - m.SidLists = make([]Srv6SidList, int(m.NumSidLists)) + m.SidLists = make([]Srv6SidList, m.NumSidLists) for j0 := 0; j0 < len(m.SidLists); j0++ { m.SidLists[j0].NumSids = buf.DecodeUint8() m.SidLists[j0].Weight = buf.DecodeUint32() @@ -338,20 +314,17 @@ func (*SrPoliciesDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrPoliciesDump) Size() int { +func (m *SrPoliciesDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SrPoliciesDump) Unmarshal(b []byte) error { @@ -375,11 +348,10 @@ func (*SrPolicyAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrPolicyAdd) Size() int { +func (m *SrPolicyAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.BsidAddr size += 4 // m.Weight size += 1 // m.IsEncap @@ -388,35 +360,24 @@ func (m *SrPolicyAdd) Size() int { size += 1 // m.Sids.NumSids size += 4 // m.Sids.Weight for j2 := 0; j2 < 16; j2++ { - var s2 ip_types.IP6Address - _ = s2 - if j2 < len(m.Sids.Sids) { - s2 = m.Sids.Sids[j2] - } - size += 1 * 16 // s2 + size += 1 * 16 // m.Sids.Sids[j2] } return size } func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.BsidAddr[:], 16) - buf.EncodeUint32(uint32(m.Weight)) + buf.EncodeUint32(m.Weight) buf.EncodeBool(m.IsEncap) buf.EncodeBool(m.IsSpray) - buf.EncodeUint32(uint32(m.FibTable)) - buf.EncodeUint8(uint8(m.Sids.NumSids)) - buf.EncodeUint32(uint32(m.Sids.Weight)) + buf.EncodeUint32(m.FibTable) + buf.EncodeUint8(m.Sids.NumSids) + buf.EncodeUint32(m.Sids.Weight) for j1 := 0; j1 < 16; j1++ { - var v1 ip_types.IP6Address - if j1 < len(m.Sids.Sids) { - v1 = m.Sids.Sids[j1] - } - buf.EncodeBytes(v1[:], 16) + buf.EncodeBytes(m.Sids.Sids[j1][:], 16) } return buf.Bytes(), nil } @@ -447,27 +408,24 @@ func (*SrPolicyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrPolicyAddReply) Size() int { +func (m *SrPolicyAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrPolicyAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -484,24 +442,21 @@ func (*SrPolicyDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrPolicyDel) Size() int { +func (m *SrPolicyDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.BsidAddr size += 4 // m.SrPolicyIndex return size } func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.BsidAddr[:], 16) - buf.EncodeUint32(uint32(m.SrPolicyIndex)) + buf.EncodeUint32(m.SrPolicyIndex) return buf.Bytes(), nil } func (m *SrPolicyDel) Unmarshal(b []byte) error { @@ -523,27 +478,24 @@ func (*SrPolicyDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrPolicyDelReply) Size() int { +func (m *SrPolicyDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrPolicyDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -565,11 +517,10 @@ func (*SrPolicyMod) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrPolicyMod) Size() int { +func (m *SrPolicyMod) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.BsidAddr size += 4 // m.SrPolicyIndex size += 4 // m.FibTable @@ -579,36 +530,25 @@ func (m *SrPolicyMod) Size() int { size += 1 // m.Sids.NumSids size += 4 // m.Sids.Weight for j2 := 0; j2 < 16; j2++ { - var s2 ip_types.IP6Address - _ = s2 - if j2 < len(m.Sids.Sids) { - s2 = m.Sids.Sids[j2] - } - size += 1 * 16 // s2 + size += 1 * 16 // m.Sids.Sids[j2] } return size } func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.BsidAddr[:], 16) - buf.EncodeUint32(uint32(m.SrPolicyIndex)) - buf.EncodeUint32(uint32(m.FibTable)) + buf.EncodeUint32(m.SrPolicyIndex) + buf.EncodeUint32(m.FibTable) buf.EncodeUint8(uint8(m.Operation)) - buf.EncodeUint32(uint32(m.SlIndex)) - buf.EncodeUint32(uint32(m.Weight)) - buf.EncodeUint8(uint8(m.Sids.NumSids)) - buf.EncodeUint32(uint32(m.Sids.Weight)) + buf.EncodeUint32(m.SlIndex) + buf.EncodeUint32(m.Weight) + buf.EncodeUint8(m.Sids.NumSids) + buf.EncodeUint32(m.Sids.Weight) for j1 := 0; j1 < 16; j1++ { - var v1 ip_types.IP6Address - if j1 < len(m.Sids.Sids) { - v1 = m.Sids.Sids[j1] - } - buf.EncodeBytes(v1[:], 16) + buf.EncodeBytes(m.Sids.Sids[j1][:], 16) } return buf.Bytes(), nil } @@ -640,27 +580,24 @@ func (*SrPolicyModReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrPolicyModReply) Size() int { +func (m *SrPolicyModReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrPolicyModReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -676,22 +613,19 @@ func (*SrSetEncapHopLimit) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrSetEncapHopLimit) Size() int { +func (m *SrSetEncapHopLimit) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.HopLimit return size } func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.HopLimit)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.HopLimit) return buf.Bytes(), nil } func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error { @@ -712,27 +646,24 @@ func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrSetEncapHopLimitReply) Size() int { +func (m *SrSetEncapHopLimitReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -748,21 +679,18 @@ func (*SrSetEncapSource) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrSetEncapSource) Size() int { +func (m *SrSetEncapSource) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 16 // m.EncapsSource return size } func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.EncapsSource[:], 16) return buf.Bytes(), nil } @@ -784,33 +712,30 @@ func (*SrSetEncapSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrSetEncapSourceReply) Size() int { +func (m *SrSetEncapSourceReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } // SrSteeringAddDel defines message 'sr_steering_add_del'. type SrSteeringAddDel struct { - IsDel bool `binapi:"bool,name=is_del,default=%!s(bool=false)" json:"is_del,omitempty"` + IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"` BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` @@ -826,11 +751,10 @@ func (*SrSteeringAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrSteeringAddDel) Size() int { +func (m *SrSteeringAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsDel size += 1 * 16 // m.BsidAddr size += 4 // m.SrPolicyIndex @@ -843,19 +767,17 @@ func (m *SrSteeringAddDel) Size() int { return size } func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsDel) buf.EncodeBytes(m.BsidAddr[:], 16) - buf.EncodeUint32(uint32(m.SrPolicyIndex)) - buf.EncodeUint32(uint32(m.TableID)) + buf.EncodeUint32(m.SrPolicyIndex) + buf.EncodeUint32(m.TableID) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.TrafficType)) return buf.Bytes(), nil @@ -886,27 +808,24 @@ func (*SrSteeringAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrSteeringAddDelReply) Size() int { +func (m *SrSteeringAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -926,11 +845,10 @@ func (*SrSteeringPolDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrSteeringPolDetails) Size() int { +func (m *SrSteeringPolDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.TrafficType size += 4 // m.FibTable size += 1 // m.Prefix.Address.Af @@ -941,17 +859,15 @@ func (m *SrSteeringPolDetails) Size() int { return size } func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.TrafficType)) - buf.EncodeUint32(uint32(m.FibTable)) + buf.EncodeUint32(m.FibTable) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBytes(m.Bsid[:], 16) return buf.Bytes(), nil @@ -978,20 +894,17 @@ func (*SrSteeringPolDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrSteeringPolDump) Size() int { +func (m *SrSteeringPolDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SrSteeringPolDump) Unmarshal(b []byte) error { diff --git a/binapi/sr_mpls/sr_mpls.ba.go b/binapi/sr_mpls/sr_mpls.ba.go index c34522d..e6bd9f0 100644 --- a/binapi/sr_mpls/sr_mpls.ba.go +++ b/binapi/sr_mpls/sr_mpls.ba.go @@ -47,11 +47,10 @@ func (*SrMplsPolicyAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrMplsPolicyAdd) Size() int { +func (m *SrMplsPolicyAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Bsid size += 4 // m.Weight size += 1 // m.IsSpray @@ -60,14 +59,12 @@ func (m *SrMplsPolicyAdd) Size() int { return size } func (m *SrMplsPolicyAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Bsid)) - buf.EncodeUint32(uint32(m.Weight)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Bsid) + buf.EncodeUint32(m.Weight) buf.EncodeBool(m.IsSpray) buf.EncodeUint8(uint8(len(m.Segments))) for i := 0; i < len(m.Segments); i++ { @@ -75,7 +72,7 @@ func (m *SrMplsPolicyAdd) Marshal(b []byte) ([]byte, error) { if i < len(m.Segments) { x = uint32(m.Segments[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } @@ -104,27 +101,24 @@ func (*SrMplsPolicyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrMplsPolicyAddReply) Size() int { +func (m *SrMplsPolicyAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrMplsPolicyAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrMplsPolicyAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -144,11 +138,10 @@ func (*SrMplsPolicyAssignEndpointColor) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrMplsPolicyAssignEndpointColor) Size() int { +func (m *SrMplsPolicyAssignEndpointColor) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Bsid size += 1 // m.Endpoint.Af size += 1 * 16 // m.Endpoint.Un @@ -156,16 +149,14 @@ func (m *SrMplsPolicyAssignEndpointColor) Size() int { return size } func (m *SrMplsPolicyAssignEndpointColor) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Bsid)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Bsid) buf.EncodeUint8(uint8(m.Endpoint.Af)) - buf.EncodeBytes(m.Endpoint.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Color)) + buf.EncodeBytes(m.Endpoint.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.Color) return buf.Bytes(), nil } func (m *SrMplsPolicyAssignEndpointColor) Unmarshal(b []byte) error { @@ -191,27 +182,24 @@ func (*SrMplsPolicyAssignEndpointColorReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrMplsPolicyAssignEndpointColorReply) Size() int { +func (m *SrMplsPolicyAssignEndpointColorReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrMplsPolicyAssignEndpointColorReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrMplsPolicyAssignEndpointColorReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -227,22 +215,19 @@ func (*SrMplsPolicyDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrMplsPolicyDel) Size() int { +func (m *SrMplsPolicyDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Bsid return size } func (m *SrMplsPolicyDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Bsid)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Bsid) return buf.Bytes(), nil } func (m *SrMplsPolicyDel) Unmarshal(b []byte) error { @@ -263,27 +248,24 @@ func (*SrMplsPolicyDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrMplsPolicyDelReply) Size() int { +func (m *SrMplsPolicyDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrMplsPolicyDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrMplsPolicyDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -304,11 +286,10 @@ func (*SrMplsPolicyMod) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrMplsPolicyMod) Size() int { +func (m *SrMplsPolicyMod) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Bsid size += 1 // m.Operation size += 4 // m.SlIndex @@ -318,23 +299,21 @@ func (m *SrMplsPolicyMod) Size() int { return size } func (m *SrMplsPolicyMod) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Bsid)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Bsid) buf.EncodeUint8(uint8(m.Operation)) - buf.EncodeUint32(uint32(m.SlIndex)) - buf.EncodeUint32(uint32(m.Weight)) + buf.EncodeUint32(m.SlIndex) + buf.EncodeUint32(m.Weight) buf.EncodeUint8(uint8(len(m.Segments))) for i := 0; i < len(m.Segments); i++ { var x uint32 if i < len(m.Segments) { x = uint32(m.Segments[i]) } - buf.EncodeUint32(uint32(x)) + buf.EncodeUint32(x) } return buf.Bytes(), nil } @@ -364,33 +343,30 @@ func (*SrMplsPolicyModReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrMplsPolicyModReply) Size() int { +func (m *SrMplsPolicyModReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrMplsPolicyModReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrMplsPolicyModReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } // SrMplsSteeringAddDel defines message 'sr_mpls_steering_add_del'. type SrMplsSteeringAddDel struct { - IsDel bool `binapi:"bool,name=is_del,default=%!s(bool=false)" json:"is_del,omitempty"` + IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"` Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"` TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` @@ -408,11 +384,10 @@ func (*SrMplsSteeringAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SrMplsSteeringAddDel) Size() int { +func (m *SrMplsSteeringAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsDel size += 4 // m.Bsid size += 4 // m.TableID @@ -428,24 +403,22 @@ func (m *SrMplsSteeringAddDel) Size() int { return size } func (m *SrMplsSteeringAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsDel) - buf.EncodeUint32(uint32(m.Bsid)) - buf.EncodeUint32(uint32(m.TableID)) + buf.EncodeUint32(m.Bsid) + buf.EncodeUint32(m.TableID) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) - buf.EncodeUint32(uint32(m.MaskWidth)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) + buf.EncodeUint32(m.MaskWidth) buf.EncodeUint8(uint8(m.NextHop.Af)) - buf.EncodeBytes(m.NextHop.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Color)) - buf.EncodeUint8(uint8(m.CoBits)) - buf.EncodeUint32(uint32(m.VPNLabel)) + buf.EncodeBytes(m.NextHop.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.Color) + buf.EncodeUint8(m.CoBits) + buf.EncodeUint32(m.VPNLabel) return buf.Bytes(), nil } func (m *SrMplsSteeringAddDel) Unmarshal(b []byte) error { @@ -477,27 +450,24 @@ func (*SrMplsSteeringAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SrMplsSteeringAddDelReply) Size() int { +func (m *SrMplsSteeringAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SrMplsSteeringAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SrMplsSteeringAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/stn/stn.ba.go b/binapi/stn/stn.ba.go index 34cb419..b44adf5 100644 --- a/binapi/stn/stn.ba.go +++ b/binapi/stn/stn.ba.go @@ -44,11 +44,10 @@ func (*StnAddDelRule) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *StnAddDelRule) Size() int { +func (m *StnAddDelRule) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un size += 4 // m.SwIfIndex @@ -56,14 +55,12 @@ func (m *StnAddDelRule) Size() int { return size } func (m *StnAddDelRule) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil @@ -89,27 +86,24 @@ func (*StnAddDelRuleReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *StnAddDelRuleReply) Size() int { +func (m *StnAddDelRuleReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *StnAddDelRuleReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *StnAddDelRuleReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -126,25 +120,22 @@ func (*StnRulesDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *StnRulesDetails) Size() int { +func (m *StnRulesDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un size += 4 // m.SwIfIndex return size } func (m *StnRulesDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -166,20 +157,17 @@ func (*StnRulesDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *StnRulesDump) Size() int { +func (m *StnRulesDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *StnRulesDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *StnRulesDump) Unmarshal(b []byte) error { diff --git a/binapi/svs/svs.ba.go b/binapi/svs/svs.ba.go index 06573cc..911e936 100644 --- a/binapi/svs/svs.ba.go +++ b/binapi/svs/svs.ba.go @@ -44,24 +44,21 @@ func (*SvsDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SvsDetails) Size() int { +func (m *SvsDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TableID size += 4 // m.SwIfIndex size += 1 // m.Af return size } func (m *SvsDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Af)) return buf.Bytes(), nil @@ -84,20 +81,17 @@ func (*SvsDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SvsDump) Size() int { +func (m *SvsDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SvsDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SvsDump) Unmarshal(b []byte) error { @@ -119,11 +113,10 @@ func (*SvsEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SvsEnableDisable) Size() int { +func (m *SvsEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsEnable size += 1 // m.Af size += 4 // m.TableID @@ -131,15 +124,13 @@ func (m *SvsEnableDisable) Size() int { return size } func (m *SvsEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsEnable) buf.EncodeUint8(uint8(m.Af)) - buf.EncodeUint32(uint32(m.TableID)) + buf.EncodeUint32(m.TableID) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -164,27 +155,24 @@ func (*SvsEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SvsEnableDisableReply) Size() int { +func (m *SvsEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SvsEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SvsEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -198,20 +186,17 @@ func (*SvsPluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SvsPluginGetVersion) Size() int { +func (m *SvsPluginGetVersion) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SvsPluginGetVersion) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SvsPluginGetVersion) Unmarshal(b []byte) error { @@ -231,24 +216,21 @@ func (*SvsPluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SvsPluginGetVersionReply) Size() int { +func (m *SvsPluginGetVersionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Major size += 4 // m.Minor return size } func (m *SvsPluginGetVersionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Major)) - buf.EncodeUint32(uint32(m.Minor)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Major) + buf.EncodeUint32(m.Minor) return buf.Bytes(), nil } func (m *SvsPluginGetVersionReply) Unmarshal(b []byte) error { @@ -273,11 +255,10 @@ func (*SvsRouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SvsRouteAddDel) Size() int { +func (m *SvsRouteAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Prefix.Address.Af size += 1 * 16 // m.Prefix.Address.Un @@ -287,18 +268,16 @@ func (m *SvsRouteAddDel) Size() int { return size } func (m *SvsRouteAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Prefix.Address.Af)) - buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0) - buf.EncodeUint8(uint8(m.Prefix.Len)) - buf.EncodeUint32(uint32(m.TableID)) - buf.EncodeUint32(uint32(m.SourceTableID)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) + buf.EncodeUint32(m.TableID) + buf.EncodeUint32(m.SourceTableID) return buf.Bytes(), nil } func (m *SvsRouteAddDel) Unmarshal(b []byte) error { @@ -324,27 +303,24 @@ func (*SvsRouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SvsRouteAddDelReply) Size() int { +func (m *SvsRouteAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SvsRouteAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SvsRouteAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -362,26 +338,23 @@ func (*SvsTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SvsTableAddDel) Size() int { +func (m *SvsTableAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 1 // m.Af size += 4 // m.TableID return size } func (m *SvsTableAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint8(uint8(m.Af)) - buf.EncodeUint32(uint32(m.TableID)) + buf.EncodeUint32(m.TableID) return buf.Bytes(), nil } func (m *SvsTableAddDel) Unmarshal(b []byte) error { @@ -404,27 +377,24 @@ func (*SvsTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SvsTableAddDelReply) Size() int { +func (m *SvsTableAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SvsTableAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SvsTableAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/syslog/syslog.ba.go b/binapi/syslog/syslog.ba.go index c6d78dc..c9bdab7 100644 --- a/binapi/syslog/syslog.ba.go +++ b/binapi/syslog/syslog.ba.go @@ -86,20 +86,17 @@ func (*SyslogGetFilter) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SyslogGetFilter) Size() int { +func (m *SyslogGetFilter) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SyslogGetFilter) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SyslogGetFilter) Unmarshal(b []byte) error { @@ -119,29 +116,26 @@ func (*SyslogGetFilterReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SyslogGetFilterReply) Size() int { +func (m *SyslogGetFilterReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Severity return size } func (m *SyslogGetFilterReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.Severity)) return buf.Bytes(), nil } func (m *SyslogGetFilterReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Severity = SyslogSeverity(buf.DecodeUint32()) return nil } @@ -156,20 +150,17 @@ func (*SyslogGetSender) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SyslogGetSender) Size() int { +func (m *SyslogGetSender) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SyslogGetSender) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SyslogGetSender) Unmarshal(b []byte) error { @@ -193,11 +184,10 @@ func (*SyslogGetSenderReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SyslogGetSenderReply) Size() int { +func (m *SyslogGetSenderReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 * 4 // m.SrcAddress size += 1 * 4 // m.CollectorAddress @@ -207,23 +197,21 @@ func (m *SyslogGetSenderReply) Size() int { return size } func (m *SyslogGetSenderReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeBytes(m.SrcAddress[:], 4) buf.EncodeBytes(m.CollectorAddress[:], 4) - buf.EncodeUint16(uint16(m.CollectorPort)) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint32(uint32(m.MaxMsgSize)) + buf.EncodeUint16(m.CollectorPort) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint32(m.MaxMsgSize) return buf.Bytes(), nil } func (m *SyslogGetSenderReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() copy(m.SrcAddress[:], buf.DecodeBytes(4)) copy(m.CollectorAddress[:], buf.DecodeBytes(4)) m.CollectorPort = buf.DecodeUint16() @@ -244,21 +232,18 @@ func (*SyslogSetFilter) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SyslogSetFilter) Size() int { +func (m *SyslogSetFilter) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Severity return size } func (m *SyslogSetFilter) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Severity)) return buf.Bytes(), nil } @@ -280,27 +265,24 @@ func (*SyslogSetFilterReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SyslogSetFilterReply) Size() int { +func (m *SyslogSetFilterReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SyslogSetFilterReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SyslogSetFilterReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -308,9 +290,9 @@ func (m *SyslogSetFilterReply) Unmarshal(b []byte) error { type SyslogSetSender struct { SrcAddress ip_types.IP4Address `binapi:"ip4_address,name=src_address" json:"src_address,omitempty"` CollectorAddress ip_types.IP4Address `binapi:"ip4_address,name=collector_address" json:"collector_address,omitempty"` - CollectorPort uint16 `binapi:"u16,name=collector_port,default=%!s(float64=514)" json:"collector_port,omitempty"` + CollectorPort uint16 `binapi:"u16,name=collector_port,default=514" json:"collector_port,omitempty"` VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` - MaxMsgSize uint32 `binapi:"u32,name=max_msg_size,default=%!s(float64=480)" json:"max_msg_size,omitempty"` + MaxMsgSize uint32 `binapi:"u32,name=max_msg_size,default=480" json:"max_msg_size,omitempty"` } func (m *SyslogSetSender) Reset() { *m = SyslogSetSender{} } @@ -320,11 +302,10 @@ func (*SyslogSetSender) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SyslogSetSender) Size() int { +func (m *SyslogSetSender) Size() (size int) { if m == nil { return 0 } - var size int size += 1 * 4 // m.SrcAddress size += 1 * 4 // m.CollectorAddress size += 2 // m.CollectorPort @@ -333,17 +314,15 @@ func (m *SyslogSetSender) Size() int { return size } func (m *SyslogSetSender) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBytes(m.SrcAddress[:], 4) buf.EncodeBytes(m.CollectorAddress[:], 4) - buf.EncodeUint16(uint16(m.CollectorPort)) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint32(uint32(m.MaxMsgSize)) + buf.EncodeUint16(m.CollectorPort) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint32(m.MaxMsgSize) return buf.Bytes(), nil } func (m *SyslogSetSender) Unmarshal(b []byte) error { @@ -368,27 +347,24 @@ func (*SyslogSetSenderReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SyslogSetSenderReply) Size() int { +func (m *SyslogSetSenderReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SyslogSetSenderReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SyslogSetSenderReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/tapv2/tapv2.ba.go b/binapi/tapv2/tapv2.ba.go index e19b556..3745c83 100644 --- a/binapi/tapv2/tapv2.ba.go +++ b/binapi/tapv2/tapv2.ba.go @@ -115,11 +115,10 @@ func (*SwInterfaceTapV2Details) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceTapV2Details) Size() int { +func (m *SwInterfaceTapV2Details) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.ID size += 2 // m.TxRingSz @@ -138,22 +137,20 @@ func (m *SwInterfaceTapV2Details) Size() int { return size } func (m *SwInterfaceTapV2Details) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.ID)) - buf.EncodeUint16(uint16(m.TxRingSz)) - buf.EncodeUint16(uint16(m.RxRingSz)) - buf.EncodeUint32(uint32(m.HostMtuSize)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SwIfIndex) + buf.EncodeUint32(m.ID) + buf.EncodeUint16(m.TxRingSz) + buf.EncodeUint16(m.RxRingSz) + buf.EncodeUint32(m.HostMtuSize) buf.EncodeBytes(m.HostMacAddr[:], 6) buf.EncodeBytes(m.HostIP4Prefix.Address[:], 4) - buf.EncodeUint8(uint8(m.HostIP4Prefix.Len)) + buf.EncodeUint8(m.HostIP4Prefix.Len) buf.EncodeBytes(m.HostIP6Prefix.Address[:], 16) - buf.EncodeUint8(uint8(m.HostIP6Prefix.Len)) + buf.EncodeUint8(m.HostIP6Prefix.Len) buf.EncodeUint32(uint32(m.TapFlags)) buf.EncodeString(m.DevName, 64) buf.EncodeString(m.HostIfName, 64) @@ -183,7 +180,7 @@ func (m *SwInterfaceTapV2Details) Unmarshal(b []byte) error { // SwInterfaceTapV2Dump defines message 'sw_interface_tap_v2_dump'. type SwInterfaceTapV2Dump struct { - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` } func (m *SwInterfaceTapV2Dump) Reset() { *m = SwInterfaceTapV2Dump{} } @@ -193,21 +190,18 @@ func (*SwInterfaceTapV2Dump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceTapV2Dump) Size() int { +func (m *SwInterfaceTapV2Dump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *SwInterfaceTapV2Dump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -219,12 +213,12 @@ func (m *SwInterfaceTapV2Dump) Unmarshal(b []byte) error { // TapCreateV2 defines message 'tap_create_v2'. type TapCreateV2 struct { - ID uint32 `binapi:"u32,name=id,default=%!s(float64=4.294967295e+09)" json:"id,omitempty"` + ID uint32 `binapi:"u32,name=id,default=4294967295" json:"id,omitempty"` UseRandomMac bool `binapi:"bool,name=use_random_mac,default=true" json:"use_random_mac,omitempty"` MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` - NumRxQueues uint8 `binapi:"u8,name=num_rx_queues,default=%!s(float64=1)" json:"num_rx_queues,omitempty"` - TxRingSz uint16 `binapi:"u16,name=tx_ring_sz,default=%!s(float64=256)" json:"tx_ring_sz,omitempty"` - RxRingSz uint16 `binapi:"u16,name=rx_ring_sz,default=%!s(float64=256)" json:"rx_ring_sz,omitempty"` + NumRxQueues uint8 `binapi:"u8,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"` + TxRingSz uint16 `binapi:"u16,name=tx_ring_sz,default=256" json:"tx_ring_sz,omitempty"` + RxRingSz uint16 `binapi:"u16,name=rx_ring_sz,default=256" json:"rx_ring_sz,omitempty"` HostMtuSet bool `binapi:"bool,name=host_mtu_set" json:"host_mtu_set,omitempty"` HostMtuSize uint32 `binapi:"u32,name=host_mtu_size" json:"host_mtu_size,omitempty"` HostMacAddrSet bool `binapi:"bool,name=host_mac_addr_set" json:"host_mac_addr_set,omitempty"` @@ -254,11 +248,10 @@ func (*TapCreateV2) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TapCreateV2) Size() int { +func (m *TapCreateV2) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ID size += 1 // m.UseRandomMac size += 1 * 6 // m.MacAddress @@ -290,28 +283,26 @@ func (m *TapCreateV2) Size() int { return size } func (m *TapCreateV2) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ID) buf.EncodeBool(m.UseRandomMac) buf.EncodeBytes(m.MacAddress[:], 6) - buf.EncodeUint8(uint8(m.NumRxQueues)) - buf.EncodeUint16(uint16(m.TxRingSz)) - buf.EncodeUint16(uint16(m.RxRingSz)) + buf.EncodeUint8(m.NumRxQueues) + buf.EncodeUint16(m.TxRingSz) + buf.EncodeUint16(m.RxRingSz) buf.EncodeBool(m.HostMtuSet) - buf.EncodeUint32(uint32(m.HostMtuSize)) + buf.EncodeUint32(m.HostMtuSize) buf.EncodeBool(m.HostMacAddrSet) buf.EncodeBytes(m.HostMacAddr[:], 6) buf.EncodeBool(m.HostIP4PrefixSet) buf.EncodeBytes(m.HostIP4Prefix.Address[:], 4) - buf.EncodeUint8(uint8(m.HostIP4Prefix.Len)) + buf.EncodeUint8(m.HostIP4Prefix.Len) buf.EncodeBool(m.HostIP6PrefixSet) buf.EncodeBytes(m.HostIP6Prefix.Address[:], 16) - buf.EncodeUint8(uint8(m.HostIP6Prefix.Len)) + buf.EncodeUint8(m.HostIP6Prefix.Len) buf.EncodeBool(m.HostIP4GwSet) buf.EncodeBytes(m.HostIP4Gw[:], 4) buf.EncodeBool(m.HostIP6GwSet) @@ -372,29 +363,26 @@ func (*TapCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *TapCreateV2Reply) Size() int { +func (m *TapCreateV2Reply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *TapCreateV2Reply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *TapCreateV2Reply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -411,21 +399,18 @@ func (*TapDeleteV2) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TapDeleteV2) Size() int { +func (m *TapDeleteV2) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *TapDeleteV2) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -447,27 +432,24 @@ func (*TapDeleteV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *TapDeleteV2Reply) Size() int { +func (m *TapDeleteV2Reply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *TapDeleteV2Reply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *TapDeleteV2Reply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/tcp/tcp.ba.go b/binapi/tcp/tcp.ba.go index 89571c4..7ae3ecc 100644 --- a/binapi/tcp/tcp.ba.go +++ b/binapi/tcp/tcp.ba.go @@ -43,11 +43,10 @@ func (*TCPConfigureSrcAddresses) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TCPConfigureSrcAddresses) Size() int { +func (m *TCPConfigureSrcAddresses) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.VrfID size += 1 // m.FirstAddress.Af size += 1 * 16 // m.FirstAddress.Un @@ -56,17 +55,15 @@ func (m *TCPConfigureSrcAddresses) Size() int { return size } func (m *TCPConfigureSrcAddresses) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.VrfID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.VrfID) buf.EncodeUint8(uint8(m.FirstAddress.Af)) - buf.EncodeBytes(m.FirstAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.FirstAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.LastAddress.Af)) - buf.EncodeBytes(m.LastAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.LastAddress.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *TCPConfigureSrcAddresses) Unmarshal(b []byte) error { @@ -93,27 +90,24 @@ func (*TCPConfigureSrcAddressesReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *TCPConfigureSrcAddressesReply) Size() int { +func (m *TCPConfigureSrcAddressesReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *TCPConfigureSrcAddressesReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *TCPConfigureSrcAddressesReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/teib/teib.ba.go b/binapi/teib/teib.ba.go index 9c216bf..d37f391 100644 --- a/binapi/teib/teib.ba.go +++ b/binapi/teib/teib.ba.go @@ -51,11 +51,10 @@ func (*TeibDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *TeibDetails) Size() int { +func (m *TeibDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Entry.SwIfIndex size += 1 // m.Entry.Peer.Af size += 1 * 16 // m.Entry.Peer.Un @@ -65,18 +64,16 @@ func (m *TeibDetails) Size() int { return size } func (m *TeibDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Entry.SwIfIndex)) buf.EncodeUint8(uint8(m.Entry.Peer.Af)) - buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.Nh.Af)) - buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Entry.NhTableID)) + buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.Entry.NhTableID) return buf.Bytes(), nil } func (m *TeibDetails) Unmarshal(b []byte) error { @@ -100,20 +97,17 @@ func (*TeibDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TeibDump) Size() int { +func (m *TeibDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *TeibDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *TeibDump) Unmarshal(b []byte) error { @@ -133,11 +127,10 @@ func (*TeibEntryAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TeibEntryAddDel) Size() int { +func (m *TeibEntryAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Entry.SwIfIndex size += 1 // m.Entry.Peer.Af @@ -148,19 +141,17 @@ func (m *TeibEntryAddDel) Size() int { return size } func (m *TeibEntryAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.IsAdd)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.IsAdd) buf.EncodeUint32(uint32(m.Entry.SwIfIndex)) buf.EncodeUint8(uint8(m.Entry.Peer.Af)) - buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.Nh.Af)) - buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Entry.NhTableID)) + buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.Entry.NhTableID) return buf.Bytes(), nil } func (m *TeibEntryAddDel) Unmarshal(b []byte) error { @@ -187,27 +178,24 @@ func (*TeibEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *TeibEntryAddDelReply) Size() int { +func (m *TeibEntryAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *TeibEntryAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *TeibEntryAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/tls_openssl/tls_openssl.ba.go b/binapi/tls_openssl/tls_openssl.ba.go index b4293fd..938a9df 100644 --- a/binapi/tls_openssl/tls_openssl.ba.go +++ b/binapi/tls_openssl/tls_openssl.ba.go @@ -43,11 +43,10 @@ func (*TLSOpensslSetEngine) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TLSOpensslSetEngine) Size() int { +func (m *TLSOpensslSetEngine) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.AsyncEnable size += 1 * 64 // m.Engine size += 1 * 64 // m.Algorithm @@ -55,24 +54,25 @@ func (m *TLSOpensslSetEngine) Size() int { return size } func (m *TLSOpensslSetEngine) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.AsyncEnable)) - buf.EncodeBytes(m.Engine[:], 64) - buf.EncodeBytes(m.Algorithm[:], 64) - buf.EncodeBytes(m.Ciphers[:], 64) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.AsyncEnable) + buf.EncodeBytes(m.Engine, 64) + buf.EncodeBytes(m.Algorithm, 64) + buf.EncodeBytes(m.Ciphers, 64) return buf.Bytes(), nil } func (m *TLSOpensslSetEngine) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.AsyncEnable = buf.DecodeUint32() - copy(m.Engine[:], buf.DecodeBytes(64)) - copy(m.Algorithm[:], buf.DecodeBytes(64)) - copy(m.Ciphers[:], buf.DecodeBytes(64)) + m.Engine = make([]byte, 64) + copy(m.Engine, buf.DecodeBytes(len(m.Engine))) + m.Algorithm = make([]byte, 64) + copy(m.Algorithm, buf.DecodeBytes(len(m.Algorithm))) + m.Ciphers = make([]byte, 64) + copy(m.Ciphers, buf.DecodeBytes(len(m.Ciphers))) return nil } @@ -88,27 +88,24 @@ func (*TLSOpensslSetEngineReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *TLSOpensslSetEngineReply) Size() int { +func (m *TLSOpensslSetEngineReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *TLSOpensslSetEngineReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *TLSOpensslSetEngineReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/trace/trace.ba.go b/binapi/trace/trace.ba.go index 25db789..9bc330b 100644 --- a/binapi/trace/trace.ba.go +++ b/binapi/trace/trace.ba.go @@ -44,11 +44,10 @@ func (*TraceProfileAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TraceProfileAdd) Size() int { +func (m *TraceProfileAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.TraceType size += 1 // m.NumElts size += 1 // m.TraceTsp @@ -57,17 +56,15 @@ func (m *TraceProfileAdd) Size() int { return size } func (m *TraceProfileAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.TraceType)) - buf.EncodeUint8(uint8(m.NumElts)) - buf.EncodeUint8(uint8(m.TraceTsp)) - buf.EncodeUint32(uint32(m.NodeID)) - buf.EncodeUint32(uint32(m.AppData)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.TraceType) + buf.EncodeUint8(m.NumElts) + buf.EncodeUint8(m.TraceTsp) + buf.EncodeUint32(m.NodeID) + buf.EncodeUint32(m.AppData) return buf.Bytes(), nil } func (m *TraceProfileAdd) Unmarshal(b []byte) error { @@ -92,27 +89,24 @@ func (*TraceProfileAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *TraceProfileAddReply) Size() int { +func (m *TraceProfileAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *TraceProfileAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *TraceProfileAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -126,20 +120,17 @@ func (*TraceProfileDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TraceProfileDel) Size() int { +func (m *TraceProfileDel) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *TraceProfileDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *TraceProfileDel) Unmarshal(b []byte) error { @@ -158,27 +149,24 @@ func (*TraceProfileDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *TraceProfileDelReply) Size() int { +func (m *TraceProfileDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *TraceProfileDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *TraceProfileDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -192,20 +180,17 @@ func (*TraceProfileShowConfig) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *TraceProfileShowConfig) Size() int { +func (m *TraceProfileShowConfig) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *TraceProfileShowConfig) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *TraceProfileShowConfig) Unmarshal(b []byte) error { @@ -229,11 +214,10 @@ func (*TraceProfileShowConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *TraceProfileShowConfigReply) Size() int { +func (m *TraceProfileShowConfigReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 1 // m.TraceType size += 1 // m.NumElts @@ -243,23 +227,21 @@ func (m *TraceProfileShowConfigReply) Size() int { return size } func (m *TraceProfileShowConfigReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint8(uint8(m.TraceType)) - buf.EncodeUint8(uint8(m.NumElts)) - buf.EncodeUint8(uint8(m.TraceTsp)) - buf.EncodeUint32(uint32(m.NodeID)) - buf.EncodeUint32(uint32(m.AppData)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint8(m.TraceType) + buf.EncodeUint8(m.NumElts) + buf.EncodeUint8(m.TraceTsp) + buf.EncodeUint32(m.NodeID) + buf.EncodeUint32(m.AppData) return buf.Bytes(), nil } func (m *TraceProfileShowConfigReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.TraceType = buf.DecodeUint8() m.NumElts = buf.DecodeUint8() m.TraceTsp = buf.DecodeUint8() diff --git a/binapi/udp/udp.ba.go b/binapi/udp/udp.ba.go index 2582afb..7795100 100644 --- a/binapi/udp/udp.ba.go +++ b/binapi/udp/udp.ba.go @@ -52,11 +52,10 @@ func (*UDPEncapAdd) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *UDPEncapAdd) Size() int { +func (m *UDPEncapAdd) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.UDPEncap.TableID size += 2 // m.UDPEncap.SrcPort size += 2 // m.UDPEncap.DstPort @@ -68,20 +67,18 @@ func (m *UDPEncapAdd) Size() int { return size } func (m *UDPEncapAdd) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.UDPEncap.TableID)) - buf.EncodeUint16(uint16(m.UDPEncap.SrcPort)) - buf.EncodeUint16(uint16(m.UDPEncap.DstPort)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.UDPEncap.TableID) + buf.EncodeUint16(m.UDPEncap.SrcPort) + buf.EncodeUint16(m.UDPEncap.DstPort) buf.EncodeUint8(uint8(m.UDPEncap.SrcIP.Af)) - buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.UDPEncap.DstIP.Af)) - buf.EncodeBytes(m.UDPEncap.DstIP.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.UDPEncap.ID)) + buf.EncodeBytes(m.UDPEncap.DstIP.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.UDPEncap.ID) return buf.Bytes(), nil } func (m *UDPEncapAdd) Unmarshal(b []byte) error { @@ -110,29 +107,26 @@ func (*UDPEncapAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *UDPEncapAddReply) Size() int { +func (m *UDPEncapAddReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.ID return size } func (m *UDPEncapAddReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ID) return buf.Bytes(), nil } func (m *UDPEncapAddReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ID = buf.DecodeUint32() return nil } @@ -149,22 +143,19 @@ func (*UDPEncapDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *UDPEncapDel) Size() int { +func (m *UDPEncapDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.ID return size } func (m *UDPEncapDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.ID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ID) return buf.Bytes(), nil } func (m *UDPEncapDel) Unmarshal(b []byte) error { @@ -185,27 +176,24 @@ func (*UDPEncapDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *UDPEncapDelReply) Size() int { +func (m *UDPEncapDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *UDPEncapDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *UDPEncapDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -221,11 +209,10 @@ func (*UDPEncapDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *UDPEncapDetails) Size() int { +func (m *UDPEncapDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.UDPEncap.TableID size += 2 // m.UDPEncap.SrcPort size += 2 // m.UDPEncap.DstPort @@ -237,20 +224,18 @@ func (m *UDPEncapDetails) Size() int { return size } func (m *UDPEncapDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.UDPEncap.TableID)) - buf.EncodeUint16(uint16(m.UDPEncap.SrcPort)) - buf.EncodeUint16(uint16(m.UDPEncap.DstPort)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.UDPEncap.TableID) + buf.EncodeUint16(m.UDPEncap.SrcPort) + buf.EncodeUint16(m.UDPEncap.DstPort) buf.EncodeUint8(uint8(m.UDPEncap.SrcIP.Af)) - buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.UDPEncap.DstIP.Af)) - buf.EncodeBytes(m.UDPEncap.DstIP.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.UDPEncap.ID)) + buf.EncodeBytes(m.UDPEncap.DstIP.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.UDPEncap.ID) return buf.Bytes(), nil } func (m *UDPEncapDetails) Unmarshal(b []byte) error { @@ -276,20 +261,17 @@ func (*UDPEncapDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *UDPEncapDump) Size() int { +func (m *UDPEncapDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *UDPEncapDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *UDPEncapDump) Unmarshal(b []byte) error { diff --git a/binapi/udp_ping/udp_ping.ba.go b/binapi/udp_ping/udp_ping.ba.go index 98d0c9f..7247b38 100644 --- a/binapi/udp_ping/udp_ping.ba.go +++ b/binapi/udp_ping/udp_ping.ba.go @@ -50,11 +50,10 @@ func (*UDPPingAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *UDPPingAddDel) Size() int { +func (m *UDPPingAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.SrcIPAddress.Af size += 1 * 16 // m.SrcIPAddress.Un size += 1 // m.DstIPAddress.Af @@ -70,24 +69,22 @@ func (m *UDPPingAddDel) Size() int { return size } func (m *UDPPingAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.SrcIPAddress.Af)) - buf.EncodeBytes(m.SrcIPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.SrcIPAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.DstIPAddress.Af)) - buf.EncodeBytes(m.DstIPAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint16(uint16(m.StartSrcPort)) - buf.EncodeUint16(uint16(m.EndSrcPort)) - buf.EncodeUint16(uint16(m.StartDstPort)) - buf.EncodeUint16(uint16(m.EndDstPort)) - buf.EncodeUint16(uint16(m.Interval)) - buf.EncodeUint8(uint8(m.Dis)) - buf.EncodeUint8(uint8(m.FaultDet)) - buf.EncodeBytes(m.Reserve[:], 3) + buf.EncodeBytes(m.DstIPAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.StartSrcPort) + buf.EncodeUint16(m.EndSrcPort) + buf.EncodeUint16(m.StartDstPort) + buf.EncodeUint16(m.EndDstPort) + buf.EncodeUint16(m.Interval) + buf.EncodeUint8(m.Dis) + buf.EncodeUint8(m.FaultDet) + buf.EncodeBytes(m.Reserve, 3) return buf.Bytes(), nil } func (m *UDPPingAddDel) Unmarshal(b []byte) error { @@ -103,7 +100,8 @@ func (m *UDPPingAddDel) Unmarshal(b []byte) error { m.Interval = buf.DecodeUint16() m.Dis = buf.DecodeUint8() m.FaultDet = buf.DecodeUint8() - copy(m.Reserve[:], buf.DecodeBytes(3)) + m.Reserve = make([]byte, 3) + copy(m.Reserve, buf.DecodeBytes(len(m.Reserve))) return nil } @@ -119,27 +117,24 @@ func (*UDPPingAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *UDPPingAddDelReply) Size() int { +func (m *UDPPingAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *UDPPingAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *UDPPingAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -155,21 +150,18 @@ func (*UDPPingExport) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *UDPPingExport) Size() int { +func (m *UDPPingExport) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Enable return size } func (m *UDPPingExport) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.Enable) return buf.Bytes(), nil } @@ -191,27 +183,24 @@ func (*UDPPingExportReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *UDPPingExportReply) Size() int { +func (m *UDPPingExportReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *UDPPingExportReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *UDPPingExportReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/urpf/urpf.ba.go b/binapi/urpf/urpf.ba.go index d324bdb..c504cfb 100644 --- a/binapi/urpf/urpf.ba.go +++ b/binapi/urpf/urpf.ba.go @@ -78,11 +78,10 @@ func (*UrpfUpdate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *UrpfUpdate) Size() int { +func (m *UrpfUpdate) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsInput size += 1 // m.Mode size += 1 // m.Af @@ -90,12 +89,10 @@ func (m *UrpfUpdate) Size() int { return size } func (m *UrpfUpdate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsInput) buf.EncodeUint8(uint8(m.Mode)) buf.EncodeUint8(uint8(m.Af)) @@ -123,27 +120,24 @@ func (*UrpfUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *UrpfUpdateReply) Size() int { +func (m *UrpfUpdateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *UrpfUpdateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *UrpfUpdateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/vhost_user/vhost_user.ba.go b/binapi/vhost_user/vhost_user.ba.go index ea3d32b..0ca7119 100644 --- a/binapi/vhost_user/vhost_user.ba.go +++ b/binapi/vhost_user/vhost_user.ba.go @@ -53,11 +53,10 @@ func (*CreateVhostUserIf) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CreateVhostUserIf) Size() int { +func (m *CreateVhostUserIf) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsServer size += 256 // m.SockFilename size += 1 // m.Renumber @@ -72,12 +71,10 @@ func (m *CreateVhostUserIf) Size() int { return size } func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsServer) buf.EncodeString(m.SockFilename, 256) buf.EncodeBool(m.Renumber) @@ -85,7 +82,7 @@ func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) { buf.EncodeBool(m.DisableIndirectDesc) buf.EncodeBool(m.EnableGso) buf.EncodeBool(m.EnablePacked) - buf.EncodeUint32(uint32(m.CustomDevInstance)) + buf.EncodeUint32(m.CustomDevInstance) buf.EncodeBool(m.UseCustomMac) buf.EncodeBytes(m.MacAddress[:], 6) buf.EncodeString(m.Tag, 64) @@ -120,29 +117,26 @@ func (*CreateVhostUserIfReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CreateVhostUserIfReply) Size() int { +func (m *CreateVhostUserIfReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *CreateVhostUserIfReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -159,21 +153,18 @@ func (*DeleteVhostUserIf) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *DeleteVhostUserIf) Size() int { +func (m *DeleteVhostUserIf) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -195,27 +186,24 @@ func (*DeleteVhostUserIfReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *DeleteVhostUserIfReply) Size() int { +func (m *DeleteVhostUserIfReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -237,11 +225,10 @@ func (*ModifyVhostUserIf) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ModifyVhostUserIf) Size() int { +func (m *ModifyVhostUserIf) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsServer size += 256 // m.SockFilename @@ -252,19 +239,17 @@ func (m *ModifyVhostUserIf) Size() int { return size } func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsServer) buf.EncodeString(m.SockFilename, 256) buf.EncodeBool(m.Renumber) buf.EncodeBool(m.EnableGso) buf.EncodeBool(m.EnablePacked) - buf.EncodeUint32(uint32(m.CustomDevInstance)) + buf.EncodeUint32(m.CustomDevInstance) return buf.Bytes(), nil } func (m *ModifyVhostUserIf) Unmarshal(b []byte) error { @@ -291,27 +276,24 @@ func (*ModifyVhostUserIfReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ModifyVhostUserIfReply) Size() int { +func (m *ModifyVhostUserIfReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -335,11 +317,10 @@ func (*SwInterfaceVhostUserDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceVhostUserDetails) Size() int { +func (m *SwInterfaceVhostUserDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 64 // m.InterfaceName size += 4 // m.VirtioNetHdrSz @@ -352,21 +333,19 @@ func (m *SwInterfaceVhostUserDetails) Size() int { return size } func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeString(m.InterfaceName, 64) - buf.EncodeUint32(uint32(m.VirtioNetHdrSz)) + buf.EncodeUint32(m.VirtioNetHdrSz) buf.EncodeUint32(uint32(m.FeaturesFirst32)) buf.EncodeUint32(uint32(m.FeaturesLast32)) buf.EncodeBool(m.IsServer) buf.EncodeString(m.SockFilename, 256) - buf.EncodeUint32(uint32(m.NumRegions)) - buf.EncodeUint32(uint32(m.SockErrno)) + buf.EncodeUint32(m.NumRegions) + buf.EncodeInt32(m.SockErrno) return buf.Bytes(), nil } func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error { @@ -379,13 +358,13 @@ func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error { m.IsServer = buf.DecodeBool() m.SockFilename = buf.DecodeString(256) m.NumRegions = buf.DecodeUint32() - m.SockErrno = int32(buf.DecodeUint32()) + m.SockErrno = buf.DecodeInt32() return nil } // SwInterfaceVhostUserDump defines message 'sw_interface_vhost_user_dump'. type SwInterfaceVhostUserDump struct { - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` } func (m *SwInterfaceVhostUserDump) Reset() { *m = SwInterfaceVhostUserDump{} } @@ -395,21 +374,18 @@ func (*SwInterfaceVhostUserDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceVhostUserDump) Size() int { +func (m *SwInterfaceVhostUserDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } diff --git a/binapi/virtio/virtio.ba.go b/binapi/virtio/virtio.ba.go index 467cc0f..b29b52f 100644 --- a/binapi/virtio/virtio.ba.go +++ b/binapi/virtio/virtio.ba.go @@ -48,11 +48,10 @@ func (*SwInterfaceVirtioPciDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceVirtioPciDetails) Size() int { +func (m *SwInterfaceVirtioPciDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 2 // m.PciAddr.Domain size += 1 // m.PciAddr.Bus @@ -65,21 +64,19 @@ func (m *SwInterfaceVirtioPciDetails) Size() int { return size } func (m *SwInterfaceVirtioPciDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint16(uint16(m.PciAddr.Domain)) - buf.EncodeUint8(uint8(m.PciAddr.Bus)) - buf.EncodeUint8(uint8(m.PciAddr.Slot)) - buf.EncodeUint8(uint8(m.PciAddr.Function)) + buf.EncodeUint16(m.PciAddr.Domain) + buf.EncodeUint8(m.PciAddr.Bus) + buf.EncodeUint8(m.PciAddr.Slot) + buf.EncodeUint8(m.PciAddr.Function) buf.EncodeBytes(m.MacAddr[:], 6) - buf.EncodeUint16(uint16(m.TxRingSz)) - buf.EncodeUint16(uint16(m.RxRingSz)) - buf.EncodeUint64(uint64(m.Features)) + buf.EncodeUint16(m.TxRingSz) + buf.EncodeUint16(m.RxRingSz) + buf.EncodeUint64(m.Features) return buf.Bytes(), nil } func (m *SwInterfaceVirtioPciDetails) Unmarshal(b []byte) error { @@ -106,20 +103,17 @@ func (*SwInterfaceVirtioPciDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceVirtioPciDump) Size() int { +func (m *SwInterfaceVirtioPciDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *SwInterfaceVirtioPciDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *SwInterfaceVirtioPciDump) Unmarshal(b []byte) error { @@ -143,11 +137,10 @@ func (*VirtioPciCreate) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VirtioPciCreate) Size() int { +func (m *VirtioPciCreate) Size() (size int) { if m == nil { return 0 } - var size int size += 2 // m.PciAddr.Domain size += 1 // m.PciAddr.Bus size += 1 // m.PciAddr.Slot @@ -160,21 +153,19 @@ func (m *VirtioPciCreate) Size() int { return size } func (m *VirtioPciCreate) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint16(uint16(m.PciAddr.Domain)) - buf.EncodeUint8(uint8(m.PciAddr.Bus)) - buf.EncodeUint8(uint8(m.PciAddr.Slot)) - buf.EncodeUint8(uint8(m.PciAddr.Function)) + buf := codec.NewBuffer(b) + buf.EncodeUint16(m.PciAddr.Domain) + buf.EncodeUint8(m.PciAddr.Bus) + buf.EncodeUint8(m.PciAddr.Slot) + buf.EncodeUint8(m.PciAddr.Function) buf.EncodeBool(m.UseRandomMac) buf.EncodeBytes(m.MacAddress[:], 6) buf.EncodeBool(m.GsoEnabled) buf.EncodeBool(m.ChecksumOffloadEnabled) - buf.EncodeUint64(uint64(m.Features)) + buf.EncodeUint64(m.Features) return buf.Bytes(), nil } func (m *VirtioPciCreate) Unmarshal(b []byte) error { @@ -204,29 +195,26 @@ func (*VirtioPciCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VirtioPciCreateReply) Size() int { +func (m *VirtioPciCreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *VirtioPciCreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *VirtioPciCreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -243,21 +231,18 @@ func (*VirtioPciDelete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VirtioPciDelete) Size() int { +func (m *VirtioPciDelete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *VirtioPciDelete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -279,27 +264,24 @@ func (*VirtioPciDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VirtioPciDeleteReply) Size() int { +func (m *VirtioPciDeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VirtioPciDeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VirtioPciDeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapi/vmxnet3/vmxnet3.ba.go b/binapi/vmxnet3/vmxnet3.ba.go index b975448..77937fa 100644 --- a/binapi/vmxnet3/vmxnet3.ba.go +++ b/binapi/vmxnet3/vmxnet3.ba.go @@ -67,11 +67,10 @@ func (*Vmxnet3Create) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Vmxnet3Create) Size() int { +func (m *Vmxnet3Create) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.PciAddr size += 4 // m.EnableElog size += 2 // m.RxqSize @@ -83,26 +82,24 @@ func (m *Vmxnet3Create) Size() int { return size } func (m *Vmxnet3Create) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.PciAddr)) - buf.EncodeUint32(uint32(m.EnableElog)) - buf.EncodeUint16(uint16(m.RxqSize)) - buf.EncodeUint16(uint16(m.RxqNum)) - buf.EncodeUint16(uint16(m.TxqSize)) - buf.EncodeUint16(uint16(m.TxqNum)) - buf.EncodeUint8(uint8(m.Bind)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.PciAddr) + buf.EncodeInt32(m.EnableElog) + buf.EncodeUint16(m.RxqSize) + buf.EncodeUint16(m.RxqNum) + buf.EncodeUint16(m.TxqSize) + buf.EncodeUint16(m.TxqNum) + buf.EncodeUint8(m.Bind) buf.EncodeBool(m.EnableGso) return buf.Bytes(), nil } func (m *Vmxnet3Create) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.PciAddr = buf.DecodeUint32() - m.EnableElog = int32(buf.DecodeUint32()) + m.EnableElog = buf.DecodeInt32() m.RxqSize = buf.DecodeUint16() m.RxqNum = buf.DecodeUint16() m.TxqSize = buf.DecodeUint16() @@ -125,29 +122,26 @@ func (*Vmxnet3CreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Vmxnet3CreateReply) Size() int { +func (m *Vmxnet3CreateReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *Vmxnet3CreateReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *Vmxnet3CreateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -164,21 +158,18 @@ func (*Vmxnet3Delete) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Vmxnet3Delete) Size() int { +func (m *Vmxnet3Delete) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *Vmxnet3Delete) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -200,27 +191,24 @@ func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Vmxnet3DeleteReply) Size() int { +func (m *Vmxnet3DeleteReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *Vmxnet3DeleteReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *Vmxnet3DeleteReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -245,11 +233,10 @@ func (*Vmxnet3Details) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Vmxnet3Details) Size() int { +func (m *Vmxnet3Details) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 64 // m.IfName size += 1 * 6 // m.HwAddr @@ -258,84 +245,64 @@ func (m *Vmxnet3Details) Size() int { size += 1 // m.AdminUpDown size += 1 // m.RxCount for j1 := 0; j1 < 16; j1++ { - var s1 Vmxnet3RxList - _ = s1 - if j1 < len(m.RxList) { - s1 = m.RxList[j1] - } - size += 2 // s1.RxQsize - size += 2 * 2 // s1.RxFill - size += 2 // s1.RxNext - size += 2 * 2 // s1.RxProduce - size += 2 * 2 // s1.RxConsume + size += 2 // m.RxList[j1].RxQsize + size += 2 * 2 // m.RxList[j1].RxFill + size += 2 // m.RxList[j1].RxNext + size += 2 * 2 // m.RxList[j1].RxProduce + size += 2 * 2 // m.RxList[j1].RxConsume } size += 1 // m.TxCount for j1 := 0; j1 < 8; j1++ { - var s1 Vmxnet3TxList - _ = s1 - if j1 < len(m.TxList) { - s1 = m.TxList[j1] - } - size += 2 // s1.TxQsize - size += 2 // s1.TxNext - size += 2 // s1.TxProduce - size += 2 // s1.TxConsume + size += 2 // m.TxList[j1].TxQsize + size += 2 // m.TxList[j1].TxNext + size += 2 // m.TxList[j1].TxProduce + size += 2 // m.TxList[j1].TxConsume } return size } func (m *Vmxnet3Details) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeString(m.IfName, 64) buf.EncodeBytes(m.HwAddr[:], 6) - buf.EncodeUint32(uint32(m.PciAddr)) - buf.EncodeUint8(uint8(m.Version)) + buf.EncodeUint32(m.PciAddr) + buf.EncodeUint8(m.Version) buf.EncodeBool(m.AdminUpDown) - buf.EncodeUint8(uint8(m.RxCount)) + buf.EncodeUint8(m.RxCount) for j0 := 0; j0 < 16; j0++ { - var v0 Vmxnet3RxList - if j0 < len(m.RxList) { - v0 = m.RxList[j0] - } - buf.EncodeUint16(uint16(v0.RxQsize)) + buf.EncodeUint16(m.RxList[j0].RxQsize) for i := 0; i < 2; i++ { var x uint16 - if i < len(v0.RxFill) { - x = uint16(v0.RxFill[i]) + if i < len(m.RxList[j0].RxFill) { + x = uint16(m.RxList[j0].RxFill[i]) } - buf.EncodeUint16(uint16(x)) + buf.EncodeUint16(x) } - buf.EncodeUint16(uint16(v0.RxNext)) + buf.EncodeUint16(m.RxList[j0].RxNext) for i := 0; i < 2; i++ { var x uint16 - if i < len(v0.RxProduce) { - x = uint16(v0.RxProduce[i]) + if i < len(m.RxList[j0].RxProduce) { + x = uint16(m.RxList[j0].RxProduce[i]) } - buf.EncodeUint16(uint16(x)) + buf.EncodeUint16(x) } for i := 0; i < 2; i++ { var x uint16 - if i < len(v0.RxConsume) { - x = uint16(v0.RxConsume[i]) + if i < len(m.RxList[j0].RxConsume) { + x = uint16(m.RxList[j0].RxConsume[i]) } - buf.EncodeUint16(uint16(x)) + buf.EncodeUint16(x) } } - buf.EncodeUint8(uint8(m.TxCount)) + buf.EncodeUint8(m.TxCount) for j0 := 0; j0 < 8; j0++ { - var v0 Vmxnet3TxList - if j0 < len(m.TxList) { - v0 = m.TxList[j0] - } - buf.EncodeUint16(uint16(v0.TxQsize)) - buf.EncodeUint16(uint16(v0.TxNext)) - buf.EncodeUint16(uint16(v0.TxProduce)) - buf.EncodeUint16(uint16(v0.TxConsume)) + buf.EncodeUint16(m.TxList[j0].TxQsize) + buf.EncodeUint16(m.TxList[j0].TxNext) + buf.EncodeUint16(m.TxList[j0].TxProduce) + buf.EncodeUint16(m.TxList[j0].TxConsume) } return buf.Bytes(), nil } @@ -384,20 +351,17 @@ func (*Vmxnet3Dump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Vmxnet3Dump) Size() int { +func (m *Vmxnet3Dump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *Vmxnet3Dump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *Vmxnet3Dump) Unmarshal(b []byte) error { diff --git a/binapi/vpe/vpe.ba.go b/binapi/vpe/vpe.ba.go index 59cdcad..046bd68 100644 --- a/binapi/vpe/vpe.ba.go +++ b/binapi/vpe/vpe.ba.go @@ -54,22 +54,19 @@ func (*AddNodeNext) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AddNodeNext) Size() int { +func (m *AddNodeNext) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.NodeName size += 64 // m.NextName return size } func (m *AddNodeNext) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.NodeName, 64) buf.EncodeString(m.NextName, 64) return buf.Bytes(), nil @@ -94,29 +91,26 @@ func (*AddNodeNextReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AddNodeNextReply) Size() int { +func (m *AddNodeNextReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.NextIndex return size } func (m *AddNodeNextReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.NextIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.NextIndex) return buf.Bytes(), nil } func (m *AddNodeNextReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.NextIndex = buf.DecodeUint32() return nil } @@ -133,22 +127,19 @@ func (*Cli) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Cli) Size() int { +func (m *Cli) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.CmdInShmem return size } func (m *Cli) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint64(uint64(m.CmdInShmem)) + buf := codec.NewBuffer(b) + buf.EncodeUint64(m.CmdInShmem) return buf.Bytes(), nil } func (m *Cli) Unmarshal(b []byte) error { @@ -169,21 +160,18 @@ func (*CliInband) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *CliInband) Size() int { +func (m *CliInband) Size() (size int) { if m == nil { return 0 } - var size int size += 4 + len(m.Cmd) // m.Cmd return size } func (m *CliInband) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.Cmd, 0) return buf.Bytes(), nil } @@ -206,29 +194,26 @@ func (*CliInbandReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CliInbandReply) Size() int { +func (m *CliInbandReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 + len(m.Reply) // m.Reply return size } func (m *CliInbandReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeString(m.Reply, 0) return buf.Bytes(), nil } func (m *CliInbandReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Reply = buf.DecodeString(0) return nil } @@ -246,29 +231,26 @@ func (*CliReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *CliReply) Size() int { +func (m *CliReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 8 // m.ReplyInShmem return size } func (m *CliReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint64(uint64(m.ReplyInShmem)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint64(m.ReplyInShmem) return buf.Bytes(), nil } func (m *CliReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ReplyInShmem = buf.DecodeUint64() return nil } @@ -283,20 +265,17 @@ func (*ControlPing) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ControlPing) Size() int { +func (m *ControlPing) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ControlPing) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ControlPing) Unmarshal(b []byte) error { @@ -317,31 +296,28 @@ func (*ControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ControlPingReply) Size() int { +func (m *ControlPingReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.ClientIndex size += 4 // m.VpePID return size } func (m *ControlPingReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.ClientIndex)) - buf.EncodeUint32(uint32(m.VpePID)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ClientIndex) + buf.EncodeUint32(m.VpePID) return buf.Bytes(), nil } func (m *ControlPingReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ClientIndex = buf.DecodeUint32() m.VpePID = buf.DecodeUint32() return nil @@ -349,7 +325,7 @@ func (m *ControlPingReply) Unmarshal(b []byte) error { // GetF64EndianValue defines message 'get_f64_endian_value'. type GetF64EndianValue struct { - F64One float64 `binapi:"f64,name=f64_one,default=%!s(float64=1)" json:"f64_one,omitempty"` + F64One float64 `binapi:"f64,name=f64_one,default=1" json:"f64_one,omitempty"` } func (m *GetF64EndianValue) Reset() { *m = GetF64EndianValue{} } @@ -359,27 +335,24 @@ func (*GetF64EndianValue) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GetF64EndianValue) Size() int { +func (m *GetF64EndianValue) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.F64One return size } func (m *GetF64EndianValue) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeFloat64(float64(m.F64One)) + buf := codec.NewBuffer(b) + buf.EncodeFloat64(m.F64One) return buf.Bytes(), nil } func (m *GetF64EndianValue) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.F64One = float64(buf.DecodeFloat64()) + m.F64One = buf.DecodeFloat64() return nil } @@ -396,36 +369,33 @@ func (*GetF64EndianValueReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GetF64EndianValueReply) Size() int { +func (m *GetF64EndianValueReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 8 // m.F64OneResult return size } func (m *GetF64EndianValueReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeFloat64(float64(m.F64OneResult)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Retval) + buf.EncodeFloat64(m.F64OneResult) return buf.Bytes(), nil } func (m *GetF64EndianValueReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeUint32() - m.F64OneResult = float64(buf.DecodeFloat64()) + m.F64OneResult = buf.DecodeFloat64() return nil } // GetF64IncrementByOne defines message 'get_f64_increment_by_one'. type GetF64IncrementByOne struct { - F64Value float64 `binapi:"f64,name=f64_value,default=%!s(float64=1)" json:"f64_value,omitempty"` + F64Value float64 `binapi:"f64,name=f64_value,default=1" json:"f64_value,omitempty"` } func (m *GetF64IncrementByOne) Reset() { *m = GetF64IncrementByOne{} } @@ -435,27 +405,24 @@ func (*GetF64IncrementByOne) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GetF64IncrementByOne) Size() int { +func (m *GetF64IncrementByOne) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.F64Value return size } func (m *GetF64IncrementByOne) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeFloat64(float64(m.F64Value)) + buf := codec.NewBuffer(b) + buf.EncodeFloat64(m.F64Value) return buf.Bytes(), nil } func (m *GetF64IncrementByOne) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.F64Value = float64(buf.DecodeFloat64()) + m.F64Value = buf.DecodeFloat64() return nil } @@ -472,30 +439,27 @@ func (*GetF64IncrementByOneReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GetF64IncrementByOneReply) Size() int { +func (m *GetF64IncrementByOneReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 8 // m.F64Value return size } func (m *GetF64IncrementByOneReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeFloat64(float64(m.F64Value)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Retval) + buf.EncodeFloat64(m.F64Value) return buf.Bytes(), nil } func (m *GetF64IncrementByOneReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeUint32() - m.F64Value = float64(buf.DecodeFloat64()) + m.F64Value = buf.DecodeFloat64() return nil } @@ -512,22 +476,19 @@ func (*GetNextIndex) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GetNextIndex) Size() int { +func (m *GetNextIndex) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.NodeName size += 64 // m.NextName return size } func (m *GetNextIndex) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.NodeName, 64) buf.EncodeString(m.NextName, 64) return buf.Bytes(), nil @@ -552,29 +513,26 @@ func (*GetNextIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GetNextIndexReply) Size() int { +func (m *GetNextIndexReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.NextIndex return size } func (m *GetNextIndexReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.NextIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.NextIndex) return buf.Bytes(), nil } func (m *GetNextIndexReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.NextIndex = buf.DecodeUint32() return nil } @@ -589,20 +547,17 @@ func (*GetNodeGraph) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GetNodeGraph) Size() int { +func (m *GetNodeGraph) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *GetNodeGraph) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *GetNodeGraph) Unmarshal(b []byte) error { @@ -622,29 +577,26 @@ func (*GetNodeGraphReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GetNodeGraphReply) Size() int { +func (m *GetNodeGraphReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 8 // m.ReplyInShmem return size } func (m *GetNodeGraphReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint64(uint64(m.ReplyInShmem)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint64(m.ReplyInShmem) return buf.Bytes(), nil } func (m *GetNodeGraphReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.ReplyInShmem = buf.DecodeUint64() return nil } @@ -661,21 +613,18 @@ func (*GetNodeIndex) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *GetNodeIndex) Size() int { +func (m *GetNodeIndex) Size() (size int) { if m == nil { return 0 } - var size int size += 64 // m.NodeName return size } func (m *GetNodeIndex) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeString(m.NodeName, 64) return buf.Bytes(), nil } @@ -698,29 +647,26 @@ func (*GetNodeIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *GetNodeIndexReply) Size() int { +func (m *GetNodeIndexReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.NodeIndex return size } func (m *GetNodeIndexReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) - buf.EncodeUint32(uint32(m.NodeIndex)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.NodeIndex) return buf.Bytes(), nil } func (m *GetNodeIndexReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.NodeIndex = buf.DecodeUint32() return nil } @@ -740,11 +686,10 @@ func (*LogDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *LogDetails) Size() int { +func (m *LogDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.Timestamp size += 4 // m.Level size += 32 // m.MsgClass @@ -752,12 +697,10 @@ func (m *LogDetails) Size() int { return size } func (m *LogDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeFloat64(float64(m.Timestamp)) buf.EncodeUint32(uint32(m.Level)) buf.EncodeString(m.MsgClass, 32) @@ -785,21 +728,18 @@ func (*LogDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *LogDump) Size() int { +func (m *LogDump) Size() (size int) { if m == nil { return 0 } - var size int size += 8 // m.StartTimestamp return size } func (m *LogDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeFloat64(float64(m.StartTimestamp)) return buf.Bytes(), nil } @@ -819,20 +759,17 @@ func (*ShowThreads) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowThreads) Size() int { +func (m *ShowThreads) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowThreads) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowThreads) Unmarshal(b []byte) error { @@ -853,11 +790,10 @@ func (*ShowThreadsReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowThreadsReply) Size() int { +func (m *ShowThreadsReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.Count for j1 := 0; j1 < len(m.ThreadData); j1++ { @@ -877,34 +813,32 @@ func (m *ShowThreadsReply) Size() int { return size } func (m *ShowThreadsReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(len(m.ThreadData))) for j0 := 0; j0 < len(m.ThreadData); j0++ { - var v0 ThreadData + var v0 ThreadData // ThreadData if j0 < len(m.ThreadData) { v0 = m.ThreadData[j0] } - buf.EncodeUint32(uint32(v0.ID)) + buf.EncodeUint32(v0.ID) buf.EncodeString(v0.Name, 64) buf.EncodeString(v0.Type, 64) - buf.EncodeUint32(uint32(v0.PID)) - buf.EncodeUint32(uint32(v0.CPUID)) - buf.EncodeUint32(uint32(v0.Core)) - buf.EncodeUint32(uint32(v0.CPUSocket)) + buf.EncodeUint32(v0.PID) + buf.EncodeUint32(v0.CPUID) + buf.EncodeUint32(v0.Core) + buf.EncodeUint32(v0.CPUSocket) } return buf.Bytes(), nil } func (m *ShowThreadsReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Count = buf.DecodeUint32() - m.ThreadData = make([]ThreadData, int(m.Count)) + m.ThreadData = make([]ThreadData, m.Count) for j0 := 0; j0 < len(m.ThreadData); j0++ { m.ThreadData[j0].ID = buf.DecodeUint32() m.ThreadData[j0].Name = buf.DecodeString(64) @@ -927,20 +861,17 @@ func (*ShowVersion) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowVersion) Size() int { +func (m *ShowVersion) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowVersion) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowVersion) Unmarshal(b []byte) error { @@ -963,11 +894,10 @@ func (*ShowVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowVersionReply) Size() int { +func (m *ShowVersionReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 32 // m.Program size += 32 // m.Version @@ -976,13 +906,11 @@ func (m *ShowVersionReply) Size() int { return size } func (m *ShowVersionReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeString(m.Program, 32) buf.EncodeString(m.Version, 32) buf.EncodeString(m.BuildDate, 32) @@ -991,7 +919,7 @@ func (m *ShowVersionReply) Marshal(b []byte) ([]byte, error) { } func (m *ShowVersionReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.Program = buf.DecodeString(32) m.Version = buf.DecodeString(32) m.BuildDate = buf.DecodeString(32) @@ -1009,20 +937,17 @@ func (*ShowVpeSystemTime) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *ShowVpeSystemTime) Size() int { +func (m *ShowVpeSystemTime) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *ShowVpeSystemTime) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *ShowVpeSystemTime) Unmarshal(b []byte) error { @@ -1042,29 +967,26 @@ func (*ShowVpeSystemTimeReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *ShowVpeSystemTimeReply) Size() int { +func (m *ShowVpeSystemTimeReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 8 // m.VpeSystemTime return size } func (m *ShowVpeSystemTimeReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeFloat64(float64(m.VpeSystemTime)) return buf.Bytes(), nil } func (m *ShowVpeSystemTimeReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.VpeSystemTime = vpe_types.Timestamp(buf.DecodeFloat64()) return nil } diff --git a/binapi/vrrp/vrrp.ba.go b/binapi/vrrp/vrrp.ba.go index 297fbd8..ef34cdd 100644 --- a/binapi/vrrp/vrrp.ba.go +++ b/binapi/vrrp/vrrp.ba.go @@ -176,11 +176,10 @@ func (*VrrpVrAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VrrpVrAddDel) Size() int { +func (m *VrrpVrAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.SwIfIndex size += 1 // m.VrID @@ -200,26 +199,24 @@ func (m *VrrpVrAddDel) Size() int { return size } func (m *VrrpVrAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint8(uint8(m.IsAdd)) + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.VrID)) - buf.EncodeUint8(uint8(m.Priority)) - buf.EncodeUint16(uint16(m.Interval)) + buf.EncodeUint8(m.VrID) + buf.EncodeUint8(m.Priority) + buf.EncodeUint16(m.Interval) buf.EncodeUint32(uint32(m.Flags)) buf.EncodeUint8(uint8(len(m.Addrs))) for j0 := 0; j0 < len(m.Addrs); j0++ { - var v0 ip_types.Address + var v0 ip_types.Address // Addrs if j0 < len(m.Addrs) { v0 = m.Addrs[j0] } buf.EncodeUint8(uint8(v0.Af)) - buf.EncodeBytes(v0.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -232,7 +229,7 @@ func (m *VrrpVrAddDel) Unmarshal(b []byte) error { m.Interval = buf.DecodeUint16() m.Flags = VrrpVrFlags(buf.DecodeUint32()) m.NAddrs = buf.DecodeUint8() - m.Addrs = make([]ip_types.Address, int(m.NAddrs)) + m.Addrs = make([]ip_types.Address, m.NAddrs) for j0 := 0; j0 < len(m.Addrs); j0++ { m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -252,27 +249,24 @@ func (*VrrpVrAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VrrpVrAddDelReply) Size() int { +func (m *VrrpVrAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VrrpVrAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VrrpVrAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -291,11 +285,10 @@ func (*VrrpVrDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VrrpVrDetails) Size() int { +func (m *VrrpVrDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Config.SwIfIndex size += 1 // m.Config.VrID size += 1 // m.Config.Priority @@ -321,32 +314,30 @@ func (m *VrrpVrDetails) Size() int { return size } func (m *VrrpVrDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Config.SwIfIndex)) - buf.EncodeUint8(uint8(m.Config.VrID)) - buf.EncodeUint8(uint8(m.Config.Priority)) - buf.EncodeUint16(uint16(m.Config.Interval)) + buf.EncodeUint8(m.Config.VrID) + buf.EncodeUint8(m.Config.Priority) + buf.EncodeUint16(m.Config.Interval) buf.EncodeUint32(uint32(m.Config.Flags)) buf.EncodeUint32(uint32(m.Runtime.State)) - buf.EncodeUint16(uint16(m.Runtime.MasterAdvInt)) - buf.EncodeUint16(uint16(m.Runtime.Skew)) - buf.EncodeUint16(uint16(m.Runtime.MasterDownInt)) + buf.EncodeUint16(m.Runtime.MasterAdvInt) + buf.EncodeUint16(m.Runtime.Skew) + buf.EncodeUint16(m.Runtime.MasterDownInt) buf.EncodeBytes(m.Runtime.Mac[:], 6) - buf.EncodeUint32(uint32(m.Runtime.Tracking.InterfacesDec)) - buf.EncodeUint8(uint8(m.Runtime.Tracking.Priority)) + buf.EncodeUint32(m.Runtime.Tracking.InterfacesDec) + buf.EncodeUint8(m.Runtime.Tracking.Priority) buf.EncodeUint8(uint8(len(m.Addrs))) for j0 := 0; j0 < len(m.Addrs); j0++ { - var v0 ip_types.Address + var v0 ip_types.Address // Addrs if j0 < len(m.Addrs) { v0 = m.Addrs[j0] } buf.EncodeUint8(uint8(v0.Af)) - buf.EncodeBytes(v0.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -365,7 +356,7 @@ func (m *VrrpVrDetails) Unmarshal(b []byte) error { m.Runtime.Tracking.InterfacesDec = buf.DecodeUint32() m.Runtime.Tracking.Priority = buf.DecodeUint8() m.NAddrs = buf.DecodeUint8() - m.Addrs = make([]ip_types.Address, int(m.NAddrs)) + m.Addrs = make([]ip_types.Address, m.NAddrs) for j0 := 0; j0 < len(m.Addrs); j0++ { m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -385,21 +376,18 @@ func (*VrrpVrDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VrrpVrDump) Size() int { +func (m *VrrpVrDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *VrrpVrDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -425,11 +413,10 @@ func (*VrrpVrPeerDetails) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VrrpVrPeerDetails) Size() int { +func (m *VrrpVrPeerDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.VrID size += 1 // m.IsIPv6 @@ -446,23 +433,21 @@ func (m *VrrpVrPeerDetails) Size() int { return size } func (m *VrrpVrPeerDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.VrID)) - buf.EncodeUint8(uint8(m.IsIPv6)) + buf.EncodeUint8(m.VrID) + buf.EncodeUint8(m.IsIPv6) buf.EncodeUint8(uint8(len(m.PeerAddrs))) for j0 := 0; j0 < len(m.PeerAddrs); j0++ { - var v0 ip_types.Address + var v0 ip_types.Address // PeerAddrs if j0 < len(m.PeerAddrs) { v0 = m.PeerAddrs[j0] } buf.EncodeUint8(uint8(v0.Af)) - buf.EncodeBytes(v0.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -472,7 +457,7 @@ func (m *VrrpVrPeerDetails) Unmarshal(b []byte) error { m.VrID = buf.DecodeUint8() m.IsIPv6 = buf.DecodeUint8() m.NPeerAddrs = buf.DecodeUint8() - m.PeerAddrs = make([]ip_types.Address, int(m.NPeerAddrs)) + m.PeerAddrs = make([]ip_types.Address, m.NPeerAddrs) for j0 := 0; j0 < len(m.PeerAddrs); j0++ { m.PeerAddrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.PeerAddrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -494,26 +479,23 @@ func (*VrrpVrPeerDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VrrpVrPeerDump) Size() int { +func (m *VrrpVrPeerDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 size += 1 // m.VrID return size } func (m *VrrpVrPeerDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.IsIPv6)) - buf.EncodeUint8(uint8(m.VrID)) + buf.EncodeUint8(m.IsIPv6) + buf.EncodeUint8(m.VrID) return buf.Bytes(), nil } func (m *VrrpVrPeerDump) Unmarshal(b []byte) error { @@ -540,11 +522,10 @@ func (*VrrpVrSetPeers) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VrrpVrSetPeers) Size() int { +func (m *VrrpVrSetPeers) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.VrID size += 1 // m.IsIPv6 @@ -561,23 +542,21 @@ func (m *VrrpVrSetPeers) Size() int { return size } func (m *VrrpVrSetPeers) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.VrID)) - buf.EncodeUint8(uint8(m.IsIPv6)) + buf.EncodeUint8(m.VrID) + buf.EncodeUint8(m.IsIPv6) buf.EncodeUint8(uint8(len(m.Addrs))) for j0 := 0; j0 < len(m.Addrs); j0++ { - var v0 ip_types.Address + var v0 ip_types.Address // Addrs if j0 < len(m.Addrs) { v0 = m.Addrs[j0] } buf.EncodeUint8(uint8(v0.Af)) - buf.EncodeBytes(v0.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16) } return buf.Bytes(), nil } @@ -587,7 +566,7 @@ func (m *VrrpVrSetPeers) Unmarshal(b []byte) error { m.VrID = buf.DecodeUint8() m.IsIPv6 = buf.DecodeUint8() m.NAddrs = buf.DecodeUint8() - m.Addrs = make([]ip_types.Address, int(m.NAddrs)) + m.Addrs = make([]ip_types.Address, m.NAddrs) for j0 := 0; j0 < len(m.Addrs); j0++ { m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16)) @@ -607,27 +586,24 @@ func (*VrrpVrSetPeersReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VrrpVrSetPeersReply) Size() int { +func (m *VrrpVrSetPeersReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VrrpVrSetPeersReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VrrpVrSetPeersReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -646,11 +622,10 @@ func (*VrrpVrStartStop) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VrrpVrStartStop) Size() int { +func (m *VrrpVrStartStop) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.VrID size += 1 // m.IsIPv6 @@ -658,16 +633,14 @@ func (m *VrrpVrStartStop) Size() int { return size } func (m *VrrpVrStartStop) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.VrID)) - buf.EncodeUint8(uint8(m.IsIPv6)) - buf.EncodeUint8(uint8(m.IsStart)) + buf.EncodeUint8(m.VrID) + buf.EncodeUint8(m.IsIPv6) + buf.EncodeUint8(m.IsStart) return buf.Bytes(), nil } func (m *VrrpVrStartStop) Unmarshal(b []byte) error { @@ -691,27 +664,24 @@ func (*VrrpVrStartStopReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VrrpVrStartStopReply) Size() int { +func (m *VrrpVrStartStopReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VrrpVrStartStopReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VrrpVrStartStopReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -732,11 +702,10 @@ func (*VrrpVrTrackIfAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VrrpVrTrackIfAddDel) Size() int { +func (m *VrrpVrTrackIfAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 size += 1 // m.VrID @@ -754,24 +723,22 @@ func (m *VrrpVrTrackIfAddDel) Size() int { return size } func (m *VrrpVrTrackIfAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.IsIPv6)) - buf.EncodeUint8(uint8(m.VrID)) - buf.EncodeUint8(uint8(m.IsAdd)) + buf.EncodeUint8(m.IsIPv6) + buf.EncodeUint8(m.VrID) + buf.EncodeUint8(m.IsAdd) buf.EncodeUint8(uint8(len(m.Ifs))) for j0 := 0; j0 < len(m.Ifs); j0++ { - var v0 VrrpVrTrackIf + var v0 VrrpVrTrackIf // Ifs if j0 < len(m.Ifs) { v0 = m.Ifs[j0] } buf.EncodeUint32(uint32(v0.SwIfIndex)) - buf.EncodeUint8(uint8(v0.Priority)) + buf.EncodeUint8(v0.Priority) } return buf.Bytes(), nil } @@ -782,7 +749,7 @@ func (m *VrrpVrTrackIfAddDel) Unmarshal(b []byte) error { m.VrID = buf.DecodeUint8() m.IsAdd = buf.DecodeUint8() m.NIfs = buf.DecodeUint8() - m.Ifs = make([]VrrpVrTrackIf, int(m.NIfs)) + m.Ifs = make([]VrrpVrTrackIf, m.NIfs) for j0 := 0; j0 < len(m.Ifs); j0++ { m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Ifs[j0].Priority = buf.DecodeUint8() @@ -802,27 +769,24 @@ func (*VrrpVrTrackIfAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VrrpVrTrackIfAddDelReply) Size() int { +func (m *VrrpVrTrackIfAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VrrpVrTrackIfAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VrrpVrTrackIfAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -842,11 +806,10 @@ func (*VrrpVrTrackIfDetails) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VrrpVrTrackIfDetails) Size() int { +func (m *VrrpVrTrackIfDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.VrID size += 1 // m.IsIPv6 @@ -863,23 +826,21 @@ func (m *VrrpVrTrackIfDetails) Size() int { return size } func (m *VrrpVrTrackIfDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.VrID)) - buf.EncodeUint8(uint8(m.IsIPv6)) + buf.EncodeUint8(m.VrID) + buf.EncodeUint8(m.IsIPv6) buf.EncodeUint8(uint8(len(m.Ifs))) for j0 := 0; j0 < len(m.Ifs); j0++ { - var v0 VrrpVrTrackIf + var v0 VrrpVrTrackIf // Ifs if j0 < len(m.Ifs) { v0 = m.Ifs[j0] } buf.EncodeUint32(uint32(v0.SwIfIndex)) - buf.EncodeUint8(uint8(v0.Priority)) + buf.EncodeUint8(v0.Priority) } return buf.Bytes(), nil } @@ -889,7 +850,7 @@ func (m *VrrpVrTrackIfDetails) Unmarshal(b []byte) error { m.VrID = buf.DecodeUint8() m.IsIPv6 = buf.DecodeUint8() m.NIfs = buf.DecodeUint8() - m.Ifs = make([]VrrpVrTrackIf, int(m.NIfs)) + m.Ifs = make([]VrrpVrTrackIf, m.NIfs) for j0 := 0; j0 < len(m.Ifs); j0++ { m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Ifs[j0].Priority = buf.DecodeUint8() @@ -912,11 +873,10 @@ func (*VrrpVrTrackIfDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VrrpVrTrackIfDump) Size() int { +func (m *VrrpVrTrackIfDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 size += 1 // m.VrID @@ -924,16 +884,14 @@ func (m *VrrpVrTrackIfDump) Size() int { return size } func (m *VrrpVrTrackIfDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint8(uint8(m.IsIPv6)) - buf.EncodeUint8(uint8(m.VrID)) - buf.EncodeUint8(uint8(m.DumpAll)) + buf.EncodeUint8(m.IsIPv6) + buf.EncodeUint8(m.VrID) + buf.EncodeUint8(m.DumpAll) return buf.Bytes(), nil } func (m *VrrpVrTrackIfDump) Unmarshal(b []byte) error { diff --git a/binapi/vxlan/vxlan.ba.go b/binapi/vxlan/vxlan.ba.go index bec763f..048b2fa 100644 --- a/binapi/vxlan/vxlan.ba.go +++ b/binapi/vxlan/vxlan.ba.go @@ -44,23 +44,20 @@ func (*SwInterfaceSetVxlanBypass) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetVxlanBypass) Size() int { +func (m *SwInterfaceSetVxlanBypass) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 size += 1 // m.Enable return size } func (m *SwInterfaceSetVxlanBypass) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) buf.EncodeBool(m.Enable) @@ -88,27 +85,24 @@ func (*SwInterfaceSetVxlanBypassReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetVxlanBypassReply) Size() int { +func (m *SwInterfaceSetVxlanBypassReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetVxlanBypassReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetVxlanBypassReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -131,11 +125,10 @@ func (*VxlanAddDelTunnel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanAddDelTunnel) Size() int { +func (m *VxlanAddDelTunnel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Instance size += 1 // m.SrcAddress.Af @@ -149,22 +142,20 @@ func (m *VxlanAddDelTunnel) Size() int { return size } func (m *VxlanAddDelTunnel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Instance)) + buf.EncodeUint32(m.Instance) buf.EncodeUint8(uint8(m.SrcAddress.Af)) - buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.DstAddress.Af)) - buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.EncapVrfID)) - buf.EncodeUint32(uint32(m.DecapNextIndex)) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapNextIndex) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *VxlanAddDelTunnel) Unmarshal(b []byte) error { @@ -195,29 +186,26 @@ func (*VxlanAddDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanAddDelTunnelReply) Size() int { +func (m *VxlanAddDelTunnelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *VxlanAddDelTunnelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *VxlanAddDelTunnelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -236,23 +224,20 @@ func (*VxlanOffloadRx) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanOffloadRx) Size() int { +func (m *VxlanOffloadRx) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.HwIfIndex size += 4 // m.SwIfIndex size += 1 // m.Enable return size } func (m *VxlanOffloadRx) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.HwIfIndex)) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.Enable) @@ -278,27 +263,24 @@ func (*VxlanOffloadRxReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanOffloadRxReply) Size() int { +func (m *VxlanOffloadRxReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VxlanOffloadRxReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VxlanOffloadRxReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -321,11 +303,10 @@ func (*VxlanTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanTunnelDetails) Size() int { +func (m *VxlanTunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 4 // m.Instance size += 1 // m.SrcAddress.Af @@ -339,22 +320,20 @@ func (m *VxlanTunnelDetails) Size() int { return size } func (m *VxlanTunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) - buf.EncodeUint32(uint32(m.Instance)) + buf.EncodeUint32(m.Instance) buf.EncodeUint8(uint8(m.SrcAddress.Af)) - buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.DstAddress.Af)) - buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.EncapVrfID)) - buf.EncodeUint32(uint32(m.DecapNextIndex)) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapNextIndex) + buf.EncodeUint32(m.Vni) return buf.Bytes(), nil } func (m *VxlanTunnelDetails) Unmarshal(b []byte) error { @@ -384,21 +363,18 @@ func (*VxlanTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanTunnelDump) Size() int { +func (m *VxlanTunnelDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *VxlanTunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } diff --git a/binapi/vxlan_gbp/vxlan_gbp.ba.go b/binapi/vxlan_gbp/vxlan_gbp.ba.go index d5c3f32..886d30a 100644 --- a/binapi/vxlan_gbp/vxlan_gbp.ba.go +++ b/binapi/vxlan_gbp/vxlan_gbp.ba.go @@ -88,23 +88,20 @@ func (*SwInterfaceSetVxlanGbpBypass) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetVxlanGbpBypass) Size() int { +func (m *SwInterfaceSetVxlanGbpBypass) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 size += 1 // m.Enable return size } func (m *SwInterfaceSetVxlanGbpBypass) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) buf.EncodeBool(m.Enable) @@ -132,27 +129,24 @@ func (*SwInterfaceSetVxlanGbpBypassReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetVxlanGbpBypassReply) Size() int { +func (m *SwInterfaceSetVxlanGbpBypassReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetVxlanGbpBypassReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetVxlanGbpBypassReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -169,11 +163,10 @@ func (*VxlanGbpTunnelAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGbpTunnelAddDel) Size() int { +func (m *VxlanGbpTunnelAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsAdd size += 4 // m.Tunnel.Instance size += 1 // m.Tunnel.Src.Af @@ -188,21 +181,19 @@ func (m *VxlanGbpTunnelAddDel) Size() int { return size } func (m *VxlanGbpTunnelAddDel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Tunnel.Instance)) + buf.EncodeUint32(m.Tunnel.Instance) buf.EncodeUint8(uint8(m.Tunnel.Src.Af)) - buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Tunnel.Dst.Af)) - buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.Tunnel.EncapTableID)) - buf.EncodeUint32(uint32(m.Tunnel.Vni)) + buf.EncodeUint32(m.Tunnel.EncapTableID) + buf.EncodeUint32(m.Tunnel.Vni) buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex)) buf.EncodeUint32(uint32(m.Tunnel.Mode)) return buf.Bytes(), nil @@ -236,29 +227,26 @@ func (*VxlanGbpTunnelAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGbpTunnelAddDelReply) Size() int { +func (m *VxlanGbpTunnelAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *VxlanGbpTunnelAddDelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *VxlanGbpTunnelAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -275,11 +263,10 @@ func (*VxlanGbpTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGbpTunnelDetails) Size() int { +func (m *VxlanGbpTunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Tunnel.Instance size += 1 // m.Tunnel.Src.Af size += 1 * 16 // m.Tunnel.Src.Un @@ -293,20 +280,18 @@ func (m *VxlanGbpTunnelDetails) Size() int { return size } func (m *VxlanGbpTunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Tunnel.Instance)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Tunnel.Instance) buf.EncodeUint8(uint8(m.Tunnel.Src.Af)) - buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Tunnel.Dst.Af)) - buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.Tunnel.EncapTableID)) - buf.EncodeUint32(uint32(m.Tunnel.Vni)) + buf.EncodeUint32(m.Tunnel.EncapTableID) + buf.EncodeUint32(m.Tunnel.Vni) buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex)) buf.EncodeUint32(uint32(m.Tunnel.Mode)) return buf.Bytes(), nil @@ -328,7 +313,7 @@ func (m *VxlanGbpTunnelDetails) Unmarshal(b []byte) error { // VxlanGbpTunnelDump defines message 'vxlan_gbp_tunnel_dump'. type VxlanGbpTunnelDump struct { - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` } func (m *VxlanGbpTunnelDump) Reset() { *m = VxlanGbpTunnelDump{} } @@ -338,21 +323,18 @@ func (*VxlanGbpTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGbpTunnelDump) Size() int { +func (m *VxlanGbpTunnelDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *VxlanGbpTunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } diff --git a/binapi/vxlan_gpe/vxlan_gpe.ba.go b/binapi/vxlan_gpe/vxlan_gpe.ba.go index 9da919d..0858ada 100644 --- a/binapi/vxlan_gpe/vxlan_gpe.ba.go +++ b/binapi/vxlan_gpe/vxlan_gpe.ba.go @@ -46,23 +46,20 @@ func (*SwInterfaceSetVxlanGpeBypass) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SwInterfaceSetVxlanGpeBypass) Size() int { +func (m *SwInterfaceSetVxlanGpeBypass) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.IsIPv6 size += 1 // m.Enable return size } func (m *SwInterfaceSetVxlanGpeBypass) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsIPv6) buf.EncodeBool(m.Enable) @@ -90,27 +87,24 @@ func (*SwInterfaceSetVxlanGpeBypassReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SwInterfaceSetVxlanGpeBypassReply) Size() int { +func (m *SwInterfaceSetVxlanGpeBypassReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SwInterfaceSetVxlanGpeBypassReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *SwInterfaceSetVxlanGpeBypassReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -133,11 +127,10 @@ func (*VxlanGpeAddDelTunnel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGpeAddDelTunnel) Size() int { +func (m *VxlanGpeAddDelTunnel) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.Local.Af size += 1 * 16 // m.Local.Un size += 1 // m.Remote.Af @@ -151,21 +144,19 @@ func (m *VxlanGpeAddDelTunnel) Size() int { return size } func (m *VxlanGpeAddDelTunnel) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint8(uint8(m.Local.Af)) - buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Remote.Af)) - buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.EncapVrfID)) - buf.EncodeUint32(uint32(m.DecapVrfID)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapVrfID) buf.EncodeUint8(uint8(m.Protocol)) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeUint32(m.Vni) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil } @@ -197,29 +188,26 @@ func (*VxlanGpeAddDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGpeAddDelTunnelReply) Size() int { +func (m *VxlanGpeAddDelTunnelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *VxlanGpeAddDelTunnelReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *VxlanGpeAddDelTunnelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } @@ -244,11 +232,10 @@ func (*VxlanGpeTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGpeTunnelDetails) Size() int { +func (m *VxlanGpeTunnelDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex size += 1 // m.Local.Af size += 1 * 16 // m.Local.Un @@ -263,22 +250,20 @@ func (m *VxlanGpeTunnelDetails) Size() int { return size } func (m *VxlanGpeTunnelDetails) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Local.Af)) - buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Remote.Af)) - buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.Vni)) + buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.Vni) buf.EncodeUint8(uint8(m.Protocol)) buf.EncodeUint32(uint32(m.McastSwIfIndex)) - buf.EncodeUint32(uint32(m.EncapVrfID)) - buf.EncodeUint32(uint32(m.DecapVrfID)) + buf.EncodeUint32(m.EncapVrfID) + buf.EncodeUint32(m.DecapVrfID) buf.EncodeBool(m.IsIPv6) return buf.Bytes(), nil } @@ -310,21 +295,18 @@ func (*VxlanGpeTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGpeTunnelDump) Size() int { +func (m *VxlanGpeTunnelDump) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.SwIfIndex return size } func (m *VxlanGpeTunnelDump) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } diff --git a/binapi/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go b/binapi/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go index 5a25905..8820fab 100644 --- a/binapi/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go +++ b/binapi/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go @@ -45,23 +45,20 @@ func (*VxlanGpeIoamExportEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *VxlanGpeIoamExportEnableDisable) Size() int { +func (m *VxlanGpeIoamExportEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IsDisable size += 1 * 4 // m.CollectorAddress size += 1 * 4 // m.SrcAddress return size } func (m *VxlanGpeIoamExportEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } + buf := codec.NewBuffer(b) buf.EncodeBool(m.IsDisable) buf.EncodeBytes(m.CollectorAddress[:], 4) buf.EncodeBytes(m.SrcAddress[:], 4) @@ -89,27 +86,24 @@ func (*VxlanGpeIoamExportEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *VxlanGpeIoamExportEnableDisableReply) Size() int { +func (m *VxlanGpeIoamExportEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *VxlanGpeIoamExportEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer if b == nil { - buf = codec.NewBuffer(make([]byte, m.Size())) - } else { - buf = codec.NewBuffer(b) + b = make([]byte, m.Size()) } - buf.EncodeUint32(uint32(m.Retval)) + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *VxlanGpeIoamExportEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } diff --git a/binapigen/binapigen.go b/binapigen/binapigen.go index 1b4c7e5..2dbd661 100644 --- a/binapigen/binapigen.go +++ b/binapigen/binapigen.go @@ -17,6 +17,7 @@ package binapigen import ( "fmt" "path" + "strconv" "strings" "git.fd.io/govpp.git/binapigen/vppapi" @@ -154,14 +155,6 @@ func (file *File) dependsOnFile(gen *Generator, dep string) bool { return false } -func normalizeImport(imp string) string { - imp = path.Base(imp) - if idx := strings.Index(imp, "."); idx >= 0 { - imp = imp[:idx] - } - return imp -} - const ( enumFlagSuffix = "_flags" ) @@ -251,8 +244,7 @@ func newStruct(gen *Generator, file *File, apitype vppapi.StructType) *Struct { } gen.structsByName[typ.Name] = typ for _, fieldType := range apitype.Fields { - field := newField(gen, file, fieldType) - field.ParentStruct = typ + field := newField(gen, file, typ, fieldType) typ.Fields = append(typ.Fields, field) } return typ @@ -285,8 +277,7 @@ func newUnion(gen *Generator, file *File, apitype vppapi.UnionType) *Union { } gen.unionsByName[typ.Name] = typ for _, fieldType := range apitype.Fields { - field := newField(gen, file, fieldType) - field.ParentUnion = typ + field := newField(gen, file, typ, fieldType) typ.Fields = append(typ.Fields, field) } return typ @@ -311,25 +302,11 @@ const ( msgTypeEvent // msg_id, client_index ) -func apiMsgType(t msgType) GoIdent { - switch t { - case msgTypeRequest: - return govppApiPkg.Ident("RequestMessage") - case msgTypeReply: - return govppApiPkg.Ident("ReplyMessage") - case msgTypeEvent: - return govppApiPkg.Ident("EventMessage") - default: - return govppApiPkg.Ident("OtherMessage") - } -} - // message fields const ( fieldMsgID = "_vl_msg_id" fieldClientIndex = "client_index" fieldContext = "context" - fieldRetval = "retval" ) // field options @@ -356,20 +333,17 @@ func newMessage(gen *Generator, file *File, apitype vppapi.Message) *Message { GoIdent: newGoIdent(file, apitype.Name), } gen.messagesByName[apitype.Name] = msg - n := 0 + var n int for _, fieldType := range apitype.Fields { - // skip internal fields - switch strings.ToLower(fieldType.Name) { - case fieldMsgID: - continue - case fieldClientIndex, fieldContext: - if n == 0 { + if n == 0 { + // skip header fields + switch strings.ToLower(fieldType.Name) { + case fieldMsgID, fieldClientIndex, fieldContext: continue } } n++ - field := newField(gen, file, fieldType) - field.ParentMessage = msg + field := newField(gen, file, msg, fieldType) msg.Fields = append(msg.Fields, field) } return msg @@ -389,16 +363,17 @@ func (m *Message) resolveDependencies(gen *Generator) (err error) { func getMsgType(m vppapi.Message) (msgType, error) { if len(m.Fields) == 0 { - return msgType(0), fmt.Errorf("message %s has no fields", m.Name) + return msgType(-1), fmt.Errorf("message %s has no fields", m.Name) } - typ := msgTypeBase - wasClientIndex := false + var typ msgType + var wasClientIndex bool for i, field := range m.Fields { - if i == 0 { + switch i { + case 0: if field.Name != fieldMsgID { - return msgType(0), fmt.Errorf("message %s is missing ID field", m.Name) + return msgType(-1), fmt.Errorf("message %s is missing ID field", m.Name) } - } else if i == 1 { + case 1: if field.Name == fieldClientIndex { // "client_index" as the second member, // this might be an event message or a request @@ -408,8 +383,8 @@ func getMsgType(m vppapi.Message) (msgType, error) { // reply needs "context" as the second member typ = msgTypeReply } - } else if i == 2 { - if wasClientIndex && field.Name == fieldContext { + case 2: + if field.Name == fieldContext && wasClientIndex { // request needs "client_index" as the second member // and "context" as the third member typ = msgTypeRequest @@ -419,34 +394,50 @@ func getMsgType(m vppapi.Message) (msgType, error) { return typ, nil } +// Field represents a field for message or struct/union types. type Field struct { vppapi.Field GoName string + // DefaultValue is a default value of field or + // nil if default value is not defined for field. DefaultValue interface{} - // Reference to actual type of this field + // Reference to actual type of this field. + // + // For fields with built-in types all of these are nil, + // otherwise only one is set to non-nil value. TypeEnum *Enum TypeAlias *Alias TypeStruct *Struct TypeUnion *Union - // Parent in which this field is declared + // Parent in which this field is declared. ParentMessage *Message ParentStruct *Struct ParentUnion *Union - // Field reference for fields determining size + // Field reference for fields with variable size. FieldSizeOf *Field FieldSizeFrom *Field } -func newField(gen *Generator, file *File, apitype vppapi.Field) *Field { +func newField(gen *Generator, file *File, parent interface{}, apitype vppapi.Field) *Field { typ := &Field{ Field: apitype, GoName: camelCaseName(apitype.Name), } + switch p := parent.(type) { + case *Message: + typ.ParentMessage = p + case *Struct: + typ.ParentStruct = p + case *Union: + typ.ParentUnion = p + default: + panic(fmt.Sprintf("invalid field parent: %T", parent)) + } if apitype.Meta != nil { if val, ok := apitype.Meta[optFieldDefault]; ok { typ.DefaultValue = val @@ -578,3 +569,61 @@ func (rpc *RPC) resolveMessages(gen *Generator) error { } return nil } + +// GoIdent is a Go identifier, consisting of a name and import path. +// The name is a single identifier and may not be a dot-qualified selector. +type GoIdent struct { + GoName string + GoImportPath GoImportPath +} + +func (id GoIdent) String() string { + return fmt.Sprintf("%q.%v", id.GoImportPath, id.GoName) +} + +func newGoIdent(f *File, fullName string) GoIdent { + name := strings.TrimPrefix(fullName, string(f.PackageName)+".") + return GoIdent{ + GoName: camelCaseName(name), + GoImportPath: f.GoImportPath, + } +} + +// GoImportPath is a Go import path for a package. +type GoImportPath string + +func (p GoImportPath) String() string { + return strconv.Quote(string(p)) +} + +func (p GoImportPath) Ident(s string) GoIdent { + return GoIdent{GoName: s, GoImportPath: p} +} + +type GoPackageName string + +func cleanPackageName(name string) GoPackageName { + return GoPackageName(sanitizedName(name)) +} + +// baseName returns the last path element of the name, with the last dotted suffix removed. +func baseName(name string) string { + // First, find the last element + if i := strings.LastIndex(name, "/"); i >= 0 { + name = name[i+1:] + } + // Now drop the suffix + if i := strings.LastIndex(name, "."); i >= 0 { + name = name[:i] + } + return name +} + +// normalizeImport returns the last path element of the import, with all dotted suffixes removed. +func normalizeImport(imp string) string { + imp = path.Base(imp) + if idx := strings.Index(imp, "."); idx >= 0 { + imp = imp[:idx] + } + return imp +} diff --git a/binapigen/binapigen_test.go b/binapigen/binapigen_test.go index 2fbd163..9a25420 100644 --- a/binapigen/binapigen_test.go +++ b/binapigen/binapigen_test.go @@ -53,3 +53,20 @@ func TestGenerator(t *testing.T) { }) } } + +func TestSanitize(t *testing.T) { + tests := []struct { + name string + expected string + }{ + {"interface", "interfaces"}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + s := sanitizedName(test.name) + if s != test.expected { + t.Fatalf("expected: %q, got: %q", test.expected, s) + } + }) + } +} diff --git a/binapigen/definitions.go b/binapigen/definitions.go deleted file mode 100644 index 3c8a874..0000000 --- a/binapigen/definitions.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) 2020 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package binapigen - -import ( - "strings" - "unicode" -) - -// commonInitialisms is a set of common initialisms that need to stay in upper case. -var commonInitialisms = map[string]bool{ - "ACL": true, - "API": true, - // NOTE: There are only two occurences of the word 'ascii' and - // these already have initialism before and after ASCII part, - // thus disabling initialism for this case. - "ASCII": false, - "CPU": true, - "CSS": true, - "DNS": true, - "DHCP": true, - "EOF": true, - "GUID": true, - "HTML": true, - "HTTP": true, - "HTTPS": true, - "ID": true, - "IP": true, - "ICMP": true, - "JSON": true, - "LHS": true, - "QPS": true, - "PID": true, - "RAM": true, - "RHS": true, - "RPC": true, - "SLA": true, - "SMTP": true, - "SQL": true, - "SSH": true, - "TCP": true, - "TLS": true, - "TTL": true, - "UDP": true, - "UI": true, - "UID": true, - "UUID": true, - "URI": true, - "URL": true, - "UTF8": true, - "VM": true, - "VPN": true, - "XML": true, - "XMPP": true, - "XSRF": true, - "XSS": true, -} - -// specialInitialisms is a set of special initialisms that need part to stay in upper case. -var specialInitialisms = map[string]string{ - "IPV": "IPv", -} - -func usesInitialism(s string) string { - if u := strings.ToUpper(s); commonInitialisms[u] { - return u - } else if su, ok := specialInitialisms[u]; ok { - return su - } - return "" -} - -// camelCaseName returns correct name identifier (camelCase). -func camelCaseName(name string) (should string) { - name = strings.Title(name) - - // Fast path for simple cases: "_" and all lowercase. - if name == "_" { - return name - } - allLower := true - for _, r := range name { - if !unicode.IsLower(r) { - allLower = false - break - } - } - if allLower { - return name - } - - // Split camelCase at any lower->upper transition, and split on underscores. - // Check each word for common initialisms. - runes := []rune(name) - w, i := 0, 0 // index of start of word, scan - for i+1 <= len(runes) { - eow := false // whether we hit the end of a word - if i+1 == len(runes) { - eow = true - } else if runes[i+1] == '_' { - // underscore; shift the remainder forward over any run of underscores - eow = true - n := 1 - for i+n+1 < len(runes) && runes[i+n+1] == '_' { - n++ - } - - // Leave at most one underscore if the underscore is between two digits - if i+n+1 < len(runes) && unicode.IsDigit(runes[i]) && unicode.IsDigit(runes[i+n+1]) { - n-- - } - - copy(runes[i+1:], runes[i+n+1:]) - runes = runes[:len(runes)-n] - } else if unicode.IsLower(runes[i]) && !unicode.IsLower(runes[i+1]) { - // lower->non-lower - eow = true - } - i++ - if !eow { - continue - } - - // [w,i) is a word. - word := string(runes[w:i]) - if u := usesInitialism(word); u != "" { - // Keep consistent case, which is lowercase only at the start. - if w == 0 && unicode.IsLower(runes[w]) { - u = strings.ToLower(u) - } - // All the common initialisms are ASCII, - // so we can replace the bytes exactly. - copy(runes[w:], []rune(u)) - } else if w > 0 && strings.ToLower(word) == word { - // already all lowercase, and not the first word, so uppercase the first character. - runes[w] = unicode.ToUpper(runes[w]) - } - w = i - } - return string(runes) -} diff --git a/binapigen/definitions_test.go b/binapigen/definitions_test.go deleted file mode 100644 index 761c95f..0000000 --- a/binapigen/definitions_test.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2020 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package binapigen - -import ( - "testing" -) - -func TestInitialism(t *testing.T) { - tests := []struct { - name string - input string - expOutput string - }{ - {name: "id", input: "id", expOutput: "ID"}, - {name: "ipv6", input: "is_ipv6", expOutput: "IsIPv6"}, - {name: "ip6", input: "is_ip6", expOutput: "IsIP6"}, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - output := camelCaseName(test.input) - if output != test.expOutput { - t.Errorf("expected %q, got %q", test.expOutput, output) - } - }) - } -} diff --git a/binapigen/gen_encoding.go b/binapigen/gen_encoding.go index 1cd3eb3..d946771 100644 --- a/binapigen/gen_encoding.go +++ b/binapigen/gen_encoding.go @@ -17,7 +17,6 @@ package binapigen import ( "fmt" "strconv" - "strings" "github.com/sirupsen/logrus" ) @@ -26,10 +25,9 @@ func init() { //RegisterPlugin("encoding", GenerateEncoding) } -func generateMessageSize(g *GenFile, name string, fields []*Field) { - g.P("func (m *", name, ") Size() int {") +func genMessageSize(g *GenFile, name string, fields []*Field) { + g.P("func (m *", name, ") Size() (size int) {") g.P("if m == nil { return 0 }") - g.P("var size int") sizeBaseType := func(typ, name string, length int, sizefrom string) { switch typ { @@ -77,17 +75,21 @@ func generateMessageSize(g *GenFile, name string, fields []*Field) { } if field.Array { - char := fmt.Sprintf("s%d", lvl) index := fmt.Sprintf("j%d", lvl) if field.Length > 0 { g.P("for ", index, " := 0; ", index, " < ", field.Length, "; ", index, "++ {") } else if field.FieldSizeFrom != nil { g.P("for ", index, " := 0; ", index, " < len(", name, "); ", index, "++ {") } - g.P("var ", char, " ", fieldGoType(g, field)) - g.P("_ = ", char) - g.P("if ", index, " < len(", name, ") { ", char, " = ", name, "[", index, "] }") - name = char + if field.Length == 0 || field.SizeFrom != "" { + char := fmt.Sprintf("s%d", lvl) + g.P("var ", char, " ", fieldGoType(g, field)) + g.P("_ = ", char) + g.P("if ", index, " < len(", name, ") { ", char, " = ", name, "[", index, "] }") + name = char + } else { + name = fmt.Sprintf("%s[%s]", name, index) + } } switch { @@ -127,44 +129,17 @@ func generateMessageSize(g *GenFile, name string, fields []*Field) { g.P("}") } -func encodeBaseType(g *GenFile, typ, name string, length int, sizefrom string) { - isArray := length > 0 || sizefrom != "" - if isArray { - switch typ { - case U8: - g.P("buf.EncodeBytes(", name, "[:], ", length, ")") - return - case I8, I16, U16, I32, U32, I64, U64, F64: - gotype := BaseTypesGo[typ] - if length != 0 { - g.P("for i := 0; i < ", length, "; i++ {") - } else if sizefrom != "" { - g.P("for i := 0; i < len(", name, "); i++ {") - } - g.P("var x ", gotype) - g.P("if i < len(", name, ") { x = ", gotype, "(", name, "[i]) }") - name = "x" - } - } - switch typ { - case I8, U8, I16, U16, I32, U32, I64, U64: - typsize := BaseTypeSizes[typ] - g.P("buf.EncodeUint", typsize*8, "(uint", typsize*8, "(", name, "))") - case F64: - g.P("buf.EncodeFloat64(float64(", name, "))") - case BOOL: - g.P("buf.EncodeBool(", name, ")") - case STRING: - g.P("buf.EncodeString(", name, ", ", length, ")") - default: - logrus.Panicf("// ??? %s %s\n", name, typ) - } - if isArray { - switch typ { - case I8, U8, I16, U16, I32, U32, I64, U64, F64: - g.P("}") - } - } +func genMessageMarshal(g *GenFile, name string, fields []*Field) { + g.P("func (m *", name, ") Marshal(b []byte) ([]byte, error) {") + g.P("if b == nil {") + g.P("b = make([]byte, m.Size())") + g.P("}") + g.P("buf := ", govppCodecPkg.Ident("NewBuffer"), "(b)") + + encodeFields(g, fields, "m", 0) + + g.P("return buf.Bytes(), nil") + g.P("}") } func encodeFields(g *GenFile, fields []*Field, parentName string, lvl int) { @@ -182,7 +157,8 @@ func encodeFields(g *GenFile, fields []*Field, parentName string, lvl int) { func encodeField(g *GenFile, field *Field, name string, getFieldName func(name string) string, lvl int) { if f := field.FieldSizeOf; f != nil { if _, ok := BaseTypesGo[field.Type]; ok { - encodeBaseType(g, field.Type, fmt.Sprintf("len(%s)", getFieldName(f.GoName)), field.Length, "") + val := fmt.Sprintf("len(%s)", getFieldName(f.GoName)) + encodeBaseType(g, field.Type, "int", val, 0, "", false) return } else { panic(fmt.Sprintf("failed to encode base type of sizefrom field: %s (%s)", field.Name, field.Type)) @@ -194,37 +170,46 @@ func encodeField(g *GenFile, field *Field, name string, getFieldName func(name s } if _, ok := BaseTypesGo[field.Type]; ok { - encodeBaseType(g, field.Type, name, field.Length, sizeFromName) + encodeBaseType(g, field.Type, fieldGoType(g, field), name, field.Length, sizeFromName, true) return } if field.Array { - char := fmt.Sprintf("v%d", lvl) index := fmt.Sprintf("j%d", lvl) if field.Length > 0 { g.P("for ", index, " := 0; ", index, " < ", field.Length, "; ", index, "++ {") } else if field.SizeFrom != "" { g.P("for ", index, " := 0; ", index, " < len(", name, "); ", index, "++ {") } - g.P("var ", char, " ", fieldGoType(g, field)) - g.P("if ", index, " < len(", name, ") { ", char, " = ", name, "[", index, "] }") - name = char + if field.Length == 0 || field.SizeFrom != "" { + char := fmt.Sprintf("v%d", lvl) + g.P("var ", char, " ", fieldGoType(g, field), "// ", field.GoName) + g.P("if ", index, " < len(", name, ") { ", char, " = ", name, "[", index, "] }") + name = char + } else { + name = fmt.Sprintf("%s[%s]", name, index) + } } switch { case field.TypeEnum != nil: - encodeBaseType(g, field.TypeEnum.Type, name, 0, "") + encodeBaseType(g, field.TypeEnum.Type, fieldGoType(g, field), name, 0, "", false) case field.TypeAlias != nil: alias := field.TypeAlias if typ := alias.TypeStruct; typ != nil { encodeFields(g, typ.Fields, name, lvl+1) } else { - encodeBaseType(g, alias.Type, name, alias.Length, "") + if alias.Length > 0 { + encodeBaseType(g, alias.Type, BaseTypesGo[alias.Type], name, alias.Length, "", false) + } else { + encodeBaseType(g, alias.Type, fieldGoType(g, field), name, 0, "", false) + } } case field.TypeStruct != nil: encodeFields(g, field.TypeStruct.Fields, name, lvl+1) case field.TypeUnion != nil: - g.P("buf.EncodeBytes(", name, ".", fieldUnionData, "[:], 0)") + maxSize := getUnionSize(field.TypeUnion) + g.P("buf.EncodeBytes(", name, ".", fieldUnionData, "[:], ", maxSize, ")") default: logrus.Panicf("\t// ??? buf[pos] = %s (%s)\n", name, field.Type) } @@ -234,61 +219,52 @@ func encodeField(g *GenFile, field *Field, name string, getFieldName func(name s } } -func generateMessageMarshal(g *GenFile, name string, fields []*Field) { - g.P("func (m *", name, ") Marshal(b []byte) ([]byte, error) {") - g.P("var buf *", govppCodecPkg.Ident("Buffer")) - g.P("if b == nil {") - g.P("buf = ", govppCodecPkg.Ident("NewBuffer"), "(make([]byte, m.Size()))") - g.P("} else {") - g.P("buf = ", govppCodecPkg.Ident("NewBuffer"), "(b)") - g.P("}") - - encodeFields(g, fields, "m", 0) - - g.P("return buf.Bytes(), nil") - g.P("}") -} - -func decodeBaseType(g *GenFile, typ, orig, name string, length int, sizefrom string, alloc bool) { +func encodeBaseType(g *GenFile, typ, orig, name string, length int, sizefrom string, alloc bool) { isArray := length > 0 || sizefrom != "" if isArray { switch typ { case U8: - g.P("copy(", name, "[:], buf.DecodeBytes(", length, "))") + if alloc { + g.P("buf.EncodeBytes(", name, ", ", length, ")") + } else { + g.P("buf.EncodeBytes(", name, "[:], ", length, ")") + } return case I8, I16, U16, I32, U32, I64, U64, F64: + gotype := BaseTypesGo[typ] + if length != 0 { + g.P("for i := 0; i < ", length, "; i++ {") + } else if sizefrom != "" { + g.P("for i := 0; i < len(", name, "); i++ {") + } if alloc { - var size string - switch { - case length > 0: - size = strconv.Itoa(length) - case sizefrom != "": - size = sizefrom - } - if size != "" { - g.P(name, " = make([]", orig, ", ", size, ")") - } + g.P("var x ", gotype) + g.P("if i < len(", name, ") { x = ", gotype, "(", name, "[i]) }") + name = "x" } - g.P("for i := 0; i < len(", name, "); i++ {") - name = fmt.Sprintf("%s[i]", name) } } + conv := func(s string) string { + if gotype, ok := BaseTypesGo[typ]; !ok || gotype != orig { + return fmt.Sprintf("%s(%s)", gotype, s) + } + return s + } switch typ { - case I8, U8, I16, U16, I32, U32, I64, U64: + case I8, I16, I32, I64: typsize := BaseTypeSizes[typ] - if gotype, ok := BaseTypesGo[typ]; !ok || gotype != orig || strings.HasPrefix(orig, "i") { - g.P(name, " = ", orig, "(buf.DecodeUint", typsize*8, "())") - } else { - g.P(name, " = buf.DecodeUint", typsize*8, "()") - } + g.P("buf.EncodeInt", typsize*8, "(", conv(name), ")") + case U8, U16, U32, U64: + typsize := BaseTypeSizes[typ] + g.P("buf.EncodeUint", typsize*8, "(", conv(name), ")") case F64: - g.P(name, " = ", orig, "(buf.DecodeFloat64())") + g.P("buf.EncodeFloat64(", conv(name), ")") case BOOL: - g.P(name, " = buf.DecodeBool()") + g.P("buf.EncodeBool(", name, ")") case STRING: - g.P(name, " = buf.DecodeString(", length, ")") + g.P("buf.EncodeString(", name, ", ", length, ")") default: - logrus.Panicf("\t// ??? %s %s\n", name, typ) + logrus.Panicf("// ??? %s %s\n", name, typ) } if isArray { switch typ { @@ -298,7 +274,7 @@ func decodeBaseType(g *GenFile, typ, orig, name string, length int, sizefrom str } } -func generateMessageUnmarshal(g *GenFile, name string, fields []*Field) { +func genMessageUnmarshal(g *GenFile, name string, fields []*Field) { g.P("func (m *", name, ") Unmarshal(b []byte) error {") if len(fields) > 0 { @@ -338,7 +314,7 @@ func decodeField(g *GenFile, field *Field, name string, getFieldName func(string if field.Length > 0 { g.P("for ", index, " := 0; ", index, " < ", field.Length, ";", index, "++ {") } else if field.SizeFrom != "" { - g.P(name, " = make(", getFieldType(g, field), ", int(", sizeFromName, "))") + g.P(name, " = make(", getFieldType(g, field), ", ", sizeFromName, ")") g.P("for ", index, " := 0; ", index, " < len(", name, ");", index, "++ {") } name = fmt.Sprintf("%s[%s]", name, index) @@ -357,7 +333,7 @@ func decodeField(g *GenFile, field *Field, name string, getFieldName func(string if alias.Length > 0 { decodeBaseType(g, alias.Type, BaseTypesGo[alias.Type], name, alias.Length, "", false) } else { - decodeBaseType(g, alias.Type, fieldGoType(g, field), name, alias.Length, "", false) + decodeBaseType(g, alias.Type, fieldGoType(g, field), name, 0, "", false) } } } else if typ := field.TypeStruct; typ != nil { @@ -373,3 +349,60 @@ func decodeField(g *GenFile, field *Field, name string, getFieldName func(string g.P("}") } } + +func decodeBaseType(g *GenFile, typ, orig, name string, length int, sizefrom string, alloc bool) { + isArray := length > 0 || sizefrom != "" + if isArray { + var size string + switch { + case length > 0: + size = strconv.Itoa(length) + case sizefrom != "": + size = sizefrom + } + switch typ { + case U8: + if alloc { + g.P(name, " = make([]byte, ", size, ")") + g.P("copy(", name, ", buf.DecodeBytes(len(", name, ")))") + } else { + g.P("copy(", name, "[:], buf.DecodeBytes(", size, "))") + } + return + case I8, I16, U16, I32, U32, I64, U64, F64: + if alloc { + g.P(name, " = make([]", orig, ", ", size, ")") + } + g.P("for i := 0; i < len(", name, "); i++ {") + name = fmt.Sprintf("%s[i]", name) + } + } + conv := func(s string) string { + if gotype, ok := BaseTypesGo[typ]; !ok || gotype != orig { + return fmt.Sprintf("%s(%s)", orig, s) + } + return s + } + switch typ { + case I8, I16, I32, I64: + typsize := BaseTypeSizes[typ] + g.P(name, " = ", conv(fmt.Sprintf("buf.DecodeInt%d()", typsize*8))) + case U8, U16, U32, U64: + typsize := BaseTypeSizes[typ] + g.P(name, " = ", conv(fmt.Sprintf("buf.DecodeUint%d()", typsize*8))) + case F64: + g.P(name, " = ", conv("buf.DecodeFloat64()")) + case BOOL: + g.P(name, " = buf.DecodeBool()") + case STRING: + g.P(name, " = buf.DecodeString(", length, ")") + default: + logrus.Panicf("\t// ??? %s %s\n", name, typ) + } + if isArray { + switch typ { + case I8, U8, I16, U16, I32, U32, I64, U64, F64: + g.P("}") + } + } +} diff --git a/binapigen/gen_helpers.go b/binapigen/gen_helpers.go index a22f1c6..5eafc76 100644 --- a/binapigen/gen_helpers.go +++ b/binapigen/gen_helpers.go @@ -25,7 +25,7 @@ const ( stringsPkg = GoImportPath("strings") ) -func generateIPConversion(g *GenFile, structName string, ipv int) { +func genIPConversion(g *GenFile, structName string, ipv int) { // ParseIPXAddress method g.P("func Parse", structName, "(s string) (", structName, ", error) {") if ipv == 4 { @@ -77,7 +77,7 @@ func generateIPConversion(g *GenFile, structName string, ipv int) { g.P() } -func generateAddressConversion(g *GenFile, structName string) { +func genAddressConversion(g *GenFile, structName string) { // ParseAddress method g.P("func Parse", structName, "(s string) (", structName, ", error) {") g.P(" ip := ", netPkg.Ident("ParseIP"), "(s)") @@ -132,7 +132,7 @@ func generateAddressConversion(g *GenFile, structName string) { g.P() } -func generateIPPrefixConversion(g *GenFile, structName string, ipv int) { +func genIPPrefixConversion(g *GenFile, structName string, ipv int) { // ParsePrefix method g.P("func Parse", structName, "(s string) (prefix ", structName, ", err error) {") g.P(" hasPrefix := ", stringsPkg.Ident("Contains"), "(s, \"/\")") @@ -211,7 +211,7 @@ func generateIPPrefixConversion(g *GenFile, structName string, ipv int) { g.P() } -func generatePrefixConversion(g *GenFile, structName string) { +func genPrefixConversion(g *GenFile, structName string) { // ParsePrefix method g.P("func Parse", structName, "(ip string) (prefix ", structName, ", err error) {") g.P(" hasPrefix := ", stringsPkg.Ident("Contains"), "(ip, \"/\")") @@ -276,7 +276,7 @@ func generatePrefixConversion(g *GenFile, structName string) { g.P() } -func generateAddressWithPrefixConversion(g *GenFile, structName string) { +func genAddressWithPrefixConversion(g *GenFile, structName string) { // ParseAddressWithPrefix method g.P("func Parse", structName, "(s string) (", structName, ", error) {") g.P(" prefix, err := ParsePrefix(s)") @@ -308,7 +308,7 @@ func generateAddressWithPrefixConversion(g *GenFile, structName string) { g.P() } -func generateMacAddressConversion(g *GenFile, structName string) { +func genMacAddressConversion(g *GenFile, structName string) { // ParseMAC method g.P("func Parse", structName, "(s string) (", structName, ", error) {") g.P(" var macaddr ", structName) diff --git a/binapigen/generate.go b/binapigen/generate.go index 689463e..679dd54 100644 --- a/binapigen/generate.go +++ b/binapigen/generate.go @@ -237,13 +237,13 @@ func genAlias(g *GenFile, alias *Alias) { // generate alias-specific methods switch alias.Name { case "ip4_address": - generateIPConversion(g, alias.GoName, 4) + genIPConversion(g, alias.GoName, 4) case "ip6_address": - generateIPConversion(g, alias.GoName, 16) + genIPConversion(g, alias.GoName, 16) case "address_with_prefix": - generateAddressWithPrefixConversion(g, alias.GoName) + genAddressWithPrefixConversion(g, alias.GoName) case "mac_address": - generateMacAddressConversion(g, alias.GoName) + genMacAddressConversion(g, alias.GoName) } } @@ -257,7 +257,7 @@ func genStruct(g *GenFile, typ *Struct) { } else { g.P("type ", typ.GoName, " struct {") for i := range typ.Fields { - generateField(g, typ.Fields, i) + genField(g, typ.Fields, i) } g.P("}") } @@ -266,13 +266,13 @@ func genStruct(g *GenFile, typ *Struct) { // generate type-specific methods switch typ.Name { case "address": - generateAddressConversion(g, typ.GoName) + genAddressConversion(g, typ.GoName) case "prefix": - generatePrefixConversion(g, typ.GoName) + genPrefixConversion(g, typ.GoName) case "ip4_prefix": - generateIPPrefixConversion(g, typ.GoName, 4) + genIPPrefixConversion(g, typ.GoName, 4) case "ip6_prefix": - generateIPPrefixConversion(g, typ.GoName, 6) + genIPPrefixConversion(g, typ.GoName, 6) } } @@ -313,7 +313,7 @@ func genUnionFieldMethods(g *GenFile, structName string, field *Field) { // Setter g.P("func (u *", structName, ") Set", field.GoName, "(a ", getterStruct, ") {") - g.P(" var buf = ", govppCodecPkg.Ident("NewBuffer"), "(u.", fieldUnionData, "[:])") + g.P(" buf := ", govppCodecPkg.Ident("NewBuffer"), "(u.", fieldUnionData, "[:])") encodeField(g, field, "a", func(name string) string { return "a." + name }, 0) @@ -321,7 +321,7 @@ func genUnionFieldMethods(g *GenFile, structName string, field *Field) { // Getter g.P("func (u *", structName, ") Get", field.GoName, "() (a ", getterStruct, ") {") - g.P(" var buf = ", govppCodecPkg.Ident("NewBuffer"), "(u.", fieldUnionData, "[:])") + g.P(" buf := ", govppCodecPkg.Ident("NewBuffer"), "(u.", fieldUnionData, "[:])") decodeField(g, field, "a", func(name string) string { return "a." + name }, 0) @@ -330,28 +330,28 @@ func genUnionFieldMethods(g *GenFile, structName string, field *Field) { g.P() } -func generateField(g *GenFile, fields []*Field, i int) { +func genField(g *GenFile, fields []*Field, i int) { field := fields[i] logf(" gen FIELD[%d] %s (%s) - type: %q (array: %v/%v)", i, field.GoName, field.Name, field.Type, field.Array, field.Length) gotype := getFieldType(g, field) tags := structTags{ - "binapi": fieldTagJSON(field), - "json": fieldTagBinapi(field), + "binapi": fieldTagBinapi(field), + "json": fieldTagJson(field), } g.P(field.GoName, " ", gotype, tags) } -func fieldTagBinapi(field *Field) string { +func fieldTagJson(field *Field) string { if field.FieldSizeOf != nil { return "-" } return fmt.Sprintf("%s,omitempty", field.Name) } -func fieldTagJSON(field *Field) string { +func fieldTagBinapi(field *Field) string { typ := fromApiType(field.Type) if field.Array { if field.Length > 0 { @@ -370,18 +370,15 @@ func fieldTagJSON(field *Field) string { tag = append(tag, fmt.Sprintf("limit=%s", limit)) } if def, ok := field.Meta["default"]; ok && def != nil { - actual := fieldActualType(field) - if t, ok := BaseTypesGo[actual]; ok { - switch t { - case I8, I16, I32, I64: - def = int(def.(float64)) - case U8, U16, U32, U64: - def = uint(def.(float64)) - case F64: - def = def.(float64) - } + switch fieldActualType(field) { + case I8, I16, I32, I64: + def = int(def.(float64)) + case U8, U16, U32, U64: + def = uint(def.(float64)) + case F64: + def = def.(float64) } - tag = append(tag, fmt.Sprintf("default=%s", def)) + tag = append(tag, fmt.Sprintf("default=%v", def)) } return strings.Join(tag, ",") } @@ -448,23 +445,23 @@ func genMessage(g *GenFile, msg *Message) { } else { g.P("type ", msg.GoIdent, " struct {") for i := range msg.Fields { - generateField(g, msg.Fields, i) + genField(g, msg.Fields, i) } g.P("}") } g.P() - generateMessageMethods(g, msg) + genMessageMethods(g, msg) // encoding methods - generateMessageSize(g, msg.GoIdent.GoName, msg.Fields) - generateMessageMarshal(g, msg.GoIdent.GoName, msg.Fields) - generateMessageUnmarshal(g, msg.GoIdent.GoName, msg.Fields) + genMessageSize(g, msg.GoIdent.GoName, msg.Fields) + genMessageMarshal(g, msg.GoIdent.GoName, msg.Fields) + genMessageUnmarshal(g, msg.GoIdent.GoName, msg.Fields) g.P() } -func generateMessageMethods(g *GenFile, msg *Message) { +func genMessageMethods(g *GenFile, msg *Message) { // Reset method g.P("func (m *", msg.GoIdent.GoName, ") Reset() { *m = ", msg.GoIdent.GoName, "{} }") @@ -481,3 +478,16 @@ func generateMessageMethods(g *GenFile, msg *Message) { g.P() } + +func apiMsgType(t msgType) GoIdent { + switch t { + case msgTypeRequest: + return govppApiPkg.Ident("RequestMessage") + case msgTypeReply: + return govppApiPkg.Ident("ReplyMessage") + case msgTypeEvent: + return govppApiPkg.Ident("EventMessage") + default: + return govppApiPkg.Ident("OtherMessage") + } +} diff --git a/binapigen/generator.go b/binapigen/generator.go index e42e7fb..ce0954a 100644 --- a/binapigen/generator.go +++ b/binapigen/generator.go @@ -19,7 +19,6 @@ import ( "bytes" "fmt" "go/ast" - "go/format" "go/parser" "go/printer" "go/token" @@ -86,12 +85,11 @@ func New(opts Options, apifiles []*vppapi.File, filesToGen []string) (*Generator logrus.Debugf("adding %d VPP API files to generator", len(gen.apifiles)) for _, apifile := range gen.apifiles { - filename := getFilename(apifile) - if _, ok := gen.FilesByName[apifile.Name]; ok { return nil, fmt.Errorf("duplicate file: %q", apifile.Name) } + filename := getFilename(apifile) file, err := newFile(gen, apifile, packageNames[filename], importPaths[filename]) if err != nil { return nil, fmt.Errorf("loading file %s failed: %w", apifile.Name, err) @@ -108,7 +106,7 @@ func New(opts Options, apifiles []*vppapi.File, filesToGen []string) (*Generator for _, genfile := range gen.filesToGen { file, ok := gen.FilesByName[genfile] if !ok { - return nil, fmt.Errorf("no API file found for: %v", genfile) + return nil, fmt.Errorf("nol API file found for: %v", genfile) } file.Generate = true // generate all imported files @@ -162,6 +160,7 @@ type GenFile struct { packageNames map[GoImportPath]GoPackageName } +// NewGenFile creates new generated file with func (g *Generator) NewGenFile(filename string, importPath GoImportPath) *GenFile { f := &GenFile{ gen: g, @@ -213,6 +212,7 @@ func (g *GenFile) Content() ([]byte, error) { return g.injectImports(g.buf.Bytes()) } +// injectImports parses source, injects import block declaration with all imports and return formatted func (g *GenFile) injectImports(original []byte) ([]byte, error) { // Parse source code fset := token.NewFileSet() @@ -290,66 +290,6 @@ func (g *GenFile) injectImports(original []byte) ([]byte, error) { return out.Bytes(), nil } -// GoIdent is a Go identifier, consisting of a name and import path. -// The name is a single identifier and may not be a dot-qualified selector. -type GoIdent struct { - GoName string - GoImportPath GoImportPath -} - -func (id GoIdent) String() string { - return fmt.Sprintf("%q.%v", id.GoImportPath, id.GoName) -} - -func newGoIdent(f *File, fullName string) GoIdent { - name := strings.TrimPrefix(fullName, string(f.PackageName)+".") - return GoIdent{ - GoName: camelCaseName(name), - GoImportPath: f.GoImportPath, - } -} - -// GoImportPath is a Go import path for a package. -type GoImportPath string - -func (p GoImportPath) String() string { - return strconv.Quote(string(p)) -} - -func (p GoImportPath) Ident(s string) GoIdent { - return GoIdent{GoName: s, GoImportPath: p} -} - -type GoPackageName string - -func cleanPackageName(name string) GoPackageName { - return GoPackageName(sanitizedName(name)) -} - -func sanitizedName(name string) string { - switch name { - case "interface": - return "interfaces" - case "map": - return "maps" - default: - return name - } -} - -// baseName returns the last path element of the name, with the last dotted suffix removed. -func baseName(name string) string { - // First, find the last element - if i := strings.LastIndex(name, "/"); i >= 0 { - name = name[i+1:] - } - // Now drop the suffix - if i := strings.LastIndex(name, "."); i >= 0 { - name = name[:i] - } - return name -} - func writeSourceTo(outputFile string, b []byte) error { // create output directory packageDir := filepath.Dir(outputFile) @@ -357,20 +297,13 @@ func writeSourceTo(outputFile string, b []byte) error { return fmt.Errorf("creating output dir %s failed: %v", packageDir, err) } - // format generated source code - gosrc, err := format.Source(b) - if err != nil { - _ = ioutil.WriteFile(outputFile, b, 0666) - return fmt.Errorf("formatting source code failed: %v", err) - } - // write generated code to output file - if err := ioutil.WriteFile(outputFile, gosrc, 0666); err != nil { + if err := ioutil.WriteFile(outputFile, b, 0666); err != nil { return fmt.Errorf("writing to output file %s failed: %v", outputFile, err) } - lines := bytes.Count(gosrc, []byte("\n")) - logf("wrote %d lines (%d bytes) to: %q", lines, len(gosrc), outputFile) + lines := bytes.Count(b, []byte("\n")) + logf("wrote %d lines (%d bytes) to: %q", lines, len(b), outputFile) return nil } diff --git a/binapigen/generator_test.go b/binapigen/generator_test.go index aa4ee04..1dfaca4 100644 --- a/binapigen/generator_test.go +++ b/binapigen/generator_test.go @@ -21,7 +21,10 @@ import ( func TestGoModule(t *testing.T) { const expected = "git.fd.io/govpp.git/binapi" - impPath := resolveImportPath("../binapi") + impPath, err := resolveImportPath("../binapi") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } if impPath != expected { t.Fatalf("expected: %q, got: %q", expected, impPath) } diff --git a/binapigen/run.go b/binapigen/run.go index 88e32b7..d3a181a 100644 --- a/binapigen/run.go +++ b/binapigen/run.go @@ -48,8 +48,11 @@ func run(apiDir string, filesToGenerate []string, opts Options, fn func(*Generat } if opts.ImportPrefix == "" { - opts.ImportPrefix = resolveImportPath(opts.OutputDir) - logrus.Debugf("resolved import prefix: %s", opts.ImportPrefix) + opts.ImportPrefix, err = resolveImportPath(opts.OutputDir) + if err != nil { + return fmt.Errorf("cannot resolve import path for output dir %s: %w", opts.OutputDir, err) + } + logrus.Infof("resolved import path prefix: %s", opts.ImportPrefix) } gen, err := New(opts, apifiles, filesToGenerate) @@ -93,10 +96,6 @@ func init() { if debug := os.Getenv("DEBUG_GOVPP"); strings.Contains(debug, "binapigen") { Logger.SetLevel(logrus.DebugLevel) logrus.SetLevel(logrus.DebugLevel) - } else if debug != "" { - Logger.SetLevel(logrus.InfoLevel) - } else { - Logger.SetLevel(logrus.WarnLevel) } } @@ -104,32 +103,30 @@ func logf(f string, v ...interface{}) { Logger.Debugf(f, v...) } -func resolveImportPath(dir string) string { +// resolveImportPath tries to resolve import path for a directory. +func resolveImportPath(dir string) (string, error) { absPath, err := filepath.Abs(dir) if err != nil { - panic(err) + return "", err } modRoot := findGoModuleRoot(absPath) if modRoot == "" { - logrus.Fatalf("module root not found at: %s", absPath) + return "", err } - modPath := findModulePath(path.Join(modRoot, "go.mod")) - if modPath == "" { - logrus.Fatalf("module path not found") + modPath, err := readModulePath(path.Join(modRoot, "go.mod")) + if err != nil { + return "", err } relDir, err := filepath.Rel(modRoot, absPath) if err != nil { - panic(err) + return "", err } - return filepath.Join(modPath, relDir) + return filepath.Join(modPath, relDir), nil } +// findGoModuleRoot looks for enclosing Go module. func findGoModuleRoot(dir string) (root string) { - if dir == "" { - panic("dir not set") - } dir = filepath.Clean(dir) - // Look for enclosing go.mod. for { if fi, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil && !fi.IsDir() { return dir @@ -143,18 +140,17 @@ func findGoModuleRoot(dir string) (root string) { return "" } -var ( - modulePathRE = regexp.MustCompile(`module[ \t]+([^ \t\r\n]+)`) -) +var modulePathRE = regexp.MustCompile(`module[ \t]+([^ \t\r\n]+)`) -func findModulePath(file string) string { - data, err := ioutil.ReadFile(file) +// readModulePath reads module path from go.mod file. +func readModulePath(gomod string) (string, error) { + data, err := ioutil.ReadFile(gomod) if err != nil { - return "" + return "", err } m := modulePathRE.FindSubmatch(data) if m == nil { - return "" + return "", err } - return string(m[1]) + return string(m[1]), nil } diff --git a/binapigen/strings.go b/binapigen/strings.go new file mode 100644 index 0000000..1ab24e9 --- /dev/null +++ b/binapigen/strings.go @@ -0,0 +1,165 @@ +// Copyright (c) 2020 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package binapigen + +import ( + "go/token" + "strings" + "unicode" + "unicode/utf8" +) + +// commonInitialisms is a set of common initialisms that need to stay in upper case. +var commonInitialisms = map[string]bool{ + "ACL": true, + "API": true, + // NOTE: There are only two occurences of the word 'ascii' and + // these already have initialism before and after ASCII part, + // thus disabling initialism for this case. + "ASCII": false, + "CPU": true, + "CSS": true, + "DNS": true, + "DHCP": true, + "EOF": true, + "GUID": true, + "HTML": true, + "HTTP": true, + "HTTPS": true, + "ID": true, + "IP": true, + "ICMP": true, + "JSON": true, + "LHS": true, + "QPS": true, + "PID": true, + "RAM": true, + "RHS": true, + "RPC": true, + "SLA": true, + "SMTP": true, + "SQL": true, + "SSH": true, + "TCP": true, + "TLS": true, + "TTL": true, + "UDP": true, + "UI": true, + "UID": true, + "UUID": true, + "URI": true, + "URL": true, + "UTF8": true, + "VM": true, + "VPN": true, + "XML": true, + "XMPP": true, + "XSRF": true, + "XSS": true, +} + +// specialInitialisms is a set of special initialisms that need part to stay in upper case. +var specialInitialisms = map[string]string{ + "IPV": "IPv", +} + +func usesInitialism(s string) string { + u := strings.ToUpper(s) + if commonInitialisms[u] { + return u + } else if su, ok := specialInitialisms[u]; ok { + return su + } + return "" +} + +// camelCaseName returns correct name identifier (camelCase). +func camelCaseName(name string) (should string) { + name = strings.Title(name) + + // Fast path for simple cases: "_" and all lowercase. + if name == "_" { + return name + } + allLower := true + for _, r := range name { + if !unicode.IsLower(r) { + allLower = false + break + } + } + if allLower { + return name + } + + // Split camelCase at any lower->upper transition, and split on underscores. + // Check each word for common initialisms. + runes := []rune(name) + w, i := 0, 0 // index of start of word, scan + for i+1 <= len(runes) { + eow := false // whether we hit the end of a word + if i+1 == len(runes) { + eow = true + } else if runes[i+1] == '_' { + // underscore; shift the remainder forward over any run of underscores + eow = true + n := 1 + for i+n+1 < len(runes) && runes[i+n+1] == '_' { + n++ + } + + // Leave at most one underscore if the underscore is between two digits + if i+n+1 < len(runes) && unicode.IsDigit(runes[i]) && unicode.IsDigit(runes[i+n+1]) { + n-- + } + + copy(runes[i+1:], runes[i+n+1:]) + runes = runes[:len(runes)-n] + } else if unicode.IsLower(runes[i]) && !unicode.IsLower(runes[i+1]) { + // lower->non-lower + eow = true + } + i++ + if !eow { + continue + } + + // [w,i) is a word. + word := string(runes[w:i]) + if u := usesInitialism(word); u != "" { + // Keep consistent case, which is lowercase only at the start. + if w == 0 && unicode.IsLower(runes[w]) { + u = strings.ToLower(u) + } + // All the common initialisms are ASCII, + // so we can replace the bytes exactly. + copy(runes[w:], []rune(u)) + } else if w > 0 && strings.ToLower(word) == word { + // already all lowercase, and not the first word, so uppercase the first character. + runes[w] = unicode.ToUpper(runes[w]) + } + w = i + } + return string(runes) +} + +// sanitizedName returns the string converted into a valid Go identifier. +func sanitizedName(s string) string { + r, _ := utf8.DecodeRuneInString(s) + if token.Lookup(s).IsKeyword() || !unicode.IsLetter(r) { + return s + "s" + } + return s +} diff --git a/binapigen/strings_test.go b/binapigen/strings_test.go new file mode 100644 index 0000000..761c95f --- /dev/null +++ b/binapigen/strings_test.go @@ -0,0 +1,39 @@ +// Copyright (c) 2020 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package binapigen + +import ( + "testing" +) + +func TestInitialism(t *testing.T) { + tests := []struct { + name string + input string + expOutput string + }{ + {name: "id", input: "id", expOutput: "ID"}, + {name: "ipv6", input: "is_ipv6", expOutput: "IsIPv6"}, + {name: "ip6", input: "is_ip6", expOutput: "IsIP6"}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + output := camelCaseName(test.input) + if output != test.expOutput { + t.Errorf("expected %q, got %q", test.expOutput, output) + } + }) + } +} diff --git a/binapigen/types.go b/binapigen/types.go index 0a21622..1d0dae5 100644 --- a/binapigen/types.go +++ b/binapigen/types.go @@ -87,8 +87,10 @@ func fieldActualType(field *Field) (actual string) { actual = field.TypeAlias.Type case field.TypeEnum != nil: actual = field.TypeEnum.Type + default: + actual = field.Type } - return field.Type + return } func fieldGoType(g *GenFile, field *Field) string { diff --git a/codec/codec.go b/codec/codec.go index 4178e12..3ae578b 100644 --- a/codec/codec.go +++ b/codec/codec.go @@ -18,8 +18,6 @@ import ( "bytes" "encoding/binary" "math" - "reflect" - "unsafe" ) // Buffer provides buffer for encoding and decoding data on wire. @@ -28,12 +26,14 @@ type Buffer struct { pos int } +// NewBuffer creates new buffer using b as data. func NewBuffer(b []byte) *Buffer { return &Buffer{ buf: b, } } +// Bytes returns buffer data up to current position. func (b *Buffer) Bytes() []byte { return b.buf[:b.pos] } @@ -68,12 +68,12 @@ func (b *Buffer) DecodeBool() bool { } func (b *Buffer) EncodeUint8(v uint8) { - b.buf[b.pos] = v + b.buf[b.pos] = byte(v) b.pos += 1 } func (b *Buffer) DecodeUint8() uint8 { - v := b.buf[b.pos] + v := uint8(b.buf[b.pos]) b.pos += 1 return v } @@ -111,6 +111,50 @@ func (b *Buffer) DecodeUint64() uint64 { return v } +func (b *Buffer) EncodeInt8(v int8) { + b.buf[b.pos] = byte(v) + b.pos += 1 +} + +func (b *Buffer) DecodeInt8() int8 { + v := int8(b.buf[b.pos]) + b.pos += 1 + return v +} + +func (b *Buffer) EncodeInt16(v int16) { + binary.BigEndian.PutUint16(b.buf[b.pos:b.pos+2], uint16(v)) + b.pos += 2 +} + +func (b *Buffer) DecodeInt16() int16 { + v := int16(binary.BigEndian.Uint16(b.buf[b.pos : b.pos+2])) + b.pos += 2 + return v +} + +func (b *Buffer) EncodeInt32(v int32) { + binary.BigEndian.PutUint32(b.buf[b.pos:b.pos+4], uint32(v)) + b.pos += 4 +} + +func (b *Buffer) DecodeInt32() int32 { + v := int32(binary.BigEndian.Uint32(b.buf[b.pos : b.pos+4])) + b.pos += 4 + return v +} + +func (b *Buffer) EncodeInt64(v int64) { + binary.BigEndian.PutUint64(b.buf[b.pos:b.pos+8], uint64(v)) + b.pos += 8 +} + +func (b *Buffer) DecodeInt64() int64 { + v := int64(binary.BigEndian.Uint64(b.buf[b.pos : b.pos+8])) + b.pos += 8 + return v +} + func (b *Buffer) EncodeFloat64(v float64) { binary.BigEndian.PutUint64(b.buf[b.pos:b.pos+8], math.Float64bits(v)) b.pos += 8 @@ -145,21 +189,3 @@ func (b *Buffer) DecodeString(length int) string { b.pos += length return string(v) } - -func BytesToString(b []byte) string { - sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b)) - stringHeader := reflect.StringHeader{Data: sliceHeader.Data, Len: sliceHeader.Len} - return *(*string)(unsafe.Pointer(&stringHeader)) -} - -func DecodeString(b []byte) string { - return string(b) -} - -func DecodeStringZero(b []byte) string { - nul := bytes.Index(b, []byte{0x00}) - if nul >= 0 { - b = b[:nul] - } - return string(b) -} diff --git a/codec/marshaler_test.go b/codec/marshaler_test.go index b3b20b0..985dd31 100644 --- a/codec/marshaler_test.go +++ b/codec/marshaler_test.go @@ -23,8 +23,7 @@ import ( "git.fd.io/govpp.git/binapi/ip_types" "git.fd.io/govpp.git/binapi/sr" "git.fd.io/govpp.git/codec" - "git.fd.io/govpp.git/internal/testbinapi/binapi2001/interfaces" - "git.fd.io/govpp.git/internal/testbinapi/binapi2001/ip" + interfaces "git.fd.io/govpp.git/internal/testbinapi/binapi2001/interface" ) // CliInband represents VPP binary API message 'cli_inband'. @@ -167,175 +166,3 @@ func TestNewCodecEncodeDecode2(t *testing.T) { t.Fatalf("newData differs from oldData") } } - -func TestNewCodecEncode(t *testing.T) { - m := NewIPRouteLookupReply() - /*m := &sr.SrPoliciesDetails{ - Bsid: sr.IP6Address{00, 11, 22, 33, 44, 55, 66, 77, 88, 99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, - IsSpray: true, - IsEncap: false, - FibTable: 33, - NumSidLists: 1, - SidLists: []sr.Srv6SidList{ - { - Weight: 555, - NumSids: 2, - Sids: [16]sr.IP6Address{ - {99}, - {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}, - }, - }, - }, - }*/ - - var err error - var oldData, newData []byte - { - w := codec.Wrapper{m} - size := m.Size() - t.Logf("wrapper size: %d", size) - oldData, err = w.Marshal(nil) - if err != nil { - t.Fatalf("expected nil error, got: %v", err) - } - } - { - size := m.Size() - t.Logf("size: %d", size) - newData, err = m.Marshal(nil) - if err != nil { - t.Fatalf("expected nil error, got: %v", err) - } - } - t.Logf("Data:\nOLD[%d]: % 03x\nNEW[%d]: % 03x", len(oldData), oldData, len(newData), newData) - - if !bytes.Equal(oldData, newData) { - t.Fatalf("newData differs from oldData") - } -} - -func TestNewCodecDecode(t *testing.T) { - data := []byte{ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, - 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, - 0x00, 0x00, 0x08, 0x09, 0x0a, 0x00, 0x00, 0x00, - 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x02, 0x01, 0x09, 0x00, - 0x00, 0x00, 0x08, 0x07, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - } - - var err error - var oldData, newData ip.IPRouteAddDel - { - w := codec.Wrapper{&oldData} - err = w.Unmarshal(data) - if err != nil { - t.Errorf("expected nil error, got: %v", err) - } - } - { - err = newData.Unmarshal(data) - if err != nil { - t.Errorf("expected nil error, got: %v", err) - } - } - t.Logf("Data:\nOLD: %+v\nNEW: %+v", oldData, newData) - - if !reflect.DeepEqual(oldData, newData) { - t.Fatalf("newData differs from oldData") - } -} - -func NewIPRouteLookupReply() *ip.IPRouteAddDel { - return &ip.IPRouteAddDel{ - Route: ip.IPRoute{ - TableID: 3, - StatsIndex: 5, - Prefix: ip.Prefix{ - Address: ip.Address{ - Af: ip.ADDRESS_IP6, - Un: ip.AddressUnion{}, - }, - Len: 24, - }, - NPaths: 2, - Paths: []ip.FibPath{ - { - SwIfIndex: 5, - TableID: 6, - RpfID: 8, - Weight: 9, - Preference: 10, - Type: 11, - Flags: 1, - Proto: 2, - Nh: ip.FibPathNh{ - Address: ip.AddressUnion{}, - ViaLabel: 3, - ObjID: 1, - ClassifyTableIndex: 2, - }, - NLabels: 1, - LabelStack: [16]ip.FibMplsLabel{ - { - IsUniform: 9, - Label: 8, - TTL: 7, - Exp: 6, - }, - }, - }, - { - SwIfIndex: 7, - TableID: 6, - RpfID: 8, - Weight: 9, - Preference: 10, - Type: 11, - Flags: 1, - Proto: 1, - Nh: ip.FibPathNh{ - Address: ip.AddressUnion{}, - ViaLabel: 3, - ObjID: 1, - ClassifyTableIndex: 2, - }, - NLabels: 2, - LabelStack: [16]ip.FibMplsLabel{ - { - IsUniform: 9, - Label: 8, - TTL: 7, - Exp: 6, - }, - { - IsUniform: 10, - Label: 8, - TTL: 7, - Exp: 6, - }, - }, - }, - }, - }, - } -} diff --git a/codec/msg_codec.go b/codec/msg_codec.go index 68cf3b1..6534e7d 100644 --- a/codec/msg_codec.go +++ b/codec/msg_codec.go @@ -24,6 +24,16 @@ import ( var DefaultCodec = new(MsgCodec) +func EncodeMsg(msg api.Message, msgID uint16) (data []byte, err error) { + return DefaultCodec.EncodeMsg(msg, msgID) +} +func DecodeMsg(data []byte, msg api.Message) (err error) { + return DefaultCodec.DecodeMsg(data, msg) +} +func DecodeMsgContext(data []byte, msg api.Message) (context uint32, err error) { + return DefaultCodec.DecodeMsgContext(data, msg) +} + // MsgCodec provides encoding and decoding functionality of `api.Message` structs into/from // binary format as accepted by VPP. type MsgCodec struct{} diff --git a/examples/simple-client/simple_client.go b/examples/simple-client/simple_client.go index e3ba83d..d823273 100644 --- a/examples/simple-client/simple_client.go +++ b/examples/simple-client/simple_client.go @@ -144,7 +144,9 @@ func interfaceDump(ch api.Channel) { fmt.Println("Dumping interfaces") n := 0 - reqCtx := ch.SendMultiRequest(&interfaces.SwInterfaceDump{}) + reqCtx := ch.SendMultiRequest(&interfaces.SwInterfaceDump{ + SwIfIndex: ^interface_types.InterfaceIndex(0), + }) for { msg := &interfaces.SwInterfaceDetails{} stop, err := reqCtx.ReceiveReply(msg) diff --git a/gen.go b/gen.go deleted file mode 100644 index 6b70a9c..0000000 --- a/gen.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2020 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package govpp - -// To generate bindings for VPP API files in the default system directory, run: -// -// go generate gen.go -// -//go:generate binapi-generator -input-dir=/usr/share/vpp/api -output-dir=binapi -gen=rpc,rest diff --git a/govpp.go b/govpp.go index 822739c..0ca020a 100644 --- a/govpp.go +++ b/govpp.go @@ -17,22 +17,36 @@ package govpp import ( "time" + "git.fd.io/govpp.git/adapter" "git.fd.io/govpp.git/adapter/socketclient" "git.fd.io/govpp.git/core" + "git.fd.io/govpp.git/internal/version" ) -// Connect connects the govpp core to VPP either using the default VPP Adapter, or using the adapter previously -// set by SetAdapter (useful mostly just for unit/integration tests with mocked VPP adapter). -// This call blocks until VPP is connected, or an error occurs. Only one connection attempt will be performed. -func Connect(shm string) (*core.Connection, error) { - return core.Connect(socketclient.NewVppClient(shm)) +// Connect connects to the VPP API using a new adapter instance created with NewVppAPIAdapter. +// +// This call blocks until VPP is connected, or an error occurs. +// Only one connection attempt will be performed. +func Connect(target string) (*core.Connection, error) { + return core.Connect(NewVppAdapter(target)) +} + +// AsyncConnect asynchronously connects to the VPP API using a new adapter instance +// created with NewVppAPIAdapter. +// +// This call does not block until connection is established, it returns immediately. +// The caller is supposed to watch the returned ConnectionState channel for connection events. +// In case of disconnect, the library will asynchronously try to reconnect. +func AsyncConnect(target string, attempts int, interval time.Duration) (*core.Connection, chan core.ConnectionEvent, error) { + return core.AsyncConnect(NewVppAdapter(target), attempts, interval) +} + +// NewVppAdapter returns new instance of VPP adapter for connecting to VPP API. +var NewVppAdapter = func(target string) adapter.VppAPI { + return socketclient.NewVppClient(target) } -// AsyncConnect asynchronously connects the govpp core to VPP either using the default VPP Adapter, -// or using the adapter previously set by SetAdapter. -// This call does not block until the connection is established, it returns immediately. The caller is -// supposed to watch the returned ConnectionState channel for Connected/Disconnected events. -// In case of a disconnect, the library will asynchronously try to reconnect. -func AsyncConnect(shm string, attempts int, interval time.Duration) (*core.Connection, chan core.ConnectionEvent, error) { - return core.AsyncConnect(socketclient.NewVppClient(shm), attempts, interval) +// Version returns version of GoVPP. +func Version() string { + return version.String() } diff --git a/internal/testbinapi/binapi2001/.vppapi/VPP_VERSION b/internal/testbinapi/binapi2001/.vppapi/VPP_VERSION new file mode 100644 index 0000000..b38ff33 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/VPP_VERSION @@ -0,0 +1 @@ +20.01-45~g7a071e370~b63 \ No newline at end of file diff --git a/internal/testbinapi/binapi2001/.vppapi/core/af_packet.api.json b/internal/testbinapi/binapi2001/.vppapi/core/af_packet.api.json new file mode 100644 index 0000000..158e7ec --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/af_packet.api.json @@ -0,0 +1,367 @@ +{ + "types": [], + "messages": [ + [ + "af_packet_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_mac_address_t", + "hw_addr" + ], + [ + "bool", + "use_random_hw_addr" + ], + [ + "string", + "host_if_name", + 64 + ], + { + "crc": "0xa190415f" + } + ], + [ + "af_packet_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "af_packet_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "host_if_name", + 64 + ], + { + "crc": "0x863fa648" + } + ], + [ + "af_packet_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "af_packet_set_l4_cksum_offload", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "set" + ], + { + "crc": "0x319cd5c8" + } + ], + [ + "af_packet_set_l4_cksum_offload_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "af_packet_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "af_packet_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "host_if_name", + 64 + ], + { + "crc": "0x58c7c042" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "af_packet_create": { + "reply": "af_packet_create_reply" + }, + "af_packet_delete": { + "reply": "af_packet_delete_reply" + }, + "af_packet_set_l4_cksum_offload": { + "reply": "af_packet_set_l4_cksum_offload_reply" + }, + "af_packet_dump": { + "reply": "af_packet_details", + "stream": true + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0xba745e20" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/arp.api.json b/internal/testbinapi/binapi2001/.vppapi/core/arp.api.json new file mode 100644 index 0000000..597c705 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/arp.api.json @@ -0,0 +1,648 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "proxy_arp", + [ + "u32", + "table_id" + ], + [ + "vl_api_ip4_address_t", + "low" + ], + [ + "vl_api_ip4_address_t", + "hi" + ] + ] + ], + "messages": [ + [ + "proxy_arp_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_proxy_arp_t", + "proxy" + ], + { + "crc": "0x85486cbd" + } + ], + [ + "proxy_arp_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "proxy_arp_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "proxy_arp_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_proxy_arp_t", + "proxy" + ], + { + "crc": "0x9228c150" + } + ], + [ + "proxy_arp_intfc_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xae6cfcfb" + } + ], + [ + "proxy_arp_intfc_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "proxy_arp_intfc_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "proxy_arp_intfc_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0xf6458e5f" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "proxy_arp_add_del": { + "reply": "proxy_arp_add_del_reply" + }, + "proxy_arp_dump": { + "reply": "proxy_arp_details", + "stream": true + }, + "proxy_arp_intfc_enable_disable": { + "reply": "proxy_arp_intfc_enable_disable_reply" + }, + "proxy_arp_intfc_dump": { + "reply": "proxy_arp_intfc_details", + "stream": true + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "mac_address": { + "type": "u8", + "length": 6 + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xa818aaf3" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/bfd.api.json b/internal/testbinapi/binapi2001/.vppapi/core/bfd.api.json new file mode 100644 index 0000000..390a0ca --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/bfd.api.json @@ -0,0 +1,1254 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "bfd_udp_set_echo_source", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "bfd_udp_set_echo_source_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bfd_udp_del_echo_source", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "bfd_udp_del_echo_source_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bfd_udp_get_echo_source", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "bfd_udp_get_echo_source_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_set" + ], + [ + "bool", + "have_usable_ip4" + ], + [ + "vl_api_ip4_address_t", + "ip4_addr" + ], + [ + "bool", + "have_usable_ip6" + ], + [ + "vl_api_ip6_address_t", + "ip6_addr" + ], + { + "crc": "0x1e00cfce" + } + ], + [ + "bfd_udp_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "desired_min_tx" + ], + [ + "u32", + "required_min_rx" + ], + [ + "vl_api_address_t", + "local_addr" + ], + [ + "vl_api_address_t", + "peer_addr" + ], + [ + "u8", + "detect_mult" + ], + [ + "bool", + "is_authenticated" + ], + [ + "u8", + "bfd_key_id" + ], + [ + "u32", + "conf_key_id" + ], + { + "crc": "0x7a6d1185" + } + ], + [ + "bfd_udp_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bfd_udp_mod", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "desired_min_tx" + ], + [ + "u32", + "required_min_rx" + ], + [ + "vl_api_address_t", + "local_addr" + ], + [ + "vl_api_address_t", + "peer_addr" + ], + [ + "u8", + "detect_mult" + ], + { + "crc": "0x783a3ff6" + } + ], + [ + "bfd_udp_mod_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bfd_udp_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_t", + "local_addr" + ], + [ + "vl_api_address_t", + "peer_addr" + ], + { + "crc": "0x8096514d" + } + ], + [ + "bfd_udp_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bfd_udp_session_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "bfd_udp_session_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_t", + "local_addr" + ], + [ + "vl_api_address_t", + "peer_addr" + ], + [ + "vl_api_bfd_state_t", + "state" + ], + [ + "bool", + "is_authenticated" + ], + [ + "u8", + "bfd_key_id" + ], + [ + "u32", + "conf_key_id" + ], + [ + "u32", + "required_min_rx" + ], + [ + "u32", + "desired_min_tx" + ], + [ + "u8", + "detect_mult" + ], + { + "crc": "0x60653c02" + } + ], + [ + "bfd_udp_session_set_flags", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_t", + "local_addr" + ], + [ + "vl_api_address_t", + "peer_addr" + ], + [ + "vl_api_if_status_flags_t", + "flags" + ], + { + "crc": "0xcf313851" + } + ], + [ + "bfd_udp_session_set_flags_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "want_bfd_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + [ + "u32", + "pid" + ], + { + "crc": "0xc5e2af94" + } + ], + [ + "want_bfd_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bfd_auth_set_key", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "conf_key_id" + ], + [ + "u8", + "key_len" + ], + [ + "u8", + "auth_type" + ], + [ + "u8", + "key", + 20 + ], + { + "crc": "0x690b8877" + } + ], + [ + "bfd_auth_set_key_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bfd_auth_del_key", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "conf_key_id" + ], + { + "crc": "0x65310b22" + } + ], + [ + "bfd_auth_del_key_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bfd_auth_keys_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "bfd_auth_keys_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "conf_key_id" + ], + [ + "u32", + "use_count" + ], + [ + "u8", + "auth_type" + ], + { + "crc": "0x84130e9f" + } + ], + [ + "bfd_udp_auth_activate", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_t", + "local_addr" + ], + [ + "vl_api_address_t", + "peer_addr" + ], + [ + "bool", + "is_delayed" + ], + [ + "u8", + "bfd_key_id" + ], + [ + "u32", + "conf_key_id" + ], + { + "crc": "0x493ee0ec" + } + ], + [ + "bfd_udp_auth_activate_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bfd_udp_auth_deactivate", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_t", + "local_addr" + ], + [ + "vl_api_address_t", + "peer_addr" + ], + [ + "bool", + "is_delayed" + ], + { + "crc": "0x99978c32" + } + ], + [ + "bfd_udp_auth_deactivate_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "bfd_state", + [ + "BFD_STATE_API_ADMIN_DOWN", + 0 + ], + [ + "BFD_STATE_API_DOWN", + 1 + ], + [ + "BFD_STATE_API_INIT", + 2 + ], + [ + "BFD_STATE_API_UP", + 3 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "bfd_udp_set_echo_source": { + "reply": "bfd_udp_set_echo_source_reply" + }, + "bfd_udp_del_echo_source": { + "reply": "bfd_udp_del_echo_source_reply" + }, + "bfd_udp_get_echo_source": { + "reply": "bfd_udp_get_echo_source_reply" + }, + "bfd_udp_add": { + "reply": "bfd_udp_add_reply" + }, + "bfd_udp_mod": { + "reply": "bfd_udp_mod_reply" + }, + "bfd_udp_del": { + "reply": "bfd_udp_del_reply" + }, + "bfd_udp_session_dump": { + "reply": "bfd_udp_session_details", + "stream": true + }, + "bfd_udp_session_set_flags": { + "reply": "bfd_udp_session_set_flags_reply" + }, + "want_bfd_events": { + "reply": "want_bfd_events_reply" + }, + "bfd_auth_set_key": { + "reply": "bfd_auth_set_key_reply" + }, + "bfd_auth_del_key": { + "reply": "bfd_auth_del_key_reply" + }, + "bfd_auth_keys_dump": { + "reply": "bfd_auth_keys_details", + "stream": true + }, + "bfd_udp_auth_activate": { + "reply": "bfd_udp_auth_activate_reply" + }, + "bfd_udp_auth_deactivate": { + "reply": "bfd_udp_auth_deactivate_reply" + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xfd792c8c" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/bier.api.json b/internal/testbinapi/binapi2001/.vppapi/core/bier.api.json new file mode 100644 index 0000000..02937e7 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/bier.api.json @@ -0,0 +1,1086 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ], + [ + "bier_table_id", + [ + "u8", + "bt_set" + ], + [ + "u8", + "bt_sub_domain" + ], + [ + "u8", + "bt_hdr_len_id" + ] + ], + [ + "bier_route", + [ + "u32", + "br_bp" + ], + [ + "vl_api_bier_table_id_t", + "br_tbl_id" + ], + [ + "u8", + "br_n_paths" + ], + [ + "vl_api_fib_path_t", + "br_paths", + 0, + "br_n_paths" + ] + ] + ], + "messages": [ + [ + "bier_table_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_bier_table_id_t", + "bt_tbl_id" + ], + [ + "u32", + "bt_label" + ], + [ + "bool", + "bt_is_add" + ], + { + "crc": "0x35e59209" + } + ], + [ + "bier_table_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bier_table_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "bier_table_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bt_label" + ], + [ + "vl_api_bier_table_id_t", + "bt_tbl_id" + ], + { + "crc": "0xfc44a9dd" + } + ], + [ + "bier_route_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "br_is_add" + ], + [ + "bool", + "br_is_replace" + ], + [ + "vl_api_bier_route_t", + "br_route" + ], + { + "crc": "0xf29edca0" + } + ], + [ + "bier_route_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bier_route_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_bier_table_id_t", + "br_tbl_id" + ], + { + "crc": "0x38339846" + } + ], + [ + "bier_route_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_bier_route_t", + "br_route" + ], + { + "crc": "0x39ee6a56" + } + ], + [ + "bier_imp_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_bier_table_id_t", + "bi_tbl_id" + ], + [ + "u16", + "bi_src" + ], + [ + "u8", + "bi_n_bytes" + ], + [ + "u8", + "bi_bytes", + 0, + "bi_n_bytes" + ], + { + "crc": "0x3856dc3d" + } + ], + [ + "bier_imp_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "bi_index" + ], + { + "crc": "0xd49c5793" + } + ], + [ + "bier_imp_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bi_index" + ], + { + "crc": "0x7d45edf6" + } + ], + [ + "bier_imp_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bier_imp_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "bier_imp_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_bier_table_id_t", + "bi_tbl_id" + ], + [ + "u16", + "bi_src" + ], + [ + "u8", + "bi_n_bytes" + ], + [ + "u8", + "bi_bytes", + 0, + "bi_n_bytes" + ], + { + "crc": "0xb76192df" + } + ], + [ + "bier_disp_table_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bdt_tbl_id" + ], + [ + "bool", + "bdt_is_add" + ], + { + "crc": "0x889657ac" + } + ], + [ + "bier_disp_table_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bier_disp_table_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "bier_disp_table_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bdt_tbl_id" + ], + { + "crc": "0xd27942c0" + } + ], + [ + "bier_disp_entry_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "bde_bp" + ], + [ + "u32", + "bde_tbl_id" + ], + [ + "bool", + "bde_is_add" + ], + [ + "u8", + "bde_payload_proto" + ], + [ + "u8", + "bde_n_paths" + ], + [ + "vl_api_fib_path_t", + "bde_paths", + 0, + "bde_n_paths" + ], + { + "crc": "0x648323eb" + } + ], + [ + "bier_disp_entry_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bier_disp_entry_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bde_tbl_id" + ], + { + "crc": "0xb5fa54ad" + } + ], + [ + "bier_disp_entry_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u16", + "bde_bp" + ], + [ + "u32", + "bde_tbl_id" + ], + [ + "bool", + "bde_is_add" + ], + [ + "u8", + "bde_payload_proto" + ], + [ + "u8", + "bde_n_paths" + ], + [ + "vl_api_fib_path_t", + "bde_paths", + 0, + "bde_n_paths" + ], + { + "crc": "0xe5b039a9" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "bier_table_add_del": { + "reply": "bier_table_add_del_reply" + }, + "bier_table_dump": { + "reply": "bier_table_details", + "stream": true + }, + "bier_route_add_del": { + "reply": "bier_route_add_del_reply" + }, + "bier_route_dump": { + "reply": "bier_route_details", + "stream": true + }, + "bier_imp_add": { + "reply": "bier_imp_add_reply" + }, + "bier_imp_del": { + "reply": "bier_imp_del_reply" + }, + "bier_imp_dump": { + "reply": "bier_imp_details", + "stream": true + }, + "bier_disp_table_add_del": { + "reply": "bier_disp_table_add_del_reply" + }, + "bier_disp_table_dump": { + "reply": "bier_disp_table_details", + "stream": true + }, + "bier_disp_entry_add_del": { + "reply": "bier_disp_entry_add_del_reply" + }, + "bier_disp_entry_dump": { + "reply": "bier_disp_entry_details", + "stream": true + } + }, + "options": { + "version": "1.2.1" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x27c878c4" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/bond.api.json b/internal/testbinapi/binapi2001/.vppapi/core/bond.api.json new file mode 100644 index 0000000..5eefc92 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/bond.api.json @@ -0,0 +1,620 @@ +{ + "types": [], + "messages": [ + [ + "bond_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "id" + ], + [ + "bool", + "use_custom_mac" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + [ + "vl_api_bond_mode_t", + "mode" + ], + [ + "vl_api_bond_lb_algo_t", + "lb" + ], + [ + "bool", + "numa_only" + ], + { + "crc": "0x48883c7e" + } + ], + [ + "bond_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "bond_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "bond_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bond_enslave", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_interface_index_t", + "bond_sw_if_index" + ], + [ + "bool", + "is_passive" + ], + [ + "bool", + "is_long_timeout" + ], + { + "crc": "0x076ecfa7" + } + ], + [ + "bond_enslave_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bond_detach_slave", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "bond_detach_slave_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_bond_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "sw_interface_bond_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "id" + ], + [ + "vl_api_bond_mode_t", + "mode" + ], + [ + "vl_api_bond_lb_algo_t", + "lb" + ], + [ + "bool", + "numa_only" + ], + [ + "u32", + "active_slaves" + ], + [ + "u32", + "slaves" + ], + [ + "string", + "interface_name", + 64 + ], + { + "crc": "0xf5ef2106" + } + ], + [ + "sw_interface_slave_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "sw_interface_slave_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "interface_name", + 64 + ], + [ + "bool", + "is_passive" + ], + [ + "bool", + "is_long_timeout" + ], + [ + "bool", + "is_local_numa" + ], + [ + "u32", + "weight" + ], + { + "crc": "0x3c4a0e23" + } + ], + [ + "sw_interface_set_bond_weight", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "weight" + ], + { + "crc": "0xdeb510a0" + } + ], + [ + "sw_interface_set_bond_weight_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "bond_mode", + [ + "BOND_API_MODE_ROUND_ROBIN", + 1 + ], + [ + "BOND_API_MODE_ACTIVE_BACKUP", + 2 + ], + [ + "BOND_API_MODE_XOR", + 3 + ], + [ + "BOND_API_MODE_BROADCAST", + 4 + ], + [ + "BOND_API_MODE_LACP", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "bond_lb_algo", + [ + "BOND_API_LB_ALGO_L2", + 0 + ], + [ + "BOND_API_LB_ALGO_L34", + 1 + ], + [ + "BOND_API_LB_ALGO_L23", + 2 + ], + [ + "BOND_API_LB_ALGO_RR", + 3 + ], + [ + "BOND_API_LB_ALGO_BC", + 4 + ], + [ + "BOND_API_LB_ALGO_AB", + 5 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "bond_create": { + "reply": "bond_create_reply" + }, + "bond_delete": { + "reply": "bond_delete_reply" + }, + "bond_enslave": { + "reply": "bond_enslave_reply" + }, + "bond_detach_slave": { + "reply": "bond_detach_slave_reply" + }, + "sw_interface_bond_dump": { + "reply": "sw_interface_bond_details", + "stream": true + }, + "sw_interface_slave_dump": { + "reply": "sw_interface_slave_details", + "stream": true + }, + "sw_interface_set_bond_weight": { + "reply": "sw_interface_set_bond_weight_reply" + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0x69f583ad" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/classify.api.json b/internal/testbinapi/binapi2001/.vppapi/core/classify.api.json new file mode 100644 index 0000000..0b6bf84 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/classify.api.json @@ -0,0 +1,1154 @@ +{ + "types": [], + "messages": [ + [ + "classify_add_del_table", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "bool", + "del_chain" + ], + [ + "u32", + "table_index", + { + "default": 4294967295 + } + ], + [ + "u32", + "nbuckets", + { + "default": 2 + } + ], + [ + "u32", + "memory_size", + { + "default": 2097152 + } + ], + [ + "u32", + "skip_n_vectors", + { + "default": 0 + } + ], + [ + "u32", + "match_n_vectors", + { + "default": 1 + } + ], + [ + "u32", + "next_table_index", + { + "default": 4294967295 + } + ], + [ + "u32", + "miss_next_index", + { + "default": 4294967295 + } + ], + [ + "u8", + "current_data_flag", + { + "default": 0 + } + ], + [ + "i16", + "current_data_offset", + { + "default": 0 + } + ], + [ + "u32", + "mask_len" + ], + [ + "u8", + "mask", + 0, + "mask_len" + ], + { + "crc": "0x6849e39e" + } + ], + [ + "classify_add_del_table_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "new_table_index" + ], + [ + "u32", + "skip_n_vectors" + ], + [ + "u32", + "match_n_vectors" + ], + { + "crc": "0x05486349" + } + ], + [ + "classify_add_del_session", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "u32", + "table_index" + ], + [ + "u32", + "hit_next_index", + { + "default": 4294967295 + } + ], + [ + "u32", + "opaque_index", + { + "default": 4294967295 + } + ], + [ + "i32", + "advance", + { + "default": 0 + } + ], + [ + "vl_api_classify_action_t", + "action", + { + "default": 0 + } + ], + [ + "u32", + "metadata", + { + "default": 0 + } + ], + [ + "u32", + "match_len" + ], + [ + "u8", + "match", + 0, + "match_len" + ], + { + "crc": "0xf20879f0" + } + ], + [ + "classify_add_del_session_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "policer_classify_set_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "ip4_table_index" + ], + [ + "u32", + "ip6_table_index" + ], + [ + "u32", + "l2_table_index" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0xde7ad708" + } + ], + [ + "policer_classify_set_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "policer_classify_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_policer_classify_table_t", + "type" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x6bfe6603" + } + ], + [ + "policer_classify_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "table_index" + ], + { + "crc": "0xdfd08765" + } + ], + [ + "classify_table_ids", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "classify_table_ids_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "u32", + "ids", + 0, + "count" + ], + { + "crc": "0xd1d20e1d" + } + ], + [ + "classify_table_by_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "classify_table_by_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "l2_table_id" + ], + [ + "u32", + "ip4_table_id" + ], + [ + "u32", + "ip6_table_id" + ], + { + "crc": "0xed4197db" + } + ], + [ + "classify_table_info", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + { + "crc": "0x0cca2cd9" + } + ], + [ + "classify_table_info_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "nbuckets" + ], + [ + "u32", + "match_n_vectors" + ], + [ + "u32", + "skip_n_vectors" + ], + [ + "u32", + "active_sessions" + ], + [ + "u32", + "next_table_index" + ], + [ + "u32", + "miss_next_index" + ], + [ + "u32", + "mask_length" + ], + [ + "u8", + "mask", + 0, + "mask_length" + ], + { + "crc": "0x4a573c0e" + } + ], + [ + "classify_session_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + { + "crc": "0x0cca2cd9" + } + ], + [ + "classify_session_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "hit_next_index" + ], + [ + "i32", + "advance" + ], + [ + "u32", + "opaque_index" + ], + [ + "u32", + "match_length" + ], + [ + "u8", + "match", + 0, + "match_length" + ], + { + "crc": "0x60e3ef94" + } + ], + [ + "flow_classify_set_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "ip4_table_index" + ], + [ + "u32", + "ip6_table_index" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0xb6192f1c" + } + ], + [ + "flow_classify_set_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "flow_classify_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_flow_classify_table_t", + "type" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x8a6ad43d" + } + ], + [ + "flow_classify_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "table_index" + ], + { + "crc": "0xdfd08765" + } + ], + [ + "classify_set_interface_ip_table", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_ipv6" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "table_index" + ], + { + "crc": "0xe0b097c7" + } + ], + [ + "classify_set_interface_ip_table_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "classify_set_interface_l2_tables", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "ip4_table_index" + ], + [ + "u32", + "ip6_table_index" + ], + [ + "u32", + "other_table_index" + ], + [ + "bool", + "is_input" + ], + { + "crc": "0x5a6ddf65" + } + ], + [ + "classify_set_interface_l2_tables_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "input_acl_set_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "ip4_table_index" + ], + [ + "u32", + "ip6_table_index" + ], + [ + "u32", + "l2_table_index" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0xde7ad708" + } + ], + [ + "input_acl_set_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "output_acl_set_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "ip4_table_index" + ], + [ + "u32", + "ip6_table_index" + ], + [ + "u32", + "l2_table_index" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0xde7ad708" + } + ], + [ + "output_acl_set_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "classify_action", + [ + "CLASSIFY_API_ACTION_NONE", + 0 + ], + [ + "CLASSIFY_API_ACTION_SET_IP4_FIB_INDEX", + 1 + ], + [ + "CLASSIFY_API_ACTION_SET_IP6_FIB_INDEX", + 2 + ], + [ + "CLASSIFY_API_ACTION_SET_METADATA", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "policer_classify_table", + [ + "POLICER_CLASSIFY_API_TABLE_IP4", + 1 + ], + [ + "POLICER_CLASSIFY_API_TABLE_IP6", + 2 + ], + [ + "POLICER_CLASSIFY_API_TABLE_L2", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "flow_classify_table", + [ + "FLOW_CLASSIFY_API_TABLE_IP4", + 1 + ], + [ + "FLOW_CLASSIFY_API_TABLE_IP6", + 2 + ], + { + "enumtype": "u8" + } + ] + ], + "services": { + "classify_add_del_table": { + "reply": "classify_add_del_table_reply" + }, + "classify_add_del_session": { + "reply": "classify_add_del_session_reply" + }, + "policer_classify_set_interface": { + "reply": "policer_classify_set_interface_reply" + }, + "policer_classify_dump": { + "reply": "policer_classify_details", + "stream": true + }, + "classify_table_ids": { + "reply": "classify_table_ids_reply" + }, + "classify_table_by_interface": { + "reply": "classify_table_by_interface_reply" + }, + "classify_table_info": { + "reply": "classify_table_info_reply" + }, + "classify_session_dump": { + "reply": "classify_session_details", + "stream": true + }, + "flow_classify_set_interface": { + "reply": "flow_classify_set_interface_reply" + }, + "flow_classify_dump": { + "reply": "flow_classify_details", + "stream": true + }, + "classify_set_interface_ip_table": { + "reply": "classify_set_interface_ip_table_reply" + }, + "classify_set_interface_l2_tables": { + "reply": "classify_set_interface_l2_tables_reply" + }, + "input_acl_set_interface": { + "reply": "input_acl_set_interface_reply" + }, + "output_acl_set_interface": { + "reply": "output_acl_set_interface_reply" + } + }, + "options": { + "version": "3.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x13587952" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/cop.api.json b/internal/testbinapi/binapi2001/.vppapi/core/cop.api.json new file mode 100644 index 0000000..2ebf76b --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/cop.api.json @@ -0,0 +1,277 @@ +{ + "types": [], + "messages": [ + [ + "cop_interface_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable_disable" + ], + { + "crc": "0x5501adee" + } + ], + [ + "cop_interface_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "cop_whitelist_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "fib_id" + ], + [ + "bool", + "ip4" + ], + [ + "bool", + "ip6" + ], + [ + "bool", + "default_cop" + ], + { + "crc": "0xdebe13ea" + } + ], + [ + "cop_whitelist_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "cop_interface_enable_disable": { + "reply": "cop_interface_enable_disable_reply" + }, + "cop_whitelist_enable_disable": { + "reply": "cop_whitelist_enable_disable_reply" + } + }, + "options": { + "version": "1.0.1" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x59bc1ad8" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ethernet_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ethernet_types.api.json new file mode 100644 index 0000000..f945773 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ethernet_types.api.json @@ -0,0 +1,15 @@ +{ + "types": [], + "messages": [], + "unions": [], + "enums": [], + "services": {}, + "options": {}, + "aliases": { + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0xd4ff2808" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/feature.api.json b/internal/testbinapi/binapi2001/.vppapi/core/feature.api.json new file mode 100644 index 0000000..d338012 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/feature.api.json @@ -0,0 +1,228 @@ +{ + "types": [], + "messages": [ + [ + "feature_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable" + ], + [ + "string", + "arc_name", + 64 + ], + [ + "string", + "feature_name", + 64 + ], + { + "crc": "0x7531c862" + } + ], + [ + "feature_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "feature_enable_disable": { + "reply": "feature_enable_disable_reply" + } + }, + "options": { + "version": "1.0.2" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x3696c431" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/fib_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/fib_types.api.json new file mode 100644 index 0000000..5b71845 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/fib_types.api.json @@ -0,0 +1,482 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ] + ], + "messages": [], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ] + ], + "services": {}, + "options": { + "version": "2.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x57387845" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/geneve.api.json b/internal/testbinapi/binapi2001/.vppapi/core/geneve.api.json new file mode 100644 index 0000000..773f245 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/geneve.api.json @@ -0,0 +1,649 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "geneve_add_del_tunnel", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_address_t", + "local_address" + ], + [ + "vl_api_address_t", + "remote_address" + ], + [ + "vl_api_interface_index_t", + "mcast_sw_if_index" + ], + [ + "u32", + "encap_vrf_id" + ], + [ + "u32", + "decap_next_index" + ], + [ + "u32", + "vni" + ], + { + "crc": "0x976693b5" + } + ], + [ + "geneve_add_del_tunnel_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "geneve_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "geneve_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_t", + "src_address" + ], + [ + "vl_api_address_t", + "dst_address" + ], + [ + "vl_api_interface_index_t", + "mcast_sw_if_index" + ], + [ + "u32", + "encap_vrf_id" + ], + [ + "u32", + "decap_next_index" + ], + [ + "u32", + "vni" + ], + { + "crc": "0xe27e2748" + } + ], + [ + "sw_interface_set_geneve_bypass", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + [ + "bool", + "enable" + ], + { + "crc": "0x65247409" + } + ], + [ + "sw_interface_set_geneve_bypass_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "geneve_add_del_tunnel": { + "reply": "geneve_add_del_tunnel_reply" + }, + "geneve_tunnel_dump": { + "reply": "geneve_tunnel_details", + "stream": true + }, + "sw_interface_set_geneve_bypass": { + "reply": "sw_interface_set_geneve_bypass_reply" + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x46ee8ab6" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/gre.api.json b/internal/testbinapi/binapi2001/.vppapi/core/gre.api.json new file mode 100644 index 0000000..49cd2c1 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/gre.api.json @@ -0,0 +1,617 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "gre_tunnel", + [ + "vl_api_gre_tunnel_type_t", + "type" + ], + [ + "vl_api_gre_tunnel_mode_t", + "mode" + ], + [ + "u16", + "session_id" + ], + [ + "u32", + "instance" + ], + [ + "u32", + "outer_table_id" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_t", + "src" + ], + [ + "vl_api_address_t", + "dst" + ] + ] + ], + "messages": [ + [ + "gre_tunnel_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_gre_tunnel_t", + "tunnel" + ], + { + "crc": "0xf9c4059d" + } + ], + [ + "gre_tunnel_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "gre_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "gre_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gre_tunnel_t", + "tunnel" + ], + { + "crc": "0x066f8369" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "gre_tunnel_type", + [ + "GRE_API_TUNNEL_TYPE_L3", + 0 + ], + [ + "GRE_API_TUNNEL_TYPE_TEB", + 1 + ], + [ + "GRE_API_TUNNEL_TYPE_ERSPAN", + 2 + ], + { + "enumtype": "u8" + } + ], + [ + "gre_tunnel_mode", + [ + "GRE_API_TUNNEL_MODE_P2P", + 1 + ], + [ + "GRE_API_TUNNEL_MODE_MP", + 2 + ], + { + "enumtype": "u8" + } + ] + ], + "services": { + "gre_tunnel_add_del": { + "reply": "gre_tunnel_add_del_reply" + }, + "gre_tunnel_dump": { + "reply": "gre_tunnel_details", + "stream": true + } + }, + "options": { + "version": "2.0.1" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xb7663194" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/gso.api.json b/internal/testbinapi/binapi2001/.vppapi/core/gso.api.json new file mode 100644 index 0000000..8cf67fe --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/gso.api.json @@ -0,0 +1,218 @@ +{ + "types": [], + "messages": [ + [ + "feature_gso_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable_disable" + ], + { + "crc": "0x5501adee" + } + ], + [ + "feature_gso_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "feature_gso_enable_disable": { + "reply": "feature_gso_enable_disable_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xecb22d44" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/interface.api.json b/internal/testbinapi/binapi2001/.vppapi/core/interface.api.json new file mode 100644 index 0000000..31ed913 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/interface.api.json @@ -0,0 +1,1902 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "sw_interface_set_flags", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_if_status_flags_t", + "flags" + ], + { + "crc": "0x6a2b491a" + } + ], + [ + "sw_interface_set_flags_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "hw_interface_set_mtu", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u16", + "mtu" + ], + { + "crc": "0xe6746899" + } + ], + [ + "hw_interface_set_mtu_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_set_mtu", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "mtu", + 4 + ], + { + "crc": "0x5cbe85e5" + } + ], + [ + "sw_interface_set_mtu_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_set_ip_directed_broadcast", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xae6cfcfb" + } + ], + [ + "sw_interface_set_ip_directed_broadcast_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_if_status_flags_t", + "flags" + ], + [ + "bool", + "deleted" + ], + { + "crc": "0xf709f78d" + } + ], + [ + "want_interface_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "enable_disable" + ], + [ + "u32", + "pid" + ], + { + "crc": "0x476f5a08" + } + ], + [ + "want_interface_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "sup_sw_if_index" + ], + [ + "vl_api_mac_address_t", + "l2_address" + ], + [ + "vl_api_if_status_flags_t", + "flags" + ], + [ + "vl_api_if_type_t", + "type" + ], + [ + "vl_api_link_duplex_t", + "link_duplex" + ], + [ + "u32", + "link_speed" + ], + [ + "u16", + "link_mtu" + ], + [ + "u32", + "mtu", + 4 + ], + [ + "u32", + "sub_id" + ], + [ + "u8", + "sub_number_of_tags" + ], + [ + "u16", + "sub_outer_vlan_id" + ], + [ + "u16", + "sub_inner_vlan_id" + ], + [ + "vl_api_sub_if_flags_t", + "sub_if_flags" + ], + [ + "u32", + "vtr_op" + ], + [ + "u32", + "vtr_push_dot1q" + ], + [ + "u32", + "vtr_tag1" + ], + [ + "u32", + "vtr_tag2" + ], + [ + "u16", + "outer_tag" + ], + [ + "vl_api_mac_address_t", + "b_dmac" + ], + [ + "vl_api_mac_address_t", + "b_smac" + ], + [ + "u16", + "b_vlanid" + ], + [ + "u32", + "i_sid" + ], + [ + "string", + "interface_name", + 64 + ], + [ + "string", + "interface_dev_type", + 64 + ], + [ + "string", + "tag", + 64 + ], + { + "crc": "0x17b69fa2" + } + ], + [ + "sw_interface_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index", + { + "default": 4294967295 + } + ], + [ + "bool", + "name_filter_valid" + ], + [ + "string", + "name_filter", + 0 + ], + { + "crc": "0xaa610c27" + } + ], + [ + "sw_interface_add_del_address", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_add" + ], + [ + "bool", + "del_all" + ], + [ + "vl_api_address_with_prefix_t", + "prefix" + ], + { + "crc": "0x5803d5c4" + } + ], + [ + "sw_interface_add_del_address_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_set_table", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0xdf42a577" + } + ], + [ + "sw_interface_set_table_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_get_table", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + { + "crc": "0x2d033de4" + } + ], + [ + "sw_interface_get_table_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0xa6eb0109" + } + ], + [ + "sw_interface_set_unnumbered", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_interface_index_t", + "unnumbered_sw_if_index" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0x938ef33b" + } + ], + [ + "sw_interface_set_unnumbered_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_clear_stats", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "sw_interface_clear_stats_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_tag_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "tag", + 64 + ], + { + "crc": "0x426f8bc1" + } + ], + [ + "sw_interface_tag_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_add_del_mac_address", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "vl_api_mac_address_t", + "addr" + ], + [ + "u8", + "is_add" + ], + { + "crc": "0x638bb9f4" + } + ], + [ + "sw_interface_add_del_mac_address_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_set_mac_address", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + { + "crc": "0x6aca746a" + } + ], + [ + "sw_interface_set_mac_address_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_get_mac_address", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "sw_interface_get_mac_address_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + { + "crc": "0x40ef2c08" + } + ], + [ + "sw_interface_set_rx_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "queue_id_valid" + ], + [ + "u32", + "queue_id" + ], + [ + "vl_api_rx_mode_t", + "mode" + ], + { + "crc": "0x780f5cee" + } + ], + [ + "sw_interface_set_rx_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_set_rx_placement", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "queue_id" + ], + [ + "u32", + "worker_id" + ], + [ + "bool", + "is_main" + ], + { + "crc": "0xdb65f3c9" + } + ], + [ + "sw_interface_set_rx_placement_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_rx_placement_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "sw_interface_rx_placement_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "queue_id" + ], + [ + "u32", + "worker_id" + ], + [ + "vl_api_rx_mode_t", + "mode" + ], + { + "crc": "0xf6d7d024" + } + ], + [ + "interface_name_renumber", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "new_show_dev_instance" + ], + { + "crc": "0x2b8858b8" + } + ], + [ + "interface_name_renumber_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "create_subif", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "sub_id" + ], + [ + "vl_api_sub_if_flags_t", + "sub_if_flags" + ], + [ + "u16", + "outer_vlan_id" + ], + [ + "u16", + "inner_vlan_id" + ], + { + "crc": "0xcb371063" + } + ], + [ + "create_subif_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "create_vlan_subif", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "vlan_id" + ], + { + "crc": "0xaf34ac8b" + } + ], + [ + "create_vlan_subif_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "delete_subif", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "delete_subif_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "create_loopback", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + { + "crc": "0x42bb5d22" + } + ], + [ + "create_loopback_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "create_loopback_instance", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + [ + "bool", + "is_specified" + ], + [ + "u32", + "user_instance" + ], + { + "crc": "0xd36a3ee2" + } + ], + [ + "create_loopback_instance_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "delete_loopback", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "delete_loopback_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "collect_detailed_interface_stats", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable_disable" + ], + { + "crc": "0x5501adee" + } + ], + [ + "collect_detailed_interface_stats_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "want_interface_events": { + "reply": "want_interface_events_reply", + "events": [ + "sw_interface_event" + ] + }, + "sw_interface_set_flags": { + "reply": "sw_interface_set_flags_reply" + }, + "hw_interface_set_mtu": { + "reply": "hw_interface_set_mtu_reply" + }, + "sw_interface_set_mtu": { + "reply": "sw_interface_set_mtu_reply" + }, + "sw_interface_set_ip_directed_broadcast": { + "reply": "sw_interface_set_ip_directed_broadcast_reply" + }, + "sw_interface_dump": { + "reply": "sw_interface_details", + "stream": true + }, + "sw_interface_add_del_address": { + "reply": "sw_interface_add_del_address_reply" + }, + "sw_interface_set_table": { + "reply": "sw_interface_set_table_reply" + }, + "sw_interface_get_table": { + "reply": "sw_interface_get_table_reply" + }, + "sw_interface_set_unnumbered": { + "reply": "sw_interface_set_unnumbered_reply" + }, + "sw_interface_clear_stats": { + "reply": "sw_interface_clear_stats_reply" + }, + "sw_interface_tag_add_del": { + "reply": "sw_interface_tag_add_del_reply" + }, + "sw_interface_add_del_mac_address": { + "reply": "sw_interface_add_del_mac_address_reply" + }, + "sw_interface_set_mac_address": { + "reply": "sw_interface_set_mac_address_reply" + }, + "sw_interface_get_mac_address": { + "reply": "sw_interface_get_mac_address_reply" + }, + "sw_interface_set_rx_mode": { + "reply": "sw_interface_set_rx_mode_reply" + }, + "sw_interface_set_rx_placement": { + "reply": "sw_interface_set_rx_placement_reply" + }, + "sw_interface_rx_placement_dump": { + "reply": "sw_interface_rx_placement_details", + "stream": true + }, + "interface_name_renumber": { + "reply": "interface_name_renumber_reply" + }, + "create_subif": { + "reply": "create_subif_reply" + }, + "create_vlan_subif": { + "reply": "create_vlan_subif_reply" + }, + "delete_subif": { + "reply": "delete_subif_reply" + }, + "create_loopback": { + "reply": "create_loopback_reply" + }, + "create_loopback_instance": { + "reply": "create_loopback_instance_reply" + }, + "delete_loopback": { + "reply": "delete_loopback_reply" + }, + "collect_detailed_interface_stats": { + "reply": "collect_detailed_interface_stats_reply" + } + }, + "options": { + "version": "3.2.2" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xfebc3ffa" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/interface_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/interface_types.api.json new file mode 100644 index 0000000..0facb3a --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/interface_types.api.json @@ -0,0 +1,167 @@ +{ + "types": [], + "messages": [], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": {}, + "options": {}, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xc97be83d" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ip.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ip.api.json new file mode 100644 index 0000000..66f0284 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ip.api.json @@ -0,0 +1,3219 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ], + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ], + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "mfib_path", + [ + "vl_api_mfib_itf_flags_t", + "itf_flags" + ], + [ + "vl_api_fib_path_t", + "path" + ] + ], + [ + "ip_table", + [ + "u32", + "table_id" + ], + [ + "bool", + "is_ip6" + ], + [ + "string", + "name", + 64 + ] + ], + [ + "ip_route", + [ + "u32", + "table_id" + ], + [ + "u32", + "stats_index" + ], + [ + "vl_api_prefix_t", + "prefix" + ], + [ + "u8", + "n_paths" + ], + [ + "vl_api_fib_path_t", + "paths", + 0, + "n_paths" + ] + ], + [ + "ip_mroute", + [ + "u32", + "table_id" + ], + [ + "u32", + "entry_flags" + ], + [ + "u32", + "rpf_id" + ], + [ + "vl_api_mprefix_t", + "prefix" + ], + [ + "u8", + "n_paths" + ], + [ + "vl_api_mfib_path_t", + "paths", + 0, + "n_paths" + ] + ], + [ + "punt_redirect", + [ + "vl_api_interface_index_t", + "rx_sw_if_index" + ], + [ + "vl_api_interface_index_t", + "tx_sw_if_index" + ], + [ + "vl_api_address_t", + "nh" + ] + ] + ], + "messages": [ + [ + "ip_table_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0x0ffdaec0" + } + ], + [ + "ip_table_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_table_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip_table_replace_begin", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_table_replace_begin_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_table_replace_end", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_table_replace_end_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_table_flush", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_table_flush_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_table_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xc79fca0f" + } + ], + [ + "ip_route_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "bool", + "is_multipath" + ], + [ + "vl_api_ip_route_t", + "route" + ], + { + "crc": "0xc1ff832d" + } + ], + [ + "ip_route_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stats_index" + ], + { + "crc": "0x1992deab" + } + ], + [ + "ip_route_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_route_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_route_t", + "route" + ], + { + "crc": "0xd1ffaae1" + } + ], + [ + "set_ip_flow_hash", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vrf_id" + ], + [ + "bool", + "is_ipv6" + ], + [ + "bool", + "src" + ], + [ + "bool", + "dst" + ], + [ + "bool", + "sport" + ], + [ + "bool", + "dport" + ], + [ + "bool", + "proto" + ], + [ + "bool", + "reverse" + ], + [ + "bool", + "symmetric" + ], + { + "crc": "0x084ee09e" + } + ], + [ + "set_ip_flow_hash_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_ip6_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xae6cfcfb" + } + ], + [ + "sw_interface_ip6_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_mtable_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip_mtable_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_mroute_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "bool", + "is_multipath" + ], + [ + "vl_api_ip_mroute_t", + "route" + ], + { + "crc": "0xf6627d17" + } + ], + [ + "ip_mroute_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stats_index" + ], + { + "crc": "0x1992deab" + } + ], + [ + "ip_mroute_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_mroute_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_mroute_t", + "route" + ], + { + "crc": "0xc1cb4b44" + } + ], + [ + "ip_address_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_with_prefix_t", + "prefix" + ], + { + "crc": "0xb1199745" + } + ], + [ + "ip_address_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + { + "crc": "0x2d033de4" + } + ], + [ + "ip_unnumbered_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_interface_index_t", + "ip_sw_if_index" + ], + { + "crc": "0xaa12a483" + } + ], + [ + "ip_unnumbered_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "ip_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + { + "crc": "0xeb152d07" + } + ], + [ + "ip_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_ipv6" + ], + { + "crc": "0x98d231ca" + } + ], + [ + "mfib_signal_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "mfib_signal_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "vl_api_mprefix_t", + "prefix" + ], + [ + "u16", + "ip_packet_len" + ], + [ + "u8", + "ip_packet_data", + 256 + ], + { + "crc": "0x64398a9a" + } + ], + [ + "ip_punt_police", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "policer_index" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "bool", + "is_ip6" + ], + { + "crc": "0xdb867cea" + } + ], + [ + "ip_punt_police_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_punt_redirect", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_punt_redirect_t", + "punt" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + { + "crc": "0xa9a5592c" + } + ], + [ + "ip_punt_redirect_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_punt_redirect_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + { + "crc": "0x2d033de4" + } + ], + [ + "ip_punt_redirect_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_punt_redirect_t", + "punt" + ], + { + "crc": "0x3924f5d3" + } + ], + [ + "ip_container_proxy_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_prefix_t", + "pfx" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + { + "crc": "0x91189f40" + } + ], + [ + "ip_container_proxy_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_container_proxy_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip_container_proxy_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_prefix_t", + "prefix" + ], + { + "crc": "0x0ee460e8" + } + ], + [ + "ip_source_and_port_range_check_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "vl_api_prefix_t", + "prefix" + ], + [ + "u8", + "number_of_ranges" + ], + [ + "u16", + "low_ports", + 32 + ], + [ + "u16", + "high_ports", + 32 + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0x8bfc76f2" + } + ], + [ + "ip_source_and_port_range_check_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_source_and_port_range_check_interface_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "tcp_in_vrf_id" + ], + [ + "u32", + "tcp_out_vrf_id" + ], + [ + "u32", + "udp_in_vrf_id" + ], + [ + "u32", + "udp_out_vrf_id" + ], + { + "crc": "0xe1ba8987" + } + ], + [ + "ip_source_and_port_range_check_interface_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_source_check_interface_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "bool", + "loose" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x6612356b" + } + ], + [ + "ip_source_check_interface_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_ip6_set_link_local_address", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_ip6_address_t", + "ip" + ], + { + "crc": "0x2931d9fa" + } + ], + [ + "sw_interface_ip6_set_link_local_address_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ioam_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "id" + ], + [ + "bool", + "seqno" + ], + [ + "bool", + "analyse" + ], + [ + "bool", + "pot_enable" + ], + [ + "bool", + "trace_enable" + ], + [ + "u32", + "node_id" + ], + { + "crc": "0x51ccd868" + } + ], + [ + "ioam_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ioam_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "id" + ], + { + "crc": "0x6b16a45e" + } + ], + [ + "ioam_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_reassembly_set", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "timeout_ms" + ], + [ + "u32", + "max_reassemblies" + ], + [ + "u32", + "max_reassembly_length" + ], + [ + "u32", + "expire_walk_interval_ms" + ], + [ + "bool", + "is_ip6" + ], + [ + "vl_api_ip_reass_type_t", + "type" + ], + { + "crc": "0x16467d25" + } + ], + [ + "ip_reassembly_set_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_reassembly_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_ip6" + ], + [ + "vl_api_ip_reass_type_t", + "type" + ], + { + "crc": "0xea13ff63" + } + ], + [ + "ip_reassembly_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "timeout_ms" + ], + [ + "u32", + "max_reassemblies" + ], + [ + "u32", + "max_reassembly_length" + ], + [ + "u32", + "expire_walk_interval_ms" + ], + [ + "bool", + "is_ip6" + ], + { + "crc": "0xd5eb8d34" + } + ], + [ + "ip_reassembly_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable_ip4" + ], + [ + "bool", + "enable_ip6" + ], + [ + "vl_api_ip_reass_type_t", + "type" + ], + { + "crc": "0x885c85a6" + } + ], + [ + "ip_reassembly_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ], + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ], + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "mfib_itf_flags", + [ + "MFIB_API_ITF_FLAG_NONE", + 0 + ], + [ + "MFIB_API_ITF_FLAG_NEGATE_SIGNAL", + 1 + ], + [ + "MFIB_API_ITF_FLAG_ACCEPT", + 2 + ], + [ + "MFIB_API_ITF_FLAG_FORWARD", + 4 + ], + [ + "MFIB_API_ITF_FLAG_SIGNAL_PRESENT", + 8 + ], + [ + "MFIB_API_ITF_FLAG_DONT_PRESERVE", + 16 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_reass_type", + [ + "IP_REASS_TYPE_FULL", + 0 + ], + [ + "IP_REASS_TYPE_SHALLOW_VIRTUAL", + 1 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "ip_table_add_del": { + "reply": "ip_table_add_del_reply" + }, + "ip_table_dump": { + "reply": "ip_table_details", + "stream": true + }, + "ip_table_replace_begin": { + "reply": "ip_table_replace_begin_reply" + }, + "ip_table_replace_end": { + "reply": "ip_table_replace_end_reply" + }, + "ip_table_flush": { + "reply": "ip_table_flush_reply" + }, + "ip_route_add_del": { + "reply": "ip_route_add_del_reply" + }, + "ip_route_dump": { + "reply": "ip_route_details", + "stream": true + }, + "set_ip_flow_hash": { + "reply": "set_ip_flow_hash_reply" + }, + "sw_interface_ip6_enable_disable": { + "reply": "sw_interface_ip6_enable_disable_reply" + }, + "ip_mtable_dump": { + "reply": "ip_mtable_details", + "stream": true + }, + "ip_mroute_add_del": { + "reply": "ip_mroute_add_del_reply" + }, + "ip_mroute_dump": { + "reply": "ip_mroute_details", + "stream": true + }, + "ip_address_dump": { + "reply": "ip_address_details", + "stream": true + }, + "ip_unnumbered_dump": { + "reply": "ip_unnumbered_details", + "stream": true + }, + "ip_dump": { + "reply": "ip_details", + "stream": true + }, + "mfib_signal_dump": { + "reply": "mfib_signal_details", + "stream": true + }, + "ip_punt_police": { + "reply": "ip_punt_police_reply" + }, + "ip_punt_redirect": { + "reply": "ip_punt_redirect_reply" + }, + "ip_punt_redirect_dump": { + "reply": "ip_punt_redirect_details", + "stream": true + }, + "ip_container_proxy_add_del": { + "reply": "ip_container_proxy_add_del_reply" + }, + "ip_container_proxy_dump": { + "reply": "ip_container_proxy_details", + "stream": true + }, + "ip_source_and_port_range_check_add_del": { + "reply": "ip_source_and_port_range_check_add_del_reply" + }, + "ip_source_and_port_range_check_interface_add_del": { + "reply": "ip_source_and_port_range_check_interface_add_del_reply" + }, + "ip_source_check_interface_add_del": { + "reply": "ip_source_check_interface_add_del_reply" + }, + "sw_interface_ip6_set_link_local_address": { + "reply": "sw_interface_ip6_set_link_local_address_reply" + }, + "ioam_enable": { + "reply": "ioam_enable_reply" + }, + "ioam_disable": { + "reply": "ioam_disable_reply" + }, + "ip_reassembly_set": { + "reply": "ip_reassembly_set_reply" + }, + "ip_reassembly_get": { + "reply": "ip_reassembly_get_reply" + }, + "ip_reassembly_enable_disable": { + "reply": "ip_reassembly_enable_disable_reply" + } + }, + "options": { + "version": "3.0.1" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0xfc3fea46" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ip6_nd.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ip6_nd.api.json new file mode 100644 index 0000000..a6f3070 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ip6_nd.api.json @@ -0,0 +1,912 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "ip6_ra_prefix_info", + [ + "vl_api_prefix_t", + "prefix" + ], + [ + "u8", + "flags" + ], + [ + "u32", + "valid_time" + ], + [ + "u32", + "preferred_time" + ] + ] + ], + "messages": [ + [ + "sw_interface_ip6nd_ra_config", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u8", + "suppress" + ], + [ + "u8", + "managed" + ], + [ + "u8", + "other" + ], + [ + "u8", + "ll_option" + ], + [ + "u8", + "send_unicast" + ], + [ + "u8", + "cease" + ], + [ + "bool", + "is_no" + ], + [ + "u8", + "default_router" + ], + [ + "u32", + "max_interval" + ], + [ + "u32", + "min_interval" + ], + [ + "u32", + "lifetime" + ], + [ + "u32", + "initial_count" + ], + [ + "u32", + "initial_interval" + ], + { + "crc": "0x3eb00b1c" + } + ], + [ + "sw_interface_ip6nd_ra_config_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_ip6nd_ra_prefix", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_prefix_t", + "prefix" + ], + [ + "bool", + "use_default" + ], + [ + "bool", + "no_advertise" + ], + [ + "bool", + "off_link" + ], + [ + "bool", + "no_autoconfig" + ], + [ + "bool", + "no_onlink" + ], + [ + "bool", + "is_no" + ], + [ + "u32", + "val_lifetime" + ], + [ + "u32", + "pref_lifetime" + ], + { + "crc": "0xe098785f" + } + ], + [ + "sw_interface_ip6nd_ra_prefix_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip6nd_proxy_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_ip6_address_t", + "ip" + ], + { + "crc": "0x3fdf6659" + } + ], + [ + "ip6nd_proxy_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip6nd_proxy_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_ip6_address_t", + "ip" + ], + { + "crc": "0xd35be8ff" + } + ], + [ + "ip6nd_proxy_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip6nd_send_router_solicitation", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "irt" + ], + [ + "u32", + "mrt" + ], + [ + "u32", + "mrc" + ], + [ + "u32", + "mrd" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "stop" + ], + { + "crc": "0xe5de609c" + } + ], + [ + "ip6nd_send_router_solicitation_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "want_ip6_ra_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable" + ], + [ + "u32", + "pid" + ], + { + "crc": "0x3ec6d6c2" + } + ], + [ + "want_ip6_ra_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip6_ra_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_ip6_address_t", + "router_addr" + ], + [ + "u8", + "current_hop_limit" + ], + [ + "u8", + "flags" + ], + [ + "u16", + "router_lifetime_in_sec" + ], + [ + "u32", + "neighbor_reachable_time_in_msec" + ], + [ + "u32", + "time_in_msec_between_retransmitted_neighbor_solicitations" + ], + [ + "u32", + "n_prefixes" + ], + [ + "vl_api_ip6_ra_prefix_info_t", + "prefixes", + 0, + "n_prefixes" + ], + { + "crc": "0x47e8cfbe" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "want_ip6_ra_events": { + "reply": "want_ip6_ra_events_reply", + "events": [ + "ip6_ra_event" + ] + }, + "sw_interface_ip6nd_ra_config": { + "reply": "sw_interface_ip6nd_ra_config_reply" + }, + "sw_interface_ip6nd_ra_prefix": { + "reply": "sw_interface_ip6nd_ra_prefix_reply" + }, + "ip6nd_proxy_add_del": { + "reply": "ip6nd_proxy_add_del_reply" + }, + "ip6nd_proxy_dump": { + "reply": "ip6nd_proxy_details", + "stream": true + }, + "ip6nd_send_router_solicitation": { + "reply": "ip6nd_send_router_solicitation_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xbb8ff0e9" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ip_neighbor.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ip_neighbor.api.json new file mode 100644 index 0000000..b4a2dcd --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ip_neighbor.api.json @@ -0,0 +1,736 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "ip_neighbor", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_ip_neighbor_flags_t", + "flags" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + [ + "vl_api_address_t", + "ip_address" + ] + ] + ], + "messages": [ + [ + "ip_neighbor_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_ip_neighbor_t", + "neighbor" + ], + { + "crc": "0x105518b6" + } + ], + [ + "ip_neighbor_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stats_index" + ], + { + "crc": "0x1992deab" + } + ], + [ + "ip_neighbor_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index", + { + "default": 4294967295 + } + ], + [ + "vl_api_address_family_t", + "af" + ], + { + "crc": "0xcd831298" + } + ], + [ + "ip_neighbor_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_neighbor_t", + "neighbor" + ], + { + "crc": "0x59121ce9" + } + ], + [ + "ip_neighbor_config", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_family_t", + "af" + ], + [ + "u32", + "max_number" + ], + [ + "u32", + "max_age" + ], + [ + "bool", + "recycle" + ], + { + "crc": "0xf4a5cf44" + } + ], + [ + "ip_neighbor_config_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "want_ip_neighbor_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable" + ], + [ + "u32", + "pid" + ], + [ + "vl_api_address_t", + "ip" + ], + [ + "vl_api_interface_index_t", + "sw_if_index", + { + "default": 4294967295 + } + ], + { + "crc": "0x1a312870" + } + ], + [ + "want_ip_neighbor_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_neighbor_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "vl_api_ip_neighbor_t", + "neighbor" + ], + { + "crc": "0x83933131" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_neighbor_flags", + [ + "IP_API_NEIGHBOR_FLAG_NONE", + 0 + ], + [ + "IP_API_NEIGHBOR_FLAG_STATIC", + 1 + ], + [ + "IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY", + 2 + ], + { + "enumtype": "u8" + } + ] + ], + "services": { + "want_ip_neighbor_events": { + "reply": "want_ip_neighbor_events_reply", + "events": [ + "ip_neighbor_event" + ] + }, + "ip_neighbor_add_del": { + "reply": "ip_neighbor_add_del_reply" + }, + "ip_neighbor_dump": { + "reply": "ip_neighbor_details", + "stream": true + }, + "ip_neighbor_config": { + "reply": "ip_neighbor_config_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "mac_address": { + "type": "u8", + "length": 6 + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xdae37c55" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ip_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ip_types.api.json new file mode 100644 index 0000000..b15946c --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ip_types.api.json @@ -0,0 +1,298 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": {}, + "options": { + "version": "3.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x80424562" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ipfix_export.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ipfix_export.api.json new file mode 100644 index 0000000..e7620d3 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ipfix_export.api.json @@ -0,0 +1,664 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "set_ipfix_exporter", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_t", + "collector_address" + ], + [ + "u16", + "collector_port" + ], + [ + "vl_api_address_t", + "src_address" + ], + [ + "u32", + "vrf_id" + ], + [ + "u32", + "path_mtu" + ], + [ + "u32", + "template_interval" + ], + [ + "bool", + "udp_checksum" + ], + { + "crc": "0x69284e07" + } + ], + [ + "set_ipfix_exporter_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipfix_exporter_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ipfix_exporter_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_t", + "collector_address" + ], + [ + "u16", + "collector_port" + ], + [ + "vl_api_address_t", + "src_address" + ], + [ + "u32", + "vrf_id" + ], + [ + "u32", + "path_mtu" + ], + [ + "u32", + "template_interval" + ], + [ + "bool", + "udp_checksum" + ], + { + "crc": "0x11e07413" + } + ], + [ + "set_ipfix_classify_stream", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "domain_id" + ], + [ + "u16", + "src_port" + ], + { + "crc": "0xc9cbe053" + } + ], + [ + "set_ipfix_classify_stream_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipfix_classify_stream_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ipfix_classify_stream_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "domain_id" + ], + [ + "u16", + "src_port" + ], + { + "crc": "0x2903539d" + } + ], + [ + "ipfix_classify_table_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + [ + "vl_api_address_family_t", + "ip_version" + ], + [ + "vl_api_ip_proto_t", + "transport_protocol" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0x5118bc5e" + } + ], + [ + "ipfix_classify_table_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipfix_classify_table_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ipfix_classify_table_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + [ + "vl_api_address_family_t", + "ip_version" + ], + [ + "vl_api_ip_proto_t", + "transport_protocol" + ], + { + "crc": "0x7c8351ec" + } + ], + [ + "ipfix_flush", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ipfix_flush_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "set_ipfix_exporter": { + "reply": "set_ipfix_exporter_reply" + }, + "ipfix_exporter_dump": { + "reply": "ipfix_exporter_details", + "stream": true + }, + "set_ipfix_classify_stream": { + "reply": "set_ipfix_classify_stream_reply" + }, + "ipfix_classify_stream_dump": { + "reply": "ipfix_classify_stream_details", + "stream": true + }, + "ipfix_classify_table_add_del": { + "reply": "ipfix_classify_table_add_del_reply" + }, + "ipfix_classify_table_dump": { + "reply": "ipfix_classify_table_details", + "stream": true + }, + "ipfix_flush": { + "reply": "ipfix_flush_reply" + } + }, + "options": { + "version": "2.0.1" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xee6ea488" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ipip.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ipip.api.json new file mode 100644 index 0000000..47b62eb --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ipip.api.json @@ -0,0 +1,764 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "ipip_tunnel", + [ + "u32", + "instance" + ], + [ + "vl_api_address_t", + "src" + ], + [ + "vl_api_address_t", + "dst" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "vl_api_ipip_tunnel_flags_t", + "flags" + ], + [ + "vl_api_ip_dscp_t", + "dscp" + ] + ] + ], + "messages": [ + [ + "ipip_add_tunnel", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ipip_tunnel_t", + "tunnel" + ], + { + "crc": "0xef93caab" + } + ], + [ + "ipip_add_tunnel_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "ipip_del_tunnel", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "ipip_del_tunnel_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipip_6rd_add_tunnel", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "ip6_table_id" + ], + [ + "u32", + "ip4_table_id" + ], + [ + "vl_api_ip6_prefix_t", + "ip6_prefix" + ], + [ + "vl_api_ip4_prefix_t", + "ip4_prefix" + ], + [ + "vl_api_ip4_address_t", + "ip4_src" + ], + [ + "bool", + "security_check" + ], + [ + "u8", + "tc_tos" + ], + { + "crc": "0x56e93cc0" + } + ], + [ + "ipip_6rd_add_tunnel_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "ipip_6rd_del_tunnel", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "ipip_6rd_del_tunnel_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipip_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "ipip_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ipip_tunnel_t", + "tunnel" + ], + { + "crc": "0x7f7b5b85" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "ipip_tunnel_flags", + [ + "IPIP_TUNNEL_API_FLAG_NONE", + 0 + ], + [ + "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DF", + 1 + ], + [ + "IPIP_TUNNEL_API_FLAG_ENCAP_SET_DF", + 2 + ], + [ + "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DSCP", + 4 + ], + [ + "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_ECN", + 8 + ], + [ + "IPIP_TUNNEL_API_FLAG_DECAP_COPY_ECN", + 16 + ], + { + "enumtype": "u8" + } + ] + ], + "services": { + "ipip_add_tunnel": { + "reply": "ipip_add_tunnel_reply" + }, + "ipip_del_tunnel": { + "reply": "ipip_del_tunnel_reply" + }, + "ipip_6rd_add_tunnel": { + "reply": "ipip_6rd_add_tunnel_reply" + }, + "ipip_6rd_del_tunnel": { + "reply": "ipip_6rd_del_tunnel_reply" + }, + "ipip_tunnel_dump": { + "reply": "ipip_tunnel_details", + "stream": true + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xf108649c" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ipip_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ipip_types.api.json new file mode 100644 index 0000000..ccded2e --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ipip_types.api.json @@ -0,0 +1,41 @@ +{ + "types": [], + "messages": [], + "unions": [], + "enums": [ + [ + "ipip_tunnel_flags", + [ + "IPIP_TUNNEL_API_FLAG_NONE", + 0 + ], + [ + "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DF", + 1 + ], + [ + "IPIP_TUNNEL_API_FLAG_ENCAP_SET_DF", + 2 + ], + [ + "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DSCP", + 4 + ], + [ + "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_ECN", + 8 + ], + [ + "IPIP_TUNNEL_API_FLAG_DECAP_COPY_ECN", + 16 + ], + { + "enumtype": "u8" + } + ] + ], + "services": {}, + "options": {}, + "aliases": {}, + "vl_api_version": "0xa2a8fa8d" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ipsec.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ipsec.api.json new file mode 100644 index 0000000..49c933e --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ipsec.api.json @@ -0,0 +1,1580 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "key", + [ + "u8", + "length" + ], + [ + "u8", + "data", + 128 + ] + ], + [ + "ipsec_sad_entry", + [ + "u32", + "sad_id" + ], + [ + "u32", + "spi" + ], + [ + "vl_api_ipsec_proto_t", + "protocol" + ], + [ + "vl_api_ipsec_crypto_alg_t", + "crypto_algorithm" + ], + [ + "vl_api_key_t", + "crypto_key" + ], + [ + "vl_api_ipsec_integ_alg_t", + "integrity_algorithm" + ], + [ + "vl_api_key_t", + "integrity_key" + ], + [ + "vl_api_ipsec_sad_flags_t", + "flags" + ], + [ + "vl_api_address_t", + "tunnel_src" + ], + [ + "vl_api_address_t", + "tunnel_dst" + ], + [ + "u32", + "tx_table_id" + ], + [ + "u32", + "salt" + ] + ], + [ + "ipsec_spd_entry", + [ + "u32", + "spd_id" + ], + [ + "i32", + "priority" + ], + [ + "u8", + "is_outbound" + ], + [ + "u32", + "sa_id" + ], + [ + "vl_api_ipsec_spd_action_t", + "policy" + ], + [ + "u8", + "protocol" + ], + [ + "vl_api_address_t", + "remote_address_start" + ], + [ + "vl_api_address_t", + "remote_address_stop" + ], + [ + "vl_api_address_t", + "local_address_start" + ], + [ + "vl_api_address_t", + "local_address_stop" + ], + [ + "u16", + "remote_port_start" + ], + [ + "u16", + "remote_port_stop" + ], + [ + "u16", + "local_port_start" + ], + [ + "u16", + "local_port_stop" + ] + ], + [ + "ipsec_tunnel_protect", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "sa_out" + ], + [ + "u8", + "n_sa_in" + ], + [ + "u32", + "sa_in", + 0, + "n_sa_in" + ] + ] + ], + "messages": [ + [ + "ipsec_spd_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "spd_id" + ], + { + "crc": "0x9ffdf5da" + } + ], + [ + "ipsec_spd_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipsec_interface_add_del_spd", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "spd_id" + ], + { + "crc": "0x1e3b8286" + } + ], + [ + "ipsec_interface_add_del_spd_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipsec_spd_entry_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "vl_api_ipsec_spd_entry_t", + "entry" + ], + { + "crc": "0xdb217840" + } + ], + [ + "ipsec_spd_entry_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stat_index" + ], + { + "crc": "0x9ffac24b" + } + ], + [ + "ipsec_spds_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ipsec_spds_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "spd_id" + ], + [ + "u32", + "npolicies" + ], + { + "crc": "0xa04bb254" + } + ], + [ + "ipsec_spd_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "spd_id" + ], + [ + "u32", + "sa_id" + ], + { + "crc": "0xafefbf7d" + } + ], + [ + "ipsec_spd_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ipsec_spd_entry_t", + "entry" + ], + { + "crc": "0x021e2c20" + } + ], + [ + "ipsec_sad_entry_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "vl_api_ipsec_sad_entry_t", + "entry" + ], + { + "crc": "0xa25ab61e" + } + ], + [ + "ipsec_sad_entry_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stat_index" + ], + { + "crc": "0x9ffac24b" + } + ], + [ + "ipsec_tunnel_protect_update", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ipsec_tunnel_protect_t", + "tunnel" + ], + { + "crc": "0xeccbc177" + } + ], + [ + "ipsec_tunnel_protect_update_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipsec_tunnel_protect_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "ipsec_tunnel_protect_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipsec_tunnel_protect_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "ipsec_tunnel_protect_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ipsec_tunnel_protect_t", + "tun" + ], + { + "crc": "0x7520eefe" + } + ], + [ + "ipsec_spd_interface_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "spd_index" + ], + [ + "u8", + "spd_index_valid" + ], + { + "crc": "0x8971de19" + } + ], + [ + "ipsec_spd_interface_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "spd_index" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x2c54296d" + } + ], + [ + "ipsec_tunnel_if_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "esn" + ], + [ + "u8", + "anti_replay" + ], + [ + "vl_api_address_t", + "local_ip" + ], + [ + "vl_api_address_t", + "remote_ip" + ], + [ + "u32", + "local_spi" + ], + [ + "u32", + "remote_spi" + ], + [ + "u8", + "crypto_alg" + ], + [ + "u8", + "local_crypto_key_len" + ], + [ + "u8", + "local_crypto_key", + 128 + ], + [ + "u8", + "remote_crypto_key_len" + ], + [ + "u8", + "remote_crypto_key", + 128 + ], + [ + "u8", + "integ_alg" + ], + [ + "u8", + "local_integ_key_len" + ], + [ + "u8", + "local_integ_key", + 128 + ], + [ + "u8", + "remote_integ_key_len" + ], + [ + "u8", + "remote_integ_key", + 128 + ], + [ + "u8", + "renumber" + ], + [ + "u32", + "show_instance" + ], + [ + "u8", + "udp_encap" + ], + [ + "u32", + "tx_table_id" + ], + [ + "u32", + "salt" + ], + { + "crc": "0xd5a98274" + } + ], + [ + "ipsec_tunnel_if_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0xfda5941f" + } + ], + [ + "ipsec_sa_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sa_id" + ], + { + "crc": "0x2076c2f4" + } + ], + [ + "ipsec_sa_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ipsec_sad_entry_t", + "entry" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "salt" + ], + [ + "u64", + "seq_outbound" + ], + [ + "u64", + "last_seq_inbound" + ], + [ + "u64", + "replay_window" + ], + [ + "u64", + "total_data_size" + ], + { + "crc": "0x9c8d829a" + } + ], + [ + "ipsec_tunnel_if_set_sa", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "sa_id" + ], + [ + "u8", + "is_outbound" + ], + { + "crc": "0x6ab567f2" + } + ], + [ + "ipsec_tunnel_if_set_sa_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ipsec_backend_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ipsec_backend_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "name", + 128 + ], + [ + "vl_api_ipsec_proto_t", + "protocol" + ], + [ + "u8", + "index" + ], + [ + "u8", + "active" + ], + { + "crc": "0x7700751c" + } + ], + [ + "ipsec_select_backend", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ipsec_proto_t", + "protocol" + ], + [ + "u8", + "index" + ], + { + "crc": "0x4fd24836" + } + ], + [ + "ipsec_select_backend_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "ipsec_crypto_alg", + [ + "IPSEC_API_CRYPTO_ALG_NONE", + 0 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CBC_128", + 1 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CBC_192", + 2 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CBC_256", + 3 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CTR_128", + 4 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CTR_192", + 5 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CTR_256", + 6 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_GCM_128", + 7 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_GCM_192", + 8 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_GCM_256", + 9 + ], + [ + "IPSEC_API_CRYPTO_ALG_DES_CBC", + 10 + ], + [ + "IPSEC_API_CRYPTO_ALG_3DES_CBC", + 11 + ], + { + "enumtype": "u32" + } + ], + [ + "ipsec_integ_alg", + [ + "IPSEC_API_INTEG_ALG_NONE", + 0 + ], + [ + "IPSEC_API_INTEG_ALG_MD5_96", + 1 + ], + [ + "IPSEC_API_INTEG_ALG_SHA1_96", + 2 + ], + [ + "IPSEC_API_INTEG_ALG_SHA_256_96", + 3 + ], + [ + "IPSEC_API_INTEG_ALG_SHA_256_128", + 4 + ], + [ + "IPSEC_API_INTEG_ALG_SHA_384_192", + 5 + ], + [ + "IPSEC_API_INTEG_ALG_SHA_512_256", + 6 + ], + { + "enumtype": "u32" + } + ], + [ + "ipsec_sad_flags", + [ + "IPSEC_API_SAD_FLAG_NONE", + 0 + ], + [ + "IPSEC_API_SAD_FLAG_USE_ESN", + 1 + ], + [ + "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY", + 2 + ], + [ + "IPSEC_API_SAD_FLAG_IS_TUNNEL", + 4 + ], + [ + "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6", + 8 + ], + [ + "IPSEC_API_SAD_FLAG_UDP_ENCAP", + 16 + ], + { + "enumtype": "u32" + } + ], + [ + "ipsec_proto", + [ + "IPSEC_API_PROTO_ESP", + 1 + ], + [ + "IPSEC_API_PROTO_AH", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "ipsec_spd_action", + [ + "IPSEC_API_SPD_ACTION_BYPASS", + 0 + ], + [ + "IPSEC_API_SPD_ACTION_DISCARD", + 1 + ], + [ + "IPSEC_API_SPD_ACTION_RESOLVE", + 2 + ], + [ + "IPSEC_API_SPD_ACTION_PROTECT", + 3 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "ipsec_spd_add_del": { + "reply": "ipsec_spd_add_del_reply" + }, + "ipsec_interface_add_del_spd": { + "reply": "ipsec_interface_add_del_spd_reply" + }, + "ipsec_spd_entry_add_del": { + "reply": "ipsec_spd_entry_add_del_reply" + }, + "ipsec_spds_dump": { + "reply": "ipsec_spds_details", + "stream": true + }, + "ipsec_spd_dump": { + "reply": "ipsec_spd_details", + "stream": true + }, + "ipsec_sad_entry_add_del": { + "reply": "ipsec_sad_entry_add_del_reply" + }, + "ipsec_tunnel_protect_update": { + "reply": "ipsec_tunnel_protect_update_reply" + }, + "ipsec_tunnel_protect_del": { + "reply": "ipsec_tunnel_protect_del_reply" + }, + "ipsec_tunnel_protect_dump": { + "reply": "ipsec_tunnel_protect_details", + "stream": true + }, + "ipsec_spd_interface_dump": { + "reply": "ipsec_spd_interface_details", + "stream": true + }, + "ipsec_tunnel_if_add_del": { + "reply": "ipsec_tunnel_if_add_del_reply" + }, + "ipsec_sa_dump": { + "reply": "ipsec_sa_details", + "stream": true + }, + "ipsec_tunnel_if_set_sa": { + "reply": "ipsec_tunnel_if_set_sa_reply" + }, + "ipsec_backend_dump": { + "reply": "ipsec_backend_details", + "stream": true + }, + "ipsec_select_backend": { + "reply": "ipsec_select_backend_reply" + } + }, + "options": { + "version": "3.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x5a59fef9" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/ipsec_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/ipsec_types.api.json new file mode 100644 index 0000000..a64bbcb --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/ipsec_types.api.json @@ -0,0 +1,493 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "key", + [ + "u8", + "length" + ], + [ + "u8", + "data", + 128 + ] + ], + [ + "ipsec_sad_entry", + [ + "u32", + "sad_id" + ], + [ + "u32", + "spi" + ], + [ + "vl_api_ipsec_proto_t", + "protocol" + ], + [ + "vl_api_ipsec_crypto_alg_t", + "crypto_algorithm" + ], + [ + "vl_api_key_t", + "crypto_key" + ], + [ + "vl_api_ipsec_integ_alg_t", + "integrity_algorithm" + ], + [ + "vl_api_key_t", + "integrity_key" + ], + [ + "vl_api_ipsec_sad_flags_t", + "flags" + ], + [ + "vl_api_address_t", + "tunnel_src" + ], + [ + "vl_api_address_t", + "tunnel_dst" + ], + [ + "u32", + "tx_table_id" + ], + [ + "u32", + "salt" + ] + ] + ], + "messages": [], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "ipsec_crypto_alg", + [ + "IPSEC_API_CRYPTO_ALG_NONE", + 0 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CBC_128", + 1 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CBC_192", + 2 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CBC_256", + 3 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CTR_128", + 4 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CTR_192", + 5 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_CTR_256", + 6 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_GCM_128", + 7 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_GCM_192", + 8 + ], + [ + "IPSEC_API_CRYPTO_ALG_AES_GCM_256", + 9 + ], + [ + "IPSEC_API_CRYPTO_ALG_DES_CBC", + 10 + ], + [ + "IPSEC_API_CRYPTO_ALG_3DES_CBC", + 11 + ], + { + "enumtype": "u32" + } + ], + [ + "ipsec_integ_alg", + [ + "IPSEC_API_INTEG_ALG_NONE", + 0 + ], + [ + "IPSEC_API_INTEG_ALG_MD5_96", + 1 + ], + [ + "IPSEC_API_INTEG_ALG_SHA1_96", + 2 + ], + [ + "IPSEC_API_INTEG_ALG_SHA_256_96", + 3 + ], + [ + "IPSEC_API_INTEG_ALG_SHA_256_128", + 4 + ], + [ + "IPSEC_API_INTEG_ALG_SHA_384_192", + 5 + ], + [ + "IPSEC_API_INTEG_ALG_SHA_512_256", + 6 + ], + { + "enumtype": "u32" + } + ], + [ + "ipsec_sad_flags", + [ + "IPSEC_API_SAD_FLAG_NONE", + 0 + ], + [ + "IPSEC_API_SAD_FLAG_USE_ESN", + 1 + ], + [ + "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY", + 2 + ], + [ + "IPSEC_API_SAD_FLAG_IS_TUNNEL", + 4 + ], + [ + "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6", + 8 + ], + [ + "IPSEC_API_SAD_FLAG_UDP_ENCAP", + 16 + ], + { + "enumtype": "u32" + } + ], + [ + "ipsec_proto", + [ + "IPSEC_API_PROTO_ESP", + 1 + ], + [ + "IPSEC_API_PROTO_AH", + 2 + ], + { + "enumtype": "u32" + } + ] + ], + "services": {}, + "options": { + "version": "3.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x6e9f4c73" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/l2.api.json b/internal/testbinapi/binapi2001/.vppapi/core/l2.api.json new file mode 100644 index 0000000..686e316 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/l2.api.json @@ -0,0 +1,2015 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "mac_entry", + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "mac_addr", + 6 + ], + [ + "u8", + "action" + ], + [ + "u8", + "flags" + ] + ], + [ + "bridge_domain_sw_if", + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "shg" + ] + ], + [ + "bd_ip_mac", + [ + "u32", + "bd_id" + ], + [ + "vl_api_address_t", + "ip" + ], + [ + "vl_api_mac_address_t", + "mac" + ] + ] + ], + "messages": [ + [ + "l2_xconnect_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "rx_sw_if_index" + ], + [ + "u32", + "tx_sw_if_index" + ], + { + "crc": "0x722e2378" + } + ], + [ + "l2_xconnect_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "l2_fib_table_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + [ + "u8", + "mac", + 6 + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "static_mac" + ], + [ + "u8", + "filter_mac" + ], + [ + "u8", + "bvi_mac" + ], + { + "crc": "0xc7392706" + } + ], + [ + "l2_fib_table_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + { + "crc": "0xc25fdce6" + } + ], + [ + "l2_fib_clear_table", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "l2_fib_clear_table_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l2fib_flush_all", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "l2fib_flush_all_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l2fib_flush_bd", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + { + "crc": "0xc25fdce6" + } + ], + [ + "l2fib_flush_bd_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l2fib_flush_int", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x529cb13f" + } + ], + [ + "l2fib_flush_int_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l2fib_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "mac", + 6 + ], + [ + "u32", + "bd_id" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "static_mac" + ], + [ + "u8", + "filter_mac" + ], + [ + "u8", + "bvi_mac" + ], + { + "crc": "0x34ced3eb" + } + ], + [ + "l2fib_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "want_l2_macs_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "learn_limit" + ], + [ + "u8", + "scan_delay" + ], + [ + "u8", + "max_macs_in_event" + ], + [ + "bool", + "enable_disable" + ], + [ + "u32", + "pid" + ], + { + "crc": "0x9aabdfde" + } + ], + [ + "want_l2_macs_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l2_macs_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "u32", + "n_macs" + ], + [ + "vl_api_mac_entry_t", + "mac", + 0, + "n_macs" + ], + { + "crc": "0xafc74a60" + } + ], + [ + "l2_flags", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_set" + ], + [ + "u32", + "feature_bitmap" + ], + { + "crc": "0x0e889fb9" + } + ], + [ + "l2_flags_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "resulting_feature_bitmap" + ], + { + "crc": "0x29b2a2b3" + } + ], + [ + "bridge_domain_set_mac_age", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + [ + "u8", + "mac_age" + ], + { + "crc": "0xb537ad7b" + } + ], + [ + "bridge_domain_set_mac_age_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bridge_domain_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + [ + "u8", + "flood" + ], + [ + "u8", + "uu_flood" + ], + [ + "u8", + "forward" + ], + [ + "u8", + "learn" + ], + [ + "u8", + "arp_term" + ], + [ + "u8", + "arp_ufwd" + ], + [ + "u8", + "mac_age" + ], + [ + "u8", + "bd_tag", + 64 + ], + [ + "u8", + "is_add" + ], + { + "crc": "0xc6360720" + } + ], + [ + "bridge_domain_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bridge_domain_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + { + "crc": "0xc25fdce6" + } + ], + [ + "bridge_domain_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + [ + "u8", + "flood" + ], + [ + "u8", + "uu_flood" + ], + [ + "u8", + "forward" + ], + [ + "u8", + "learn" + ], + [ + "u8", + "arp_term" + ], + [ + "u8", + "arp_ufwd" + ], + [ + "u8", + "mac_age" + ], + [ + "u8", + "bd_tag", + 64 + ], + [ + "u32", + "bvi_sw_if_index" + ], + [ + "u32", + "uu_fwd_sw_if_index" + ], + [ + "u32", + "n_sw_ifs" + ], + [ + "vl_api_bridge_domain_sw_if_t", + "sw_if_details", + 0, + "n_sw_ifs" + ], + { + "crc": "0x748c854a" + } + ], + [ + "bridge_flags", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + [ + "u8", + "is_set" + ], + [ + "vl_api_bd_flags_t", + "flags" + ], + { + "crc": "0x2eb9b76c" + } + ], + [ + "bridge_flags_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "resulting_feature_bitmap" + ], + { + "crc": "0x29b2a2b3" + } + ], + [ + "l2_interface_vlan_tag_rewrite", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "vtr_op" + ], + [ + "u32", + "push_dot1q" + ], + [ + "u32", + "tag1" + ], + [ + "u32", + "tag2" + ], + { + "crc": "0xb90be6b4" + } + ], + [ + "l2_interface_vlan_tag_rewrite_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l2_interface_pbb_tag_rewrite", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "vtr_op" + ], + [ + "u16", + "outer_tag" + ], + [ + "u8", + "b_dmac", + 6 + ], + [ + "u8", + "b_smac", + 6 + ], + [ + "u16", + "b_vlanid" + ], + [ + "u32", + "i_sid" + ], + { + "crc": "0x6cf815f9" + } + ], + [ + "l2_interface_pbb_tag_rewrite_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l2_patch_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "rx_sw_if_index" + ], + [ + "u32", + "tx_sw_if_index" + ], + [ + "u8", + "is_add" + ], + { + "crc": "0x62506e63" + } + ], + [ + "l2_patch_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_set_l2_xconnect", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "rx_sw_if_index" + ], + [ + "u32", + "tx_sw_if_index" + ], + [ + "u8", + "enable" + ], + { + "crc": "0x95de3988" + } + ], + [ + "sw_interface_set_l2_xconnect_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_set_l2_bridge", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "rx_sw_if_index" + ], + [ + "u32", + "bd_id" + ], + [ + "vl_api_l2_port_type_t", + "port_type" + ], + [ + "u8", + "shg" + ], + [ + "u8", + "enable" + ], + { + "crc": "0x5579f809" + } + ], + [ + "sw_interface_set_l2_bridge_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bd_ip_mac_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "vl_api_bd_ip_mac_t", + "entry" + ], + { + "crc": "0x25bf4063" + } + ], + [ + "bd_ip_mac_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bd_ip_mac_flush", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + { + "crc": "0xc25fdce6" + } + ], + [ + "bd_ip_mac_flush_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bd_ip_mac_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_bd_ip_mac_t", + "entry" + ], + { + "crc": "0xa52f8044" + } + ], + [ + "bd_ip_mac_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + { + "crc": "0xc25fdce6" + } + ], + [ + "l2_interface_efp_filter", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "enable_disable" + ], + { + "crc": "0x69d24598" + } + ], + [ + "l2_interface_efp_filter_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_set_vpath", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "enable" + ], + { + "crc": "0xa36fadc0" + } + ], + [ + "sw_interface_set_vpath_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bvi_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_mac_address_t", + "mac" + ], + [ + "u32", + "user_instance" + ], + { + "crc": "0xf5398559" + } + ], + [ + "bvi_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0xfda5941f" + } + ], + [ + "bvi_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x529cb13f" + } + ], + [ + "bvi_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "want_l2_arp_term_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable" + ], + [ + "u32", + "pid" + ], + { + "crc": "0x3ec6d6c2" + } + ], + [ + "want_l2_arp_term_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l2_arp_term_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "vl_api_address_t", + "ip" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_mac_address_t", + "mac" + ], + { + "crc": "0x85ff71ea" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "bd_flags", + [ + "BRIDGE_API_FLAG_NONE", + 0 + ], + [ + "BRIDGE_API_FLAG_LEARN", + 1 + ], + [ + "BRIDGE_API_FLAG_FWD", + 2 + ], + [ + "BRIDGE_API_FLAG_FLOOD", + 4 + ], + [ + "BRIDGE_API_FLAG_UU_FLOOD", + 8 + ], + [ + "BRIDGE_API_FLAG_ARP_TERM", + 16 + ], + [ + "BRIDGE_API_FLAG_ARP_UFWD", + 32 + ], + { + "enumtype": "u32" + } + ], + [ + "l2_port_type", + [ + "L2_API_PORT_TYPE_NORMAL", + 0 + ], + [ + "L2_API_PORT_TYPE_BVI", + 1 + ], + [ + "L2_API_PORT_TYPE_UU_FWD", + 2 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "want_l2_macs_events": { + "reply": "want_l2_macs_events_reply", + "events": [ + "l2_macs_event" + ] + }, + "want_l2_arp_term_events": { + "reply": "want_l2_arp_term_events_reply", + "events": [ + "l2_arp_term_event" + ] + }, + "l2_xconnect_dump": { + "reply": "l2_xconnect_details", + "stream": true + }, + "l2_fib_table_dump": { + "reply": "l2_fib_table_details", + "stream": true + }, + "l2_fib_clear_table": { + "reply": "l2_fib_clear_table_reply" + }, + "l2fib_flush_all": { + "reply": "l2fib_flush_all_reply" + }, + "l2fib_flush_bd": { + "reply": "l2fib_flush_bd_reply" + }, + "l2fib_flush_int": { + "reply": "l2fib_flush_int_reply" + }, + "l2fib_add_del": { + "reply": "l2fib_add_del_reply" + }, + "l2_flags": { + "reply": "l2_flags_reply" + }, + "bridge_domain_set_mac_age": { + "reply": "bridge_domain_set_mac_age_reply" + }, + "bridge_domain_add_del": { + "reply": "bridge_domain_add_del_reply" + }, + "bridge_domain_dump": { + "reply": "bridge_domain_details", + "stream": true + }, + "bridge_flags": { + "reply": "bridge_flags_reply" + }, + "l2_interface_vlan_tag_rewrite": { + "reply": "l2_interface_vlan_tag_rewrite_reply" + }, + "l2_interface_pbb_tag_rewrite": { + "reply": "l2_interface_pbb_tag_rewrite_reply" + }, + "l2_patch_add_del": { + "reply": "l2_patch_add_del_reply" + }, + "sw_interface_set_l2_xconnect": { + "reply": "sw_interface_set_l2_xconnect_reply" + }, + "sw_interface_set_l2_bridge": { + "reply": "sw_interface_set_l2_bridge_reply" + }, + "bd_ip_mac_add_del": { + "reply": "bd_ip_mac_add_del_reply" + }, + "bd_ip_mac_flush": { + "reply": "bd_ip_mac_flush_reply" + }, + "bd_ip_mac_dump": { + "reply": "bd_ip_mac_details", + "stream": true + }, + "l2_interface_efp_filter": { + "reply": "l2_interface_efp_filter_reply" + }, + "sw_interface_set_vpath": { + "reply": "sw_interface_set_vpath_reply" + }, + "bvi_create": { + "reply": "bvi_create_reply" + }, + "bvi_delete": { + "reply": "bvi_delete_reply" + } + }, + "options": { + "version": "2.2.2" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "mac_address": { + "type": "u8", + "length": 6 + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x2e148df3" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/l2tp.api.json b/internal/testbinapi/binapi2001/.vppapi/core/l2tp.api.json new file mode 100644 index 0000000..6cb9d6b --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/l2tp.api.json @@ -0,0 +1,767 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "l2tpv3_create_tunnel", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_t", + "client_address" + ], + [ + "vl_api_address_t", + "our_address" + ], + [ + "u32", + "local_session_id" + ], + [ + "u32", + "remote_session_id" + ], + [ + "u64", + "local_cookie" + ], + [ + "u64", + "remote_cookie" + ], + [ + "bool", + "l2_sublayer_present" + ], + [ + "u32", + "encap_vrf_id" + ], + { + "crc": "0x596892cb" + } + ], + [ + "l2tpv3_create_tunnel_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "l2tpv3_set_tunnel_cookies", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u64", + "new_local_cookie" + ], + [ + "u64", + "new_remote_cookie" + ], + { + "crc": "0xb3f4faf7" + } + ], + [ + "l2tpv3_set_tunnel_cookies_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_if_l2tpv3_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "interface_name", + 64 + ], + [ + "vl_api_address_t", + "client_address" + ], + [ + "vl_api_address_t", + "our_address" + ], + [ + "u32", + "local_session_id" + ], + [ + "u32", + "remote_session_id" + ], + [ + "u64", + "local_cookie", + 2 + ], + [ + "u64", + "remote_cookie" + ], + [ + "bool", + "l2_sublayer_present" + ], + { + "crc": "0x1dab5c7e" + } + ], + [ + "sw_if_l2tpv3_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "l2tpv3_interface_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x3865946c" + } + ], + [ + "l2tpv3_interface_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l2tpv3_set_lookup_key", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_l2t_lookup_key_t", + "key" + ], + { + "crc": "0xc9892c86" + } + ], + [ + "l2tpv3_set_lookup_key_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "l2t_lookup_key", + [ + "L2T_LOOKUP_KEY_API_SRC_ADDR", + 0 + ], + [ + "L2T_LOOKUP_KEY_API_DST_ADDR", + 1 + ], + [ + "L2T_LOOKUP_KEY_API_SESSION_ID", + 2 + ], + { + "enumtype": "u8" + } + ] + ], + "services": { + "l2tpv3_create_tunnel": { + "reply": "l2tpv3_create_tunnel_reply" + }, + "l2tpv3_set_tunnel_cookies": { + "reply": "l2tpv3_set_tunnel_cookies_reply" + }, + "sw_if_l2tpv3_tunnel_dump": { + "reply": "sw_if_l2tpv3_tunnel_details", + "stream": true + }, + "l2tpv3_interface_enable_disable": { + "reply": "l2tpv3_interface_enable_disable_reply" + }, + "l2tpv3_set_lookup_key": { + "reply": "l2tpv3_set_lookup_key_reply" + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x1ecf7730" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/lisp.api.json b/internal/testbinapi/binapi2001/.vppapi/core/lisp.api.json new file mode 100644 index 0000000..1d6884a --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/lisp.api.json @@ -0,0 +1,1704 @@ +{ + "types": [ + [ + "local_locator", + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "priority" + ], + [ + "u8", + "weight" + ] + ], + [ + "remote_locator", + [ + "u8", + "is_ip4" + ], + [ + "u8", + "priority" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "addr", + 16 + ] + ], + [ + "lisp_adjacency", + [ + "u8", + "eid_type" + ], + [ + "u8", + "reid", + 16 + ], + [ + "u8", + "leid", + 16 + ], + [ + "u8", + "reid_prefix_len" + ], + [ + "u8", + "leid_prefix_len" + ] + ] + ], + "messages": [ + [ + "lisp_add_del_locator_set", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "locator_set_name", + 64 + ], + [ + "u32", + "locator_num" + ], + [ + "vl_api_local_locator_t", + "locators", + 0, + "locator_num" + ], + { + "crc": "0x06968e38" + } + ], + [ + "lisp_add_del_locator_set_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "ls_index" + ], + { + "crc": "0xb6666db4" + } + ], + [ + "lisp_add_del_locator", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "locator_set_name", + 64 + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "priority" + ], + [ + "u8", + "weight" + ], + { + "crc": "0x006a4240" + } + ], + [ + "lisp_add_del_locator_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_add_del_local_eid", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "eid", + 16 + ], + [ + "u8", + "prefix_len" + ], + [ + "u8", + "locator_set_name", + 64 + ], + [ + "u32", + "vni" + ], + [ + "u16", + "key_id" + ], + [ + "u8", + "key", + 64 + ], + { + "crc": "0xe6d00717" + } + ], + [ + "lisp_add_del_local_eid_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_add_del_map_server", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + { + "crc": "0x0ebcd37d" + } + ], + [ + "lisp_add_del_map_server_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_add_del_map_resolver", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + { + "crc": "0x0ebcd37d" + } + ], + [ + "lisp_add_del_map_resolver_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0xeb0e943b" + } + ], + [ + "lisp_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_pitr_set_locator_set", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "ls_name", + 64 + ], + { + "crc": "0x7aa022dd" + } + ], + [ + "lisp_pitr_set_locator_set_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_use_petr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "address", + 16 + ], + [ + "u8", + "is_add" + ], + { + "crc": "0x6910787d" + } + ], + [ + "lisp_use_petr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "show_lisp_use_petr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_lisp_use_petr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "status" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "address", + 16 + ], + { + "crc": "0x1eb21916" + } + ], + [ + "show_lisp_rloc_probe_state", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_lisp_rloc_probe_state_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "is_enabled" + ], + { + "crc": "0x14304fbc" + } + ], + [ + "lisp_rloc_probe_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_enabled" + ], + { + "crc": "0x294103d1" + } + ], + [ + "lisp_rloc_probe_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_map_register_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_enabled" + ], + { + "crc": "0x294103d1" + } + ], + [ + "lisp_map_register_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "show_lisp_map_register_state", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_lisp_map_register_state_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "is_enabled" + ], + { + "crc": "0x14304fbc" + } + ], + [ + "lisp_map_request_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "mode" + ], + { + "crc": "0xf3f93ce9" + } + ], + [ + "lisp_map_request_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "show_lisp_map_request_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_lisp_map_request_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "mode" + ], + { + "crc": "0xd423107c" + } + ], + [ + "lisp_add_del_remote_mapping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_src_dst" + ], + [ + "u8", + "del_all" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "action" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "eid", + 16 + ], + [ + "u8", + "eid_len" + ], + [ + "u8", + "seid", + 16 + ], + [ + "u8", + "seid_len" + ], + [ + "u32", + "rloc_num" + ], + [ + "vl_api_remote_locator_t", + "rlocs", + 0, + "rloc_num" + ], + { + "crc": "0xb879c3a9" + } + ], + [ + "lisp_add_del_remote_mapping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_add_del_adjacency", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "reid", + 16 + ], + [ + "u8", + "leid", + 16 + ], + [ + "u8", + "reid_len" + ], + [ + "u8", + "leid_len" + ], + { + "crc": "0xf047390d" + } + ], + [ + "lisp_add_del_adjacency_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_add_del_map_request_itr_rlocs", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "locator_set_name", + 64 + ], + { + "crc": "0xc7c6cb2f" + } + ], + [ + "lisp_add_del_map_request_itr_rlocs_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_eid_table_add_del_map", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "vni" + ], + [ + "u32", + "dp_table" + ], + [ + "u8", + "is_l2" + ], + { + "crc": "0x59e9975e" + } + ], + [ + "lisp_eid_table_add_del_map_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lisp_locator_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "ls_index" + ], + [ + "u8", + "ls_name", + 64 + ], + [ + "u8", + "is_index_set" + ], + { + "crc": "0xf27d5050" + } + ], + [ + "lisp_locator_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "local" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + [ + "u8", + "priority" + ], + [ + "u8", + "weight" + ], + { + "crc": "0xb3988a30" + } + ], + [ + "lisp_locator_set_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "ls_index" + ], + [ + "u8", + "ls_name", + 64 + ], + { + "crc": "0x6b846882" + } + ], + [ + "lisp_locator_set_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "filter" + ], + { + "crc": "0xc79e8ab0" + } + ], + [ + "lisp_eid_table_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "locator_set_index" + ], + [ + "u8", + "action" + ], + [ + "u8", + "is_local" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "is_src_dst" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "eid", + 16 + ], + [ + "u8", + "eid_prefix_len" + ], + [ + "u8", + "seid", + 16 + ], + [ + "u8", + "seid_prefix_len" + ], + [ + "u32", + "ttl" + ], + [ + "u8", + "authoritative" + ], + [ + "u16", + "key_id" + ], + [ + "u8", + "key", + 64 + ], + { + "crc": "0xdcd9f414" + } + ], + [ + "lisp_eid_table_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "eid_set" + ], + [ + "u8", + "prefix_length" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "eid", + 16 + ], + [ + "u8", + "filter" + ], + { + "crc": "0xe0df64da" + } + ], + [ + "lisp_adjacencies_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "vl_api_lisp_adjacency_t", + "adjacencies", + 0, + "count" + ], + { + "crc": "0xada0f464" + } + ], + [ + "lisp_adjacencies_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + { + "crc": "0x8d1f2fe9" + } + ], + [ + "lisp_eid_table_map_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + [ + "u32", + "dp_table" + ], + { + "crc": "0x0b6859e2" + } + ], + [ + "lisp_eid_table_map_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_l2" + ], + { + "crc": "0x67c54650" + } + ], + [ + "lisp_eid_table_vni_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "lisp_eid_table_vni_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + { + "crc": "0x64abc01e" + } + ], + [ + "lisp_map_resolver_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + { + "crc": "0x60a5f5ca" + } + ], + [ + "lisp_map_resolver_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "lisp_map_server_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + { + "crc": "0x60a5f5ca" + } + ], + [ + "lisp_map_server_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_lisp_status", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_lisp_status_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "feature_status" + ], + [ + "u8", + "gpe_status" + ], + { + "crc": "0xddcf48ef" + } + ], + [ + "lisp_get_map_request_itr_rlocs", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "lisp_get_map_request_itr_rlocs_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "locator_set_name", + 64 + ], + { + "crc": "0x9f56f6f7" + } + ], + [ + "show_lisp_pitr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_lisp_pitr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "status" + ], + [ + "u8", + "locator_set_name", + 64 + ], + { + "crc": "0xdca512cc" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "lisp_add_del_locator_set": { + "reply": "lisp_add_del_locator_set_reply" + }, + "lisp_add_del_locator": { + "reply": "lisp_add_del_locator_reply" + }, + "lisp_add_del_local_eid": { + "reply": "lisp_add_del_local_eid_reply" + }, + "lisp_add_del_map_server": { + "reply": "lisp_add_del_map_server_reply" + }, + "lisp_add_del_map_resolver": { + "reply": "lisp_add_del_map_resolver_reply" + }, + "lisp_enable_disable": { + "reply": "lisp_enable_disable_reply" + }, + "lisp_pitr_set_locator_set": { + "reply": "lisp_pitr_set_locator_set_reply" + }, + "lisp_use_petr": { + "reply": "lisp_use_petr_reply" + }, + "show_lisp_use_petr": { + "reply": "show_lisp_use_petr_reply" + }, + "show_lisp_rloc_probe_state": { + "reply": "show_lisp_rloc_probe_state_reply" + }, + "lisp_rloc_probe_enable_disable": { + "reply": "lisp_rloc_probe_enable_disable_reply" + }, + "lisp_map_register_enable_disable": { + "reply": "lisp_map_register_enable_disable_reply" + }, + "show_lisp_map_register_state": { + "reply": "show_lisp_map_register_state_reply" + }, + "lisp_map_request_mode": { + "reply": "lisp_map_request_mode_reply" + }, + "show_lisp_map_request_mode": { + "reply": "show_lisp_map_request_mode_reply" + }, + "lisp_add_del_remote_mapping": { + "reply": "lisp_add_del_remote_mapping_reply" + }, + "lisp_add_del_adjacency": { + "reply": "lisp_add_del_adjacency_reply" + }, + "lisp_add_del_map_request_itr_rlocs": { + "reply": "lisp_add_del_map_request_itr_rlocs_reply" + }, + "lisp_eid_table_add_del_map": { + "reply": "lisp_eid_table_add_del_map_reply" + }, + "lisp_locator_dump": { + "reply": "lisp_locator_details", + "stream": true + }, + "lisp_locator_set_dump": { + "reply": "lisp_locator_set_details", + "stream": true + }, + "lisp_eid_table_dump": { + "reply": "lisp_eid_table_details", + "stream": true + }, + "lisp_adjacencies_get": { + "reply": "lisp_adjacencies_get_reply" + }, + "lisp_eid_table_map_dump": { + "reply": "lisp_eid_table_map_details", + "stream": true + }, + "lisp_eid_table_vni_dump": { + "reply": "lisp_eid_table_vni_details", + "stream": true + }, + "lisp_map_resolver_dump": { + "reply": "lisp_map_resolver_details", + "stream": true + }, + "lisp_map_server_dump": { + "reply": "lisp_map_server_details", + "stream": true + }, + "show_lisp_status": { + "reply": "show_lisp_status_reply" + }, + "lisp_get_map_request_itr_rlocs": { + "reply": "lisp_get_map_request_itr_rlocs_reply" + }, + "show_lisp_pitr": { + "reply": "show_lisp_pitr_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x681568f8" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/lisp_gpe.api.json b/internal/testbinapi/binapi2001/.vppapi/core/lisp_gpe.api.json new file mode 100644 index 0000000..bf6eb9a --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/lisp_gpe.api.json @@ -0,0 +1,630 @@ +{ + "types": [ + [ + "gpe_locator", + [ + "u8", + "is_ip4" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "addr", + 16 + ] + ], + [ + "gpe_fwd_entry", + [ + "u32", + "fwd_entry_index" + ], + [ + "u32", + "dp_table" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "leid_prefix_len" + ], + [ + "u8", + "reid_prefix_len" + ], + [ + "u8", + "leid", + 16 + ], + [ + "u8", + "reid", + 16 + ], + [ + "u32", + "vni" + ], + [ + "u8", + "action" + ] + ], + [ + "gpe_native_fwd_rpath", + [ + "u32", + "fib_index" + ], + [ + "u32", + "nh_sw_if_index" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "nh_addr", + 16 + ] + ] + ], + "messages": [ + [ + "gpe_add_del_fwd_entry", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "rmt_eid", + 16 + ], + [ + "u8", + "lcl_eid", + 16 + ], + [ + "u8", + "rmt_len" + ], + [ + "u8", + "lcl_len" + ], + [ + "u32", + "vni" + ], + [ + "u32", + "dp_table" + ], + [ + "u8", + "action" + ], + [ + "u32", + "loc_num" + ], + [ + "vl_api_gpe_locator_t", + "locs", + 0, + "loc_num" + ], + { + "crc": "0xafbf857a" + } + ], + [ + "gpe_add_del_fwd_entry_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "fwd_entry_index" + ], + { + "crc": "0xefe5f176" + } + ], + [ + "gpe_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0xeb0e943b" + } + ], + [ + "gpe_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gpe_add_del_iface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_l2" + ], + [ + "u32", + "dp_table" + ], + [ + "u32", + "vni" + ], + { + "crc": "0x42d6b533" + } + ], + [ + "gpe_add_del_iface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gpe_fwd_entry_vnis_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gpe_fwd_entry_vnis_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "u32", + "vnis", + 0, + "count" + ], + { + "crc": "0xaa70da20" + } + ], + [ + "gpe_fwd_entries_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + { + "crc": "0x8d1f2fe9" + } + ], + [ + "gpe_fwd_entries_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "vl_api_gpe_fwd_entry_t", + "entries", + 0, + "count" + ], + { + "crc": "0x07b02c34" + } + ], + [ + "gpe_fwd_entry_path_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "fwd_entry_index" + ], + { + "crc": "0x39bce980" + } + ], + [ + "gpe_fwd_entry_path_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gpe_locator_t", + "lcl_loc" + ], + [ + "vl_api_gpe_locator_t", + "rmt_loc" + ], + { + "crc": "0xa9bdc1f1" + } + ], + [ + "gpe_set_encap_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "mode" + ], + { + "crc": "0xf3f93ce9" + } + ], + [ + "gpe_set_encap_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gpe_get_encap_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gpe_get_encap_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "encap_mode" + ], + { + "crc": "0x36e3f7ca" + } + ], + [ + "gpe_add_del_native_fwd_rpath", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "nh_sw_if_index" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "nh_addr", + 16 + ], + { + "crc": "0xbfc42b8f" + } + ], + [ + "gpe_add_del_native_fwd_rpath_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gpe_native_fwd_rpaths_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ip4" + ], + { + "crc": "0xc5e0d91b" + } + ], + [ + "gpe_native_fwd_rpaths_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "vl_api_gpe_native_fwd_rpath_t", + "entries", + 0, + "count" + ], + { + "crc": "0x1e4536e3" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "gpe_add_del_fwd_entry": { + "reply": "gpe_add_del_fwd_entry_reply" + }, + "gpe_enable_disable": { + "reply": "gpe_enable_disable_reply" + }, + "gpe_add_del_iface": { + "reply": "gpe_add_del_iface_reply" + }, + "gpe_fwd_entry_vnis_get": { + "reply": "gpe_fwd_entry_vnis_get_reply" + }, + "gpe_fwd_entries_get": { + "reply": "gpe_fwd_entries_get_reply" + }, + "gpe_fwd_entry_path_dump": { + "reply": "gpe_fwd_entry_path_details", + "stream": true + }, + "gpe_set_encap_mode": { + "reply": "gpe_set_encap_mode_reply" + }, + "gpe_get_encap_mode": { + "reply": "gpe_get_encap_mode_reply" + }, + "gpe_add_del_native_fwd_rpath": { + "reply": "gpe_add_del_native_fwd_rpath_reply" + }, + "gpe_native_fwd_rpaths_get": { + "reply": "gpe_native_fwd_rpaths_get_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x9396c80c" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/lldp.api.json b/internal/testbinapi/binapi2001/.vppapi/core/lldp.api.json new file mode 100644 index 0000000..9dbd66b --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/lldp.api.json @@ -0,0 +1,133 @@ +{ + "types": [], + "messages": [ + [ + "lldp_config", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "system_name", + 256 + ], + [ + "u32", + "tx_hold" + ], + [ + "u32", + "tx_interval" + ], + { + "crc": "0x2410286f" + } + ], + [ + "lldp_config_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_set_lldp", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "port_desc", + 256 + ], + [ + "u8", + "mgmt_ip4", + 4 + ], + [ + "u8", + "mgmt_ip6", + 16 + ], + [ + "u8", + "mgmt_oid", + 128 + ], + [ + "u8", + "enable" + ], + { + "crc": "0x2d85d156" + } + ], + [ + "sw_interface_set_lldp_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "lldp_config": { + "reply": "lldp_config_reply" + }, + "sw_interface_set_lldp": { + "reply": "sw_interface_set_lldp_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0xabb21dd0" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/memclnt.api.json b/internal/testbinapi/binapi2001/.vppapi/core/memclnt.api.json new file mode 100644 index 0000000..746707e --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/memclnt.api.json @@ -0,0 +1,595 @@ +{ + "types": [ + [ + "module_version", + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + [ + "u32", + "patch" + ], + [ + "string", + "name", + 64 + ] + ], + [ + "message_table_entry", + [ + "u16", + "index" + ], + [ + "string", + "name", + 64 + ] + ] + ], + "messages": [ + [ + "memclnt_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "ctx_quota" + ], + [ + "u64", + "input_queue" + ], + [ + "string", + "name", + 64 + ], + [ + "u32", + "api_versions", + 8 + ], + { + "crc": "0x9c5e1c2f" + } + ], + [ + "memclnt_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "response" + ], + [ + "u64", + "handle" + ], + [ + "u32", + "index" + ], + [ + "u64", + "message_table" + ], + { + "crc": "0x42ec4560" + } + ], + [ + "memclnt_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "index" + ], + [ + "u64", + "handle" + ], + [ + "bool", + "do_cleanup" + ], + { + "crc": "0x7e1c04e3" + } + ], + [ + "memclnt_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "i32", + "response" + ], + [ + "u64", + "handle" + ], + { + "crc": "0x3d3b6312" + } + ], + [ + "rx_thread_exit", + [ + "u16", + "_vl_msg_id" + ], + [ + "u8", + "dummy" + ], + { + "crc": "0xc3a3a452" + } + ], + [ + "memclnt_rx_thread_suspend", + [ + "u16", + "_vl_msg_id" + ], + [ + "u8", + "dummy" + ], + { + "crc": "0xc3a3a452" + } + ], + [ + "memclnt_read_timeout", + [ + "u16", + "_vl_msg_id" + ], + [ + "u8", + "dummy" + ], + { + "crc": "0xc3a3a452" + } + ], + [ + "rpc_call", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "function" + ], + [ + "u8", + "multicast" + ], + [ + "u8", + "need_barrier_sync" + ], + [ + "u8", + "send_reply" + ], + [ + "u32", + "data_len" + ], + [ + "u8", + "data", + 0, + "data_len" + ], + { + "crc": "0x7e8a2c95" + } + ], + [ + "rpc_call_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "get_first_msg_id", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + { + "crc": "0xebf79a66" + } + ], + [ + "get_first_msg_id_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u16", + "first_msg_id" + ], + { + "crc": "0x7d337472" + } + ], + [ + "api_versions", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "api_versions_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "vl_api_module_version_t", + "api_versions", + 0, + "count" + ], + { + "crc": "0x5f0d99d6" + } + ], + [ + "trace_plugin_msg_ids", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "plugin_name", + 128 + ], + [ + "u16", + "first_msg_id" + ], + [ + "u16", + "last_msg_id" + ], + { + "crc": "0xf476d3ce" + } + ], + [ + "sockclnt_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + { + "crc": "0x455fb9c4" + } + ], + [ + "sockclnt_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "i32", + "response" + ], + [ + "u32", + "index" + ], + [ + "u16", + "count" + ], + [ + "vl_api_message_table_entry_t", + "message_table", + 0, + "count" + ], + { + "crc": "0x35166268" + } + ], + [ + "sockclnt_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "index" + ], + { + "crc": "0x8ac76db6" + } + ], + [ + "sockclnt_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "response" + ], + { + "crc": "0x8f38b1ee" + } + ], + [ + "sock_init_shm", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "requested_size" + ], + [ + "u8", + "nitems" + ], + [ + "u64", + "configs", + 0, + "nitems" + ], + { + "crc": "0x51646d92" + } + ], + [ + "sock_init_shm_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "memclnt_keepalive", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "memclnt_keepalive_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "memclnt_rx_thread_suspend": { + "reply": "null" + }, + "memclnt_read_timeout": { + "reply": "null" + }, + "rx_thread_exit": { + "reply": "null" + }, + "trace_plugin_msg_ids": { + "reply": "null" + }, + "memclnt_create": { + "reply": "memclnt_create_reply" + }, + "memclnt_delete": { + "reply": "memclnt_delete_reply" + }, + "rpc_call": { + "reply": "rpc_call_reply" + }, + "get_first_msg_id": { + "reply": "get_first_msg_id_reply" + }, + "api_versions": { + "reply": "api_versions_reply" + }, + "sockclnt_create": { + "reply": "sockclnt_create_reply" + }, + "sockclnt_delete": { + "reply": "sockclnt_delete_reply" + }, + "sock_init_shm": { + "reply": "sock_init_shm_reply" + }, + "memclnt_keepalive": { + "reply": "memclnt_keepalive_reply" + } + }, + "options": { + "version": "2.1.0" + }, + "aliases": {}, + "vl_api_version": "0x8d3dd881" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/mfib_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/mfib_types.api.json new file mode 100644 index 0000000..a33b76f --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/mfib_types.api.json @@ -0,0 +1,786 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ], + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "mfib_path", + [ + "vl_api_mfib_itf_flags_t", + "itf_flags" + ], + [ + "vl_api_fib_path_t", + "path" + ] + ] + ], + "messages": [], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ], + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "mfib_itf_flags", + [ + "MFIB_API_ITF_FLAG_NONE", + 0 + ], + [ + "MFIB_API_ITF_FLAG_NEGATE_SIGNAL", + 1 + ], + [ + "MFIB_API_ITF_FLAG_ACCEPT", + 2 + ], + [ + "MFIB_API_ITF_FLAG_FORWARD", + 4 + ], + [ + "MFIB_API_ITF_FLAG_SIGNAL_PRESENT", + 8 + ], + [ + "MFIB_API_ITF_FLAG_DONT_PRESERVE", + 16 + ], + { + "enumtype": "u32" + } + ] + ], + "services": {}, + "options": {}, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xba024d84" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/mpls.api.json b/internal/testbinapi/binapi2001/.vppapi/core/mpls.api.json new file mode 100644 index 0000000..a9797ba --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/mpls.api.json @@ -0,0 +1,1378 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ], + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "mpls_tunnel", + [ + "vl_api_interface_index_t", + "mt_sw_if_index" + ], + [ + "u32", + "mt_tunnel_index" + ], + [ + "bool", + "mt_l2_only" + ], + [ + "bool", + "mt_is_multicast" + ], + [ + "u8", + "mt_n_paths" + ], + [ + "vl_api_fib_path_t", + "mt_paths", + 0, + "mt_n_paths" + ] + ], + [ + "mpls_table", + [ + "u32", + "mt_table_id" + ], + [ + "string", + "mt_name", + 64 + ] + ], + [ + "mpls_route", + [ + "u32", + "mr_table_id" + ], + [ + "u32", + "mr_label" + ], + [ + "u8", + "mr_eos" + ], + [ + "u8", + "mr_eos_proto" + ], + [ + "bool", + "mr_is_multicast" + ], + [ + "u8", + "mr_n_paths" + ], + [ + "vl_api_fib_path_t", + "mr_paths", + 0, + "mr_n_paths" + ] + ] + ], + "messages": [ + [ + "mpls_ip_bind_unbind", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "mb_mpls_table_id" + ], + [ + "u32", + "mb_label" + ], + [ + "u32", + "mb_ip_table_id" + ], + [ + "bool", + "mb_is_bind" + ], + [ + "vl_api_prefix_t", + "mb_prefix" + ], + { + "crc": "0x48249a27" + } + ], + [ + "mpls_ip_bind_unbind_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "mpls_tunnel_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "mt_is_add", + { + "default": "true" + } + ], + [ + "vl_api_mpls_tunnel_t", + "mt_tunnel" + ], + { + "crc": "0x0de2478e" + } + ], + [ + "mpls_tunnel_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "tunnel_index" + ], + { + "crc": "0xafb01472" + } + ], + [ + "mpls_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "mpls_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_mpls_tunnel_t", + "mt_tunnel" + ], + { + "crc": "0xbdc55cce" + } + ], + [ + "mpls_table_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "mt_is_add", + { + "default": "true" + } + ], + [ + "vl_api_mpls_table_t", + "mt_table" + ], + { + "crc": "0x57817512" + } + ], + [ + "mpls_table_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "mpls_table_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "mpls_table_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_mpls_table_t", + "mt_table" + ], + { + "crc": "0xf03ecdc8" + } + ], + [ + "mpls_route_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "mr_is_add" + ], + [ + "bool", + "mr_is_multipath" + ], + [ + "vl_api_mpls_route_t", + "mr_route" + ], + { + "crc": "0x343cff54" + } + ], + [ + "mpls_route_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stats_index" + ], + { + "crc": "0x1992deab" + } + ], + [ + "mpls_route_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_mpls_table_t", + "table" + ], + { + "crc": "0x935fdefa" + } + ], + [ + "mpls_route_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_mpls_route_t", + "mr_route" + ], + { + "crc": "0xd0ac384c" + } + ], + [ + "sw_interface_set_mpls_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable", + { + "default": "true" + } + ], + { + "crc": "0xae6cfcfb" + } + ], + [ + "sw_interface_set_mpls_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ], + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "mpls_ip_bind_unbind": { + "reply": "mpls_ip_bind_unbind_reply" + }, + "mpls_tunnel_add_del": { + "reply": "mpls_tunnel_add_del_reply" + }, + "mpls_tunnel_dump": { + "reply": "mpls_tunnel_details", + "stream": true + }, + "mpls_table_add_del": { + "reply": "mpls_table_add_del_reply" + }, + "mpls_table_dump": { + "reply": "mpls_table_details", + "stream": true + }, + "mpls_route_add_del": { + "reply": "mpls_route_add_del_reply" + }, + "mpls_route_dump": { + "reply": "mpls_route_details", + "stream": true + }, + "sw_interface_set_mpls_enable": { + "reply": "sw_interface_set_mpls_enable_reply" + } + }, + "options": { + "version": "1.1.1" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xfe593e14" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/netmap.api.json b/internal/testbinapi/binapi2001/.vppapi/core/netmap.api.json new file mode 100644 index 0000000..4dbd80c --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/netmap.api.json @@ -0,0 +1,119 @@ +{ + "types": [], + "messages": [ + [ + "netmap_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "netmap_if_name", + 64 + ], + [ + "u8", + "hw_addr", + 6 + ], + [ + "u8", + "use_random_hw_addr" + ], + [ + "u8", + "is_pipe" + ], + [ + "u8", + "is_master" + ], + { + "crc": "0x5299044e" + } + ], + [ + "netmap_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "netmap_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "netmap_if_name", + 64 + ], + { + "crc": "0xa8b6c201" + } + ], + [ + "netmap_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "netmap_create": { + "reply": "netmap_create_reply" + }, + "netmap_delete": { + "reply": "netmap_delete_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x40e7a84f" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/nhrp.api.json b/internal/testbinapi/binapi2001/.vppapi/core/nhrp.api.json new file mode 100644 index 0000000..d307086 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/nhrp.api.json @@ -0,0 +1,561 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "nhrp_entry", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_t", + "peer" + ], + [ + "vl_api_address_t", + "nh" + ], + [ + "u32", + "nh_table_id" + ] + ] + ], + "messages": [ + [ + "nhrp_entry_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "vl_api_nhrp_entry_t", + "entry" + ], + { + "crc": "0x5a47c531" + } + ], + [ + "nhrp_entry_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nhrp_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nhrp_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_nhrp_entry_t", + "entry" + ], + { + "crc": "0xe351c50a" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "nhrp_entry_add_del": { + "reply": "nhrp_entry_add_del_reply" + }, + "nhrp_dump": { + "reply": "nhrp_details", + "stream": true + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xfb0453b2" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/one.api.json b/internal/testbinapi/binapi2001/.vppapi/core/one.api.json new file mode 100644 index 0000000..6d3dcc4 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/one.api.json @@ -0,0 +1,2867 @@ +{ + "types": [ + [ + "one_local_locator", + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "priority" + ], + [ + "u8", + "weight" + ] + ], + [ + "one_remote_locator", + [ + "u8", + "is_ip4" + ], + [ + "u8", + "priority" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "addr", + 16 + ] + ], + [ + "one_l2_arp_entry", + [ + "u8", + "mac", + 6 + ], + [ + "u32", + "ip4" + ] + ], + [ + "one_ndp_entry", + [ + "u8", + "mac", + 6 + ], + [ + "u8", + "ip6", + 16 + ] + ], + [ + "one_adjacency", + [ + "u8", + "eid_type" + ], + [ + "u8", + "reid", + 16 + ], + [ + "u8", + "leid", + 16 + ], + [ + "u8", + "reid_prefix_len" + ], + [ + "u8", + "leid_prefix_len" + ] + ] + ], + "messages": [ + [ + "one_add_del_locator_set", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "locator_set_name", + 64 + ], + [ + "u32", + "locator_num" + ], + [ + "vl_api_one_local_locator_t", + "locators", + 0, + "locator_num" + ], + { + "crc": "0x2e73b050" + } + ], + [ + "one_add_del_locator_set_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "ls_index" + ], + { + "crc": "0xb6666db4" + } + ], + [ + "one_add_del_locator", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "locator_set_name", + 64 + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "priority" + ], + [ + "u8", + "weight" + ], + { + "crc": "0x006a4240" + } + ], + [ + "one_add_del_locator_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_add_del_local_eid", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "eid", + 16 + ], + [ + "u8", + "prefix_len" + ], + [ + "u8", + "locator_set_name", + 64 + ], + [ + "u32", + "vni" + ], + [ + "u16", + "key_id" + ], + [ + "u8", + "key", + 64 + ], + { + "crc": "0xe6d00717" + } + ], + [ + "one_add_del_local_eid_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_map_register_set_ttl", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "ttl" + ], + { + "crc": "0xdd59f1f3" + } + ], + [ + "one_map_register_set_ttl_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "show_one_map_register_ttl", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_map_register_ttl_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "ttl" + ], + { + "crc": "0xfa83dd66" + } + ], + [ + "one_add_del_map_server", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + { + "crc": "0x0ebcd37d" + } + ], + [ + "one_add_del_map_server_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_add_del_map_resolver", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + { + "crc": "0x0ebcd37d" + } + ], + [ + "one_add_del_map_resolver_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0xeb0e943b" + } + ], + [ + "one_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_nsh_set_locator_set", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "ls_name", + 64 + ], + { + "crc": "0x7aa022dd" + } + ], + [ + "one_nsh_set_locator_set_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_pitr_set_locator_set", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "ls_name", + 64 + ], + { + "crc": "0x7aa022dd" + } + ], + [ + "one_pitr_set_locator_set_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_use_petr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "address", + 16 + ], + [ + "u8", + "is_add" + ], + { + "crc": "0x6910787d" + } + ], + [ + "one_use_petr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "show_one_use_petr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_use_petr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "status" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "address", + 16 + ], + { + "crc": "0x1eb21916" + } + ], + [ + "show_one_rloc_probe_state", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_rloc_probe_state_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "is_enabled" + ], + { + "crc": "0x14304fbc" + } + ], + [ + "one_rloc_probe_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_enabled" + ], + { + "crc": "0x294103d1" + } + ], + [ + "one_rloc_probe_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_map_register_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_enabled" + ], + { + "crc": "0x294103d1" + } + ], + [ + "one_map_register_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "show_one_map_register_state", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_map_register_state_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "is_enabled" + ], + { + "crc": "0x14304fbc" + } + ], + [ + "one_map_request_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "mode" + ], + { + "crc": "0xf3f93ce9" + } + ], + [ + "one_map_request_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "show_one_map_request_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_map_request_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "mode" + ], + { + "crc": "0xd423107c" + } + ], + [ + "one_add_del_remote_mapping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_src_dst" + ], + [ + "u8", + "del_all" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "action" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "eid", + 16 + ], + [ + "u8", + "eid_len" + ], + [ + "u8", + "seid", + 16 + ], + [ + "u8", + "seid_len" + ], + [ + "u32", + "rloc_num" + ], + [ + "vl_api_one_remote_locator_t", + "rlocs", + 0, + "rloc_num" + ], + { + "crc": "0x0b2010ec" + } + ], + [ + "one_add_del_remote_mapping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_add_del_l2_arp_entry", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "mac", + 6 + ], + [ + "u32", + "bd" + ], + [ + "u32", + "ip4" + ], + { + "crc": "0xa95cc2d7" + } + ], + [ + "one_add_del_l2_arp_entry_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_l2_arp_entries_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd" + ], + { + "crc": "0x4d418cf4" + } + ], + [ + "one_l2_arp_entries_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "vl_api_one_l2_arp_entry_t", + "entries", + 0, + "count" + ], + { + "crc": "0x88e54ded" + } + ], + [ + "one_add_del_ndp_entry", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "mac", + 6 + ], + [ + "u32", + "bd" + ], + [ + "u8", + "ip6", + 16 + ], + { + "crc": "0xe9468fe3" + } + ], + [ + "one_add_del_ndp_entry_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_ndp_entries_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd" + ], + { + "crc": "0x4d418cf4" + } + ], + [ + "one_ndp_entries_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "vl_api_one_ndp_entry_t", + "entries", + 0, + "count" + ], + { + "crc": "0xd0822f37" + } + ], + [ + "one_set_transport_protocol", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "protocol" + ], + { + "crc": "0x07b6b85f" + } + ], + [ + "one_set_transport_protocol_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_get_transport_protocol", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_get_transport_protocol_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "protocol" + ], + { + "crc": "0x62a28eb3" + } + ], + [ + "one_ndp_bd_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_ndp_bd_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "u32", + "bridge_domains", + 0, + "count" + ], + { + "crc": "0x221ac888" + } + ], + [ + "one_l2_arp_bd_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_l2_arp_bd_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "u32", + "bridge_domains", + 0, + "count" + ], + { + "crc": "0x221ac888" + } + ], + [ + "one_add_del_adjacency", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "reid", + 16 + ], + [ + "u8", + "leid", + 16 + ], + [ + "u8", + "reid_len" + ], + [ + "u8", + "leid_len" + ], + { + "crc": "0xf047390d" + } + ], + [ + "one_add_del_adjacency_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_add_del_map_request_itr_rlocs", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "locator_set_name", + 64 + ], + { + "crc": "0xc7c6cb2f" + } + ], + [ + "one_add_del_map_request_itr_rlocs_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_eid_table_add_del_map", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "vni" + ], + [ + "u32", + "dp_table" + ], + [ + "u8", + "is_l2" + ], + { + "crc": "0x59e9975e" + } + ], + [ + "one_eid_table_add_del_map_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_locator_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "ls_index" + ], + [ + "u8", + "ls_name", + 64 + ], + [ + "u8", + "is_index_set" + ], + { + "crc": "0xf27d5050" + } + ], + [ + "one_locator_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "local" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + [ + "u8", + "priority" + ], + [ + "u8", + "weight" + ], + { + "crc": "0xb3988a30" + } + ], + [ + "one_locator_set_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "ls_index" + ], + [ + "u8", + "ls_name", + 64 + ], + { + "crc": "0x6b846882" + } + ], + [ + "one_locator_set_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "filter" + ], + { + "crc": "0xc79e8ab0" + } + ], + [ + "one_eid_table_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "locator_set_index" + ], + [ + "u8", + "action" + ], + [ + "u8", + "is_local" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "is_src_dst" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "eid", + 16 + ], + [ + "u8", + "eid_prefix_len" + ], + [ + "u8", + "seid", + 16 + ], + [ + "u8", + "seid_prefix_len" + ], + [ + "u32", + "ttl" + ], + [ + "u8", + "authoritative" + ], + [ + "u16", + "key_id" + ], + [ + "u8", + "key", + 64 + ], + { + "crc": "0xdcd9f414" + } + ], + [ + "one_eid_table_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "eid_set" + ], + [ + "u8", + "prefix_length" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "eid", + 16 + ], + [ + "u8", + "filter" + ], + { + "crc": "0xe0df64da" + } + ], + [ + "one_adjacencies_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "vl_api_one_adjacency_t", + "adjacencies", + 0, + "count" + ], + { + "crc": "0x60a3c592" + } + ], + [ + "one_adjacencies_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + { + "crc": "0x8d1f2fe9" + } + ], + [ + "one_eid_table_map_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + [ + "u32", + "dp_table" + ], + { + "crc": "0x0b6859e2" + } + ], + [ + "one_eid_table_map_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_l2" + ], + { + "crc": "0x67c54650" + } + ], + [ + "one_eid_table_vni_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_eid_table_vni_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + { + "crc": "0x64abc01e" + } + ], + [ + "one_map_resolver_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + { + "crc": "0x60a5f5ca" + } + ], + [ + "one_map_resolver_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_map_server_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "ip_address", + 16 + ], + { + "crc": "0x60a5f5ca" + } + ], + [ + "one_map_server_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_status", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_status_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "feature_status" + ], + [ + "u8", + "gpe_status" + ], + { + "crc": "0xddcf48ef" + } + ], + [ + "one_get_map_request_itr_rlocs", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_get_map_request_itr_rlocs_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "locator_set_name", + 64 + ], + { + "crc": "0x9f56f6f7" + } + ], + [ + "show_one_nsh_mapping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_nsh_mapping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "is_set" + ], + [ + "u8", + "locator_set_name", + 64 + ], + { + "crc": "0xf2ff364e" + } + ], + [ + "show_one_pitr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_pitr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "status" + ], + [ + "u8", + "locator_set_name", + 64 + ], + { + "crc": "0xdca512cc" + } + ], + [ + "one_stats_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_stats_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "eid_type" + ], + [ + "u8", + "deid", + 16 + ], + [ + "u8", + "seid", + 16 + ], + [ + "u8", + "deid_pref_len" + ], + [ + "u8", + "seid_pref_len" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "rloc", + 16 + ], + [ + "u8", + "lloc", + 16 + ], + [ + "u32", + "pkt_count" + ], + [ + "u32", + "bytes" + ], + { + "crc": "0xe1a34a05" + } + ], + [ + "one_stats_flush", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_stats_flush_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_stats_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0xeb0e943b" + } + ], + [ + "one_stats_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "show_one_stats_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_stats_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0x6b4c29dc" + } + ], + [ + "one_map_register_fallback_threshold", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "value" + ], + { + "crc": "0xf7d4a475" + } + ], + [ + "one_map_register_fallback_threshold_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "show_one_map_register_fallback_threshold", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_one_map_register_fallback_threshold_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "value" + ], + { + "crc": "0xc93a9113" + } + ], + [ + "one_enable_disable_xtr_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0xeb0e943b" + } + ], + [ + "one_enable_disable_xtr_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_show_xtr_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_show_xtr_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0x6b4c29dc" + } + ], + [ + "one_enable_disable_petr_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0xeb0e943b" + } + ], + [ + "one_enable_disable_petr_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_show_petr_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_show_petr_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0x6b4c29dc" + } + ], + [ + "one_enable_disable_pitr_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0xeb0e943b" + } + ], + [ + "one_enable_disable_pitr_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "one_show_pitr_mode", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "one_show_pitr_mode_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "is_en" + ], + { + "crc": "0x6b4c29dc" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "one_add_del_locator_set": { + "reply": "one_add_del_locator_set_reply" + }, + "one_add_del_locator": { + "reply": "one_add_del_locator_reply" + }, + "one_add_del_local_eid": { + "reply": "one_add_del_local_eid_reply" + }, + "one_map_register_set_ttl": { + "reply": "one_map_register_set_ttl_reply" + }, + "show_one_map_register_ttl": { + "reply": "show_one_map_register_ttl_reply" + }, + "one_add_del_map_server": { + "reply": "one_add_del_map_server_reply" + }, + "one_add_del_map_resolver": { + "reply": "one_add_del_map_resolver_reply" + }, + "one_enable_disable": { + "reply": "one_enable_disable_reply" + }, + "one_nsh_set_locator_set": { + "reply": "one_nsh_set_locator_set_reply" + }, + "one_pitr_set_locator_set": { + "reply": "one_pitr_set_locator_set_reply" + }, + "one_use_petr": { + "reply": "one_use_petr_reply" + }, + "show_one_use_petr": { + "reply": "show_one_use_petr_reply" + }, + "show_one_rloc_probe_state": { + "reply": "show_one_rloc_probe_state_reply" + }, + "one_rloc_probe_enable_disable": { + "reply": "one_rloc_probe_enable_disable_reply" + }, + "one_map_register_enable_disable": { + "reply": "one_map_register_enable_disable_reply" + }, + "show_one_map_register_state": { + "reply": "show_one_map_register_state_reply" + }, + "one_map_request_mode": { + "reply": "one_map_request_mode_reply" + }, + "show_one_map_request_mode": { + "reply": "show_one_map_request_mode_reply" + }, + "one_add_del_remote_mapping": { + "reply": "one_add_del_remote_mapping_reply" + }, + "one_add_del_l2_arp_entry": { + "reply": "one_add_del_l2_arp_entry_reply" + }, + "one_l2_arp_entries_get": { + "reply": "one_l2_arp_entries_get_reply" + }, + "one_add_del_ndp_entry": { + "reply": "one_add_del_ndp_entry_reply" + }, + "one_ndp_entries_get": { + "reply": "one_ndp_entries_get_reply" + }, + "one_set_transport_protocol": { + "reply": "one_set_transport_protocol_reply" + }, + "one_get_transport_protocol": { + "reply": "one_get_transport_protocol_reply" + }, + "one_ndp_bd_get": { + "reply": "one_ndp_bd_get_reply" + }, + "one_l2_arp_bd_get": { + "reply": "one_l2_arp_bd_get_reply" + }, + "one_add_del_adjacency": { + "reply": "one_add_del_adjacency_reply" + }, + "one_add_del_map_request_itr_rlocs": { + "reply": "one_add_del_map_request_itr_rlocs_reply" + }, + "one_eid_table_add_del_map": { + "reply": "one_eid_table_add_del_map_reply" + }, + "one_locator_dump": { + "reply": "one_locator_details", + "stream": true + }, + "one_locator_set_dump": { + "reply": "one_locator_set_details", + "stream": true + }, + "one_eid_table_dump": { + "reply": "one_eid_table_details", + "stream": true + }, + "one_adjacencies_get": { + "reply": "one_adjacencies_get_reply" + }, + "one_eid_table_map_dump": { + "reply": "one_eid_table_map_details", + "stream": true + }, + "one_eid_table_vni_dump": { + "reply": "one_eid_table_vni_details", + "stream": true + }, + "one_map_resolver_dump": { + "reply": "one_map_resolver_details", + "stream": true + }, + "one_map_server_dump": { + "reply": "one_map_server_details", + "stream": true + }, + "show_one_status": { + "reply": "show_one_status_reply" + }, + "one_get_map_request_itr_rlocs": { + "reply": "one_get_map_request_itr_rlocs_reply" + }, + "show_one_nsh_mapping": { + "reply": "show_one_nsh_mapping_reply" + }, + "show_one_pitr": { + "reply": "show_one_pitr_reply" + }, + "one_stats_dump": { + "reply": "one_stats_details", + "stream": true + }, + "one_stats_flush": { + "reply": "one_stats_flush_reply" + }, + "one_stats_enable_disable": { + "reply": "one_stats_enable_disable_reply" + }, + "show_one_stats_enable_disable": { + "reply": "show_one_stats_enable_disable_reply" + }, + "one_map_register_fallback_threshold": { + "reply": "one_map_register_fallback_threshold_reply" + }, + "show_one_map_register_fallback_threshold": { + "reply": "show_one_map_register_fallback_threshold_reply" + }, + "one_enable_disable_xtr_mode": { + "reply": "one_enable_disable_xtr_mode_reply" + }, + "one_show_xtr_mode": { + "reply": "one_show_xtr_mode_reply" + }, + "one_enable_disable_petr_mode": { + "reply": "one_enable_disable_petr_mode_reply" + }, + "one_show_petr_mode": { + "reply": "one_show_petr_mode_reply" + }, + "one_enable_disable_pitr_mode": { + "reply": "one_enable_disable_pitr_mode_reply" + }, + "one_show_pitr_mode": { + "reply": "one_show_pitr_mode_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0xde9891c3" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/p2p_ethernet.api.json b/internal/testbinapi/binapi2001/.vppapi/core/p2p_ethernet.api.json new file mode 100644 index 0000000..0ab4f51 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/p2p_ethernet.api.json @@ -0,0 +1,277 @@ +{ + "types": [], + "messages": [ + [ + "p2p_ethernet_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "parent_if_index" + ], + [ + "u32", + "subif_id" + ], + [ + "vl_api_mac_address_t", + "remote_mac" + ], + { + "crc": "0xeeb8e717" + } + ], + [ + "p2p_ethernet_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "p2p_ethernet_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "parent_if_index" + ], + [ + "vl_api_mac_address_t", + "remote_mac" + ], + { + "crc": "0x0b62c386" + } + ], + [ + "p2p_ethernet_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "p2p_ethernet_add": { + "reply": "p2p_ethernet_add_reply" + }, + "p2p_ethernet_del": { + "reply": "p2p_ethernet_del_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0x282f1ed1" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/pci_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/pci_types.api.json new file mode 100644 index 0000000..079c508 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/pci_types.api.json @@ -0,0 +1,32 @@ +{ + "types": [ + [ + "pci_address", + [ + "u16", + "domain" + ], + [ + "u8", + "bus" + ], + [ + "u8", + "slot" + ], + [ + "u8", + "function" + ] + ] + ], + "messages": [], + "unions": [], + "enums": [], + "services": {}, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x5d418665" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/pg.api.json b/internal/testbinapi/binapi2001/.vppapi/core/pg.api.json new file mode 100644 index 0000000..6b41f7d --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/pg.api.json @@ -0,0 +1,183 @@ +{ + "types": [], + "messages": [ + [ + "pg_create_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "interface_id" + ], + [ + "u8", + "gso_enabled" + ], + [ + "u32", + "gso_size" + ], + { + "crc": "0xb1ecff05" + } + ], + [ + "pg_create_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0xfda5941f" + } + ], + [ + "pg_capture", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "interface_id" + ], + [ + "u8", + "is_enabled" + ], + [ + "u32", + "count" + ], + [ + "u32", + "pcap_name_length" + ], + [ + "u8", + "pcap_file_name", + 0, + "pcap_name_length" + ], + { + "crc": "0x453da78d" + } + ], + [ + "pg_capture_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "pg_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_enabled" + ], + [ + "u32", + "stream_name_length" + ], + [ + "u8", + "stream_name", + 0, + "stream_name_length" + ], + { + "crc": "0x0cb71d10" + } + ], + [ + "pg_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "pg_create_interface": { + "reply": "pg_create_interface_reply" + }, + "pg_capture": { + "reply": "pg_capture_reply" + }, + "pg_enable_disable": { + "reply": "pg_enable_disable_reply" + } + }, + "options": { + "version": "1.1.0" + }, + "aliases": {}, + "vl_api_version": "0x2583e07b" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/pipe.api.json b/internal/testbinapi/binapi2001/.vppapi/core/pipe.api.json new file mode 100644 index 0000000..973f56d --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/pipe.api.json @@ -0,0 +1,319 @@ +{ + "types": [], + "messages": [ + [ + "pipe_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_specified" + ], + [ + "u32", + "user_instance" + ], + { + "crc": "0xbb263bd3" + } + ], + [ + "pipe_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_interface_index_t", + "pipe_sw_if_index", + 2 + ], + { + "crc": "0xd4c2c2b3" + } + ], + [ + "pipe_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "pipe_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "pipe_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "pipe_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_interface_index_t", + "pipe_sw_if_index", + 2 + ], + [ + "u32", + "instance" + ], + { + "crc": "0x43ac107a" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "pipe_create": { + "reply": "pipe_create_reply" + }, + "pipe_delete": { + "reply": "pipe_delete_reply" + }, + "pipe_dump": { + "reply": "pipe_details", + "stream": true + } + }, + "options": { + "version": "1.0.1" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x1d68f11" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/policer.api.json b/internal/testbinapi/binapi2001/.vppapi/core/policer.api.json new file mode 100644 index 0000000..1a3f2ba --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/policer.api.json @@ -0,0 +1,264 @@ +{ + "types": [], + "messages": [ + [ + "policer_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "name", + 64 + ], + [ + "u32", + "cir" + ], + [ + "u32", + "eir" + ], + [ + "u64", + "cb" + ], + [ + "u64", + "eb" + ], + [ + "u8", + "rate_type" + ], + [ + "u8", + "round_type" + ], + [ + "u8", + "type" + ], + [ + "u8", + "color_aware" + ], + [ + "u8", + "conform_action_type" + ], + [ + "u8", + "conform_dscp" + ], + [ + "u8", + "exceed_action_type" + ], + [ + "u8", + "exceed_dscp" + ], + [ + "u8", + "violate_action_type" + ], + [ + "u8", + "violate_dscp" + ], + { + "crc": "0xdfea2be8" + } + ], + [ + "policer_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "policer_index" + ], + { + "crc": "0xa177cef2" + } + ], + [ + "policer_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "match_name_valid" + ], + [ + "u8", + "match_name", + 64 + ], + { + "crc": "0x8be04d34" + } + ], + [ + "policer_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "name", + 64 + ], + [ + "u32", + "cir" + ], + [ + "u32", + "eir" + ], + [ + "u64", + "cb" + ], + [ + "u64", + "eb" + ], + [ + "u8", + "rate_type" + ], + [ + "u8", + "round_type" + ], + [ + "u8", + "type" + ], + [ + "u8", + "conform_action_type" + ], + [ + "u8", + "conform_dscp" + ], + [ + "u8", + "exceed_action_type" + ], + [ + "u8", + "exceed_dscp" + ], + [ + "u8", + "violate_action_type" + ], + [ + "u8", + "violate_dscp" + ], + [ + "u8", + "single_rate" + ], + [ + "u8", + "color_aware" + ], + [ + "u32", + "scale" + ], + [ + "u32", + "cir_tokens_per_period" + ], + [ + "u32", + "pir_tokens_per_period" + ], + [ + "u32", + "current_limit" + ], + [ + "u32", + "current_bucket" + ], + [ + "u32", + "extended_limit" + ], + [ + "u32", + "extended_bucket" + ], + [ + "u64", + "last_update_time" + ], + { + "crc": "0xff2765f0" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "policer_add_del": { + "reply": "policer_add_del_reply" + }, + "policer_dump": { + "reply": "policer_details", + "stream": true + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x4218ed4f" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/punt.api.json b/internal/testbinapi/binapi2001/.vppapi/core/punt.api.json new file mode 100644 index 0000000..2ca291d --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/punt.api.json @@ -0,0 +1,629 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "punt_l4", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_ip_proto_t", + "protocol" + ], + [ + "u16", + "port" + ] + ], + [ + "punt_ip_proto", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_ip_proto_t", + "protocol" + ] + ], + [ + "punt_exception", + [ + "u32", + "id" + ] + ], + [ + "punt", + [ + "vl_api_punt_type_t", + "type" + ], + [ + "vl_api_punt_union_t", + "punt" + ] + ], + [ + "punt_reason", + [ + "u32", + "id" + ], + [ + "string", + "name", + 0 + ] + ] + ], + "messages": [ + [ + "set_punt", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_punt_t", + "punt" + ], + { + "crc": "0x83799618" + } + ], + [ + "set_punt_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "punt_socket_register", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "header_version" + ], + [ + "vl_api_punt_t", + "punt" + ], + [ + "string", + "pathname", + 108 + ], + { + "crc": "0xc8cd10fa" + } + ], + [ + "punt_socket_register_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "string", + "pathname", + 108 + ], + { + "crc": "0xbd30ae90" + } + ], + [ + "punt_socket_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_punt_type_t", + "type" + ], + { + "crc": "0x52974935" + } + ], + [ + "punt_socket_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_punt_t", + "punt" + ], + [ + "string", + "pathname", + 108 + ], + { + "crc": "0x1de0ce75" + } + ], + [ + "punt_socket_deregister", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_punt_t", + "punt" + ], + { + "crc": "0x98a444f4" + } + ], + [ + "punt_socket_deregister_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "punt_reason_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_punt_reason_t", + "reason" + ], + { + "crc": "0x5c0dd4fe" + } + ], + [ + "punt_reason_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_punt_reason_t", + "reason" + ], + { + "crc": "0x2c9d4a40" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ], + [ + "punt_union", + [ + "vl_api_punt_exception_t", + "exception" + ], + [ + "vl_api_punt_l4_t", + "l4" + ], + [ + "vl_api_punt_ip_proto_t", + "ip_proto" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "punt_type", + [ + "PUNT_API_TYPE_L4", + 1 + ], + [ + "PUNT_API_TYPE_IP_PROTO", + 2 + ], + [ + "PUNT_API_TYPE_EXCEPTION", + 3 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "set_punt": { + "reply": "set_punt_reply" + }, + "punt_socket_register": { + "reply": "punt_socket_register_reply" + }, + "punt_socket_dump": { + "reply": "punt_socket_details", + "stream": true + }, + "punt_socket_deregister": { + "reply": "punt_socket_deregister_reply" + }, + "punt_reason_dump": { + "reply": "punt_reason_details", + "stream": true + } + }, + "options": { + "version": "2.2.1" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x51716f7f" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/qos.api.json b/internal/testbinapi/binapi2001/.vppapi/core/qos.api.json new file mode 100644 index 0000000..81a5f07 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/qos.api.json @@ -0,0 +1,956 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "qos_store", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_qos_source_t", + "input_source" + ], + [ + "u8", + "value" + ] + ], + [ + "qos_record", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_qos_source_t", + "input_source" + ] + ], + [ + "qos_egress_map_row", + [ + "u8", + "outputs", + 256 + ] + ], + [ + "qos_egress_map", + [ + "u32", + "id" + ], + [ + "vl_api_qos_egress_map_row_t", + "rows", + 4 + ] + ], + [ + "qos_mark", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "map_id" + ], + [ + "vl_api_qos_source_t", + "output_source" + ] + ] + ], + "messages": [ + [ + "qos_store_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable", + { + "default": "true" + } + ], + [ + "vl_api_qos_store_t", + "store" + ], + { + "crc": "0x3507235e" + } + ], + [ + "qos_store_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "qos_store_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "qos_store_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_qos_store_t", + "store" + ], + { + "crc": "0x038a6d48" + } + ], + [ + "qos_record_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable", + { + "default": "true" + } + ], + [ + "vl_api_qos_record_t", + "record" + ], + { + "crc": "0x25b33f88" + } + ], + [ + "qos_record_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "qos_record_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "qos_record_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_qos_record_t", + "record" + ], + { + "crc": "0x4956ccdd" + } + ], + [ + "qos_egress_map_update", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_qos_egress_map_t", + "map" + ], + { + "crc": "0x6d1c065f" + } + ], + [ + "qos_egress_map_update_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "qos_egress_map_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "id" + ], + { + "crc": "0x3a91bde5" + } + ], + [ + "qos_egress_map_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "qos_egress_map_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "qos_egress_map_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_qos_egress_map_t", + "map" + ], + { + "crc": "0x46c5653c" + } + ], + [ + "qos_mark_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable", + { + "default": "true" + } + ], + [ + "vl_api_qos_mark_t", + "mark" + ], + { + "crc": "0x1a010f74" + } + ], + [ + "qos_mark_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "qos_mark_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "qos_mark_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_qos_mark_t", + "mark" + ], + { + "crc": "0x89fe81a9" + } + ], + [ + "qos_mark_details_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "qos_source", + [ + "QOS_API_SOURCE_EXT", + 0 + ], + [ + "QOS_API_SOURCE_VLAN", + 1 + ], + [ + "QOS_API_SOURCE_MPLS", + 2 + ], + [ + "QOS_API_SOURCE_IP", + 3 + ], + { + "enumtype": "u8" + } + ] + ], + "services": { + "qos_store_enable_disable": { + "reply": "qos_store_enable_disable_reply" + }, + "qos_store_dump": { + "reply": "qos_store_details", + "stream": true + }, + "qos_record_enable_disable": { + "reply": "qos_record_enable_disable_reply" + }, + "qos_record_dump": { + "reply": "qos_record_details", + "stream": true + }, + "qos_egress_map_update": { + "reply": "qos_egress_map_update_reply" + }, + "qos_egress_map_delete": { + "reply": "qos_egress_map_delete_reply" + }, + "qos_egress_map_dump": { + "reply": "qos_egress_map_details", + "stream": true + }, + "qos_mark_enable_disable": { + "reply": "qos_mark_enable_disable_reply" + }, + "qos_mark_dump": { + "reply": "qos_mark_details", + "stream": true + } + }, + "options": { + "version": "1.1.1" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x86291f7f" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/rd_cp.api.json b/internal/testbinapi/binapi2001/.vppapi/core/rd_cp.api.json new file mode 100644 index 0000000..87bb44d --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/rd_cp.api.json @@ -0,0 +1,222 @@ +{ + "types": [], + "messages": [ + [ + "ip6_nd_address_autoconfig", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable" + ], + [ + "bool", + "install_default_routes" + ], + { + "crc": "0x9e14a4a7" + } + ], + [ + "ip6_nd_address_autoconfig_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "ip6_nd_address_autoconfig": { + "reply": "ip6_nd_address_autoconfig_reply" + } + }, + "options": { + "version": "1.0.1" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x5269dfb9" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/session.api.json b/internal/testbinapi/binapi2001/.vppapi/core/session.api.json new file mode 100644 index 0000000..11a2ebf --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/session.api.json @@ -0,0 +1,1372 @@ +{ + "types": [], + "messages": [ + [ + "application_attach", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "initial_segment_size" + ], + [ + "u64", + "options", + 16 + ], + [ + "u8", + "namespace_id_len" + ], + [ + "u8", + "namespace_id", + 64 + ], + { + "crc": "0x81d4f974" + } + ], + [ + "application_attach_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u64", + "app_event_queue_address" + ], + [ + "u8", + "n_fds" + ], + [ + "u8", + "fd_flags" + ], + [ + "u32", + "segment_size" + ], + [ + "u8", + "segment_name_length" + ], + [ + "u8", + "segment_name", + 128 + ], + [ + "u32", + "app_index" + ], + [ + "u64", + "segment_handle" + ], + { + "crc": "0x581866e8" + } + ], + [ + "app_attach", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "options", + 16 + ], + [ + "u8", + "namespace_id_len" + ], + [ + "u8", + "namespace_id", + 64 + ], + { + "crc": "0xed08f4bd" + } + ], + [ + "app_attach_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u64", + "app_mq" + ], + [ + "u64", + "vpp_ctrl_mq" + ], + [ + "u8", + "vpp_ctrl_mq_thread" + ], + [ + "u32", + "app_index" + ], + [ + "u8", + "n_fds" + ], + [ + "u8", + "fd_flags" + ], + [ + "u32", + "segment_size" + ], + [ + "u8", + "segment_name_length" + ], + [ + "u8", + "segment_name", + 128 + ], + [ + "u64", + "segment_handle" + ], + { + "crc": "0x0112f647" + } + ], + [ + "app_add_cert_key_pair", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "cert_len" + ], + [ + "u16", + "certkey_len" + ], + [ + "u8", + "certkey", + 0, + "certkey_len" + ], + { + "crc": "0x02eb8016" + } + ], + [ + "app_add_cert_key_pair_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "index" + ], + { + "crc": "0xb42958d0" + } + ], + [ + "app_del_cert_key_pair", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "index" + ], + { + "crc": "0x8ac76db6" + } + ], + [ + "app_del_cert_key_pair_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "application_tls_cert_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "app_index" + ], + [ + "u16", + "cert_len" + ], + [ + "u8", + "cert", + 0, + "cert_len" + ], + { + "crc": "0x3f5cfe45" + } + ], + [ + "application_tls_cert_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "application_tls_key_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "app_index" + ], + [ + "u16", + "key_len" + ], + [ + "u8", + "key", + 0, + "key_len" + ], + { + "crc": "0x5eaf70cd" + } + ], + [ + "application_tls_key_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "application_detach", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "application_detach_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_another_segment", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "fd_flags" + ], + [ + "u32", + "segment_size" + ], + [ + "u8", + "segment_name", + 128 + ], + [ + "u64", + "segment_handle" + ], + { + "crc": "0xdc2d630b" + } + ], + [ + "map_another_segment_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "unmap_segment", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "segment_handle" + ], + { + "crc": "0xf77096f6" + } + ], + [ + "unmap_segment_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "bind_uri", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "accept_cookie" + ], + [ + "u8", + "uri", + 128 + ], + { + "crc": "0xfae140cb" + } + ], + [ + "bind_uri_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "unbind_uri", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "uri", + 128 + ], + { + "crc": "0x294cf07d" + } + ], + [ + "unbind_uri_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "connect_uri", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "client_queue_address" + ], + [ + "u64", + "options", + 16 + ], + [ + "u8", + "uri", + 128 + ], + { + "crc": "0xa36143d6" + } + ], + [ + "connect_uri_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "disconnect_session", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "handle" + ], + { + "crc": "0x7279205b" + } + ], + [ + "disconnect_session_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u64", + "handle" + ], + { + "crc": "0xd6960a03" + } + ], + [ + "bind_sock", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "wrk_index" + ], + [ + "u32", + "vrf" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "ip", + 16 + ], + [ + "u16", + "port" + ], + [ + "u8", + "proto" + ], + [ + "u64", + "options", + 16 + ], + { + "crc": "0x0394633f" + } + ], + [ + "bind_sock_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "unbind_sock", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "wrk_index" + ], + [ + "u64", + "handle" + ], + { + "crc": "0x08880908" + } + ], + [ + "unbind_sock_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "connect_sock", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "wrk_index" + ], + [ + "u64", + "client_queue_address" + ], + [ + "u64", + "options", + 16 + ], + [ + "u32", + "vrf" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "ip", + 16 + ], + [ + "u16", + "port" + ], + [ + "u8", + "proto" + ], + [ + "u64", + "parent_handle" + ], + [ + "u8", + "hostname_len" + ], + [ + "u8", + "hostname", + 0, + "hostname_len" + ], + { + "crc": "0xd2b460ca" + } + ], + [ + "connect_sock_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "app_cut_through_registration_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "evt_q_address" + ], + [ + "u64", + "peer_evt_q_address" + ], + [ + "u32", + "wrk_index" + ], + [ + "u8", + "n_fds" + ], + [ + "u8", + "fd_flags" + ], + { + "crc": "0x6d73b1b9" + } + ], + [ + "app_cut_through_registration_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "app_worker_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "app_index" + ], + [ + "u32", + "wrk_index" + ], + [ + "u8", + "is_add" + ], + { + "crc": "0x6d2b2279" + } + ], + [ + "app_worker_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "wrk_index" + ], + [ + "u64", + "app_event_queue_address" + ], + [ + "u8", + "n_fds" + ], + [ + "u8", + "fd_flags" + ], + [ + "u8", + "segment_name_length" + ], + [ + "u8", + "segment_name", + 128 + ], + [ + "u64", + "segment_handle" + ], + [ + "u8", + "is_add" + ], + { + "crc": "0x56b21abc" + } + ], + [ + "session_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_enable" + ], + { + "crc": "0x30ac9be7" + } + ], + [ + "session_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "app_namespace_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "secret" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "ip4_fib_id" + ], + [ + "u32", + "ip6_fib_id" + ], + [ + "u8", + "namespace_id_len" + ], + [ + "u8", + "namespace_id", + 64 + ], + { + "crc": "0xdd074c65" + } + ], + [ + "app_namespace_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "appns_index" + ], + { + "crc": "0x85137120" + } + ], + [ + "session_rule_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "transport_proto" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "lcl_ip", + 16 + ], + [ + "u8", + "lcl_plen" + ], + [ + "u8", + "rmt_ip", + 16 + ], + [ + "u8", + "rmt_plen" + ], + [ + "u16", + "lcl_port" + ], + [ + "u16", + "rmt_port" + ], + [ + "u32", + "action_index" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "appns_index" + ], + [ + "u8", + "scope" + ], + [ + "u8", + "tag", + 64 + ], + { + "crc": "0x4ab2eb06" + } + ], + [ + "session_rule_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "session_rules_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "session_rules_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "transport_proto" + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "lcl_ip", + 16 + ], + [ + "u8", + "lcl_plen" + ], + [ + "u8", + "rmt_ip", + 16 + ], + [ + "u8", + "rmt_plen" + ], + [ + "u16", + "lcl_port" + ], + [ + "u16", + "rmt_port" + ], + [ + "u32", + "action_index" + ], + [ + "u32", + "appns_index" + ], + [ + "u8", + "scope" + ], + [ + "u8", + "tag", + 64 + ], + { + "crc": "0xa52b0e96" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "application_attach": { + "reply": "application_attach_reply" + }, + "app_attach": { + "reply": "app_attach_reply" + }, + "app_add_cert_key_pair": { + "reply": "app_add_cert_key_pair_reply" + }, + "app_del_cert_key_pair": { + "reply": "app_del_cert_key_pair_reply" + }, + "application_tls_cert_add": { + "reply": "application_tls_cert_add_reply" + }, + "application_tls_key_add": { + "reply": "application_tls_key_add_reply" + }, + "application_detach": { + "reply": "application_detach_reply" + }, + "map_another_segment": { + "reply": "map_another_segment_reply" + }, + "unmap_segment": { + "reply": "unmap_segment_reply" + }, + "bind_uri": { + "reply": "bind_uri_reply" + }, + "unbind_uri": { + "reply": "unbind_uri_reply" + }, + "connect_uri": { + "reply": "connect_uri_reply" + }, + "disconnect_session": { + "reply": "disconnect_session_reply" + }, + "bind_sock": { + "reply": "bind_sock_reply" + }, + "unbind_sock": { + "reply": "unbind_sock_reply" + }, + "connect_sock": { + "reply": "connect_sock_reply" + }, + "app_cut_through_registration_add": { + "reply": "app_cut_through_registration_add_reply" + }, + "app_worker_add_del": { + "reply": "app_worker_add_del_reply" + }, + "session_enable_disable": { + "reply": "session_enable_disable_reply" + }, + "app_namespace_add_del": { + "reply": "app_namespace_add_del_reply" + }, + "session_rule_add_del": { + "reply": "session_rule_add_del_reply" + }, + "session_rules_dump": { + "reply": "session_rules_details", + "stream": true + } + }, + "options": { + "version": "1.7.0" + }, + "aliases": {}, + "vl_api_version": "0xdf888b15" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/span.api.json b/internal/testbinapi/binapi2001/.vppapi/core/span.api.json new file mode 100644 index 0000000..0063d9b --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/span.api.json @@ -0,0 +1,125 @@ +{ + "types": [], + "messages": [ + [ + "sw_interface_span_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index_from" + ], + [ + "u32", + "sw_if_index_to" + ], + [ + "u8", + "state" + ], + [ + "u8", + "is_l2" + ], + { + "crc": "0x7216258d" + } + ], + [ + "sw_interface_span_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_span_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_l2" + ], + { + "crc": "0x67c54650" + } + ], + [ + "sw_interface_span_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index_from" + ], + [ + "u32", + "sw_if_index_to" + ], + [ + "u8", + "state" + ], + [ + "u8", + "is_l2" + ], + { + "crc": "0x23966371" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "sw_interface_span_enable_disable": { + "reply": "sw_interface_span_enable_disable_reply" + }, + "sw_interface_span_dump": { + "reply": "sw_interface_span_details", + "stream": true + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x10769b5" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/sr.api.json b/internal/testbinapi/binapi2001/.vppapi/core/sr.api.json new file mode 100644 index 0000000..8f51656 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/sr.api.json @@ -0,0 +1,656 @@ +{ + "types": [ + [ + "srv6_sid", + [ + "u8", + "addr", + 16 + ] + ], + [ + "srv6_sid_list", + [ + "u8", + "num_sids" + ], + [ + "u32", + "weight" + ], + [ + "vl_api_srv6_sid_t", + "sids", + 16 + ] + ], + [ + "sr_ip6_address", + [ + "u8", + "data", + 16 + ] + ] + ], + "messages": [ + [ + "sr_localsid_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_del" + ], + [ + "vl_api_srv6_sid_t", + "localsid" + ], + [ + "u8", + "end_psp" + ], + [ + "u8", + "behavior" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "vlan_index" + ], + [ + "u32", + "fib_table" + ], + [ + "u8", + "nh_addr6", + 16 + ], + [ + "u8", + "nh_addr4", + 4 + ], + { + "crc": "0xb30489eb" + } + ], + [ + "sr_localsid_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_policy_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "bsid_addr", + 16 + ], + [ + "u32", + "weight" + ], + [ + "u8", + "is_encap" + ], + [ + "u8", + "type" + ], + [ + "u32", + "fib_table" + ], + [ + "vl_api_srv6_sid_list_t", + "sids" + ], + { + "crc": "0x4b6e2484" + } + ], + [ + "sr_policy_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_policy_mod", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "bsid_addr", + 16 + ], + [ + "u32", + "sr_policy_index" + ], + [ + "u32", + "fib_table" + ], + [ + "u8", + "operation" + ], + [ + "u32", + "sl_index" + ], + [ + "u32", + "weight" + ], + [ + "vl_api_srv6_sid_list_t", + "sids" + ], + { + "crc": "0xc1dfaee0" + } + ], + [ + "sr_policy_mod_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_policy_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_srv6_sid_t", + "bsid_addr" + ], + [ + "u32", + "sr_policy_index" + ], + { + "crc": "0xe4133171" + } + ], + [ + "sr_policy_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_set_encap_source", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "encaps_source", + 16 + ], + { + "crc": "0xd05bb4de" + } + ], + [ + "sr_set_encap_source_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_set_encap_hop_limit", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "hop_limit" + ], + { + "crc": "0xaa75d7d0" + } + ], + [ + "sr_set_encap_hop_limit_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_steering_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_del" + ], + [ + "u8", + "bsid_addr", + 16 + ], + [ + "u32", + "sr_policy_index" + ], + [ + "u32", + "table_id" + ], + [ + "u8", + "prefix_addr", + 16 + ], + [ + "u32", + "mask_width" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "traffic_type" + ], + { + "crc": "0x28b5dcab" + } + ], + [ + "sr_steering_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_localsids_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "sr_localsids_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_srv6_sid_t", + "addr" + ], + [ + "u8", + "end_psp" + ], + [ + "u16", + "behavior" + ], + [ + "u32", + "fib_table" + ], + [ + "u32", + "vlan_index" + ], + [ + "u8", + "xconnect_nh_addr6", + 16 + ], + [ + "u8", + "xconnect_nh_addr4", + 4 + ], + [ + "u32", + "xconnect_iface_or_vrf_table" + ], + { + "crc": "0x0791babc" + } + ], + [ + "sr_policies_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "sr_policies_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_srv6_sid_t", + "bsid" + ], + [ + "u8", + "type" + ], + [ + "u8", + "is_encap" + ], + [ + "u32", + "fib_table" + ], + [ + "u8", + "num_sid_lists" + ], + [ + "vl_api_srv6_sid_list_t", + "sid_lists", + 0, + "num_sid_lists" + ], + { + "crc": "0x5087f460" + } + ], + [ + "sr_steering_pol_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "sr_steering_pol_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u8", + "traffic_type" + ], + [ + "u32", + "fib_table" + ], + [ + "u8", + "prefix_addr", + 16 + ], + [ + "u32", + "mask_width" + ], + [ + "u32", + "sw_if_index" + ], + [ + "vl_api_srv6_sid_t", + "bsid" + ], + { + "crc": "0x5627d483" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "sr_localsid_add_del": { + "reply": "sr_localsid_add_del_reply" + }, + "sr_policy_add": { + "reply": "sr_policy_add_reply" + }, + "sr_policy_mod": { + "reply": "sr_policy_mod_reply" + }, + "sr_policy_del": { + "reply": "sr_policy_del_reply" + }, + "sr_set_encap_source": { + "reply": "sr_set_encap_source_reply" + }, + "sr_set_encap_hop_limit": { + "reply": "sr_set_encap_hop_limit_reply" + }, + "sr_steering_add_del": { + "reply": "sr_steering_add_del_reply" + }, + "sr_localsids_dump": { + "reply": "sr_localsids_details", + "stream": true + }, + "sr_policies_dump": { + "reply": "sr_policies_details", + "stream": true + }, + "sr_steering_pol_dump": { + "reply": "sr_steering_pol_details", + "stream": true + } + }, + "options": { + "version": "1.2.0" + }, + "aliases": {}, + "vl_api_version": "0xbf277f96" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/sr_mpls.api.json b/internal/testbinapi/binapi2001/.vppapi/core/sr_mpls.api.json new file mode 100644 index 0000000..6fc2497 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/sr_mpls.api.json @@ -0,0 +1,324 @@ +{ + "types": [], + "messages": [ + [ + "sr_mpls_policy_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bsid" + ], + [ + "u32", + "weight" + ], + [ + "u8", + "type" + ], + [ + "u8", + "n_segments" + ], + [ + "u32", + "segments", + 0, + "n_segments" + ], + { + "crc": "0x6f5b21cc" + } + ], + [ + "sr_mpls_policy_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_mpls_policy_mod", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bsid" + ], + [ + "u8", + "operation" + ], + [ + "u32", + "sl_index" + ], + [ + "u32", + "weight" + ], + [ + "u8", + "n_segments" + ], + [ + "u32", + "segments", + 0, + "n_segments" + ], + { + "crc": "0x09d338ac" + } + ], + [ + "sr_mpls_policy_mod_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_mpls_policy_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bsid" + ], + { + "crc": "0xe29d34fa" + } + ], + [ + "sr_mpls_policy_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_mpls_steering_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_del" + ], + [ + "u32", + "bsid" + ], + [ + "u32", + "table_id" + ], + [ + "u8", + "prefix_addr", + 16 + ], + [ + "u32", + "mask_width" + ], + [ + "u8", + "traffic_type" + ], + [ + "u8", + "next_hop", + 16 + ], + [ + "u8", + "nh_type" + ], + [ + "u32", + "color" + ], + [ + "u8", + "co_bits" + ], + [ + "u32", + "vpn_label" + ], + { + "crc": "0x1591f94a" + } + ], + [ + "sr_mpls_steering_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sr_mpls_policy_assign_endpoint_color", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bsid" + ], + [ + "u8", + "endpoint", + 16 + ], + [ + "u8", + "endpoint_type" + ], + [ + "u32", + "color" + ], + { + "crc": "0x6c82a6da" + } + ], + [ + "sr_mpls_policy_assign_endpoint_color_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "sr_mpls_policy_add": { + "reply": "sr_mpls_policy_add_reply" + }, + "sr_mpls_policy_mod": { + "reply": "sr_mpls_policy_mod_reply" + }, + "sr_mpls_policy_del": { + "reply": "sr_mpls_policy_del_reply" + }, + "sr_mpls_steering_add_del": { + "reply": "sr_mpls_steering_add_del_reply" + }, + "sr_mpls_policy_assign_endpoint_color": { + "reply": "sr_mpls_policy_assign_endpoint_color_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x933a0861" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/syslog.api.json b/internal/testbinapi/binapi2001/.vppapi/core/syslog.api.json new file mode 100644 index 0000000..93923b5 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/syslog.api.json @@ -0,0 +1,542 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "syslog_set_sender", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "src_address" + ], + [ + "vl_api_ip4_address_t", + "collector_address" + ], + [ + "u16", + "collector_port" + ], + [ + "u32", + "vrf_id" + ], + [ + "u32", + "max_msg_size" + ], + { + "crc": "0xbb641285" + } + ], + [ + "syslog_set_sender_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "syslog_get_sender", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "syslog_get_sender_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_ip4_address_t", + "src_address" + ], + [ + "vl_api_ip4_address_t", + "collector_address" + ], + [ + "u16", + "collector_port" + ], + [ + "u32", + "vrf_id" + ], + [ + "u32", + "max_msg_size" + ], + { + "crc": "0xd3da60ac" + } + ], + [ + "syslog_set_filter", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_syslog_severity_t", + "severity" + ], + { + "crc": "0x571348c3" + } + ], + [ + "syslog_set_filter_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "syslog_get_filter", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "syslog_get_filter_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_syslog_severity_t", + "severity" + ], + { + "crc": "0xeb1833f8" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "syslog_severity", + [ + "SYSLOG_API_SEVERITY_EMERG", + 0 + ], + [ + "SYSLOG_API_SEVERITY_ALERT", + 1 + ], + [ + "SYSLOG_API_SEVERITY_CRIT", + 2 + ], + [ + "SYSLOG_API_SEVERITY_ERR", + 3 + ], + [ + "SYSLOG_API_SEVERITY_WARN", + 4 + ], + [ + "SYSLOG_API_SEVERITY_NOTICE", + 5 + ], + [ + "SYSLOG_API_SEVERITY_INFO", + 6 + ], + [ + "SYSLOG_API_SEVERITY_DBG", + 7 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "syslog_set_sender": { + "reply": "syslog_set_sender_reply" + }, + "syslog_get_sender": { + "reply": "syslog_get_sender_reply" + }, + "syslog_set_filter": { + "reply": "syslog_set_filter_reply" + }, + "syslog_get_filter": { + "reply": "syslog_get_filter_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xb0790f43" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/tapv2.api.json b/internal/testbinapi/binapi2001/.vppapi/core/tapv2.api.json new file mode 100644 index 0000000..c36b943 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/tapv2.api.json @@ -0,0 +1,775 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "tap_create_v2", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "id", + { + "default": 4294967295 + } + ], + [ + "bool", + "use_random_mac", + { + "default": "true" + } + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + [ + "u8", + "num_rx_queues", + { + "default": 1 + } + ], + [ + "u16", + "tx_ring_sz" + ], + [ + "u16", + "rx_ring_sz" + ], + [ + "bool", + "host_mtu_set" + ], + [ + "u32", + "host_mtu_size" + ], + [ + "bool", + "host_mac_addr_set" + ], + [ + "vl_api_mac_address_t", + "host_mac_addr" + ], + [ + "bool", + "host_ip4_prefix_set" + ], + [ + "vl_api_ip4_address_with_prefix_t", + "host_ip4_prefix" + ], + [ + "bool", + "host_ip6_prefix_set" + ], + [ + "vl_api_ip6_address_with_prefix_t", + "host_ip6_prefix" + ], + [ + "bool", + "host_ip4_gw_set" + ], + [ + "vl_api_ip4_address_t", + "host_ip4_gw" + ], + [ + "bool", + "host_ip6_gw_set" + ], + [ + "vl_api_ip6_address_t", + "host_ip6_gw" + ], + [ + "vl_api_tap_flags_t", + "tap_flags" + ], + [ + "bool", + "host_namespace_set" + ], + [ + "string", + "host_namespace", + 64 + ], + [ + "bool", + "host_if_name_set" + ], + [ + "string", + "host_if_name", + 64 + ], + [ + "bool", + "host_bridge_set" + ], + [ + "string", + "host_bridge", + 64 + ], + [ + "string", + "tag", + 0 + ], + { + "crc": "0x445835fd" + } + ], + [ + "tap_create_v2_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "tap_delete_v2", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "tap_delete_v2_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_tap_v2_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index", + { + "default": 4294967295 + } + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "sw_interface_tap_v2_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "id" + ], + [ + "u16", + "tx_ring_sz" + ], + [ + "u16", + "rx_ring_sz" + ], + [ + "u32", + "host_mtu_size" + ], + [ + "vl_api_mac_address_t", + "host_mac_addr" + ], + [ + "vl_api_ip4_address_with_prefix_t", + "host_ip4_prefix" + ], + [ + "vl_api_ip6_address_with_prefix_t", + "host_ip6_prefix" + ], + [ + "vl_api_tap_flags_t", + "tap_flags" + ], + [ + "string", + "dev_name", + 64 + ], + [ + "string", + "host_if_name", + 64 + ], + [ + "string", + "host_namespace", + 64 + ], + [ + "string", + "host_bridge", + 64 + ], + { + "crc": "0xe53c16de" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "tap_flags", + [ + "TAP_FLAG_GSO", + 1 + ], + [ + "TAP_FLAG_CSUM_OFFLOAD", + 2 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "tap_create_v2": { + "reply": "tap_create_v2_reply" + }, + "tap_delete_v2": { + "reply": "tap_delete_v2_reply" + }, + "sw_interface_tap_v2_dump": { + "reply": "sw_interface_tap_v2_details", + "stream": true + } + }, + "options": { + "version": "3.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x7d58f9a4" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/tcp.api.json b/internal/testbinapi/binapi2001/.vppapi/core/tcp.api.json new file mode 100644 index 0000000..97223c6 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/tcp.api.json @@ -0,0 +1,351 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "tcp_configure_src_addresses", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vrf_id" + ], + [ + "vl_api_address_t", + "first_address" + ], + [ + "vl_api_address_t", + "last_address" + ], + { + "crc": "0x4b02b946" + } + ], + [ + "tcp_configure_src_addresses_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "tcp_configure_src_addresses": { + "reply": "tcp_configure_src_addresses_reply" + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x4d731ac5" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/udp.api.json b/internal/testbinapi/binapi2001/.vppapi/core/udp.api.json new file mode 100644 index 0000000..9aa3f52 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/udp.api.json @@ -0,0 +1,457 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "udp_encap", + [ + "u32", + "table_id" + ], + [ + "u16", + "src_port" + ], + [ + "u16", + "dst_port" + ], + [ + "vl_api_address_t", + "src_ip" + ], + [ + "vl_api_address_t", + "dst_ip" + ], + [ + "u32", + "id" + ] + ] + ], + "messages": [ + [ + "udp_encap_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_udp_encap_t", + "udp_encap" + ], + { + "crc": "0x61d5fc48" + } + ], + [ + "udp_encap_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "id" + ], + { + "crc": "0xe2fc8294" + } + ], + [ + "udp_encap_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "id" + ], + { + "crc": "0x3a91bde5" + } + ], + [ + "udp_encap_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "udp_encap_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "udp_encap_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_udp_encap_t", + "udp_encap" + ], + { + "crc": "0x87c82821" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "udp_encap_add": { + "reply": "udp_encap_add_reply" + }, + "udp_encap_del": { + "reply": "udp_encap_del_reply" + }, + "udp_encap_dump": { + "reply": "udp_encap_details", + "stream": true + } + }, + "options": { + "version": "1.1.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xa6b4c475" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/vhost_user.api.json b/internal/testbinapi/binapi2001/.vppapi/core/vhost_user.api.json new file mode 100644 index 0000000..839ade2 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/vhost_user.api.json @@ -0,0 +1,528 @@ +{ + "types": [], + "messages": [ + [ + "create_vhost_user_if", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_server" + ], + [ + "string", + "sock_filename", + 256 + ], + [ + "bool", + "renumber" + ], + [ + "bool", + "disable_mrg_rxbuf" + ], + [ + "bool", + "disable_indirect_desc" + ], + [ + "bool", + "enable_gso" + ], + [ + "u32", + "custom_dev_instance" + ], + [ + "bool", + "use_custom_mac" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + [ + "string", + "tag", + 64 + ], + { + "crc": "0x591ee951" + } + ], + [ + "create_vhost_user_if_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "modify_vhost_user_if", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_server" + ], + [ + "string", + "sock_filename", + 256 + ], + [ + "bool", + "renumber" + ], + [ + "bool", + "enable_gso" + ], + [ + "u32", + "custom_dev_instance" + ], + { + "crc": "0xfcfeaf16" + } + ], + [ + "modify_vhost_user_if_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "delete_vhost_user_if", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "delete_vhost_user_if_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_vhost_user_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "interface_name", + 64 + ], + [ + "u32", + "virtio_net_hdr_sz" + ], + [ + "vl_api_virtio_net_features_first_32_t", + "features_first_32" + ], + [ + "vl_api_virtio_net_features_last_32_t", + "features_last_32" + ], + [ + "bool", + "is_server" + ], + [ + "string", + "sock_filename", + 256 + ], + [ + "u32", + "num_regions" + ], + [ + "i32", + "sock_errno" + ], + { + "crc": "0x98530df1" + } + ], + [ + "sw_interface_vhost_user_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index", + { + "default": 4294967295 + } + ], + { + "crc": "0xf9e6675e" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "virtio_net_features_first_32", + [ + "VIRTIO_NET_F_API_CSUM", + 1 + ], + [ + "VIRTIO_NET_F_API_GUEST_CSUM", + 2 + ], + [ + "VIRTIO_NET_F_API_GUEST_TSO4", + 128 + ], + [ + "VIRTIO_NET_F_API_GUEST_TSO6", + 256 + ], + [ + "VIRTIO_NET_F_API_GUEST_UFO", + 1024 + ], + [ + "VIRTIO_NET_F_API_HOST_TSO4", + 2048 + ], + [ + "VIRTIO_NET_F_API_HOST_TSO6", + 4096 + ], + [ + "VIRTIO_NET_F_API_HOST_UFO", + 16384 + ], + [ + "VIRTIO_NET_F_API_MRG_RXBUF", + 32768 + ], + [ + "VIRTIO_NET_F_API_CTRL_VQ", + 131072 + ], + [ + "VIRTIO_NET_F_API_GUEST_ANNOUNCE", + 2097152 + ], + [ + "VIRTIO_NET_F_API_MQ", + 4194304 + ], + [ + "VHOST_F_API_LOG_ALL", + 67108864 + ], + [ + "VIRTIO_F_API_ANY_LAYOUT", + 134217728 + ], + [ + "VIRTIO_F_API_INDIRECT_DESC", + 268435456 + ], + [ + "VHOST_USER_F_API_PROTOCOL_FEATURES", + 1073741824 + ], + { + "enumtype": "u32" + } + ], + [ + "virtio_net_features_last_32", + [ + "VIRTIO_F_API_VERSION_1", + 1 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "create_vhost_user_if": { + "reply": "create_vhost_user_if_reply" + }, + "modify_vhost_user_if": { + "reply": "modify_vhost_user_if_reply" + }, + "delete_vhost_user_if": { + "reply": "delete_vhost_user_if_reply" + }, + "sw_interface_vhost_user_dump": { + "reply": "sw_interface_vhost_user_details", + "stream": true + } + }, + "options": { + "version": "4.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0xb547a33d" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/virtio.api.json b/internal/testbinapi/binapi2001/.vppapi/core/virtio.api.json new file mode 100644 index 0000000..eb3a12c --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/virtio.api.json @@ -0,0 +1,365 @@ +{ + "types": [ + [ + "pci_address", + [ + "u16", + "domain" + ], + [ + "u8", + "bus" + ], + [ + "u8", + "slot" + ], + [ + "u8", + "function" + ] + ] + ], + "messages": [ + [ + "virtio_pci_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_pci_address_t", + "pci_addr" + ], + [ + "bool", + "use_random_mac" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + [ + "bool", + "gso_enabled" + ], + [ + "bool", + "checksum_offload_enabled" + ], + [ + "u64", + "features" + ], + { + "crc": "0xa9f1370c" + } + ], + [ + "virtio_pci_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "virtio_pci_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "virtio_pci_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_virtio_pci_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "sw_interface_virtio_pci_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_pci_address_t", + "pci_addr" + ], + [ + "vl_api_mac_address_t", + "mac_addr" + ], + [ + "u16", + "tx_ring_sz" + ], + [ + "u16", + "rx_ring_sz" + ], + [ + "u64", + "features" + ], + { + "crc": "0x16187f3a" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "virtio_pci_create": { + "reply": "virtio_pci_create_reply" + }, + "virtio_pci_delete": { + "reply": "virtio_pci_delete_reply" + }, + "sw_interface_virtio_pci_dump": { + "reply": "sw_interface_virtio_pci_details", + "stream": true + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0xb64fcf02" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/virtio_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/virtio_types.api.json new file mode 100644 index 0000000..a4cc4cf --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/virtio_types.api.json @@ -0,0 +1,93 @@ +{ + "types": [], + "messages": [], + "unions": [], + "enums": [ + [ + "virtio_net_features_first_32", + [ + "VIRTIO_NET_F_API_CSUM", + 1 + ], + [ + "VIRTIO_NET_F_API_GUEST_CSUM", + 2 + ], + [ + "VIRTIO_NET_F_API_GUEST_TSO4", + 128 + ], + [ + "VIRTIO_NET_F_API_GUEST_TSO6", + 256 + ], + [ + "VIRTIO_NET_F_API_GUEST_UFO", + 1024 + ], + [ + "VIRTIO_NET_F_API_HOST_TSO4", + 2048 + ], + [ + "VIRTIO_NET_F_API_HOST_TSO6", + 4096 + ], + [ + "VIRTIO_NET_F_API_HOST_UFO", + 16384 + ], + [ + "VIRTIO_NET_F_API_MRG_RXBUF", + 32768 + ], + [ + "VIRTIO_NET_F_API_CTRL_VQ", + 131072 + ], + [ + "VIRTIO_NET_F_API_GUEST_ANNOUNCE", + 2097152 + ], + [ + "VIRTIO_NET_F_API_MQ", + 4194304 + ], + [ + "VHOST_F_API_LOG_ALL", + 67108864 + ], + [ + "VIRTIO_F_API_ANY_LAYOUT", + 134217728 + ], + [ + "VIRTIO_F_API_INDIRECT_DESC", + 268435456 + ], + [ + "VHOST_USER_F_API_PROTOCOL_FEATURES", + 1073741824 + ], + { + "enumtype": "u32" + } + ], + [ + "virtio_net_features_last_32", + [ + "VIRTIO_F_API_VERSION_1", + 1 + ], + { + "enumtype": "u32" + } + ] + ], + "services": {}, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x7a70a44e" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/vpe.api.json b/internal/testbinapi/binapi2001/.vppapi/core/vpe.api.json new file mode 100644 index 0000000..ba487d2 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/vpe.api.json @@ -0,0 +1,772 @@ +{ + "types": [ + [ + "version", + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + [ + "u32", + "patch" + ], + [ + "u8", + "pre_release", + 17 + ], + [ + "u8", + "build_metadata", + 17 + ] + ], + [ + "thread_data", + [ + "u32", + "id" + ], + [ + "u8", + "name", + 64 + ], + [ + "u8", + "type", + 64 + ], + [ + "u32", + "pid" + ], + [ + "u32", + "cpu_id" + ], + [ + "u32", + "core" + ], + [ + "u32", + "cpu_socket" + ] + ] + ], + "messages": [ + [ + "control_ping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "control_ping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "vpe_pid" + ], + { + "crc": "0xf6b0b8ca" + } + ], + [ + "cli", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "cmd_in_shmem" + ], + { + "crc": "0x23bfbfff" + } + ], + [ + "cli_inband", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "cmd", + 0 + ], + { + "crc": "0xf8377302" + } + ], + [ + "cli_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u64", + "reply_in_shmem" + ], + { + "crc": "0x06d68297" + } + ], + [ + "cli_inband_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "string", + "reply", + 0 + ], + { + "crc": "0x05879051" + } + ], + [ + "get_node_index", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "node_name", + 64 + ], + { + "crc": "0x6c9a495d" + } + ], + [ + "get_node_index_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "node_index" + ], + { + "crc": "0xa8600b89" + } + ], + [ + "add_node_next", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "node_name", + 64 + ], + [ + "u8", + "next_name", + 64 + ], + { + "crc": "0x9ab92f7a" + } + ], + [ + "add_node_next_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "next_index" + ], + { + "crc": "0x2ed75f32" + } + ], + [ + "show_version", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_version_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "string", + "program", + 32 + ], + [ + "string", + "version", + 32 + ], + [ + "string", + "build_date", + 32 + ], + [ + "string", + "build_directory", + 256 + ], + { + "crc": "0xc919bde1" + } + ], + [ + "show_threads", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_threads_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "vl_api_thread_data_t", + "thread_data", + 0, + "count" + ], + { + "crc": "0xf5e0b66f" + } + ], + [ + "get_node_graph", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "get_node_graph_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u64", + "reply_in_shmem" + ], + { + "crc": "0x06d68297" + } + ], + [ + "get_next_index", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "node_name", + 64 + ], + [ + "u8", + "next_name", + 64 + ], + { + "crc": "0x9ab92f7a" + } + ], + [ + "get_next_index_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "next_index" + ], + { + "crc": "0x2ed75f32" + } + ], + [ + "log_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_timestamp_t", + "start_timestamp" + ], + { + "crc": "0x6ab31753" + } + ], + [ + "log_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_timestamp_t", + "timestamp" + ], + [ + "vl_api_log_level_t", + "level" + ], + [ + "string", + "msg_class", + 32 + ], + [ + "string", + "message", + 256 + ], + { + "crc": "0x255827a1" + } + ], + [ + "show_vpe_system_time", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_vpe_system_time_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_timestamp_t", + "vpe_system_time" + ], + { + "crc": "0x7ffd8193" + } + ], + [ + "get_f64_endian_value", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "f64", + "f64_one", + { + "default": 1.0 + } + ], + { + "crc": "0x809fcd44" + } + ], + [ + "get_f64_endian_value_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "retval" + ], + [ + "f64", + "f64_one_result" + ], + { + "crc": "0x7e02e404" + } + ], + [ + "get_f64_increment_by_one", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "f64", + "f64_value", + { + "default": 1.0 + } + ], + { + "crc": "0xb64f027e" + } + ], + [ + "get_f64_increment_by_one_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "retval" + ], + [ + "f64", + "f64_value" + ], + { + "crc": "0xd25dbaa3" + } + ] + ], + "unions": [], + "enums": [ + [ + "log_level", + [ + "VPE_API_LOG_LEVEL_EMERG", + 0 + ], + [ + "VPE_API_LOG_LEVEL_ALERT", + 1 + ], + [ + "VPE_API_LOG_LEVEL_CRIT", + 2 + ], + [ + "VPE_API_LOG_LEVEL_ERR", + 3 + ], + [ + "VPE_API_LOG_LEVEL_WARNING", + 4 + ], + [ + "VPE_API_LOG_LEVEL_NOTICE", + 5 + ], + [ + "VPE_API_LOG_LEVEL_INFO", + 6 + ], + [ + "VPE_API_LOG_LEVEL_DEBUG", + 7 + ], + [ + "VPE_API_LOG_LEVEL_DISABLED", + 8 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "control_ping": { + "reply": "control_ping_reply" + }, + "cli": { + "reply": "cli_reply" + }, + "cli_inband": { + "reply": "cli_inband_reply" + }, + "get_node_index": { + "reply": "get_node_index_reply" + }, + "add_node_next": { + "reply": "add_node_next_reply" + }, + "show_version": { + "reply": "show_version_reply" + }, + "show_threads": { + "reply": "show_threads_reply" + }, + "get_node_graph": { + "reply": "get_node_graph_reply" + }, + "get_next_index": { + "reply": "get_next_index_reply" + }, + "log_dump": { + "reply": "log_details", + "stream": true + }, + "show_vpe_system_time": { + "reply": "show_vpe_system_time_reply" + }, + "get_f64_endian_value": { + "reply": "get_f64_endian_value_reply" + }, + "get_f64_increment_by_one": { + "reply": "get_f64_increment_by_one_reply" + } + }, + "options": { + "version": "1.6.0" + }, + "aliases": { + "timestamp": { + "type": "f64" + }, + "timedelta": { + "type": "f64" + } + }, + "vl_api_version": "0xc6c0bcf6" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/vpe_types.api.json b/internal/testbinapi/binapi2001/.vppapi/core/vpe_types.api.json new file mode 100644 index 0000000..5463cc4 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/vpe_types.api.json @@ -0,0 +1,86 @@ +{ + "types": [ + [ + "version", + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + [ + "u32", + "patch" + ], + [ + "u8", + "pre_release", + 17 + ], + [ + "u8", + "build_metadata", + 17 + ] + ] + ], + "messages": [], + "unions": [], + "enums": [ + [ + "log_level", + [ + "VPE_API_LOG_LEVEL_EMERG", + 0 + ], + [ + "VPE_API_LOG_LEVEL_ALERT", + 1 + ], + [ + "VPE_API_LOG_LEVEL_CRIT", + 2 + ], + [ + "VPE_API_LOG_LEVEL_ERR", + 3 + ], + [ + "VPE_API_LOG_LEVEL_WARNING", + 4 + ], + [ + "VPE_API_LOG_LEVEL_NOTICE", + 5 + ], + [ + "VPE_API_LOG_LEVEL_INFO", + 6 + ], + [ + "VPE_API_LOG_LEVEL_DEBUG", + 7 + ], + [ + "VPE_API_LOG_LEVEL_DISABLED", + 8 + ], + { + "enumtype": "u32" + } + ] + ], + "services": {}, + "options": {}, + "aliases": { + "timestamp": { + "type": "f64" + }, + "timedelta": { + "type": "f64" + } + }, + "vl_api_version": "0x3369988d" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/vxlan.api.json b/internal/testbinapi/binapi2001/.vppapi/core/vxlan.api.json new file mode 100644 index 0000000..8cdf8a7 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/vxlan.api.json @@ -0,0 +1,275 @@ +{ + "types": [], + "messages": [ + [ + "vxlan_add_del_tunnel", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u32", + "instance" + ], + [ + "u8", + "src_address", + 16 + ], + [ + "u8", + "dst_address", + 16 + ], + [ + "u32", + "mcast_sw_if_index" + ], + [ + "u32", + "encap_vrf_id" + ], + [ + "u32", + "decap_next_index" + ], + [ + "u32", + "vni" + ], + { + "crc": "0x00f4bdd0" + } + ], + [ + "vxlan_add_del_tunnel_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0xfda5941f" + } + ], + [ + "vxlan_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x529cb13f" + } + ], + [ + "vxlan_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "instance" + ], + [ + "u8", + "src_address", + 16 + ], + [ + "u8", + "dst_address", + 16 + ], + [ + "u32", + "mcast_sw_if_index" + ], + [ + "u32", + "encap_vrf_id" + ], + [ + "u32", + "decap_next_index" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "is_ipv6" + ], + { + "crc": "0xce38e127" + } + ], + [ + "sw_interface_set_vxlan_bypass", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "enable" + ], + { + "crc": "0xe74ca095" + } + ], + [ + "sw_interface_set_vxlan_bypass_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "vxlan_offload_rx", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "hw_if_index" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "enable" + ], + { + "crc": "0xf0b08786" + } + ], + [ + "vxlan_offload_rx_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "vxlan_add_del_tunnel": { + "reply": "vxlan_add_del_tunnel_reply" + }, + "vxlan_tunnel_dump": { + "reply": "vxlan_tunnel_details", + "stream": true + }, + "sw_interface_set_vxlan_bypass": { + "reply": "sw_interface_set_vxlan_bypass_reply" + }, + "vxlan_offload_rx": { + "reply": "vxlan_offload_rx_reply" + } + }, + "options": { + "version": "1.1.0" + }, + "aliases": {}, + "vl_api_version": "0xa95aa271" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/vxlan_gbp.api.json b/internal/testbinapi/binapi2001/.vppapi/core/vxlan_gbp.api.json new file mode 100644 index 0000000..52feb9b --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/vxlan_gbp.api.json @@ -0,0 +1,656 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "vxlan_gbp_tunnel", + [ + "u32", + "instance" + ], + [ + "vl_api_address_t", + "src" + ], + [ + "vl_api_address_t", + "dst" + ], + [ + "vl_api_interface_index_t", + "mcast_sw_if_index" + ], + [ + "u32", + "encap_table_id" + ], + [ + "u32", + "vni" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_vxlan_gbp_api_tunnel_mode_t", + "mode" + ] + ] + ], + "messages": [ + [ + "vxlan_gbp_tunnel_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "vl_api_vxlan_gbp_tunnel_t", + "tunnel" + ], + { + "crc": "0x8c819166" + } + ], + [ + "vxlan_gbp_tunnel_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "vxlan_gbp_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "vxlan_gbp_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_vxlan_gbp_tunnel_t", + "tunnel" + ], + { + "crc": "0x1da24016" + } + ], + [ + "sw_interface_set_vxlan_gbp_bypass", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + [ + "bool", + "enable", + { + "default": "true" + } + ], + { + "crc": "0x65247409" + } + ], + [ + "sw_interface_set_vxlan_gbp_bypass_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "vxlan_gbp_api_tunnel_mode", + [ + "VXLAN_GBP_API_TUNNEL_MODE_L2", + 1 + ], + [ + "VXLAN_GBP_API_TUNNEL_MODE_L3", + 2 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "vxlan_gbp_tunnel_add_del": { + "reply": "vxlan_gbp_tunnel_add_del_reply" + }, + "vxlan_gbp_tunnel_dump": { + "reply": "vxlan_gbp_tunnel_details", + "stream": true + }, + "sw_interface_set_vxlan_gbp_bypass": { + "reply": "sw_interface_set_vxlan_gbp_bypass_reply" + } + }, + "options": { + "version": "1.1.1" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xdc218362" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/core/vxlan_gpe.api.json b/internal/testbinapi/binapi2001/.vppapi/core/vxlan_gpe.api.json new file mode 100644 index 0000000..f1ff47d --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/core/vxlan_gpe.api.json @@ -0,0 +1,224 @@ +{ + "types": [], + "messages": [ + [ + "vxlan_gpe_add_del_tunnel", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "local", + 16 + ], + [ + "u8", + "remote", + 16 + ], + [ + "u32", + "mcast_sw_if_index" + ], + [ + "u32", + "encap_vrf_id" + ], + [ + "u32", + "decap_vrf_id" + ], + [ + "u8", + "protocol" + ], + [ + "u32", + "vni" + ], + [ + "u8", + "is_add" + ], + { + "crc": "0xd15850ba" + } + ], + [ + "vxlan_gpe_add_del_tunnel_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0xfda5941f" + } + ], + [ + "vxlan_gpe_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x529cb13f" + } + ], + [ + "vxlan_gpe_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "local", + 16 + ], + [ + "u8", + "remote", + 16 + ], + [ + "u32", + "vni" + ], + [ + "u8", + "protocol" + ], + [ + "u32", + "mcast_sw_if_index" + ], + [ + "u32", + "encap_vrf_id" + ], + [ + "u32", + "decap_vrf_id" + ], + [ + "u8", + "is_ipv6" + ], + { + "crc": "0x2673fbfa" + } + ], + [ + "sw_interface_set_vxlan_gpe_bypass", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "enable" + ], + { + "crc": "0xe74ca095" + } + ], + [ + "sw_interface_set_vxlan_gpe_bypass_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "vxlan_gpe_add_del_tunnel": { + "reply": "vxlan_gpe_add_del_tunnel_reply" + }, + "vxlan_gpe_tunnel_dump": { + "reply": "vxlan_gpe_tunnel_details", + "stream": true + }, + "sw_interface_set_vxlan_gpe_bypass": { + "reply": "sw_interface_set_vxlan_gpe_bypass_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x25bfb55d" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/abf.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/abf.api.json new file mode 100644 index 0000000..3f6f1e2 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/abf.api.json @@ -0,0 +1,1161 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ], + [ + "abf_policy", + [ + "u32", + "policy_id" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "n_paths" + ], + [ + "vl_api_fib_path_t", + "paths", + 0, + "n_paths" + ] + ], + [ + "abf_itf_attach", + [ + "u32", + "policy_id" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "priority" + ], + [ + "bool", + "is_ipv6" + ] + ] + ], + "messages": [ + [ + "abf_plugin_get_version", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "abf_plugin_get_version_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + { + "crc": "0x9b32cf86" + } + ], + [ + "abf_policy_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_abf_policy_t", + "policy" + ], + { + "crc": "0xee66f93e" + } + ], + [ + "abf_policy_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "abf_policy_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_abf_policy_t", + "policy" + ], + { + "crc": "0x6769e504" + } + ], + [ + "abf_policy_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "abf_itf_attach_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_abf_itf_attach_t", + "attach" + ], + { + "crc": "0x25c8621b" + } + ], + [ + "abf_itf_attach_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "abf_itf_attach_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_abf_itf_attach_t", + "attach" + ], + { + "crc": "0x7819523e" + } + ], + [ + "abf_itf_attach_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ], + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "abf_plugin_get_version": { + "reply": "abf_plugin_get_version_reply" + }, + "abf_policy_add_del": { + "reply": "abf_policy_add_del_reply" + }, + "abf_policy_dump": { + "reply": "abf_policy_details", + "stream": true + }, + "abf_itf_attach_add_del": { + "reply": "abf_itf_attach_add_del_reply" + }, + "abf_itf_attach_dump": { + "reply": "abf_itf_attach_details", + "stream": true + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xc2e5c644" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/acl.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/acl.api.json new file mode 100644 index 0000000..eeb7f10 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/acl.api.json @@ -0,0 +1,1095 @@ +{ + "types": [ + [ + "acl_rule", + [ + "u8", + "is_permit" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "src_ip_addr", + 16 + ], + [ + "u8", + "src_ip_prefix_len" + ], + [ + "u8", + "dst_ip_addr", + 16 + ], + [ + "u8", + "dst_ip_prefix_len" + ], + [ + "u8", + "proto" + ], + [ + "u16", + "srcport_or_icmptype_first" + ], + [ + "u16", + "srcport_or_icmptype_last" + ], + [ + "u16", + "dstport_or_icmpcode_first" + ], + [ + "u16", + "dstport_or_icmpcode_last" + ], + [ + "u8", + "tcp_flags_mask" + ], + [ + "u8", + "tcp_flags_value" + ] + ], + [ + "macip_acl_rule", + [ + "u8", + "is_permit" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "src_mac", + 6 + ], + [ + "u8", + "src_mac_mask", + 6 + ], + [ + "u8", + "src_ip_addr", + 16 + ], + [ + "u8", + "src_ip_prefix_len" + ] + ] + ], + "messages": [ + [ + "acl_plugin_get_version", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "acl_plugin_get_version_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + { + "crc": "0x9b32cf86" + } + ], + [ + "acl_plugin_control_ping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "acl_plugin_control_ping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "vpe_pid" + ], + { + "crc": "0xf6b0b8ca" + } + ], + [ + "acl_plugin_get_conn_table_max_entries", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "acl_plugin_get_conn_table_max_entries_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u64", + "conn_table_max_entries" + ], + { + "crc": "0x7a096d3d" + } + ], + [ + "acl_add_replace", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0x13bc8539" + } + ], + [ + "acl_add_replace_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xac407b0c" + } + ], + [ + "acl_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0xef34fea4" + } + ], + [ + "acl_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "acl_interface_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_input" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0x0b2aedd1" + } + ], + [ + "acl_interface_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "acl_interface_set_acl_list", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "count" + ], + [ + "u8", + "n_input" + ], + [ + "u32", + "acls", + 0, + "count" + ], + { + "crc": "0x8baece38" + } + ], + [ + "acl_interface_set_acl_list_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "acl_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0xef34fea4" + } + ], + [ + "acl_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0xf89d7a88" + } + ], + [ + "acl_interface_list_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x529cb13f" + } + ], + [ + "acl_interface_list_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "count" + ], + [ + "u8", + "n_input" + ], + [ + "u32", + "acls", + 0, + "count" + ], + { + "crc": "0xd5e80809" + } + ], + [ + "macip_acl_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_macip_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0x0c680ca5" + } + ], + [ + "macip_acl_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xac407b0c" + } + ], + [ + "macip_acl_add_replace", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_macip_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0xd3d313e7" + } + ], + [ + "macip_acl_add_replace_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xac407b0c" + } + ], + [ + "macip_acl_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0xef34fea4" + } + ], + [ + "macip_acl_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "macip_acl_interface_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0x6a6be97c" + } + ], + [ + "macip_acl_interface_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "macip_acl_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0xef34fea4" + } + ], + [ + "macip_acl_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_macip_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0xe164e69a" + } + ], + [ + "macip_acl_interface_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "macip_acl_interface_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "count" + ], + [ + "u32", + "acls", + 0, + "count" + ], + { + "crc": "0xaccf9b05" + } + ], + [ + "macip_acl_interface_list_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x529cb13f" + } + ], + [ + "macip_acl_interface_list_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "count" + ], + [ + "u32", + "acls", + 0, + "count" + ], + { + "crc": "0x29783fa0" + } + ], + [ + "acl_interface_set_etype_whitelist", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "count" + ], + [ + "u8", + "n_input" + ], + [ + "u16", + "whitelist", + 0, + "count" + ], + { + "crc": "0xf515efc5" + } + ], + [ + "acl_interface_set_etype_whitelist_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "acl_interface_etype_whitelist_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x529cb13f" + } + ], + [ + "acl_interface_etype_whitelist_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "count" + ], + [ + "u8", + "n_input" + ], + [ + "u16", + "whitelist", + 0, + "count" + ], + { + "crc": "0x6a5d4e81" + } + ], + [ + "acl_stats_intf_counters_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xb3e225d2" + } + ], + [ + "acl_stats_intf_counters_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "acl_plugin_get_version": { + "reply": "acl_plugin_get_version_reply" + }, + "acl_plugin_control_ping": { + "reply": "acl_plugin_control_ping_reply" + }, + "acl_plugin_get_conn_table_max_entries": { + "reply": "acl_plugin_get_conn_table_max_entries_reply" + }, + "acl_add_replace": { + "reply": "acl_add_replace_reply" + }, + "acl_del": { + "reply": "acl_del_reply" + }, + "acl_interface_add_del": { + "reply": "acl_interface_add_del_reply" + }, + "acl_interface_set_acl_list": { + "reply": "acl_interface_set_acl_list_reply" + }, + "acl_dump": { + "reply": "acl_details", + "stream": true + }, + "acl_interface_list_dump": { + "reply": "acl_interface_list_details", + "stream": true + }, + "macip_acl_add": { + "reply": "macip_acl_add_reply" + }, + "macip_acl_add_replace": { + "reply": "macip_acl_add_replace_reply" + }, + "macip_acl_del": { + "reply": "macip_acl_del_reply" + }, + "macip_acl_interface_add_del": { + "reply": "macip_acl_interface_add_del_reply" + }, + "macip_acl_dump": { + "reply": "macip_acl_details", + "stream": true + }, + "macip_acl_interface_get": { + "reply": "macip_acl_interface_get_reply" + }, + "macip_acl_interface_list_dump": { + "reply": "macip_acl_interface_list_details", + "stream": true + }, + "acl_interface_set_etype_whitelist": { + "reply": "acl_interface_set_etype_whitelist_reply" + }, + "acl_interface_etype_whitelist_dump": { + "reply": "acl_interface_etype_whitelist_details", + "stream": true + }, + "acl_stats_intf_counters_enable": { + "reply": "acl_stats_intf_counters_enable_reply" + } + }, + "options": { + "version": "1.0.1" + }, + "aliases": {}, + "vl_api_version": "0x11c5c1e5" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/acl_types.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/acl_types.api.json new file mode 100644 index 0000000..b82a43e --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/acl_types.api.json @@ -0,0 +1,98 @@ +{ + "types": [ + [ + "acl_rule", + [ + "u8", + "is_permit" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "src_ip_addr", + 16 + ], + [ + "u8", + "src_ip_prefix_len" + ], + [ + "u8", + "dst_ip_addr", + 16 + ], + [ + "u8", + "dst_ip_prefix_len" + ], + [ + "u8", + "proto" + ], + [ + "u16", + "srcport_or_icmptype_first" + ], + [ + "u16", + "srcport_or_icmptype_last" + ], + [ + "u16", + "dstport_or_icmpcode_first" + ], + [ + "u16", + "dstport_or_icmpcode_last" + ], + [ + "u8", + "tcp_flags_mask" + ], + [ + "u8", + "tcp_flags_value" + ] + ], + [ + "macip_acl_rule", + [ + "u8", + "is_permit" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "src_mac", + 6 + ], + [ + "u8", + "src_mac_mask", + 6 + ], + [ + "u8", + "src_ip_addr", + 16 + ], + [ + "u8", + "src_ip_prefix_len" + ] + ] + ], + "messages": [], + "unions": [], + "enums": [], + "services": {}, + "options": {}, + "aliases": {}, + "vl_api_version": "0x1803336d" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/avf.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/avf.api.json new file mode 100644 index 0000000..f741f29 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/avf.api.json @@ -0,0 +1,277 @@ +{ + "types": [], + "messages": [ + [ + "avf_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "pci_addr" + ], + [ + "i32", + "enable_elog" + ], + [ + "u16", + "rxq_num" + ], + [ + "u16", + "rxq_size" + ], + [ + "u16", + "txq_size" + ], + { + "crc": "0xdaab8ae2" + } + ], + [ + "avf_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "avf_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "avf_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "avf_create": { + "reply": "avf_create_reply" + }, + "avf_delete": { + "reply": "avf_delete_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xb7c68e1d" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/builtinurl.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/builtinurl.api.json new file mode 100644 index 0000000..355a7d7 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/builtinurl.api.json @@ -0,0 +1,53 @@ +{ + "types": [], + "messages": [ + [ + "builtinurl_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "builtinurl_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "builtinurl_enable": { + "reply": "builtinurl_enable_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x25045d63" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/cdp.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/cdp.api.json new file mode 100644 index 0000000..30f861f --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/cdp.api.json @@ -0,0 +1,57 @@ +{ + "types": [], + "messages": [ + [ + "cdp_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + { + "crc": "0x2e7b47df" + } + ], + [ + "cdp_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "cdp_enable_disable": { + "reply": "cdp_enable_disable_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x8cfa825e" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/ct6.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/ct6.api.json new file mode 100644 index 0000000..77bcc69 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/ct6.api.json @@ -0,0 +1,222 @@ +{ + "types": [], + "messages": [ + [ + "ct6_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + [ + "bool", + "is_inside" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5d02ac02" + } + ], + [ + "ct6_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "ct6_enable_disable": { + "reply": "ct6_enable_disable_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xb294742c" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/dhcp.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/dhcp.api.json new file mode 100644 index 0000000..6f74182 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/dhcp.api.json @@ -0,0 +1,1581 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "dhcp_client", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "hostname", + 64 + ], + [ + "u8", + "id", + 64 + ], + [ + "bool", + "want_dhcp_event" + ], + [ + "bool", + "set_broadcast_flag" + ], + [ + "vl_api_ip_dscp_t", + "dscp" + ], + [ + "u32", + "pid" + ] + ], + [ + "domain_server", + [ + "vl_api_address_t", + "address" + ] + ], + [ + "dhcp_lease", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_dhcp_client_state_t", + "state" + ], + [ + "bool", + "is_ipv6" + ], + [ + "string", + "hostname", + 64 + ], + [ + "u8", + "mask_width" + ], + [ + "vl_api_address_t", + "host_address" + ], + [ + "vl_api_address_t", + "router_address" + ], + [ + "vl_api_mac_address_t", + "host_mac" + ], + [ + "u8", + "count" + ], + [ + "vl_api_domain_server_t", + "domain_server", + 0, + "count" + ] + ], + [ + "dhcp_server", + [ + "u32", + "server_vrf_id" + ], + [ + "vl_api_address_t", + "dhcp_server" + ] + ], + [ + "dhcp6_address_info", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u32", + "valid_time" + ], + [ + "u32", + "preferred_time" + ] + ], + [ + "dhcp6_pd_prefix_info", + [ + "vl_api_ip6_prefix_t", + "prefix" + ], + [ + "u32", + "valid_time" + ], + [ + "u32", + "preferred_time" + ] + ] + ], + "messages": [ + [ + "dhcp_plugin_get_version", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "dhcp_plugin_get_version_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + { + "crc": "0x9b32cf86" + } + ], + [ + "dhcp_plugin_control_ping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "dhcp_plugin_control_ping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "vpe_pid" + ], + { + "crc": "0xf6b0b8ca" + } + ], + [ + "dhcp_proxy_config", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "rx_vrf_id" + ], + [ + "u32", + "server_vrf_id" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_address_t", + "dhcp_server" + ], + [ + "vl_api_address_t", + "dhcp_src_address" + ], + { + "crc": "0x6767230e" + } + ], + [ + "dhcp_proxy_config_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dhcp_proxy_set_vss", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "tbl_id" + ], + [ + "vl_api_vss_type_t", + "vss_type" + ], + [ + "string", + "vpn_ascii_id", + 129 + ], + [ + "u32", + "oui" + ], + [ + "u32", + "vpn_index" + ], + [ + "bool", + "is_ipv6" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0x50537301" + } + ], + [ + "dhcp_proxy_set_vss_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dhcp_client_config", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_dhcp_client_t", + "client" + ], + { + "crc": "0x959b80a3" + } + ], + [ + "dhcp_client_config_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dhcp_compl_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "vl_api_dhcp_lease_t", + "lease" + ], + { + "crc": "0xe908fd1d" + } + ], + [ + "dhcp_client_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "dhcp_client_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_dhcp_client_t", + "client" + ], + [ + "vl_api_dhcp_lease_t", + "lease" + ], + { + "crc": "0xacd82f5a" + } + ], + [ + "dhcp_proxy_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_ip6" + ], + { + "crc": "0x5c5b063f" + } + ], + [ + "dhcp_proxy_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "rx_vrf_id" + ], + [ + "u32", + "vss_oui" + ], + [ + "u32", + "vss_fib_id" + ], + [ + "vl_api_vss_type_t", + "vss_type" + ], + [ + "bool", + "is_ipv6" + ], + [ + "string", + "vss_vpn_ascii_id", + 129 + ], + [ + "vl_api_address_t", + "dhcp_src_address" + ], + [ + "u8", + "count" + ], + [ + "vl_api_dhcp_server_t", + "servers", + 0, + "count" + ], + { + "crc": "0xce16f044" + } + ], + [ + "dhcp6_duid_ll_set", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "duid_ll", + 10 + ], + { + "crc": "0x0f6ca323" + } + ], + [ + "dhcp6_duid_ll_set_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dhcp6_clients_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xb3e225d2" + } + ], + [ + "dhcp6_clients_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dhcp6_send_client_message", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "server_index" + ], + [ + "u32", + "irt" + ], + [ + "u32", + "mrt" + ], + [ + "u32", + "mrc" + ], + [ + "u32", + "mrd" + ], + [ + "bool", + "stop" + ], + [ + "vl_api_dhcpv6_msg_type_t", + "msg_type" + ], + [ + "u32", + "T1" + ], + [ + "u32", + "T2" + ], + [ + "u32", + "n_addresses" + ], + [ + "vl_api_dhcp6_address_info_t", + "addresses", + 0, + "n_addresses" + ], + { + "crc": "0xf6f14ef0" + } + ], + [ + "dhcp6_send_client_message_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dhcp6_pd_send_client_message", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "server_index" + ], + [ + "u32", + "irt" + ], + [ + "u32", + "mrt" + ], + [ + "u32", + "mrc" + ], + [ + "u32", + "mrd" + ], + [ + "bool", + "stop" + ], + [ + "vl_api_dhcpv6_msg_type_t", + "msg_type" + ], + [ + "u32", + "T1" + ], + [ + "u32", + "T2" + ], + [ + "u32", + "n_prefixes" + ], + [ + "vl_api_dhcp6_pd_prefix_info_t", + "prefixes", + 0, + "n_prefixes" + ], + { + "crc": "0x064badb8" + } + ], + [ + "dhcp6_pd_send_client_message_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "want_dhcp6_reply_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "enable_disable" + ], + [ + "u32", + "pid" + ], + { + "crc": "0x05b454b5" + } + ], + [ + "want_dhcp6_reply_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "want_dhcp6_pd_reply_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + [ + "u32", + "pid" + ], + { + "crc": "0xc5e2af94" + } + ], + [ + "want_dhcp6_pd_reply_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dhcp6_reply_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "server_index" + ], + [ + "vl_api_dhcpv6_msg_type_t", + "msg_type" + ], + [ + "u32", + "T1" + ], + [ + "u32", + "T2" + ], + [ + "u16", + "inner_status_code" + ], + [ + "u16", + "status_code" + ], + [ + "u8", + "preference" + ], + [ + "u32", + "n_addresses" + ], + [ + "vl_api_dhcp6_address_info_t", + "addresses", + 0, + "n_addresses" + ], + { + "crc": "0x9f3af9e5" + } + ], + [ + "dhcp6_pd_reply_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "server_index" + ], + [ + "vl_api_dhcpv6_msg_type_t", + "msg_type" + ], + [ + "u32", + "T1" + ], + [ + "u32", + "T2" + ], + [ + "u16", + "inner_status_code" + ], + [ + "u16", + "status_code" + ], + [ + "u8", + "preference" + ], + [ + "u32", + "n_prefixes" + ], + [ + "vl_api_dhcp6_pd_prefix_info_t", + "prefixes", + 0, + "n_prefixes" + ], + { + "crc": "0xcb3e462b" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "vss_type", + [ + "VSS_TYPE_API_ASCII", + 0 + ], + [ + "VSS_TYPE_API_VPN_ID", + 1 + ], + [ + "VSS_TYPE_API_INVALID", + 123 + ], + [ + "VSS_TYPE_API_DEFAULT", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "dhcp_client_state", + [ + "DHCP_CLIENT_STATE_API_DISCOVER", + 1 + ], + [ + "DHCP_CLIENT_STATE_API_REQUEST", + 2 + ], + [ + "DHCP_CLIENT_STATE_API_BOUND", + 3 + ], + { + "enumtype": "u32" + } + ], + [ + "dhcpv6_msg_type", + [ + "DHCPV6_MSG_API_SOLICIT", + 1 + ], + [ + "DHCPV6_MSG_API_ADVERTISE", + 2 + ], + [ + "DHCPV6_MSG_API_REQUEST", + 3 + ], + [ + "DHCPV6_MSG_API_CONFIRM", + 4 + ], + [ + "DHCPV6_MSG_API_RENEW", + 5 + ], + [ + "DHCPV6_MSG_API_REBIND", + 6 + ], + [ + "DHCPV6_MSG_API_REPLY", + 7 + ], + [ + "DHCPV6_MSG_API_RELEASE", + 8 + ], + [ + "DHCPV6_MSG_API_DECLINE", + 9 + ], + [ + "DHCPV6_MSG_API_RECONFIGURE", + 10 + ], + [ + "DHCPV6_MSG_API_INFORMATION_REQUEST", + 11 + ], + [ + "DHCPV6_MSG_API_RELAY_FORW", + 12 + ], + [ + "DHCPV6_MSG_API_RELAY_REPL", + 13 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "dhcp_client_config": { + "reply": "dhcp_client_config_reply", + "events": [ + "dhcp_compl_event" + ] + }, + "want_dhcp6_reply_events": { + "reply": "want_dhcp6_reply_events_reply", + "events": [ + "dhcp6_reply_event" + ] + }, + "want_dhcp6_pd_reply_events": { + "reply": "want_dhcp6_pd_reply_events_reply", + "events": [ + "dhcp6_pd_reply_event" + ] + }, + "dhcp_plugin_get_version": { + "reply": "dhcp_plugin_get_version_reply" + }, + "dhcp_plugin_control_ping": { + "reply": "dhcp_plugin_control_ping_reply" + }, + "dhcp_proxy_config": { + "reply": "dhcp_proxy_config_reply" + }, + "dhcp_proxy_set_vss": { + "reply": "dhcp_proxy_set_vss_reply" + }, + "dhcp_client_dump": { + "reply": "dhcp_client_details", + "stream": true + }, + "dhcp_proxy_dump": { + "reply": "dhcp_proxy_details", + "stream": true + }, + "dhcp6_duid_ll_set": { + "reply": "dhcp6_duid_ll_set_reply" + }, + "dhcp6_clients_enable_disable": { + "reply": "dhcp6_clients_enable_disable_reply" + }, + "dhcp6_send_client_message": { + "reply": "dhcp6_send_client_message_reply" + }, + "dhcp6_pd_send_client_message": { + "reply": "dhcp6_pd_send_client_message_reply" + } + }, + "options": { + "version": "3.0.1" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0x96a5f046" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_ia_na_client_cp.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_ia_na_client_cp.api.json new file mode 100644 index 0000000..00fdbe5 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_ia_na_client_cp.api.json @@ -0,0 +1,218 @@ +{ + "types": [], + "messages": [ + [ + "dhcp6_client_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xae6cfcfb" + } + ], + [ + "dhcp6_client_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "dhcp6_client_enable_disable": { + "reply": "dhcp6_client_enable_disable_reply" + } + }, + "options": { + "version": "1.0.1" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x541d3edd" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_pd_client_cp.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_pd_client_cp.api.json new file mode 100644 index 0000000..e4dcc62 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_pd_client_cp.api.json @@ -0,0 +1,563 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "dhcp6_pd_client_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "prefix_group", + 64 + ], + [ + "bool", + "enable" + ], + { + "crc": "0xa75a0772" + } + ], + [ + "dhcp6_pd_client_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip6_add_del_address_using_prefix", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "prefix_group", + 64 + ], + [ + "vl_api_ip6_address_with_prefix_t", + "address_with_prefix" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0x9b3d11e0" + } + ], + [ + "ip6_add_del_address_using_prefix_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "dhcp6_pd_client_enable_disable": { + "reply": "dhcp6_pd_client_enable_disable_reply" + }, + "ip6_add_del_address_using_prefix": { + "reply": "ip6_add_del_address_using_prefix_reply" + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xb44ae848" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/dns.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/dns.api.json new file mode 100644 index 0000000..493a07b --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/dns.api.json @@ -0,0 +1,224 @@ +{ + "types": [], + "messages": [ + [ + "dns_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "enable" + ], + { + "crc": "0x8050327d" + } + ], + [ + "dns_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dns_name_server_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ip6" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "server_address", + 16 + ], + { + "crc": "0x3bb05d8c" + } + ], + [ + "dns_name_server_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dns_resolve_name", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "name", + 256 + ], + { + "crc": "0xc6566676" + } + ], + [ + "dns_resolve_name_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "ip4_set" + ], + [ + "u8", + "ip6_set" + ], + [ + "u8", + "ip4_address", + 4 + ], + [ + "u8", + "ip6_address", + 16 + ], + { + "crc": "0xc2d758c3" + } + ], + [ + "dns_resolve_ip", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ip6" + ], + [ + "u8", + "address", + 16 + ], + { + "crc": "0xae96a1a3" + } + ], + [ + "dns_resolve_ip_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "name", + 256 + ], + { + "crc": "0x49ed78d6" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "dns_enable_disable": { + "reply": "dns_enable_disable_reply" + }, + "dns_name_server_add_del": { + "reply": "dns_name_server_add_del_reply" + }, + "dns_resolve_name": { + "reply": "dns_resolve_name_reply" + }, + "dns_resolve_ip": { + "reply": "dns_resolve_ip_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x269575cd" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/flowprobe.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/flowprobe.api.json new file mode 100644 index 0000000..f23376f --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/flowprobe.api.json @@ -0,0 +1,309 @@ +{ + "types": [], + "messages": [ + [ + "flowprobe_tx_interface_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_flowprobe_which_flags_t", + "which" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xb782c976" + } + ], + [ + "flowprobe_tx_interface_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "flowprobe_params", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_flowprobe_record_flags_t", + "record_flags" + ], + [ + "u32", + "active_timer" + ], + [ + "u32", + "passive_timer" + ], + { + "crc": "0xbaa46c09" + } + ], + [ + "flowprobe_params_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "flowprobe_which_flags", + [ + "FLOWPROBE_WHICH_FLAG_IP4", + 1 + ], + [ + "FLOWPROBE_WHICH_FLAG_L2", + 2 + ], + [ + "FLOWPROBE_WHICH_FLAG_IP6", + 4 + ], + { + "enumtype": "u8" + } + ], + [ + "flowprobe_record_flags", + [ + "FLOWPROBE_RECORD_FLAG_L2", + 1 + ], + [ + "FLOWPROBE_RECORD_FLAG_L3", + 2 + ], + [ + "FLOWPROBE_RECORD_FLAG_L4", + 4 + ], + { + "enumtype": "u8" + } + ] + ], + "services": { + "flowprobe_tx_interface_add_del": { + "reply": "flowprobe_tx_interface_add_del_reply" + }, + "flowprobe_params": { + "reply": "flowprobe_params_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xbb4dfc0d" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/gbp.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/gbp.api.json new file mode 100644 index 0000000..455cfa2 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/gbp.api.json @@ -0,0 +1,1930 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "gbp_bridge_domain", + [ + "u32", + "bd_id" + ], + [ + "u32", + "rd_id" + ], + [ + "vl_api_gbp_bridge_domain_flags_t", + "flags" + ], + [ + "vl_api_interface_index_t", + "bvi_sw_if_index" + ], + [ + "vl_api_interface_index_t", + "uu_fwd_sw_if_index" + ], + [ + "vl_api_interface_index_t", + "bm_flood_sw_if_index" + ] + ], + [ + "gbp_route_domain", + [ + "u32", + "rd_id" + ], + [ + "u32", + "ip4_table_id" + ], + [ + "u32", + "ip6_table_id" + ], + [ + "vl_api_interface_index_t", + "ip4_uu_sw_if_index" + ], + [ + "vl_api_interface_index_t", + "ip6_uu_sw_if_index" + ], + [ + "vl_api_gbp_scope_t", + "scope" + ] + ], + [ + "gbp_endpoint_tun", + [ + "vl_api_address_t", + "src" + ], + [ + "vl_api_address_t", + "dst" + ] + ], + [ + "gbp_endpoint", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u16", + "sclass" + ], + [ + "vl_api_gbp_endpoint_flags_t", + "flags" + ], + [ + "vl_api_mac_address_t", + "mac" + ], + [ + "vl_api_gbp_endpoint_tun_t", + "tun" + ], + [ + "u8", + "n_ips" + ], + [ + "vl_api_address_t", + "ips", + 0, + "n_ips" + ] + ], + [ + "gbp_endpoint_retention", + [ + "u32", + "remote_ep_timeout" + ] + ], + [ + "gbp_endpoint_group", + [ + "u32", + "vnid" + ], + [ + "u16", + "sclass" + ], + [ + "u32", + "bd_id" + ], + [ + "u32", + "rd_id" + ], + [ + "vl_api_interface_index_t", + "uplink_sw_if_index" + ], + [ + "vl_api_gbp_endpoint_retention_t", + "retention" + ] + ], + [ + "gbp_recirc", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u16", + "sclass" + ], + [ + "bool", + "is_ext" + ] + ], + [ + "gbp_subnet", + [ + "u32", + "rd_id" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u16", + "sclass" + ], + [ + "vl_api_gbp_subnet_type_t", + "type" + ], + [ + "vl_api_prefix_t", + "prefix" + ] + ], + [ + "gbp_next_hop", + [ + "vl_api_address_t", + "ip" + ], + [ + "vl_api_mac_address_t", + "mac" + ], + [ + "u32", + "bd_id" + ], + [ + "u32", + "rd_id" + ] + ], + [ + "gbp_next_hop_set", + [ + "vl_api_gbp_hash_mode_t", + "hash_mode" + ], + [ + "u8", + "n_nhs" + ], + [ + "vl_api_gbp_next_hop_t", + "nhs", + 8 + ] + ], + [ + "gbp_rule", + [ + "vl_api_gbp_rule_action_t", + "action" + ], + [ + "vl_api_gbp_next_hop_set_t", + "nh_set" + ] + ], + [ + "gbp_contract", + [ + "vl_api_gbp_scope_t", + "scope" + ], + [ + "u16", + "sclass" + ], + [ + "u16", + "dclass" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "n_ether_types" + ], + [ + "u16", + "allowed_ethertypes", + 16 + ], + [ + "u8", + "n_rules" + ], + [ + "vl_api_gbp_rule_t", + "rules", + 0, + "n_rules" + ] + ], + [ + "gbp_vxlan_tunnel", + [ + "u32", + "vni" + ], + [ + "vl_api_gbp_vxlan_tunnel_mode_t", + "mode" + ], + [ + "u32", + "bd_rd_id" + ], + [ + "vl_api_ip4_address_t", + "src" + ] + ], + [ + "gbp_ext_itf", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "bd_id" + ], + [ + "u32", + "rd_id" + ], + [ + "vl_api_gbp_ext_itf_flags_t", + "flags" + ] + ] + ], + "messages": [ + [ + "gbp_bridge_domain_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_bridge_domain_t", + "bd" + ], + { + "crc": "0x8454bfdf" + } + ], + [ + "gbp_bridge_domain_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_bridge_domain_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "bd_id" + ], + { + "crc": "0xc25fdce6" + } + ], + [ + "gbp_bridge_domain_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_bridge_domain_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gbp_bridge_domain_dump_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_bridge_domain_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_bridge_domain_t", + "bd" + ], + { + "crc": "0x2acd15f9" + } + ], + [ + "gbp_route_domain_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_route_domain_t", + "rd" + ], + { + "crc": "0x2d0afe38" + } + ], + [ + "gbp_route_domain_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_route_domain_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "rd_id" + ], + { + "crc": "0xbee4edcd" + } + ], + [ + "gbp_route_domain_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_route_domain_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gbp_route_domain_dump_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_route_domain_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_route_domain_t", + "rd" + ], + { + "crc": "0x8ab11375" + } + ], + [ + "gbp_endpoint_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_endpoint_t", + "endpoint" + ], + { + "crc": "0x9ce16d5a" + } + ], + [ + "gbp_endpoint_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "handle" + ], + { + "crc": "0x1dd3ff3e" + } + ], + [ + "gbp_endpoint_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "handle" + ], + { + "crc": "0xb93cd566" + } + ], + [ + "gbp_endpoint_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_endpoint_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gbp_endpoint_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "f64", + "age" + ], + [ + "u32", + "handle" + ], + [ + "vl_api_gbp_endpoint_t", + "endpoint" + ], + { + "crc": "0x08aecb60" + } + ], + [ + "gbp_endpoint_group_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_endpoint_group_t", + "epg" + ], + { + "crc": "0x8e0f4054" + } + ], + [ + "gbp_endpoint_group_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_endpoint_group_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "sclass" + ], + { + "crc": "0x3436b8b7" + } + ], + [ + "gbp_endpoint_group_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_endpoint_group_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gbp_endpoint_group_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_endpoint_group_t", + "epg" + ], + { + "crc": "0x8f38292c" + } + ], + [ + "gbp_recirc_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_gbp_recirc_t", + "recirc" + ], + { + "crc": "0x718c69c3" + } + ], + [ + "gbp_recirc_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_recirc_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gbp_recirc_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_recirc_t", + "recirc" + ], + { + "crc": "0x66ecc42e" + } + ], + [ + "gbp_subnet_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_gbp_subnet_t", + "subnet" + ], + { + "crc": "0x888aca35" + } + ], + [ + "gbp_subnet_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_subnet_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gbp_subnet_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_subnet_t", + "subnet" + ], + { + "crc": "0x4ed84156" + } + ], + [ + "gbp_contract_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_gbp_contract_t", + "contract" + ], + { + "crc": "0x553e275b" + } + ], + [ + "gbp_contract_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stats_index" + ], + { + "crc": "0x1992deab" + } + ], + [ + "gbp_contract_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gbp_contract_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_contract_t", + "contract" + ], + { + "crc": "0x2a18db6e" + } + ], + [ + "gbp_vxlan_tunnel_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_vxlan_tunnel_t", + "tunnel" + ], + { + "crc": "0x3e070b35" + } + ], + [ + "gbp_vxlan_tunnel_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "gbp_vxlan_tunnel_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + { + "crc": "0x8d1f2fe9" + } + ], + [ + "gbp_vxlan_tunnel_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_vxlan_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gbp_vxlan_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_vxlan_tunnel_t", + "tunnel" + ], + { + "crc": "0x65c6c818" + } + ], + [ + "gbp_ext_itf_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_gbp_ext_itf_t", + "ext_itf" + ], + { + "crc": "0x12ed5700" + } + ], + [ + "gbp_ext_itf_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "gbp_ext_itf_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "gbp_ext_itf_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_gbp_ext_itf_t", + "ext_itf" + ], + { + "crc": "0x408a45c0" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "gbp_bridge_domain_flags", + [ + "GBP_BD_API_FLAG_NONE", + 0 + ], + [ + "GBP_BD_API_FLAG_DO_NOT_LEARN", + 1 + ], + [ + "GBP_BD_API_FLAG_UU_FWD_DROP", + 2 + ], + [ + "GBP_BD_API_FLAG_MCAST_DROP", + 4 + ], + [ + "GBP_BD_API_FLAG_UCAST_ARP", + 8 + ], + { + "enumtype": "u32" + } + ], + [ + "gbp_endpoint_flags", + [ + "GBP_API_ENDPOINT_FLAG_NONE", + 0 + ], + [ + "GBP_API_ENDPOINT_FLAG_BOUNCE", + 1 + ], + [ + "GBP_API_ENDPOINT_FLAG_REMOTE", + 2 + ], + [ + "GBP_API_ENDPOINT_FLAG_LEARNT", + 4 + ], + [ + "GBP_API_ENDPOINT_FLAG_EXTERNAL", + 8 + ], + { + "enumtype": "u32" + } + ], + [ + "gbp_subnet_type", + [ + "GBP_API_SUBNET_TRANSPORT", + 1 + ], + [ + "GBP_API_SUBNET_STITCHED_INTERNAL", + 2 + ], + [ + "GBP_API_SUBNET_STITCHED_EXTERNAL", + 3 + ], + [ + "GBP_API_SUBNET_L3_OUT", + 4 + ], + [ + "GBP_API_SUBNET_ANON_L3_OUT", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "gbp_hash_mode", + [ + "GBP_API_HASH_MODE_SRC_IP", + 1 + ], + [ + "GBP_API_HASH_MODE_DST_IP", + 2 + ], + [ + "GBP_API_HASH_MODE_SYMMETRIC", + 3 + ], + { + "enumtype": "u32" + } + ], + [ + "gbp_rule_action", + [ + "GBP_API_RULE_PERMIT", + 1 + ], + [ + "GBP_API_RULE_DENY", + 2 + ], + [ + "GBP_API_RULE_REDIRECT", + 3 + ], + { + "enumtype": "u32" + } + ], + [ + "gbp_vxlan_tunnel_mode", + [ + "GBP_VXLAN_TUNNEL_MODE_L2", + 1 + ], + [ + "GBP_VXLAN_TUNNEL_MODE_L3", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "gbp_ext_itf_flags", + [ + "GBP_API_EXT_ITF_F_NONE", + 0 + ], + [ + "GBP_API_EXT_ITF_F_ANON", + 1 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "gbp_bridge_domain_add": { + "reply": "gbp_bridge_domain_add_reply" + }, + "gbp_bridge_domain_del": { + "reply": "gbp_bridge_domain_del_reply" + }, + "gbp_bridge_domain_dump": { + "reply": "gbp_bridge_domain_details", + "stream": true + }, + "gbp_route_domain_add": { + "reply": "gbp_route_domain_add_reply" + }, + "gbp_route_domain_del": { + "reply": "gbp_route_domain_del_reply" + }, + "gbp_route_domain_dump": { + "reply": "gbp_route_domain_details", + "stream": true + }, + "gbp_endpoint_add": { + "reply": "gbp_endpoint_add_reply" + }, + "gbp_endpoint_del": { + "reply": "gbp_endpoint_del_reply" + }, + "gbp_endpoint_dump": { + "reply": "gbp_endpoint_details", + "stream": true + }, + "gbp_endpoint_group_add": { + "reply": "gbp_endpoint_group_add_reply" + }, + "gbp_endpoint_group_del": { + "reply": "gbp_endpoint_group_del_reply" + }, + "gbp_endpoint_group_dump": { + "reply": "gbp_endpoint_group_details", + "stream": true + }, + "gbp_recirc_add_del": { + "reply": "gbp_recirc_add_del_reply" + }, + "gbp_recirc_dump": { + "reply": "gbp_recirc_details", + "stream": true + }, + "gbp_subnet_add_del": { + "reply": "gbp_subnet_add_del_reply" + }, + "gbp_subnet_dump": { + "reply": "gbp_subnet_details", + "stream": true + }, + "gbp_contract_add_del": { + "reply": "gbp_contract_add_del_reply" + }, + "gbp_contract_dump": { + "reply": "gbp_contract_details", + "stream": true + }, + "gbp_vxlan_tunnel_add": { + "reply": "gbp_vxlan_tunnel_add_reply" + }, + "gbp_vxlan_tunnel_del": { + "reply": "gbp_vxlan_tunnel_del_reply" + }, + "gbp_vxlan_tunnel_dump": { + "reply": "gbp_vxlan_tunnel_details", + "stream": true + }, + "gbp_ext_itf_add_del": { + "reply": "gbp_ext_itf_add_del_reply" + }, + "gbp_ext_itf_dump": { + "reply": "gbp_ext_itf_details", + "stream": true + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "mac_address": { + "type": "u8", + "length": 6 + }, + "interface_index": { + "type": "u32" + }, + "gbp_scope": { + "type": "u16" + } + }, + "vl_api_version": "0xa891d6ff" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/gtpu.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/gtpu.api.json new file mode 100644 index 0000000..63cee32 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/gtpu.api.json @@ -0,0 +1,645 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "gtpu_add_del_tunnel", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_address_t", + "src_address" + ], + [ + "vl_api_address_t", + "dst_address" + ], + [ + "vl_api_interface_index_t", + "mcast_sw_if_index" + ], + [ + "u32", + "encap_vrf_id" + ], + [ + "u32", + "decap_next_index" + ], + [ + "u32", + "teid" + ], + { + "crc": "0x9a26a51c" + } + ], + [ + "gtpu_add_del_tunnel_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "gtpu_tunnel_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "gtpu_tunnel_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_t", + "src_address" + ], + [ + "vl_api_address_t", + "dst_address" + ], + [ + "vl_api_interface_index_t", + "mcast_sw_if_index" + ], + [ + "u32", + "encap_vrf_id" + ], + [ + "u32", + "decap_next_index" + ], + [ + "u32", + "teid" + ], + { + "crc": "0xa4d81a09" + } + ], + [ + "sw_interface_set_gtpu_bypass", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + [ + "bool", + "enable" + ], + { + "crc": "0x65247409" + } + ], + [ + "sw_interface_set_gtpu_bypass_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "gtpu_add_del_tunnel": { + "reply": "gtpu_add_del_tunnel_reply" + }, + "gtpu_tunnel_dump": { + "reply": "gtpu_tunnel_details", + "stream": true + }, + "sw_interface_set_gtpu_bypass": { + "reply": "sw_interface_set_gtpu_bypass_reply" + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x6305cc01" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/http_static.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/http_static.api.json new file mode 100644 index 0000000..5bd9315 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/http_static.api.json @@ -0,0 +1,79 @@ +{ + "types": [], + "messages": [ + [ + "http_static_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "fifo_size" + ], + [ + "u32", + "cache_size_limit" + ], + [ + "u32", + "prealloc_fifos" + ], + [ + "u32", + "private_segment_size" + ], + [ + "string", + "www_root", + 256 + ], + [ + "string", + "uri", + 256 + ], + { + "crc": "0x075f8292" + } + ], + [ + "http_static_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "http_static_enable": { + "reply": "http_static_enable_reply" + } + }, + "options": { + "version": "2.1.0" + }, + "aliases": {}, + "vl_api_version": "0xd29e72e9" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/igmp.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/igmp.api.json new file mode 100644 index 0000000..80a5120 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/igmp.api.json @@ -0,0 +1,969 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "igmp_group", + [ + "vl_api_filter_mode_t", + "filter" + ], + [ + "u8", + "n_srcs" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_ip4_address_t", + "gaddr" + ], + [ + "vl_api_ip4_address_t", + "saddrs", + 0, + "n_srcs" + ] + ], + [ + "group_prefix", + [ + "vl_api_group_prefix_type_t", + "type" + ], + [ + "vl_api_prefix_t", + "prefix" + ] + ] + ], + "messages": [ + [ + "igmp_listen", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_igmp_group_t", + "group" + ], + { + "crc": "0x3f93a51a" + } + ], + [ + "igmp_listen_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "igmp_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable" + ], + [ + "u8", + "mode" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xb1edfb96" + } + ], + [ + "igmp_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "igmp_proxy_device_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "add" + ], + [ + "u32", + "vrf_id" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x0b9be9ce" + } + ], + [ + "igmp_proxy_device_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "igmp_proxy_device_add_del_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "add" + ], + [ + "u32", + "vrf_id" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x1a9ec24a" + } + ], + [ + "igmp_proxy_device_add_del_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "igmp_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "igmp_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_ip4_address_t", + "saddr" + ], + [ + "vl_api_ip4_address_t", + "gaddr" + ], + { + "crc": "0x52f12a89" + } + ], + [ + "igmp_clear_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "igmp_clear_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "want_igmp_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "enable" + ], + [ + "u32", + "pid" + ], + { + "crc": "0xcfaccc1f" + } + ], + [ + "want_igmp_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "igmp_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_filter_mode_t", + "filter" + ], + [ + "vl_api_ip4_address_t", + "saddr" + ], + [ + "vl_api_ip4_address_t", + "gaddr" + ], + { + "crc": "0xd7696eaf" + } + ], + [ + "igmp_group_prefix_set", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_group_prefix_t", + "gp" + ], + { + "crc": "0xd4f20ac5" + } + ], + [ + "igmp_group_prefix_set_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "igmp_group_prefix_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "igmp_group_prefix_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_group_prefix_t", + "gp" + ], + { + "crc": "0xc3b3c526" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "filter_mode", + [ + "EXCLUDE", + 0 + ], + [ + "INCLUDE", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "group_prefix_type", + [ + "ASM", + 0 + ], + [ + "SSM", + 1 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "want_igmp_events": { + "reply": "want_igmp_events_reply", + "events": [ + "igmp_event" + ] + }, + "igmp_listen": { + "reply": "igmp_listen_reply" + }, + "igmp_enable_disable": { + "reply": "igmp_enable_disable_reply" + }, + "igmp_proxy_device_add_del": { + "reply": "igmp_proxy_device_add_del_reply" + }, + "igmp_proxy_device_add_del_interface": { + "reply": "igmp_proxy_device_add_del_interface_reply" + }, + "igmp_dump": { + "reply": "igmp_details", + "stream": true + }, + "igmp_clear_interface": { + "reply": "igmp_clear_interface_reply" + }, + "igmp_group_prefix_set": { + "reply": "igmp_group_prefix_set_reply" + }, + "igmp_group_prefix_dump": { + "reply": "igmp_group_prefix_details", + "stream": true + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xfd1fef7b" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/ikev2.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/ikev2.api.json new file mode 100644 index 0000000..84c8259 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/ikev2.api.json @@ -0,0 +1,1187 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "ikev2_plugin_get_version", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ikev2_plugin_get_version_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + { + "crc": "0x9b32cf86" + } + ], + [ + "ikev2_profile_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + [ + "bool", + "is_add" + ], + { + "crc": "0x2c925b55" + } + ], + [ + "ikev2_profile_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_profile_set_auth", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + [ + "u8", + "auth_method" + ], + [ + "bool", + "is_hex" + ], + [ + "u32", + "data_len" + ], + [ + "u8", + "data", + 0, + "data_len" + ], + { + "crc": "0x642c97cd" + } + ], + [ + "ikev2_profile_set_auth_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_profile_set_id", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + [ + "bool", + "is_local" + ], + [ + "u8", + "id_type" + ], + [ + "u32", + "data_len" + ], + [ + "u8", + "data", + 0, + "data_len" + ], + { + "crc": "0x4d7e2418" + } + ], + [ + "ikev2_profile_set_id_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_profile_set_ts", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + [ + "bool", + "is_local" + ], + [ + "u8", + "proto" + ], + [ + "u16", + "start_port" + ], + [ + "u16", + "end_port" + ], + [ + "u32", + "start_addr" + ], + [ + "u32", + "end_addr" + ], + { + "crc": "0x64d55c16" + } + ], + [ + "ikev2_profile_set_ts_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_set_local_key", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "key_file", + 256 + ], + { + "crc": "0xe4996cd5" + } + ], + [ + "ikev2_set_local_key_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_set_responder", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_ip4_address_t", + "address" + ], + { + "crc": "0xf0d3dc80" + } + ], + [ + "ikev2_set_responder_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_set_ike_transforms", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + [ + "u32", + "crypto_alg" + ], + [ + "u32", + "crypto_key_size" + ], + [ + "u32", + "integ_alg" + ], + [ + "u32", + "dh_group" + ], + { + "crc": "0x936a1a37" + } + ], + [ + "ikev2_set_ike_transforms_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_set_esp_transforms", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + [ + "u32", + "crypto_alg" + ], + [ + "u32", + "crypto_key_size" + ], + [ + "u32", + "integ_alg" + ], + [ + "u32", + "dh_group" + ], + { + "crc": "0x936a1a37" + } + ], + [ + "ikev2_set_esp_transforms_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_set_sa_lifetime", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + [ + "u64", + "lifetime" + ], + [ + "u32", + "lifetime_jitter" + ], + [ + "u32", + "handover" + ], + [ + "u64", + "lifetime_maxdata" + ], + { + "crc": "0x7039feaa" + } + ], + [ + "ikev2_set_sa_lifetime_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_initiate_sa_init", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "name", + 64 + ], + { + "crc": "0xebf79a66" + } + ], + [ + "ikev2_initiate_sa_init_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_initiate_del_ike_sa", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "ispi" + ], + { + "crc": "0x8d125bdd" + } + ], + [ + "ikev2_initiate_del_ike_sa_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_initiate_del_child_sa", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "ispi" + ], + { + "crc": "0x7f004d2e" + } + ], + [ + "ikev2_initiate_del_child_sa_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ikev2_initiate_rekey_child_sa", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "ispi" + ], + { + "crc": "0x7f004d2e" + } + ], + [ + "ikev2_initiate_rekey_child_sa_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "ikev2_plugin_get_version": { + "reply": "ikev2_plugin_get_version_reply" + }, + "ikev2_profile_add_del": { + "reply": "ikev2_profile_add_del_reply" + }, + "ikev2_profile_set_auth": { + "reply": "ikev2_profile_set_auth_reply" + }, + "ikev2_profile_set_id": { + "reply": "ikev2_profile_set_id_reply" + }, + "ikev2_profile_set_ts": { + "reply": "ikev2_profile_set_ts_reply" + }, + "ikev2_set_local_key": { + "reply": "ikev2_set_local_key_reply" + }, + "ikev2_set_responder": { + "reply": "ikev2_set_responder_reply" + }, + "ikev2_set_ike_transforms": { + "reply": "ikev2_set_ike_transforms_reply" + }, + "ikev2_set_esp_transforms": { + "reply": "ikev2_set_esp_transforms_reply" + }, + "ikev2_set_sa_lifetime": { + "reply": "ikev2_set_sa_lifetime_reply" + }, + "ikev2_initiate_sa_init": { + "reply": "ikev2_initiate_sa_init_reply" + }, + "ikev2_initiate_del_ike_sa": { + "reply": "ikev2_initiate_del_ike_sa_reply" + }, + "ikev2_initiate_del_child_sa": { + "reply": "ikev2_initiate_del_child_sa_reply" + }, + "ikev2_initiate_rekey_child_sa": { + "reply": "ikev2_initiate_rekey_child_sa_reply" + } + }, + "options": { + "version": "1.0.1" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x4eab5d22" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/ioam_cache.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/ioam_cache.api.json new file mode 100644 index 0000000..bf9bdeb --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/ioam_cache.api.json @@ -0,0 +1,57 @@ +{ + "types": [], + "messages": [ + [ + "ioam_cache_ip6_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_disable" + ], + { + "crc": "0x47705c03" + } + ], + [ + "ioam_cache_ip6_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "ioam_cache_ip6_enable_disable": { + "reply": "ioam_cache_ip6_enable_disable_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0xd0a0cf20" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/ioam_export.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/ioam_export.api.json new file mode 100644 index 0000000..aedd65d --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/ioam_export.api.json @@ -0,0 +1,351 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "ioam_export_ip6_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_disable" + ], + [ + "vl_api_ip4_address_t", + "collector_address" + ], + [ + "vl_api_ip4_address_t", + "src_address" + ], + { + "crc": "0xe4d4ebfa" + } + ], + [ + "ioam_export_ip6_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "ioam_export_ip6_enable_disable": { + "reply": "ioam_export_ip6_enable_disable_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xc6fdb83f" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/ioam_vxlan_gpe.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/ioam_vxlan_gpe.api.json new file mode 100644 index 0000000..0bc2f0a --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/ioam_vxlan_gpe.api.json @@ -0,0 +1,594 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "vxlan_gpe_ioam_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "id" + ], + [ + "u8", + "trace_ppc" + ], + [ + "bool", + "pow_enable" + ], + [ + "bool", + "trace_enable" + ], + { + "crc": "0x2481bef7" + } + ], + [ + "vxlan_gpe_ioam_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "vxlan_gpe_ioam_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "id" + ], + { + "crc": "0x6b16a45e" + } + ], + [ + "vxlan_gpe_ioam_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "vxlan_gpe_ioam_vni_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + [ + "vl_api_address_t", + "local" + ], + [ + "vl_api_address_t", + "remote" + ], + { + "crc": "0x997161fb" + } + ], + [ + "vxlan_gpe_ioam_vni_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "vxlan_gpe_ioam_vni_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vni" + ], + [ + "vl_api_address_t", + "local" + ], + [ + "vl_api_address_t", + "remote" + ], + { + "crc": "0x997161fb" + } + ], + [ + "vxlan_gpe_ioam_vni_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "vxlan_gpe_ioam_transit_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "outer_fib_index" + ], + [ + "vl_api_address_t", + "dst_addr" + ], + { + "crc": "0x553f5b7b" + } + ], + [ + "vxlan_gpe_ioam_transit_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "vxlan_gpe_ioam_transit_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "outer_fib_index" + ], + [ + "vl_api_address_t", + "dst_addr" + ], + { + "crc": "0x553f5b7b" + } + ], + [ + "vxlan_gpe_ioam_transit_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "vxlan_gpe_ioam_enable": { + "reply": "vxlan_gpe_ioam_enable_reply" + }, + "vxlan_gpe_ioam_disable": { + "reply": "vxlan_gpe_ioam_disable_reply" + }, + "vxlan_gpe_ioam_vni_enable": { + "reply": "vxlan_gpe_ioam_vni_enable_reply" + }, + "vxlan_gpe_ioam_vni_disable": { + "reply": "vxlan_gpe_ioam_vni_disable_reply" + }, + "vxlan_gpe_ioam_transit_enable": { + "reply": "vxlan_gpe_ioam_transit_enable_reply" + }, + "vxlan_gpe_ioam_transit_disable": { + "reply": "vxlan_gpe_ioam_transit_disable_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xf80eb923" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/l2e.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/l2e.api.json new file mode 100644 index 0000000..b1168f7 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/l2e.api.json @@ -0,0 +1,218 @@ +{ + "types": [], + "messages": [ + [ + "l2_emulation", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xae6cfcfb" + } + ], + [ + "l2_emulation_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "l2_emulation": { + "reply": "l2_emulation_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x541d3edd" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/l3xc.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/l3xc.api.json new file mode 100644 index 0000000..bec72fb --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/l3xc.api.json @@ -0,0 +1,841 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ], + [ + "l3xc", + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ip6" + ], + [ + "u8", + "n_paths" + ], + [ + "vl_api_fib_path_t", + "paths", + 0, + "n_paths" + ] + ] + ], + "messages": [ + [ + "l3xc_plugin_get_version", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "l3xc_plugin_get_version_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + { + "crc": "0x9b32cf86" + } + ], + [ + "l3xc_update", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_l3xc_t", + "l3xc" + ], + { + "crc": "0x0787b1d3" + } + ], + [ + "l3xc_update_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stats_index" + ], + { + "crc": "0x1992deab" + } + ], + [ + "l3xc_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ip6" + ], + { + "crc": "0xe7dbef91" + } + ], + [ + "l3xc_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "l3xc_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "l3xc_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_l3xc_t", + "l3xc" + ], + { + "crc": "0xd4f69627" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "l3xc_plugin_get_version": { + "reply": "l3xc_plugin_get_version_reply" + }, + "l3xc_update": { + "reply": "l3xc_update_reply" + }, + "l3xc_del": { + "reply": "l3xc_del_reply" + }, + "l3xc_dump": { + "reply": "l3xc_details", + "stream": true + } + }, + "options": { + "version": "1.0.1" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x80b00c99" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/lacp.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/lacp.api.json new file mode 100644 index 0000000..ca7599b --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/lacp.api.json @@ -0,0 +1,289 @@ +{ + "types": [], + "messages": [ + [ + "sw_interface_lacp_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "sw_interface_lacp_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "interface_name", + 64 + ], + [ + "u32", + "rx_state" + ], + [ + "u32", + "tx_state" + ], + [ + "u32", + "mux_state" + ], + [ + "u32", + "ptx_state" + ], + [ + "string", + "bond_interface_name", + 64 + ], + [ + "u16", + "actor_system_priority" + ], + [ + "vl_api_mac_address_t", + "actor_system" + ], + [ + "u16", + "actor_key" + ], + [ + "u16", + "actor_port_priority" + ], + [ + "u16", + "actor_port_number" + ], + [ + "u8", + "actor_state" + ], + [ + "u16", + "partner_system_priority" + ], + [ + "vl_api_mac_address_t", + "partner_system" + ], + [ + "u16", + "partner_key" + ], + [ + "u16", + "partner_port_priority" + ], + [ + "u16", + "partner_port_number" + ], + [ + "u8", + "partner_state" + ], + { + "crc": "0x745ae0ba" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "sw_interface_lacp_dump": { + "reply": "sw_interface_lacp_details", + "stream": true + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "mac_address": { + "type": "u8", + "length": 6 + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x930086a4" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/lb.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/lb.api.json new file mode 100644 index 0000000..ae9b8d0 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/lb.api.json @@ -0,0 +1,1090 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "lb_vip", + [ + "vl_api_address_with_prefix_t", + "pfx" + ], + [ + "vl_api_ip_proto_t", + "protocol" + ], + [ + "u16", + "port" + ] + ] + ], + "messages": [ + [ + "lb_conf", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "ip4_src_address" + ], + [ + "vl_api_ip6_address_t", + "ip6_src_address" + ], + [ + "u32", + "sticky_buckets_per_core" + ], + [ + "u32", + "flow_timeout" + ], + { + "crc": "0x22ddb739" + } + ], + [ + "lb_conf_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lb_add_del_vip", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_with_prefix_t", + "pfx" + ], + [ + "u8", + "protocol", + { + "default": 255 + } + ], + [ + "u16", + "port" + ], + [ + "vl_api_lb_encap_type_t", + "encap" + ], + [ + "u8", + "dscp" + ], + [ + "vl_api_lb_srv_type_t", + "type" + ], + [ + "u16", + "target_port" + ], + [ + "u16", + "node_port" + ], + [ + "u32", + "new_flows_table_length", + { + "default": 1024 + } + ], + [ + "bool", + "is_del" + ], + { + "crc": "0xd15b7ddc" + } + ], + [ + "lb_add_del_vip_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lb_add_del_as", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_with_prefix_t", + "pfx" + ], + [ + "u8", + "protocol", + { + "default": 255 + } + ], + [ + "u16", + "port" + ], + [ + "vl_api_address_t", + "as_address" + ], + [ + "bool", + "is_del" + ], + [ + "bool", + "is_flush" + ], + { + "crc": "0x78628987" + } + ], + [ + "lb_add_del_as_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lb_flush_vip", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_with_prefix_t", + "pfx" + ], + [ + "u8", + "protocol" + ], + [ + "u16", + "port" + ], + { + "crc": "0x1063f819" + } + ], + [ + "lb_flush_vip_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lb_vip_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_with_prefix_t", + "pfx" + ], + [ + "vl_api_prefix_matcher_t", + "pfx_matcher" + ], + [ + "u8", + "protocol", + { + "default": 255 + } + ], + [ + "u16", + "port" + ], + { + "crc": "0xc7bcb124" + } + ], + [ + "lb_vip_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_lb_vip_t", + "vip" + ], + [ + "vl_api_lb_encap_type_t", + "encap" + ], + [ + "vl_api_ip_dscp_t", + "dscp" + ], + [ + "vl_api_lb_srv_type_t", + "srv_type" + ], + [ + "u16", + "target_port" + ], + [ + "u16", + "flow_table_length" + ], + { + "crc": "0x08f39bed" + } + ], + [ + "lb_as_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_with_prefix_t", + "pfx" + ], + [ + "u8", + "protocol" + ], + [ + "u16", + "port" + ], + { + "crc": "0x1063f819" + } + ], + [ + "lb_as_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_lb_vip_t", + "vip" + ], + [ + "vl_api_address_t", + "app_srv" + ], + [ + "u8", + "flags" + ], + [ + "u32", + "in_use_since" + ], + { + "crc": "0x9c39f60e" + } + ], + [ + "lb_add_del_intf_nat4", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x47d6e753" + } + ], + [ + "lb_add_del_intf_nat4_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "lb_add_del_intf_nat6", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x47d6e753" + } + ], + [ + "lb_add_del_intf_nat6_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_srv_type", + [ + "LB_API_SRV_TYPE_CLUSTERIP", + 0 + ], + [ + "LB_API_SRV_TYPE_NODEPORT", + 1 + ], + [ + "LB_API_SRV_N_TYPES", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_encap_type", + [ + "LB_API_ENCAP_TYPE_GRE4", + 0 + ], + [ + "LB_API_ENCAP_TYPE_GRE6", + 1 + ], + [ + "LB_API_ENCAP_TYPE_L3DSR", + 2 + ], + [ + "LB_API_ENCAP_TYPE_NAT4", + 3 + ], + [ + "LB_API_ENCAP_TYPE_NAT6", + 4 + ], + [ + "LB_API_ENCAP_N_TYPES", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_lkp_type_t", + [ + "LB_API_LKP_SAME_IP_PORT", + 0 + ], + [ + "LB_API_LKP_DIFF_IP_PORT", + 1 + ], + [ + "LB_API_LKP_ALL_PORT_IP", + 2 + ], + [ + "LB_API_LKP_N_TYPES", + 3 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_vip_type", + [ + "LB_API_VIP_TYPE_IP6_GRE6", + 0 + ], + [ + "LB_API_VIP_TYPE_IP6_GRE4", + 1 + ], + [ + "LB_API_VIP_TYPE_IP4_GRE6", + 2 + ], + [ + "LB_API_VIP_TYPE_IP4_GRE4", + 3 + ], + [ + "LB_API_VIP_TYPE_IP4_L3DSR", + 4 + ], + [ + "LB_API_VIP_TYPE_IP4_NAT4", + 5 + ], + [ + "LB_API_VIP_TYPE_IP6_NAT6", + 6 + ], + [ + "LB_API_VIP_N_TYPES", + 7 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_nat_protocol", + [ + "LB_API_NAT_PROTOCOL_UDP", + 6 + ], + [ + "LB_API_NAT_PROTOCOL_TCP", + 23 + ], + [ + "LB_API_NAT_PROTOCOL_ANY", + 4294967295 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "lb_conf": { + "reply": "lb_conf_reply" + }, + "lb_add_del_vip": { + "reply": "lb_add_del_vip_reply" + }, + "lb_add_del_as": { + "reply": "lb_add_del_as_reply" + }, + "lb_flush_vip": { + "reply": "lb_flush_vip_reply" + }, + "lb_vip_dump": { + "reply": "lb_vip_details", + "stream": true + }, + "lb_as_dump": { + "reply": "lb_as_details", + "stream": true + }, + "lb_add_del_intf_nat4": { + "reply": "lb_add_del_intf_nat4_reply" + }, + "lb_add_del_intf_nat6": { + "reply": "lb_add_del_intf_nat6_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x76c36b4c" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/lb_types.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/lb_types.api.json new file mode 100644 index 0000000..0f7f714 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/lb_types.api.json @@ -0,0 +1,437 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "lb_vip", + [ + "vl_api_address_with_prefix_t", + "pfx" + ], + [ + "vl_api_ip_proto_t", + "protocol" + ], + [ + "u16", + "port" + ] + ] + ], + "messages": [], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_srv_type", + [ + "LB_API_SRV_TYPE_CLUSTERIP", + 0 + ], + [ + "LB_API_SRV_TYPE_NODEPORT", + 1 + ], + [ + "LB_API_SRV_N_TYPES", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_encap_type", + [ + "LB_API_ENCAP_TYPE_GRE4", + 0 + ], + [ + "LB_API_ENCAP_TYPE_GRE6", + 1 + ], + [ + "LB_API_ENCAP_TYPE_L3DSR", + 2 + ], + [ + "LB_API_ENCAP_TYPE_NAT4", + 3 + ], + [ + "LB_API_ENCAP_TYPE_NAT6", + 4 + ], + [ + "LB_API_ENCAP_N_TYPES", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_lkp_type_t", + [ + "LB_API_LKP_SAME_IP_PORT", + 0 + ], + [ + "LB_API_LKP_DIFF_IP_PORT", + 1 + ], + [ + "LB_API_LKP_ALL_PORT_IP", + 2 + ], + [ + "LB_API_LKP_N_TYPES", + 3 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_vip_type", + [ + "LB_API_VIP_TYPE_IP6_GRE6", + 0 + ], + [ + "LB_API_VIP_TYPE_IP6_GRE4", + 1 + ], + [ + "LB_API_VIP_TYPE_IP4_GRE6", + 2 + ], + [ + "LB_API_VIP_TYPE_IP4_GRE4", + 3 + ], + [ + "LB_API_VIP_TYPE_IP4_L3DSR", + 4 + ], + [ + "LB_API_VIP_TYPE_IP4_NAT4", + 5 + ], + [ + "LB_API_VIP_TYPE_IP6_NAT6", + 6 + ], + [ + "LB_API_VIP_N_TYPES", + 7 + ], + { + "enumtype": "u32" + } + ], + [ + "lb_nat_protocol", + [ + "LB_API_NAT_PROTOCOL_UDP", + 6 + ], + [ + "LB_API_NAT_PROTOCOL_TCP", + 23 + ], + [ + "LB_API_NAT_PROTOCOL_ANY", + 4294967295 + ], + { + "enumtype": "u32" + } + ] + ], + "services": {}, + "options": {}, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xd04207f3" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/mactime.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/mactime.api.json new file mode 100644 index 0000000..97c348f --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/mactime.api.json @@ -0,0 +1,424 @@ +{ + "types": [ + [ + "time_range", + [ + "f64", + "start" + ], + [ + "f64", + "end" + ] + ], + [ + "mactime_time_range", + [ + "f64", + "start" + ], + [ + "f64", + "end" + ] + ] + ], + "messages": [ + [ + "mactime_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x3865946c" + } + ], + [ + "mactime_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "mactime_add_del_range", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "bool", + "drop" + ], + [ + "bool", + "allow" + ], + [ + "u8", + "allow_quota" + ], + [ + "bool", + "no_udp_10001" + ], + [ + "u64", + "data_quota" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + [ + "string", + "device_name", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_time_range_t", + "ranges", + 0, + "count" + ], + { + "crc": "0x101858ef" + } + ], + [ + "mactime_add_del_range_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "mactime_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "my_table_epoch" + ], + { + "crc": "0x8f454e23" + } + ], + [ + "mactime_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "pool_index" + ], + [ + "vl_api_mac_address_t", + "mac_address" + ], + [ + "u64", + "data_quota" + ], + [ + "u64", + "data_used_in_range" + ], + [ + "u32", + "flags" + ], + [ + "string", + "device_name", + 64 + ], + [ + "u32", + "nranges" + ], + [ + "vl_api_mactime_time_range_t", + "ranges", + 0, + "nranges" + ], + { + "crc": "0x44921c06" + } + ], + [ + "mactime_dump_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "table_epoch" + ], + { + "crc": "0x49bcc753" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "mactime_enable_disable": { + "reply": "mactime_enable_disable_reply" + }, + "mactime_add_del_range": { + "reply": "mactime_add_del_range_reply" + }, + "mactime_dump": { + "reply": "mactime_details", + "stream": true + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "mac_address": { + "type": "u8", + "length": 6 + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xd32f01e0" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/map.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/map.api.json new file mode 100644 index 0000000..065092a --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/map.api.json @@ -0,0 +1,1283 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "map_add_domain", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip6_prefix_t", + "ip6_prefix" + ], + [ + "vl_api_ip4_prefix_t", + "ip4_prefix" + ], + [ + "vl_api_ip6_prefix_t", + "ip6_src" + ], + [ + "u8", + "ea_bits_len" + ], + [ + "u8", + "psid_offset" + ], + [ + "u8", + "psid_length" + ], + [ + "u16", + "mtu" + ], + [ + "string", + "tag", + 64 + ], + { + "crc": "0x7a5a18c9" + } + ], + [ + "map_add_domain_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "index" + ], + [ + "i32", + "retval" + ], + { + "crc": "0x3e6d4e2c" + } + ], + [ + "map_del_domain", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "index" + ], + { + "crc": "0x8ac76db6" + } + ], + [ + "map_del_domain_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_add_del_rule", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "index" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_ip6_address_t", + "ip6_dst" + ], + [ + "u16", + "psid" + ], + { + "crc": "0xc65b32f7" + } + ], + [ + "map_add_del_rule_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_domain_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "map_domain_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "domain_index" + ], + [ + "vl_api_ip6_prefix_t", + "ip6_prefix" + ], + [ + "vl_api_ip4_prefix_t", + "ip4_prefix" + ], + [ + "vl_api_ip6_prefix_t", + "ip6_src" + ], + [ + "u8", + "ea_bits_len" + ], + [ + "u8", + "psid_offset" + ], + [ + "u8", + "psid_length" + ], + [ + "u8", + "flags" + ], + [ + "u16", + "mtu" + ], + [ + "string", + "tag", + 64 + ], + { + "crc": "0xfc1859dd" + } + ], + [ + "map_rule_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "domain_index" + ], + { + "crc": "0xe43e6ff6" + } + ], + [ + "map_rule_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip6_address_t", + "ip6_dst" + ], + [ + "u16", + "psid" + ], + { + "crc": "0xc7cbeea5" + } + ], + [ + "map_if_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_enable" + ], + [ + "bool", + "is_translation" + ], + { + "crc": "0x59bb32f4" + } + ], + [ + "map_if_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_summary_stats", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "map_summary_stats_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u64", + "total_bindings" + ], + [ + "u64", + "total_pkts", + 2 + ], + [ + "u64", + "total_bytes", + 2 + ], + [ + "u64", + "total_ip4_fragments" + ], + [ + "u64", + "total_security_check", + 2 + ], + { + "crc": "0x0e4ace0e" + } + ], + [ + "map_param_set_fragmentation", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "inner" + ], + [ + "bool", + "ignore_df" + ], + { + "crc": "0x9ff54d90" + } + ], + [ + "map_param_set_fragmentation_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_param_set_icmp", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "ip4_err_relay_src" + ], + { + "crc": "0x58210cbf" + } + ], + [ + "map_param_set_icmp_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_param_set_icmp6", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_unreachable" + ], + { + "crc": "0x5d01f8c1" + } + ], + [ + "map_param_set_icmp6_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_param_add_del_pre_resolve", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_ip4_address_t", + "ip4_nh_address" + ], + [ + "vl_api_ip6_address_t", + "ip6_nh_address" + ], + { + "crc": "0x17008c66" + } + ], + [ + "map_param_add_del_pre_resolve_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_param_set_security_check", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable" + ], + [ + "bool", + "fragments" + ], + { + "crc": "0x6abe9836" + } + ], + [ + "map_param_set_security_check_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_param_set_traffic_class", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "copy" + ], + [ + "u8", + "tc_class" + ], + { + "crc": "0x9cac455c" + } + ], + [ + "map_param_set_traffic_class_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_param_set_tcp", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "tcp_mss" + ], + { + "crc": "0x87a825d9" + } + ], + [ + "map_param_set_tcp_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "map_param_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "map_param_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "frag_inner" + ], + [ + "u8", + "frag_ignore_df" + ], + [ + "vl_api_ip4_address_t", + "icmp_ip4_err_relay_src" + ], + [ + "bool", + "icmp6_enable_unreachable" + ], + [ + "vl_api_ip4_address_t", + "ip4_nh_address" + ], + [ + "vl_api_ip6_address_t", + "ip6_nh_address" + ], + [ + "u16", + "ip4_lifetime_ms" + ], + [ + "u16", + "ip4_pool_size" + ], + [ + "u32", + "ip4_buffers" + ], + [ + "f64", + "ip4_ht_ratio" + ], + [ + "bool", + "sec_check_enable" + ], + [ + "bool", + "sec_check_fragments" + ], + [ + "bool", + "tc_copy" + ], + [ + "u8", + "tc_class" + ], + { + "crc": "0x28092156" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "map_add_domain": { + "reply": "map_add_domain_reply" + }, + "map_del_domain": { + "reply": "map_del_domain_reply" + }, + "map_add_del_rule": { + "reply": "map_add_del_rule_reply" + }, + "map_domain_dump": { + "reply": "map_domain_details", + "stream": true + }, + "map_rule_dump": { + "reply": "map_rule_details", + "stream": true + }, + "map_if_enable_disable": { + "reply": "map_if_enable_disable_reply" + }, + "map_summary_stats": { + "reply": "map_summary_stats_reply" + }, + "map_param_set_fragmentation": { + "reply": "map_param_set_fragmentation_reply" + }, + "map_param_set_icmp": { + "reply": "map_param_set_icmp_reply" + }, + "map_param_set_icmp6": { + "reply": "map_param_set_icmp6_reply" + }, + "map_param_add_del_pre_resolve": { + "reply": "map_param_add_del_pre_resolve_reply" + }, + "map_param_set_security_check": { + "reply": "map_param_set_security_check_reply" + }, + "map_param_set_traffic_class": { + "reply": "map_param_set_traffic_class_reply" + }, + "map_param_set_tcp": { + "reply": "map_param_set_tcp_reply" + }, + "map_param_get": { + "reply": "map_param_get_reply" + } + }, + "options": { + "version": "4.1.1" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x42c84657" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/mdata.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/mdata.api.json new file mode 100644 index 0000000..1f4b23e --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/mdata.api.json @@ -0,0 +1,214 @@ +{ + "types": [], + "messages": [ + [ + "mdata_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + { + "crc": "0x2e7b47df" + } + ], + [ + "mdata_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "mdata_enable_disable": { + "reply": "mdata_enable_disable_reply" + } + }, + "options": { + "version": "0.1.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x68055b0c" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/memif.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/memif.api.json new file mode 100644 index 0000000..193e0a1 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/memif.api.json @@ -0,0 +1,516 @@ +{ + "types": [], + "messages": [ + [ + "memif_socket_filename_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "u32", + "socket_id" + ], + [ + "string", + "socket_filename", + 108 + ], + { + "crc": "0xa2ce1a10" + } + ], + [ + "memif_socket_filename_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "memif_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_memif_role_t", + "role" + ], + [ + "vl_api_memif_mode_t", + "mode" + ], + [ + "u8", + "rx_queues" + ], + [ + "u8", + "tx_queues" + ], + [ + "u32", + "id" + ], + [ + "u32", + "socket_id" + ], + [ + "u32", + "ring_size" + ], + [ + "u16", + "buffer_size" + ], + [ + "bool", + "no_zero_copy" + ], + [ + "vl_api_mac_address_t", + "hw_addr" + ], + [ + "string", + "secret", + 24 + ], + { + "crc": "0xb1b25061" + } + ], + [ + "memif_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "memif_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "memif_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "memif_socket_filename_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "socket_id" + ], + [ + "string", + "socket_filename", + 108 + ], + { + "crc": "0x7ff326f7" + } + ], + [ + "memif_socket_filename_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "memif_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_mac_address_t", + "hw_addr" + ], + [ + "u32", + "id" + ], + [ + "vl_api_memif_role_t", + "role" + ], + [ + "vl_api_memif_mode_t", + "mode" + ], + [ + "bool", + "zero_copy" + ], + [ + "u32", + "socket_id" + ], + [ + "u32", + "ring_size" + ], + [ + "u16", + "buffer_size" + ], + [ + "vl_api_if_status_flags_t", + "flags" + ], + [ + "string", + "if_name", + 64 + ], + { + "crc": "0xd0382c4c" + } + ], + [ + "memif_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "memif_role", + [ + "MEMIF_ROLE_API_MASTER", + 0 + ], + [ + "MEMIF_ROLE_API_SLAVE", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "memif_mode", + [ + "MEMIF_MODE_API_ETHERNET", + 0 + ], + [ + "MEMIF_MODE_API_IP", + 1 + ], + [ + "MEMIF_MODE_API_PUNT_INJECT", + 2 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "memif_socket_filename_add_del": { + "reply": "memif_socket_filename_add_del_reply" + }, + "memif_create": { + "reply": "memif_create_reply" + }, + "memif_delete": { + "reply": "memif_delete_reply" + }, + "memif_socket_filename_dump": { + "reply": "memif_socket_filename_details", + "stream": true + }, + "memif_dump": { + "reply": "memif_details", + "stream": true + } + }, + "options": { + "version": "3.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0x88dc56c9" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/nat.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/nat.api.json new file mode 100644 index 0000000..f3382b9 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/nat.api.json @@ -0,0 +1,4157 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "nat44_lb_addr_port", + [ + "vl_api_ip4_address_t", + "addr" + ], + [ + "u16", + "port" + ], + [ + "u8", + "probability" + ], + [ + "u32", + "vrf_id" + ] + ] + ], + "messages": [ + [ + "nat_control_ping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_control_ping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "vpe_pid" + ], + { + "crc": "0xf6b0b8ca" + } + ], + [ + "nat_show_config", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_show_config_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "bool", + "static_mapping_only" + ], + [ + "bool", + "static_mapping_connection_tracking" + ], + [ + "bool", + "deterministic" + ], + [ + "bool", + "endpoint_dependent" + ], + [ + "bool", + "out2in_dpo" + ], + [ + "bool", + "dslite_ce" + ], + [ + "u32", + "translation_buckets" + ], + [ + "u32", + "translation_memory_size" + ], + [ + "u32", + "user_buckets" + ], + [ + "u32", + "user_memory_size" + ], + [ + "u32", + "max_translations_per_user" + ], + [ + "u32", + "outside_vrf_id" + ], + [ + "u32", + "inside_vrf_id" + ], + [ + "u32", + "nat64_bib_buckets" + ], + [ + "u32", + "nat64_bib_memory_size" + ], + [ + "u32", + "nat64_st_buckets" + ], + [ + "u32", + "nat64_st_memory_size" + ], + { + "crc": "0x006a0786" + } + ], + [ + "nat_set_log_level", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_nat_log_level_t", + "log_level" + ], + { + "crc": "0x70076bfe" + } + ], + [ + "nat_set_log_level_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_set_workers", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "worker_mask" + ], + { + "crc": "0xda926638" + } + ], + [ + "nat_set_workers_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_worker_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_worker_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "worker_index" + ], + [ + "u32", + "lcore_id" + ], + [ + "string", + "name", + 64 + ], + { + "crc": "0x84bf06fc" + } + ], + [ + "nat_ipfix_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "domain_id" + ], + [ + "u16", + "src_port" + ], + [ + "bool", + "enable" + ], + { + "crc": "0x9af4a2d2" + } + ], + [ + "nat_ipfix_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_set_timeouts", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "udp" + ], + [ + "u32", + "tcp_established" + ], + [ + "u32", + "tcp_transitory" + ], + [ + "u32", + "icmp" + ], + { + "crc": "0xd4746b16" + } + ], + [ + "nat_set_timeouts_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_get_timeouts", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_get_timeouts_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "udp" + ], + [ + "u32", + "tcp_established" + ], + [ + "u32", + "tcp_transitory" + ], + [ + "u32", + "icmp" + ], + { + "crc": "0x3c4df4e1" + } + ], + [ + "nat_set_addr_and_port_alloc_alg", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "alg" + ], + [ + "u8", + "psid_offset" + ], + [ + "u8", + "psid_length" + ], + [ + "u16", + "psid" + ], + [ + "u16", + "start_port" + ], + [ + "u16", + "end_port" + ], + { + "crc": "0xdeeb746f" + } + ], + [ + "nat_set_addr_and_port_alloc_alg_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_get_addr_and_port_alloc_alg", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_get_addr_and_port_alloc_alg_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "alg" + ], + [ + "u8", + "psid_offset" + ], + [ + "u8", + "psid_length" + ], + [ + "u16", + "psid" + ], + [ + "u16", + "start_port" + ], + [ + "u16", + "end_port" + ], + { + "crc": "0x3607a7d0" + } + ], + [ + "nat_set_mss_clamping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "mss_value" + ], + [ + "bool", + "enable" + ], + { + "crc": "0x25e90abb" + } + ], + [ + "nat_set_mss_clamping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_get_mss_clamping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_get_mss_clamping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u16", + "mss_value" + ], + [ + "bool", + "enable" + ], + { + "crc": "0x1c0b2a78" + } + ], + [ + "nat_ha_set_listener", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + [ + "u16", + "port" + ], + [ + "u32", + "path_mtu" + ], + { + "crc": "0xe4a8cb4e" + } + ], + [ + "nat_ha_set_listener_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_ha_set_failover", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + [ + "u16", + "port" + ], + [ + "u32", + "session_refresh_interval" + ], + { + "crc": "0x718246af" + } + ], + [ + "nat_ha_set_failover_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_ha_get_listener", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_ha_get_listener_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + [ + "u16", + "port" + ], + [ + "u32", + "path_mtu" + ], + { + "crc": "0x123ea41f" + } + ], + [ + "nat_ha_get_failover", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_ha_get_failover_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + [ + "u16", + "port" + ], + [ + "u32", + "session_refresh_interval" + ], + { + "crc": "0xa67d8752" + } + ], + [ + "nat_ha_flush", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_ha_flush_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_ha_resync", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "want_resync_event" + ], + [ + "u32", + "pid" + ], + { + "crc": "0xc8ab9e03" + } + ], + [ + "nat_ha_resync_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_ha_resync_completed_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "u32", + "missed_count" + ], + { + "crc": "0xfdc598fb" + } + ], + [ + "nat44_add_del_address_range", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "first_ip_address" + ], + [ + "vl_api_ip4_address_t", + "last_ip_address" + ], + [ + "u32", + "vrf_id" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + { + "crc": "0xd4c7568c" + } + ], + [ + "nat44_add_del_address_range_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_address_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat44_address_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0x45410ac4" + } + ], + [ + "nat44_interface_add_del_feature", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf3699b83" + } + ], + [ + "nat44_interface_add_del_feature_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_interface_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat44_interface_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5d286289" + } + ], + [ + "nat44_interface_add_del_output_feature", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf3699b83" + } + ], + [ + "nat44_interface_add_del_output_feature_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_interface_output_feature_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat44_interface_output_feature_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5d286289" + } + ], + [ + "nat44_add_del_static_mapping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_ip4_address_t", + "local_ip_address" + ], + [ + "vl_api_ip4_address_t", + "external_ip_address" + ], + [ + "u8", + "protocol" + ], + [ + "u16", + "local_port" + ], + [ + "u16", + "external_port" + ], + [ + "vl_api_interface_index_t", + "external_sw_if_index" + ], + [ + "u32", + "vrf_id" + ], + [ + "string", + "tag", + 64 + ], + { + "crc": "0xe165e83b" + } + ], + [ + "nat44_add_del_static_mapping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_static_mapping_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat44_static_mapping_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_ip4_address_t", + "local_ip_address" + ], + [ + "vl_api_ip4_address_t", + "external_ip_address" + ], + [ + "u8", + "protocol" + ], + [ + "u16", + "local_port" + ], + [ + "u16", + "external_port" + ], + [ + "vl_api_interface_index_t", + "external_sw_if_index" + ], + [ + "u32", + "vrf_id" + ], + [ + "string", + "tag", + 64 + ], + { + "crc": "0x1a433ef7" + } + ], + [ + "nat44_add_del_identity_mapping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + [ + "u8", + "protocol" + ], + [ + "u16", + "port" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "vrf_id" + ], + [ + "string", + "tag", + 64 + ], + { + "crc": "0x8e12743f" + } + ], + [ + "nat44_add_del_identity_mapping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_identity_mapping_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat44_identity_mapping_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + [ + "u8", + "protocol" + ], + [ + "u16", + "port" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "vrf_id" + ], + [ + "string", + "tag", + 64 + ], + { + "crc": "0x36d21351" + } + ], + [ + "nat44_add_del_interface_addr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + { + "crc": "0xfc835325" + } + ], + [ + "nat44_add_del_interface_addr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_interface_addr_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat44_interface_addr_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + { + "crc": "0x3e687514" + } + ], + [ + "nat44_user_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat44_user_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vrf_id" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + [ + "u32", + "nsessions" + ], + [ + "u32", + "nstaticsessions" + ], + { + "crc": "0x355896c2" + } + ], + [ + "nat44_user_session_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0xe1899c98" + } + ], + [ + "nat44_user_session_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "outside_ip_address" + ], + [ + "u16", + "outside_port" + ], + [ + "vl_api_ip4_address_t", + "inside_ip_address" + ], + [ + "u16", + "inside_port" + ], + [ + "u16", + "protocol" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "u64", + "last_heard" + ], + [ + "u64", + "total_bytes" + ], + [ + "u32", + "total_pkts" + ], + [ + "vl_api_ip4_address_t", + "ext_host_address" + ], + [ + "u16", + "ext_host_port" + ], + [ + "vl_api_ip4_address_t", + "ext_host_nat_address" + ], + [ + "u16", + "ext_host_nat_port" + ], + { + "crc": "0x1965fd69" + } + ], + [ + "nat44_add_del_lb_static_mapping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_ip4_address_t", + "external_addr" + ], + [ + "u16", + "external_port" + ], + [ + "u8", + "protocol" + ], + [ + "u32", + "affinity" + ], + [ + "string", + "tag", + 64 + ], + [ + "u32", + "local_num" + ], + [ + "vl_api_nat44_lb_addr_port_t", + "locals", + 0, + "local_num" + ], + { + "crc": "0x53b24611" + } + ], + [ + "nat44_add_del_lb_static_mapping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_lb_static_mapping_add_del_local", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_ip4_address_t", + "external_addr" + ], + [ + "u16", + "external_port" + ], + [ + "u8", + "protocol" + ], + [ + "vl_api_nat44_lb_addr_port_t", + "local" + ], + { + "crc": "0x2910a151" + } + ], + [ + "nat44_lb_static_mapping_add_del_local_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_lb_static_mapping_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat44_lb_static_mapping_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "external_addr" + ], + [ + "u16", + "external_port" + ], + [ + "u8", + "protocol" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "u32", + "affinity" + ], + [ + "string", + "tag", + 64 + ], + [ + "u32", + "local_num" + ], + [ + "vl_api_nat44_lb_addr_port_t", + "locals", + 0, + "local_num" + ], + { + "crc": "0x2267b9e8" + } + ], + [ + "nat44_del_session", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "protocol" + ], + [ + "u16", + "port" + ], + [ + "u32", + "vrf_id" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_ip4_address_t", + "ext_host_address" + ], + [ + "u16", + "ext_host_port" + ], + { + "crc": "0x4c49c387" + } + ], + [ + "nat44_del_session_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_forwarding_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xb3e225d2" + } + ], + [ + "nat44_forwarding_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat44_forwarding_is_enabled", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat44_forwarding_is_enabled_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enabled" + ], + { + "crc": "0x46924a06" + } + ], + [ + "nat_det_add_del_map", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_ip4_address_t", + "in_addr" + ], + [ + "u8", + "in_plen" + ], + [ + "vl_api_ip4_address_t", + "out_addr" + ], + [ + "u8", + "out_plen" + ], + { + "crc": "0x112fde05" + } + ], + [ + "nat_det_add_del_map_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_det_forward", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "in_addr" + ], + { + "crc": "0x7f8a89cd" + } + ], + [ + "nat_det_forward_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u16", + "out_port_lo" + ], + [ + "u16", + "out_port_hi" + ], + [ + "vl_api_ip4_address_t", + "out_addr" + ], + { + "crc": "0xa8ccbdc0" + } + ], + [ + "nat_det_reverse", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "out_port" + ], + [ + "vl_api_ip4_address_t", + "out_addr" + ], + { + "crc": "0xa7573fe1" + } + ], + [ + "nat_det_reverse_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_ip4_address_t", + "in_addr" + ], + { + "crc": "0x34066d48" + } + ], + [ + "nat_det_map_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat_det_map_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "in_addr" + ], + [ + "u8", + "in_plen" + ], + [ + "vl_api_ip4_address_t", + "out_addr" + ], + [ + "u8", + "out_plen" + ], + [ + "u32", + "sharing_ratio" + ], + [ + "u16", + "ports_per_host" + ], + [ + "u32", + "ses_num" + ], + { + "crc": "0x88000ee1" + } + ], + [ + "nat_det_close_session_out", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "out_addr" + ], + [ + "u16", + "out_port" + ], + [ + "vl_api_ip4_address_t", + "ext_addr" + ], + [ + "u16", + "ext_port" + ], + { + "crc": "0xc1b6cbfb" + } + ], + [ + "nat_det_close_session_out_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_det_close_session_in", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "in_addr" + ], + [ + "u16", + "in_port" + ], + [ + "vl_api_ip4_address_t", + "ext_addr" + ], + [ + "u16", + "ext_port" + ], + { + "crc": "0x0a10ef64" + } + ], + [ + "nat_det_close_session_in_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat_det_session_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "user_addr" + ], + { + "crc": "0xe45a3af7" + } + ], + [ + "nat_det_session_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u16", + "in_port" + ], + [ + "vl_api_ip4_address_t", + "ext_addr" + ], + [ + "u16", + "ext_port" + ], + [ + "u16", + "out_port" + ], + [ + "u8", + "state" + ], + [ + "u32", + "expire" + ], + { + "crc": "0x27f3c171" + } + ], + [ + "nat64_add_del_pool_addr_range", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "start_addr" + ], + [ + "vl_api_ip4_address_t", + "end_addr" + ], + [ + "u32", + "vrf_id" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0x21234ef3" + } + ], + [ + "nat64_add_del_pool_addr_range_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat64_pool_addr_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat64_pool_addr_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0x9bb99cdb" + } + ], + [ + "nat64_add_del_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf3699b83" + } + ], + [ + "nat64_add_del_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat64_interface_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat64_interface_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5d286289" + } + ], + [ + "nat64_add_del_static_bib", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip6_address_t", + "i_addr" + ], + [ + "vl_api_ip4_address_t", + "o_addr" + ], + [ + "u16", + "i_port" + ], + [ + "u16", + "o_port" + ], + [ + "u32", + "vrf_id" + ], + [ + "u8", + "proto" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0x90fae58a" + } + ], + [ + "nat64_add_del_static_bib_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat64_bib_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "proto" + ], + { + "crc": "0xcfcb6b75" + } + ], + [ + "nat64_bib_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip6_address_t", + "i_addr" + ], + [ + "vl_api_ip4_address_t", + "o_addr" + ], + [ + "u16", + "i_port" + ], + [ + "u16", + "o_port" + ], + [ + "u32", + "vrf_id" + ], + [ + "u8", + "proto" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "u32", + "ses_num" + ], + { + "crc": "0x62c8541d" + } + ], + [ + "nat64_st_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "proto" + ], + { + "crc": "0xcfcb6b75" + } + ], + [ + "nat64_st_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip6_address_t", + "il_addr" + ], + [ + "vl_api_ip4_address_t", + "ol_addr" + ], + [ + "u16", + "il_port" + ], + [ + "u16", + "ol_port" + ], + [ + "vl_api_ip6_address_t", + "ir_addr" + ], + [ + "vl_api_ip4_address_t", + "or_addr" + ], + [ + "u16", + "r_port" + ], + [ + "u32", + "vrf_id" + ], + [ + "u8", + "proto" + ], + { + "crc": "0xc770d620" + } + ], + [ + "nat64_add_del_prefix", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip6_prefix_t", + "prefix" + ], + [ + "u32", + "vrf_id" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0x727b2f4c" + } + ], + [ + "nat64_add_del_prefix_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat64_prefix_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat64_prefix_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip6_prefix_t", + "prefix" + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0x20568de3" + } + ], + [ + "nat64_add_del_interface_addr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x47d6e753" + } + ], + [ + "nat64_add_del_interface_addr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dslite_add_del_pool_addr_range", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "start_addr" + ], + [ + "vl_api_ip4_address_t", + "end_addr" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0xc448457a" + } + ], + [ + "dslite_add_del_pool_addr_range_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dslite_address_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "dslite_address_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "ip_address" + ], + { + "crc": "0xec26d648" + } + ], + [ + "dslite_set_aftr_addr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "ip4_addr" + ], + [ + "vl_api_ip6_address_t", + "ip6_addr" + ], + { + "crc": "0x1e955f8d" + } + ], + [ + "dslite_set_aftr_addr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dslite_get_aftr_addr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "dslite_get_aftr_addr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_ip4_address_t", + "ip4_addr" + ], + [ + "vl_api_ip6_address_t", + "ip6_addr" + ], + { + "crc": "0x38e30db1" + } + ], + [ + "dslite_set_b4_addr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip4_address_t", + "ip4_addr" + ], + [ + "vl_api_ip6_address_t", + "ip6_addr" + ], + { + "crc": "0x1e955f8d" + } + ], + [ + "dslite_set_b4_addr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "dslite_get_b4_addr", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "dslite_get_b4_addr_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_ip4_address_t", + "ip4_addr" + ], + [ + "vl_api_ip6_address_t", + "ip6_addr" + ], + { + "crc": "0x38e30db1" + } + ], + [ + "nat66_add_del_interface", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf3699b83" + } + ], + [ + "nat66_add_del_interface_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat66_interface_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat66_interface_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_nat_config_flags_t", + "flags" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5d286289" + } + ], + [ + "nat66_add_del_static_mapping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_ip6_address_t", + "local_ip_address" + ], + [ + "vl_api_ip6_address_t", + "external_ip_address" + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0xfb64e50b" + } + ], + [ + "nat66_add_del_static_mapping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nat66_static_mapping_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "nat66_static_mapping_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip6_address_t", + "local_ip_address" + ], + [ + "vl_api_ip6_address_t", + "external_ip_address" + ], + [ + "u32", + "vrf_id" + ], + [ + "u64", + "total_bytes" + ], + [ + "u64", + "total_pkts" + ], + { + "crc": "0x5c568448" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "nat_config_flags", + [ + "NAT_IS_NONE", + 0 + ], + [ + "NAT_IS_TWICE_NAT", + 1 + ], + [ + "NAT_IS_SELF_TWICE_NAT", + 2 + ], + [ + "NAT_IS_OUT2IN_ONLY", + 4 + ], + [ + "NAT_IS_ADDR_ONLY", + 8 + ], + [ + "NAT_IS_OUTSIDE", + 16 + ], + [ + "NAT_IS_INSIDE", + 32 + ], + [ + "NAT_IS_STATIC", + 64 + ], + [ + "NAT_IS_EXT_HOST_VALID", + 128 + ], + { + "enumtype": "u8" + } + ], + [ + "nat_log_level", + [ + "NAT_LOG_NONE", + 0 + ], + [ + "NAT_LOG_ERROR", + 1 + ], + [ + "NAT_LOG_WARNING", + 2 + ], + [ + "NAT_LOG_NOTICE", + 3 + ], + [ + "NAT_LOG_INFO", + 4 + ], + [ + "NAT_LOG_DEBUG", + 5 + ], + { + "enumtype": "u8" + } + ] + ], + "services": { + "nat_ha_resync": { + "reply": "nat_ha_resync_reply", + "events": [ + "nat_ha_resync_completed_event" + ] + }, + "nat_control_ping": { + "reply": "nat_control_ping_reply" + }, + "nat_show_config": { + "reply": "nat_show_config_reply" + }, + "nat_set_log_level": { + "reply": "nat_set_log_level_reply" + }, + "nat_set_workers": { + "reply": "nat_set_workers_reply" + }, + "nat_worker_dump": { + "reply": "nat_worker_details", + "stream": true + }, + "nat_ipfix_enable_disable": { + "reply": "nat_ipfix_enable_disable_reply" + }, + "nat_set_timeouts": { + "reply": "nat_set_timeouts_reply" + }, + "nat_get_timeouts": { + "reply": "nat_get_timeouts_reply" + }, + "nat_set_addr_and_port_alloc_alg": { + "reply": "nat_set_addr_and_port_alloc_alg_reply" + }, + "nat_get_addr_and_port_alloc_alg": { + "reply": "nat_get_addr_and_port_alloc_alg_reply" + }, + "nat_set_mss_clamping": { + "reply": "nat_set_mss_clamping_reply" + }, + "nat_get_mss_clamping": { + "reply": "nat_get_mss_clamping_reply" + }, + "nat_ha_set_listener": { + "reply": "nat_ha_set_listener_reply" + }, + "nat_ha_set_failover": { + "reply": "nat_ha_set_failover_reply" + }, + "nat_ha_get_listener": { + "reply": "nat_ha_get_listener_reply" + }, + "nat_ha_get_failover": { + "reply": "nat_ha_get_failover_reply" + }, + "nat_ha_flush": { + "reply": "nat_ha_flush_reply" + }, + "nat44_add_del_address_range": { + "reply": "nat44_add_del_address_range_reply" + }, + "nat44_address_dump": { + "reply": "nat44_address_details", + "stream": true + }, + "nat44_interface_add_del_feature": { + "reply": "nat44_interface_add_del_feature_reply" + }, + "nat44_interface_dump": { + "reply": "nat44_interface_details", + "stream": true + }, + "nat44_interface_add_del_output_feature": { + "reply": "nat44_interface_add_del_output_feature_reply" + }, + "nat44_interface_output_feature_dump": { + "reply": "nat44_interface_output_feature_details", + "stream": true + }, + "nat44_add_del_static_mapping": { + "reply": "nat44_add_del_static_mapping_reply" + }, + "nat44_static_mapping_dump": { + "reply": "nat44_static_mapping_details", + "stream": true + }, + "nat44_add_del_identity_mapping": { + "reply": "nat44_add_del_identity_mapping_reply" + }, + "nat44_identity_mapping_dump": { + "reply": "nat44_identity_mapping_details", + "stream": true + }, + "nat44_add_del_interface_addr": { + "reply": "nat44_add_del_interface_addr_reply" + }, + "nat44_interface_addr_dump": { + "reply": "nat44_interface_addr_details", + "stream": true + }, + "nat44_user_dump": { + "reply": "nat44_user_details", + "stream": true + }, + "nat44_user_session_dump": { + "reply": "nat44_user_session_details", + "stream": true + }, + "nat44_add_del_lb_static_mapping": { + "reply": "nat44_add_del_lb_static_mapping_reply" + }, + "nat44_lb_static_mapping_add_del_local": { + "reply": "nat44_lb_static_mapping_add_del_local_reply" + }, + "nat44_lb_static_mapping_dump": { + "reply": "nat44_lb_static_mapping_details", + "stream": true + }, + "nat44_del_session": { + "reply": "nat44_del_session_reply" + }, + "nat44_forwarding_enable_disable": { + "reply": "nat44_forwarding_enable_disable_reply" + }, + "nat44_forwarding_is_enabled": { + "reply": "nat44_forwarding_is_enabled_reply" + }, + "nat_det_add_del_map": { + "reply": "nat_det_add_del_map_reply" + }, + "nat_det_forward": { + "reply": "nat_det_forward_reply" + }, + "nat_det_reverse": { + "reply": "nat_det_reverse_reply" + }, + "nat_det_map_dump": { + "reply": "nat_det_map_details", + "stream": true + }, + "nat_det_close_session_out": { + "reply": "nat_det_close_session_out_reply" + }, + "nat_det_close_session_in": { + "reply": "nat_det_close_session_in_reply" + }, + "nat_det_session_dump": { + "reply": "nat_det_session_details", + "stream": true + }, + "nat64_add_del_pool_addr_range": { + "reply": "nat64_add_del_pool_addr_range_reply" + }, + "nat64_pool_addr_dump": { + "reply": "nat64_pool_addr_details", + "stream": true + }, + "nat64_add_del_interface": { + "reply": "nat64_add_del_interface_reply" + }, + "nat64_interface_dump": { + "reply": "nat64_interface_details", + "stream": true + }, + "nat64_add_del_static_bib": { + "reply": "nat64_add_del_static_bib_reply" + }, + "nat64_bib_dump": { + "reply": "nat64_bib_details", + "stream": true + }, + "nat64_st_dump": { + "reply": "nat64_st_details", + "stream": true + }, + "nat64_add_del_prefix": { + "reply": "nat64_add_del_prefix_reply" + }, + "nat64_prefix_dump": { + "reply": "nat64_prefix_details", + "stream": true + }, + "nat64_add_del_interface_addr": { + "reply": "nat64_add_del_interface_addr_reply" + }, + "dslite_add_del_pool_addr_range": { + "reply": "dslite_add_del_pool_addr_range_reply" + }, + "dslite_address_dump": { + "reply": "dslite_address_details", + "stream": true + }, + "dslite_set_aftr_addr": { + "reply": "dslite_set_aftr_addr_reply" + }, + "dslite_get_aftr_addr": { + "reply": "dslite_get_aftr_addr_reply" + }, + "dslite_set_b4_addr": { + "reply": "dslite_set_b4_addr_reply" + }, + "dslite_get_b4_addr": { + "reply": "dslite_get_b4_addr_reply" + }, + "nat66_add_del_interface": { + "reply": "nat66_add_del_interface_reply" + }, + "nat66_interface_dump": { + "reply": "nat66_interface_details", + "stream": true + }, + "nat66_add_del_static_mapping": { + "reply": "nat66_add_del_static_mapping_reply" + }, + "nat66_static_mapping_dump": { + "reply": "nat66_static_mapping_details", + "stream": true + } + }, + "options": { + "version": "5.2.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xef1a1c94" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/nsh.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/nsh.api.json new file mode 100644 index 0000000..fd8e422 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/nsh.api.json @@ -0,0 +1,499 @@ +{ + "types": [], + "messages": [ + [ + "nsh_add_del_entry", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "u32", + "nsp_nsi" + ], + [ + "u8", + "md_type" + ], + [ + "u8", + "ver_o_c" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "length" + ], + [ + "u8", + "next_protocol" + ], + [ + "u32", + "c1" + ], + [ + "u32", + "c2" + ], + [ + "u32", + "c3" + ], + [ + "u32", + "c4" + ], + [ + "u8", + "tlv_length" + ], + [ + "u8", + "tlv", + 248 + ], + { + "crc": "0x7dea480b" + } + ], + [ + "nsh_add_del_entry_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "entry_index" + ], + { + "crc": "0x6296a9eb" + } + ], + [ + "nsh_entry_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "entry_index" + ], + { + "crc": "0xcdaf8ccb" + } + ], + [ + "nsh_entry_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "entry_index" + ], + [ + "u32", + "nsp_nsi" + ], + [ + "u8", + "md_type" + ], + [ + "u8", + "ver_o_c" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "length" + ], + [ + "u8", + "next_protocol" + ], + [ + "u32", + "c1" + ], + [ + "u32", + "c2" + ], + [ + "u32", + "c3" + ], + [ + "u32", + "c4" + ], + [ + "u8", + "tlv_length" + ], + [ + "u8", + "tlv", + 248 + ], + { + "crc": "0x046fb556" + } + ], + [ + "nsh_add_del_map", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "u32", + "nsp_nsi" + ], + [ + "u32", + "mapped_nsp_nsi" + ], + [ + "u32", + "nsh_action" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_interface_index_t", + "rx_sw_if_index" + ], + [ + "u32", + "next_node" + ], + { + "crc": "0x898d857d" + } + ], + [ + "nsh_add_del_map_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "map_index" + ], + { + "crc": "0xb2b127ef" + } + ], + [ + "nsh_map_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "map_index" + ], + { + "crc": "0x8fc06b82" + } + ], + [ + "nsh_map_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "map_index" + ], + [ + "u32", + "nsp_nsi" + ], + [ + "u32", + "mapped_nsp_nsi" + ], + [ + "u32", + "nsh_action" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_interface_index_t", + "rx_sw_if_index" + ], + [ + "u32", + "next_node" + ], + { + "crc": "0xb34ac8a1" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "nsh_add_del_entry": { + "reply": "nsh_add_del_entry_reply" + }, + "nsh_entry_dump": { + "reply": "nsh_entry_details", + "stream": true + }, + "nsh_add_del_map": { + "reply": "nsh_add_del_map_reply" + }, + "nsh_map_dump": { + "reply": "nsh_map_details", + "stream": true + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xac2c8897" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/nsim.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/nsim.api.json new file mode 100644 index 0000000..1e1e9fa --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/nsim.api.json @@ -0,0 +1,324 @@ +{ + "types": [], + "messages": [ + [ + "nsim_cross_connect_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + [ + "vl_api_interface_index_t", + "sw_if_index0" + ], + [ + "vl_api_interface_index_t", + "sw_if_index1" + ], + { + "crc": "0x16f70bdf" + } + ], + [ + "nsim_cross_connect_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nsim_output_feature_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x3865946c" + } + ], + [ + "nsim_output_feature_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "nsim_configure", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "delay_in_usec" + ], + [ + "u32", + "average_packet_size" + ], + [ + "u64", + "bandwidth_in_bits_per_second" + ], + [ + "u32", + "packets_per_drop" + ], + { + "crc": "0x16ed400f" + } + ], + [ + "nsim_configure_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "nsim_cross_connect_enable_disable": { + "reply": "nsim_cross_connect_enable_disable_reply" + }, + "nsim_output_feature_enable_disable": { + "reply": "nsim_output_feature_enable_disable_reply" + }, + "nsim_configure": { + "reply": "nsim_configure_reply" + } + }, + "options": { + "version": "2.1.1" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xd61e346f" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/oddbuf.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/oddbuf.api.json new file mode 100644 index 0000000..da2baa5 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/oddbuf.api.json @@ -0,0 +1,218 @@ +{ + "types": [], + "messages": [ + [ + "oddbuf_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable_disable" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x3865946c" + } + ], + [ + "oddbuf_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "oddbuf_enable_disable": { + "reply": "oddbuf_enable_disable_reply" + } + }, + "options": { + "version": "0.1.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x570f3132" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/pot.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/pot.api.json new file mode 100644 index 0000000..c15eed4 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/pot.api.json @@ -0,0 +1,258 @@ +{ + "types": [], + "messages": [ + [ + "pot_profile_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "id" + ], + [ + "u8", + "validator" + ], + [ + "u64", + "secret_key" + ], + [ + "u64", + "secret_share" + ], + [ + "u64", + "prime" + ], + [ + "u8", + "max_bits" + ], + [ + "u64", + "lpc" + ], + [ + "u64", + "polynomial_public" + ], + [ + "string", + "list_name", + 0 + ], + { + "crc": "0xad5da3a3" + } + ], + [ + "pot_profile_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "pot_profile_activate", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "id" + ], + [ + "string", + "list_name", + 0 + ], + { + "crc": "0x0770af98" + } + ], + [ + "pot_profile_activate_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "pot_profile_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "list_name", + 0 + ], + { + "crc": "0xcd63f53b" + } + ], + [ + "pot_profile_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "pot_profile_show_config_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "id" + ], + { + "crc": "0x005b7d59" + } + ], + [ + "pot_profile_show_config_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "id" + ], + [ + "u8", + "validator" + ], + [ + "u64", + "secret_key" + ], + [ + "u64", + "secret_share" + ], + [ + "u64", + "prime" + ], + [ + "u64", + "bit_mask" + ], + [ + "u64", + "lpc" + ], + [ + "u64", + "polynomial_public" + ], + { + "crc": "0xb7ce0618" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "pot_profile_add": { + "reply": "pot_profile_add_reply" + }, + "pot_profile_activate": { + "reply": "pot_profile_activate_reply" + }, + "pot_profile_del": { + "reply": "pot_profile_del_reply" + }, + "pot_profile_show_config_dump": { + "reply": "pot_profile_show_config_details", + "stream": true + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0xa9d8e55c" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/pppoe.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/pppoe.api.json new file mode 100644 index 0000000..c34bf3a --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/pppoe.api.json @@ -0,0 +1,590 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "pppoe_add_del_session", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "u16", + "session_id" + ], + [ + "vl_api_address_t", + "client_ip" + ], + [ + "u32", + "decap_vrf_id" + ], + [ + "vl_api_mac_address_t", + "client_mac" + ], + { + "crc": "0x46ace853" + } + ], + [ + "pppoe_add_del_session_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "pppoe_session_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "pppoe_session_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u16", + "session_id" + ], + [ + "vl_api_address_t", + "client_ip" + ], + [ + "vl_api_interface_index_t", + "encap_if_index" + ], + [ + "u32", + "decap_vrf_id" + ], + [ + "vl_api_mac_address_t", + "local_mac" + ], + [ + "vl_api_mac_address_t", + "client_mac" + ], + { + "crc": "0x332bc742" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "pppoe_add_del_session": { + "reply": "pppoe_add_del_session_reply" + }, + "pppoe_session_dump": { + "reply": "pppoe_session_details", + "stream": true + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xb83e4d5f" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/rdma.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/rdma.api.json new file mode 100644 index 0000000..692e604 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/rdma.api.json @@ -0,0 +1,313 @@ +{ + "types": [], + "messages": [ + [ + "rdma_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "host_if", + 64 + ], + [ + "string", + "name", + 64 + ], + [ + "u16", + "rxq_num", + { + "default": 1 + } + ], + [ + "u16", + "rxq_size", + { + "default": 1024 + } + ], + [ + "u16", + "txq_size", + { + "default": 1024 + } + ], + [ + "vl_api_rdma_mode_t", + "mode", + { + "default": 0 + } + ], + { + "crc": "0x076fe418" + } + ], + [ + "rdma_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "rdma_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "rdma_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "rdma_mode", + [ + "RDMA_API_MODE_AUTO", + 0 + ], + [ + "RDMA_API_MODE_IBV", + 1 + ], + [ + "RDMA_API_MODE_DV", + 2 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "rdma_create": { + "reply": "rdma_create_reply" + }, + "rdma_delete": { + "reply": "rdma_delete_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0x5ce233e0" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/sctp.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/sctp.api.json new file mode 100644 index 0000000..170ef26 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/sctp.api.json @@ -0,0 +1,175 @@ +{ + "types": [], + "messages": [ + [ + "sctp_add_src_dst_connection", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u32", + "vrf_id" + ], + [ + "u8", + "src_address", + 16 + ], + [ + "u8", + "dst_address", + 16 + ], + { + "crc": "0x45c59b2f" + } + ], + [ + "sctp_add_src_dst_connection_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sctp_del_src_dst_connection", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u32", + "vrf_id" + ], + [ + "u8", + "src_address", + 16 + ], + [ + "u8", + "dst_address", + 16 + ], + { + "crc": "0x45c59b2f" + } + ], + [ + "sctp_del_src_dst_connection_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sctp_config", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "never_delay_sack" + ], + [ + "u8", + "never_bundle" + ], + { + "crc": "0x7617eced" + } + ], + [ + "sctp_config_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "sctp_add_src_dst_connection": { + "reply": "sctp_add_src_dst_connection_reply" + }, + "sctp_del_src_dst_connection": { + "reply": "sctp_del_src_dst_connection_reply" + }, + "sctp_config": { + "reply": "sctp_config_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x35f411c4" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/stn.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/stn.api.json new file mode 100644 index 0000000..abb385e --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/stn.api.json @@ -0,0 +1,550 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "stn_add_del_rule", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_t", + "ip_address" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_add" + ], + { + "crc": "0x53f751e6" + } + ], + [ + "stn_add_del_rule_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "stn_rules_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "stn_rules_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_t", + "ip_address" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xb0f6606c" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "stn_add_del_rule": { + "reply": "stn_add_del_rule_reply" + }, + "stn_rules_dump": { + "reply": "stn_rules_details", + "stream": true + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x619d8f3" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/svs.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/svs.api.json new file mode 100644 index 0000000..942d112 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/svs.api.json @@ -0,0 +1,707 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "svs_plugin_get_version", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "svs_plugin_get_version_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + { + "crc": "0x9b32cf86" + } + ], + [ + "svs_table_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_address_family_t", + "af" + ], + [ + "u32", + "table_id" + ], + { + "crc": "0x7d21cb2a" + } + ], + [ + "svs_table_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "svs_route_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add" + ], + [ + "vl_api_prefix_t", + "prefix" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "source_table_id" + ], + { + "crc": "0xd39e31fc" + } + ], + [ + "svs_route_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "svs_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_enable" + ], + [ + "vl_api_address_family_t", + "af" + ], + [ + "u32", + "table_id" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x634b89d2" + } + ], + [ + "svs_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "svs_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "svs_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_family_t", + "af" + ], + { + "crc": "0xb8523d64" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "svs_plugin_get_version": { + "reply": "svs_plugin_get_version_reply" + }, + "svs_table_add_del": { + "reply": "svs_table_add_del_reply" + }, + "svs_route_add_del": { + "reply": "svs_route_add_del_reply" + }, + "svs_enable_disable": { + "reply": "svs_enable_disable_reply" + }, + "svs_dump": { + "reply": "svs_details", + "stream": true + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "interface_index": { + "type": "u32" + } + }, + "vl_api_version": "0xf870d4cb" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/tls_openssl.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/tls_openssl.api.json new file mode 100644 index 0000000..1d9b9e6 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/tls_openssl.api.json @@ -0,0 +1,72 @@ +{ + "types": [], + "messages": [ + [ + "tls_openssl_set_engine", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "async_enable" + ], + [ + "u8", + "engine", + 64 + ], + [ + "u8", + "algorithm", + 64 + ], + [ + "u8", + "ciphers", + 64 + ], + { + "crc": "0xe34d95c1" + } + ], + [ + "tls_openssl_set_engine_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "tls_openssl_set_engine": { + "reply": "tls_openssl_set_engine_reply" + } + }, + "options": { + "version": "2.0.0" + }, + "aliases": {}, + "vl_api_version": "0x7386fbcd" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/trace.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/trace.api.json new file mode 100644 index 0000000..b6d5e68 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/trace.api.json @@ -0,0 +1,171 @@ +{ + "types": [], + "messages": [ + [ + "trace_profile_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "trace_type" + ], + [ + "u8", + "num_elts" + ], + [ + "u8", + "trace_tsp" + ], + [ + "u32", + "node_id" + ], + [ + "u32", + "app_data" + ], + { + "crc": "0xde08aa6d" + } + ], + [ + "trace_profile_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "trace_profile_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "trace_profile_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "trace_profile_show_config", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "trace_profile_show_config_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u8", + "trace_type" + ], + [ + "u8", + "num_elts" + ], + [ + "u8", + "trace_tsp" + ], + [ + "u32", + "node_id" + ], + [ + "u32", + "app_data" + ], + { + "crc": "0x0f1d374c" + } + ] + ], + "unions": [], + "enums": [], + "services": { + "trace_profile_add": { + "reply": "trace_profile_add_reply" + }, + "trace_profile_del": { + "reply": "trace_profile_del_reply" + }, + "trace_profile_show_config": { + "reply": "trace_profile_show_config_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": {}, + "vl_api_version": "0x397cbf90" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/udp_ping.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/udp_ping.api.json new file mode 100644 index 0000000..8881a39 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/udp_ping.api.json @@ -0,0 +1,423 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "udp_ping_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_address_t", + "src_ip_address" + ], + [ + "vl_api_address_t", + "dst_ip_address" + ], + [ + "u16", + "start_src_port" + ], + [ + "u16", + "end_src_port" + ], + [ + "u16", + "start_dst_port" + ], + [ + "u16", + "end_dst_port" + ], + [ + "u16", + "interval" + ], + [ + "u8", + "dis" + ], + [ + "u8", + "fault_det" + ], + [ + "u8", + "reserve", + 3 + ], + { + "crc": "0xc692b188" + } + ], + [ + "udp_ping_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "udp_ping_export", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xb3e225d2" + } + ], + [ + "udp_ping_export_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "udp_ping_add_del": { + "reply": "udp_ping_add_del_reply" + }, + "udp_ping_export": { + "reply": "udp_ping_export_reply" + } + }, + "options": { + "version": "3.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0x5a416f51" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/vmxnet3.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/vmxnet3.api.json new file mode 100644 index 0000000..a0d4768 --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/vmxnet3.api.json @@ -0,0 +1,418 @@ +{ + "types": [ + [ + "vmxnet3_tx_list", + [ + "u16", + "tx_qsize" + ], + [ + "u16", + "tx_next" + ], + [ + "u16", + "tx_produce" + ], + [ + "u16", + "tx_consume" + ] + ], + [ + "vmxnet3_rx_list", + [ + "u16", + "rx_qsize" + ], + [ + "u16", + "rx_fill", + 2 + ], + [ + "u16", + "rx_next" + ], + [ + "u16", + "rx_produce", + 2 + ], + [ + "u16", + "rx_consume", + 2 + ] + ] + ], + "messages": [ + [ + "vmxnet3_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "pci_addr" + ], + [ + "i32", + "enable_elog" + ], + [ + "u16", + "rxq_size" + ], + [ + "u16", + "rxq_num" + ], + [ + "u16", + "txq_size" + ], + [ + "u16", + "txq_num" + ], + [ + "u8", + "bind" + ], + [ + "bool", + "enable_gso" + ], + { + "crc": "0x71a07314" + } + ], + [ + "vmxnet3_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0x5383d31f" + } + ], + [ + "vmxnet3_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "vmxnet3_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "vmxnet3_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "string", + "if_name", + 64 + ], + [ + "vl_api_mac_address_t", + "hw_addr" + ], + [ + "u32", + "pci_addr" + ], + [ + "u8", + "version" + ], + [ + "bool", + "admin_up_down" + ], + [ + "u8", + "rx_count" + ], + [ + "vl_api_vmxnet3_rx_list_t", + "rx_list", + 16 + ], + [ + "u8", + "tx_count" + ], + [ + "vl_api_vmxnet3_tx_list_t", + "tx_list", + 8 + ], + { + "crc": "0x829ba055" + } + ], + [ + "vmxnet3_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ] + ], + "unions": [], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 1 + ], + [ + "MTU_PROTO_API_IP4", + 2 + ], + [ + "MTU_PROTO_API_IP6", + 3 + ], + [ + "MTU_PROTO_API_MPLS", + 4 + ], + [ + "MTU_PROTO_API_N", + 5 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 1 + ], + [ + "IF_API_TYPE_SUB", + 2 + ], + [ + "IF_API_TYPE_P2P", + 3 + ], + [ + "IF_API_TYPE_PIPE", + 4 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "vmxnet3_create": { + "reply": "vmxnet3_create_reply" + }, + "vmxnet3_delete": { + "reply": "vmxnet3_delete_reply" + }, + "vmxnet3_dump": { + "reply": "vmxnet3_details", + "stream": true + } + }, + "options": { + "version": "1.1.0" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0xe89a60f7" +} diff --git a/internal/testbinapi/binapi2001/.vppapi/plugins/vxlan_gpe_ioam_export.api.json b/internal/testbinapi/binapi2001/.vppapi/plugins/vxlan_gpe_ioam_export.api.json new file mode 100644 index 0000000..18acecb --- /dev/null +++ b/internal/testbinapi/binapi2001/.vppapi/plugins/vxlan_gpe_ioam_export.api.json @@ -0,0 +1,351 @@ +{ + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ] + ], + "messages": [ + [ + "vxlan_gpe_ioam_export_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_disable" + ], + [ + "vl_api_ip4_address_t", + "collector_address" + ], + [ + "vl_api_ip4_address_t", + "src_address" + ], + { + "crc": "0xe4d4ebfa" + } + ], + [ + "vxlan_gpe_ioam_export_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_AH", + 50 + ], + [ + "IP_API_PROTO_ESP", + 51 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "vxlan_gpe_ioam_export_enable_disable": { + "reply": "vxlan_gpe_ioam_export_enable_disable_reply" + } + }, + "options": { + "version": "1.0.0" + }, + "aliases": { + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + } + }, + "vl_api_version": "0xc6fdb83f" +} diff --git a/internal/testbinapi/binapi2001/abf/abf.ba.go b/internal/testbinapi/binapi2001/abf/abf.ba.go new file mode 100644 index 0000000..a7b67bd --- /dev/null +++ b/internal/testbinapi/binapi2001/abf/abf.ba.go @@ -0,0 +1,1569 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. +// versions: +// binapi-generator: v0.4.0-dev +// VPP: 20.01 +// source: .vppapi/plugins/abf.api.json + +// Package abf contains generated bindings for API file abf.api. +// +// Contents: +// 6 aliases +// 13 enums +// 11 structs +// 1 union +// 10 messages +// +package abf + +import ( + "fmt" + api "git.fd.io/govpp.git/api" + codec "git.fd.io/govpp.git/codec" + "net" + "strconv" + "strings" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the GoVPP api package it is being compiled against. +// A compilation error at this line likely means your copy of the +// GoVPP api package needs to be updated. +const _ = api.GoVppAPIPackageIsVersion2 + +const ( + APIFile = "abf" + APIVersion = "1.0.0" + VersionCrc = 0xc2e5c644 +) + +// AddressFamily defines enum 'address_family'. +type AddressFamily uint32 + +const ( + ADDRESS_IP4 AddressFamily = 0 + ADDRESS_IP6 AddressFamily = 1 +) + +var ( + AddressFamily_name = map[uint32]string{ + 0: "ADDRESS_IP4", + 1: "ADDRESS_IP6", + } + AddressFamily_value = map[string]uint32{ + "ADDRESS_IP4": 0, + "ADDRESS_IP6": 1, + } +) + +func (x AddressFamily) String() string { + s, ok := AddressFamily_name[uint32(x)] + if ok { + return s + } + return "AddressFamily(" + strconv.Itoa(int(x)) + ")" +} + +// FibPathFlags defines enum 'fib_path_flags'. +type FibPathFlags uint32 + +const ( + FIB_API_PATH_FLAG_NONE FibPathFlags = 0 + FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED FibPathFlags = 1 + FIB_API_PATH_FLAG_RESOLVE_VIA_HOST FibPathFlags = 2 + FIB_API_PATH_FLAG_POP_PW_CW FibPathFlags = 4 +) + +var ( + FibPathFlags_name = map[uint32]string{ + 0: "FIB_API_PATH_FLAG_NONE", + 1: "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 2: "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 4: "FIB_API_PATH_FLAG_POP_PW_CW", + } + FibPathFlags_value = map[string]uint32{ + "FIB_API_PATH_FLAG_NONE": 0, + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED": 1, + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST": 2, + "FIB_API_PATH_FLAG_POP_PW_CW": 4, + } +) + +func (x FibPathFlags) String() string { + s, ok := FibPathFlags_name[uint32(x)] + if ok { + return s + } + str := func(n uint32) string { + s, ok := FibPathFlags_name[uint32(n)] + if ok { + return s + } + return "FibPathFlags(" + strconv.Itoa(int(n)) + ")" + } + for i := uint32(0); i <= 32; i++ { + val := uint32(x) + if val&(1<