aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-07-22 04:40:55 +0200
committerOndrej Fabry <ofabry@cisco.com>2020-07-22 04:40:55 +0200
commit58da9ac6e691a8c660eb8ca838a154e11da0db68 (patch)
treea1bbda04c6d0621ce0fc20779276620f1820190b
parenta155cd438c6558da266c1c5931361ea088b35653 (diff)
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 <ofabry@cisco.com>
-rw-r--r--Makefile7
-rw-r--r--api/binapi.go18
-rw-r--r--binapi/abf/abf.ba.go216
-rw-r--r--binapi/acl/acl.ba.go520
-rw-r--r--binapi/af_packet/af_packet.ba.go84
-rw-r--r--binapi/arp/arp.ba.go86
-rw-r--r--binapi/avf/avf.ba.go56
-rw-r--r--binapi/bfd/bfd.ba.go379
-rw-r--r--binapi/bier/bier.ba.go504
-rw-r--r--binapi/bond/bond.ba.go160
-rw-r--r--binapi/builtinurl/builtinurl.ba.go22
-rw-r--r--binapi/cdp/cdp.ba.go22
-rw-r--r--binapi/classify/classify.ba.go462
-rw-r--r--binapi/cop/cop.ba.go46
-rw-r--r--binapi/ct6/ct6.ba.go22
-rw-r--r--binapi/dhcp/dhcp.ba.go482
-rw-r--r--binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go22
-rw-r--r--binapi/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go46
-rw-r--r--binapi/dns/dns.ba.go130
-rw-r--r--binapi/dslite/dslite.ba.go128
-rw-r--r--binapi/feature/feature.ba.go22
-rw-r--r--binapi/flowprobe/flowprobe.ba.go48
-rw-r--r--binapi/gbp/gbp.ba.go710
-rw-r--r--binapi/gen.go (renamed from gen.go)6
-rw-r--r--binapi/geneve/geneve.ba.go82
-rw-r--r--binapi/gre/gre.ba.go60
-rw-r--r--binapi/gso/gso.ba.go22
-rw-r--r--binapi/gtpu/gtpu.ba.go110
-rw-r--r--binapi/http_static/http_static.ba.go30
-rw-r--r--binapi/igmp/igmp.ba.go223
-rw-r--r--binapi/ikev2/ikev2.ba.go458
-rw-r--r--binapi/interface/interface.ba.go693
-rw-r--r--binapi/ioam_cache/ioam_cache.ba.go22
-rw-r--r--binapi/ioam_export/ioam_export.ba.go22
-rw-r--r--binapi/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go158
-rw-r--r--binapi/ip/ip.ba.go1024
-rw-r--r--binapi/ip6_nd/ip6_nd.ba.go205
-rw-r--r--binapi/ip_neighbor/ip_neighbor.ba.go187
-rw-r--r--binapi/ip_types/ip_types.ba.go8
-rw-r--r--binapi/ipfix_export/ipfix_export.ba.go178
-rw-r--r--binapi/ipip/ipip.ba.go132
-rw-r--r--binapi/ipsec/ipsec.ba.go520
-rw-r--r--binapi/ipsec_types/ipsec_types.ba.go4
-rw-r--r--binapi/l2/l2.ba.go682
-rw-r--r--binapi/l2e/l2e.ba.go22
-rw-r--r--binapi/l2tp/l2tp.ba.go136
-rw-r--r--binapi/l3xc/l3xc.ba.go184
-rw-r--r--binapi/lacp/lacp.ba.go46
-rw-r--r--binapi/lb/lb.ba.go260
-rw-r--r--binapi/lisp/lisp.ba.go752
-rw-r--r--binapi/lisp_gpe/lisp_gpe.ba.go284
-rw-r--r--binapi/lisp_types/lisp_types.ba.go20
-rw-r--r--binapi/lldp/lldp.ba.go53
-rw-r--r--binapi/mactime/mactime.ba.go115
-rw-r--r--binapi/map/map.ba.go398
-rw-r--r--binapi/mdata/mdata.ba.go22
-rw-r--r--binapi/memclnt/memclnt.ba.go303
-rw-r--r--binapi/memif/memif.ba.go126
-rw-r--r--binapi/mpls/mpls.ba.go402
-rw-r--r--binapi/nat/nat.ba.go1607
-rw-r--r--binapi/nsh/nsh.ba.go162
-rw-r--r--binapi/nsim/nsim.ba.go74
-rw-r--r--binapi/oddbuf/oddbuf.ba.go22
-rw-r--r--binapi/one/one.ba.go1318
-rw-r--r--binapi/p2p_ethernet/p2p_ethernet.ba.go46
-rw-r--r--binapi/pg/pg.ba.go70
-rw-r--r--binapi/pipe/pipe.ba.go92
-rw-r--r--binapi/policer/policer.ba.go86
-rw-r--r--binapi/pot/pot.ba.go124
-rw-r--r--binapi/pppoe/pppoe.ba.go52
-rw-r--r--binapi/punt/punt.ba.go132
-rw-r--r--binapi/qos/qos.ba.go245
-rw-r--r--binapi/rd_cp/rd_cp.ba.go22
-rw-r--r--binapi/rdma/rdma.ba.go58
-rw-r--r--binapi/session/session.ba.go337
-rw-r--r--binapi/span/span.ba.go40
-rw-r--r--binapi/sr/sr.ba.go315
-rw-r--r--binapi/sr_mpls/sr_mpls.ba.go152
-rw-r--r--binapi/stn/stn.ba.go44
-rw-r--r--binapi/svs/svs.ba.go120
-rw-r--r--binapi/syslog/syslog.ba.go104
-rw-r--r--binapi/tapv2/tapv2.ba.go100
-rw-r--r--binapi/tcp/tcp.ba.go28
-rw-r--r--binapi/teib/teib.ba.go54
-rw-r--r--binapi/tls_openssl/tls_openssl.ba.go39
-rw-r--r--binapi/trace/trace.ba.go86
-rw-r--r--binapi/udp/udp.ba.go90
-rw-r--r--binapi/udp_ping/udp_ping.ba.go67
-rw-r--r--binapi/urpf/urpf.ba.go22
-rw-r--r--binapi/vhost_user/vhost_user.ba.go98
-rw-r--r--binapi/virtio/virtio.ba.go86
-rw-r--r--binapi/vmxnet3/vmxnet3.ba.go152
-rw-r--r--binapi/vpe/vpe.ba.go328
-rw-r--r--binapi/vrrp/vrrp.ba.go236
-rw-r--r--binapi/vxlan/vxlan.ba.go108
-rw-r--r--binapi/vxlan_gbp/vxlan_gbp.ba.go84
-rw-r--r--binapi/vxlan_gpe/vxlan_gpe.ba.go82
-rw-r--r--binapi/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go22
-rw-r--r--binapigen/binapigen.go143
-rw-r--r--binapigen/binapigen_test.go17
-rw-r--r--binapigen/gen_encoding.go229
-rw-r--r--binapigen/gen_helpers.go12
-rw-r--r--binapigen/generate.go76
-rw-r--r--binapigen/generator.go81
-rw-r--r--binapigen/generator_test.go5
-rw-r--r--binapigen/run.go48
-rw-r--r--binapigen/strings.go (renamed from binapigen/definitions.go)14
-rw-r--r--binapigen/strings_test.go (renamed from binapigen/definitions_test.go)0
-rw-r--r--binapigen/types.go4
-rw-r--r--codec/codec.go70
-rw-r--r--codec/marshaler_test.go175
-rw-r--r--codec/msg_codec.go10
-rw-r--r--examples/simple-client/simple_client.go4
-rw-r--r--govpp.go38
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/VPP_VERSION1
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/af_packet.api.json367
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/arp.api.json648
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/bfd.api.json1254
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/bier.api.json1086
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/bond.api.json620
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/classify.api.json1154
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/cop.api.json277
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ethernet_types.api.json15
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/feature.api.json228
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/fib_types.api.json482
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/geneve.api.json649
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/gre.api.json617
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/gso.api.json218
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/interface.api.json1902
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/interface_types.api.json167
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ip.api.json3219
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ip6_nd.api.json912
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ip_neighbor.api.json736
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ip_types.api.json298
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ipfix_export.api.json664
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ipip.api.json764
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ipip_types.api.json41
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ipsec.api.json1580
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/ipsec_types.api.json493
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/l2.api.json2015
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/l2tp.api.json767
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/lisp.api.json1704
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/lisp_gpe.api.json630
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/lldp.api.json133
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/memclnt.api.json595
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/mfib_types.api.json786
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/mpls.api.json1378
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/netmap.api.json119
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/nhrp.api.json561
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/one.api.json2867
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/p2p_ethernet.api.json277
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/pci_types.api.json32
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/pg.api.json183
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/pipe.api.json319
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/policer.api.json264
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/punt.api.json629
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/qos.api.json956
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/rd_cp.api.json222
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/session.api.json1372
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/span.api.json125
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/sr.api.json656
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/sr_mpls.api.json324
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/syslog.api.json542
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/tapv2.api.json775
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/tcp.api.json351
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/udp.api.json457
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/vhost_user.api.json528
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/virtio.api.json365
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/virtio_types.api.json93
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/vpe.api.json772
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/vpe_types.api.json86
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/vxlan.api.json275
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/vxlan_gbp.api.json656
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/core/vxlan_gpe.api.json224
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/abf.api.json1161
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/acl.api.json1095
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/acl_types.api.json98
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/avf.api.json277
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/builtinurl.api.json53
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/cdp.api.json57
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/ct6.api.json222
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/dhcp.api.json1581
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_ia_na_client_cp.api.json218
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/dhcp6_pd_client_cp.api.json563
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/dns.api.json224
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/flowprobe.api.json309
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/gbp.api.json1930
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/gtpu.api.json645
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/http_static.api.json79
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/igmp.api.json969
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/ikev2.api.json1187
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/ioam_cache.api.json57
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/ioam_export.api.json351
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/ioam_vxlan_gpe.api.json594
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/l2e.api.json218
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/l3xc.api.json841
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/lacp.api.json289
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/lb.api.json1090
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/lb_types.api.json437
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/mactime.api.json424
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/map.api.json1283
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/mdata.api.json214
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/memif.api.json516
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/nat.api.json4157
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/nsh.api.json499
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/nsim.api.json324
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/oddbuf.api.json218
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/pot.api.json258
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/pppoe.api.json590
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/rdma.api.json313
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/sctp.api.json175
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/stn.api.json550
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/svs.api.json707
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/tls_openssl.api.json72
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/trace.api.json171
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/udp_ping.api.json423
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/vmxnet3.api.json418
-rw-r--r--internal/testbinapi/binapi2001/.vppapi/plugins/vxlan_gpe_ioam_export.api.json351
-rw-r--r--internal/testbinapi/binapi2001/abf/abf.ba.go1569
-rw-r--r--internal/testbinapi/binapi2001/abf/abf_rpc.ba.go133
-rw-r--r--internal/testbinapi/binapi2001/acl/acl.ba.go3071
-rw-r--r--internal/testbinapi/binapi2001/acl/acl_rpc.ba.go313
-rw-r--r--internal/testbinapi/binapi2001/acl_types/acl_types.ba.go49
-rw-r--r--internal/testbinapi/binapi2001/af_packet/af_packet.ba.go600
-rw-r--r--internal/testbinapi/binapi2001/af_packet/af_packet_rpc.ba.go89
-rw-r--r--internal/testbinapi/binapi2001/arp/arp.ba.go1187
-rw-r--r--internal/testbinapi/binapi2001/arp/arp_rpc.ba.go123
-rw-r--r--internal/testbinapi/binapi2001/avf/avf.ba.go456
-rw-r--r--internal/testbinapi/binapi2001/avf/avf_rpc.ba.go40
-rw-r--r--internal/testbinapi/binapi2001/bfd/bfd.ba.go2080
-rw-r--r--internal/testbinapi/binapi2001/bfd/bfd_rpc.ba.go223
-rw-r--r--internal/testbinapi/binapi2001/bier/bier.ba.go1980
-rw-r--r--internal/testbinapi/binapi2001/bier/bier_rpc.ba.go283
-rw-r--r--internal/testbinapi/binapi2001/bond/bond.ba.go976
-rw-r--r--internal/testbinapi/binapi2001/bond/bond_rpc.ba.go153
-rw-r--r--internal/testbinapi/binapi2001/builtinurl/builtinurl.ba.go103
-rw-r--r--internal/testbinapi/binapi2001/builtinurl/builtinurl_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/cdp/cdp.ba.go109
-rw-r--r--internal/testbinapi/binapi2001/cdp/cdp_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/classify/classify.ba.go1661
-rw-r--r--internal/testbinapi/binapi2001/classify/classify_rpc.ba.go253
-rw-r--r--internal/testbinapi/binapi2001/cop/cop.ba.go460
-rw-r--r--internal/testbinapi/binapi2001/cop/cop_rpc.ba.go40
-rw-r--r--internal/testbinapi/binapi2001/ct6/ct6.ba.go374
-rw-r--r--internal/testbinapi/binapi2001/ct6/ct6_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/dhcp/dhcp.ba.go2606
-rw-r--r--internal/testbinapi/binapi2001/dhcp/dhcp_rpc.ba.go213
-rw-r--r--internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go372
-rw-r--r--internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go1029
-rw-r--r--internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp_rpc.ba.go40
-rw-r--r--internal/testbinapi/binapi2001/dns/dns.ba.go357
-rw-r--r--internal/testbinapi/binapi2001/dns/dns_rpc.ba.go60
-rw-r--r--internal/testbinapi/binapi2001/ethernet_types/ethernet_types.ba.go53
-rw-r--r--internal/testbinapi/binapi2001/feature/feature.ba.go378
-rw-r--r--internal/testbinapi/binapi2001/feature/feature_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/fib_types/fib_types.ba.go762
-rw-r--r--internal/testbinapi/binapi2001/flowprobe/flowprobe.ba.go552
-rw-r--r--internal/testbinapi/binapi2001/flowprobe/flowprobe_rpc.ba.go40
-rw-r--r--internal/testbinapi/binapi2001/gbp/gbp.ba.go3363
-rw-r--r--internal/testbinapi/binapi2001/gbp/gbp_rpc.ba.go523
-rw-r--r--internal/testbinapi/binapi2001/gen.go17
-rw-r--r--internal/testbinapi/binapi2001/geneve/geneve.ba.go1174
-rw-r--r--internal/testbinapi/binapi2001/geneve/geneve_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/gre/gre.ba.go1131
-rw-r--r--internal/testbinapi/binapi2001/gre/gre_rpc.ba.go73
-rw-r--r--internal/testbinapi/binapi2001/gso/gso.ba.go372
-rw-r--r--internal/testbinapi/binapi2001/gso/gso_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/gtpu/gtpu.ba.go1144
-rw-r--r--internal/testbinapi/binapi2001/gtpu/gtpu_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/http_static/http_static.ba.go129
-rw-r--r--internal/testbinapi/binapi2001/http_static/http_static_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/igmp/igmp.ba.go1686
-rw-r--r--internal/testbinapi/binapi2001/igmp/igmp_rpc.ba.go173
-rw-r--r--internal/testbinapi/binapi2001/ikev2/ikev2.ba.go1961
-rw-r--r--internal/testbinapi/binapi2001/ikev2/ikev2_rpc.ba.go160
-rw-r--r--internal/testbinapi/binapi2001/interface/interface.ba.go3083
-rw-r--r--internal/testbinapi/binapi2001/interface/interface_rpc.ba.go (renamed from internal/testbinapi/binapi2001/interfaces/interfaces_rpc.ba.go)200
-rw-r--r--internal/testbinapi/binapi2001/interface_types/interface_types.ba.go278
-rw-r--r--internal/testbinapi/binapi2001/interfaces/interfaces.ba.go3961
-rw-r--r--internal/testbinapi/binapi2001/ioam_cache/ioam_cache.ba.go111
-rw-r--r--internal/testbinapi/binapi2001/ioam_cache/ioam_cache_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/ioam_export/ioam_export.ba.go686
-rw-r--r--internal/testbinapi/binapi2001/ioam_export/ioam_export_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go1086
-rw-r--r--internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe_rpc.ba.go80
-rw-r--r--internal/testbinapi/binapi2001/ip/ip.ba.go5951
-rw-r--r--internal/testbinapi/binapi2001/ip/ip_rpc.ba.go576
-rw-r--r--internal/testbinapi/binapi2001/ip6_nd/ip6_nd.ba.go1520
-rw-r--r--internal/testbinapi/binapi2001/ip6_nd/ip6_nd_rpc.ba.go113
-rw-r--r--internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor.ba.go1341
-rw-r--r--internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor_rpc.ba.go93
-rw-r--r--internal/testbinapi/binapi2001/ip_types/ip_types.ba.go589
-rw-r--r--internal/testbinapi/binapi2001/ipfix_export/ipfix_export.ba.go1162
-rw-r--r--internal/testbinapi/binapi2001/ipfix_export/ipfix_export_rpc.ba.go183
-rw-r--r--internal/testbinapi/binapi2001/ipip/ipip.ba.go1365
-rw-r--r--internal/testbinapi/binapi2001/ipip/ipip_rpc.ba.go103
-rw-r--r--internal/testbinapi/binapi2001/ipip_types/ipip_types.ba.go81
-rw-r--r--internal/testbinapi/binapi2001/ipsec/ipsec.ba.go2590
-rw-r--r--internal/testbinapi/binapi2001/ipsec/ipsec_rpc.ba.go353
-rw-r--r--internal/testbinapi/binapi2001/ipsec_types/ipsec_types.ba.go795
-rw-r--r--internal/testbinapi/binapi2001/l2/l2.ba.go3250
-rw-r--r--internal/testbinapi/binapi2001/l2/l2_rpc.ba.go403
-rw-r--r--internal/testbinapi/binapi2001/l2e/l2e.ba.go370
-rw-r--r--internal/testbinapi/binapi2001/l2e/l2e_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/l2tp/l2tp.ba.go1365
-rw-r--r--internal/testbinapi/binapi2001/l2tp/l2tp_rpc.ba.go103
-rw-r--r--internal/testbinapi/binapi2001/l3xc/l3xc.ba.go1485
-rw-r--r--internal/testbinapi/binapi2001/l3xc/l3xc_rpc.ba.go93
-rw-r--r--internal/testbinapi/binapi2001/lacp/lacp.ba.go463
-rw-r--r--internal/testbinapi/binapi2001/lacp/lacp_rpc.ba.go63
-rw-r--r--internal/testbinapi/binapi2001/lb/lb.ba.go1803
-rw-r--r--internal/testbinapi/binapi2001/lb/lb_rpc.ba.go163
-rw-r--r--internal/testbinapi/binapi2001/lb_types/lb_types.ba.go773
-rw-r--r--internal/testbinapi/binapi2001/lisp/lisp.ba.go2568
-rw-r--r--internal/testbinapi/binapi2001/lisp/lisp_rpc.ba.go533
-rw-r--r--internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe.ba.go979
-rw-r--r--internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe_rpc.ba.go153
-rw-r--r--internal/testbinapi/binapi2001/lldp/lldp.ba.go212
-rw-r--r--internal/testbinapi/binapi2001/lldp/lldp_rpc.ba.go40
-rw-r--r--internal/testbinapi/binapi2001/mactime/mactime.ba.go695
-rw-r--r--internal/testbinapi/binapi2001/mactime/mactime_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/map/map.ba.go2133
-rw-r--r--internal/testbinapi/binapi2001/map/map_rpc.ba.go233
-rw-r--r--internal/testbinapi/binapi2001/mdata/mdata.ba.go366
-rw-r--r--internal/testbinapi/binapi2001/mdata/mdata_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/memclnt/memclnt.ba.go1507
-rw-r--r--internal/testbinapi/binapi2001/memclnt/memclnt_rpc.ba.go69
-rw-r--r--internal/testbinapi/binapi2001/memif/memif.ba.go908
-rw-r--r--internal/testbinapi/binapi2001/memif/memif_rpc.ba.go130
-rw-r--r--internal/testbinapi/binapi2001/mfib_types/mfib_types.ba.go826
-rw-r--r--internal/testbinapi/binapi2001/mpls/mpls.ba.go2025
-rw-r--r--internal/testbinapi/binapi2001/mpls/mpls_rpc.ba.go193
-rw-r--r--internal/testbinapi/binapi2001/nat/nat.ba.go6378
-rw-r--r--internal/testbinapi/binapi2001/nat/nat_rpc.ba.go1273
-rw-r--r--internal/testbinapi/binapi2001/netmap/netmap.ba.go198
-rw-r--r--internal/testbinapi/binapi2001/netmap/netmap_rpc.ba.go40
-rw-r--r--internal/testbinapi/binapi2001/nhrp/nhrp.ba.go1036
-rw-r--r--internal/testbinapi/binapi2001/nhrp/nhrp_rpc.ba.go73
-rw-r--r--internal/testbinapi/binapi2001/nsh/nsh.ba.go730
-rw-r--r--internal/testbinapi/binapi2001/nsh/nsh_rpc.ba.go123
-rw-r--r--internal/testbinapi/binapi2001/nsim/nsim.ba.go538
-rw-r--r--internal/testbinapi/binapi2001/nsim/nsim_rpc.ba.go50
-rw-r--r--internal/testbinapi/binapi2001/oddbuf/oddbuf.ba.go370
-rw-r--r--internal/testbinapi/binapi2001/oddbuf/oddbuf_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/one/one.ba.go4408
-rw-r--r--internal/testbinapi/binapi2001/one/one_rpc.ba.go803
-rw-r--r--internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet.ba.go483
-rw-r--r--internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet_rpc.ba.go40
-rw-r--r--internal/testbinapi/binapi2001/pci_types/pci_types.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/pg/pg.ba.go287
-rw-r--r--internal/testbinapi/binapi2001/pg/pg_rpc.ba.go50
-rw-r--r--internal/testbinapi/binapi2001/pipe/pipe.ba.go532
-rw-r--r--internal/testbinapi/binapi2001/pipe/pipe_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/policer/policer.ba.go342
-rw-r--r--internal/testbinapi/binapi2001/policer/policer_rpc.ba.go73
-rw-r--r--internal/testbinapi/binapi2001/pot/pot.ba.go387
-rw-r--r--internal/testbinapi/binapi2001/pot/pot_rpc.ba.go93
-rw-r--r--internal/testbinapi/binapi2001/pppoe/pppoe.ba.go1080
-rw-r--r--internal/testbinapi/binapi2001/pppoe/pppoe_rpc.ba.go73
-rw-r--r--internal/testbinapi/binapi2001/punt/punt.ba.go1110
-rw-r--r--internal/testbinapi/binapi2001/punt/punt_rpc.ba.go133
-rw-r--r--internal/testbinapi/binapi2001/qos/qos.ba.go1633
-rw-r--r--internal/testbinapi/binapi2001/qos/qos_rpc.ba.go233
-rw-r--r--internal/testbinapi/binapi2001/rd_cp/rd_cp.ba.go374
-rw-r--r--internal/testbinapi/binapi2001/rd_cp/rd_cp_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/rdma/rdma.ba.go490
-rw-r--r--internal/testbinapi/binapi2001/rdma/rdma_rpc.ba.go40
-rw-r--r--internal/testbinapi/binapi2001/sctp/sctp.ba.go285
-rw-r--r--internal/testbinapi/binapi2001/sctp/sctp_rpc.ba.go50
-rw-r--r--internal/testbinapi/binapi2001/session/session.ba.go2026
-rw-r--r--internal/testbinapi/binapi2001/session/session_rpc.ba.go273
-rw-r--r--internal/testbinapi/binapi2001/span/span.ba.go207
-rw-r--r--internal/testbinapi/binapi2001/span/span_rpc.ba.go73
-rw-r--r--internal/testbinapi/binapi2001/sr/sr.ba.go1857
-rw-r--r--internal/testbinapi/binapi2001/sr/sr_rpc.ba.go179
-rw-r--r--internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go502
-rw-r--r--internal/testbinapi/binapi2001/sr_mpls/sr_mpls_rpc.ba.go70
-rw-r--r--internal/testbinapi/binapi2001/stn/stn.ba.go1012
-rw-r--r--internal/testbinapi/binapi2001/stn/stn_rpc.ba.go73
-rw-r--r--internal/testbinapi/binapi2001/svs/svs.ba.go1248
-rw-r--r--internal/testbinapi/binapi2001/svs/svs_rpc.ba.go103
-rw-r--r--internal/testbinapi/binapi2001/syslog/syslog.ba.go959
-rw-r--r--internal/testbinapi/binapi2001/syslog/syslog_rpc.ba.go60
-rw-r--r--internal/testbinapi/binapi2001/tapv2/tapv2.ba.go1310
-rw-r--r--internal/testbinapi/binapi2001/tapv2/tapv2_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/tcp/tcp.ba.go692
-rw-r--r--internal/testbinapi/binapi2001/tcp/tcp_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/tls_openssl/tls_openssl.ba.go124
-rw-r--r--internal/testbinapi/binapi2001/tls_openssl/tls_openssl_rpc.ba.go30
-rw-r--r--internal/testbinapi/binapi2001/trace/trace.ba.go273
-rw-r--r--internal/testbinapi/binapi2001/trace/trace_rpc.ba.go50
-rw-r--r--internal/testbinapi/binapi2001/udp/udp.ba.go866
-rw-r--r--internal/testbinapi/binapi2001/udp/udp_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/udp_ping/udp_ping.ba.go789
-rw-r--r--internal/testbinapi/binapi2001/udp_ping/udp_ping_rpc.ba.go40
-rw-r--r--internal/testbinapi/binapi2001/vhost_user/vhost_user.ba.go792
-rw-r--r--internal/testbinapi/binapi2001/vhost_user/vhost_user_rpc.ba.go93
-rw-r--r--internal/testbinapi/binapi2001/virtio/virtio.ba.go602
-rw-r--r--internal/testbinapi/binapi2001/virtio/virtio_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/virtio_types/virtio_types.ba.go116
-rw-r--r--internal/testbinapi/binapi2001/vmxnet3/vmxnet3.ba.go677
-rw-r--r--internal/testbinapi/binapi2001/vmxnet3/vmxnet3_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/vpe/vpe.ba.go1745
-rw-r--r--internal/testbinapi/binapi2001/vpe/vpe_rpc.ba.go108
-rw-r--r--internal/testbinapi/binapi2001/vpe_types/vpe_types.ba.go88
-rw-r--r--internal/testbinapi/binapi2001/vxlan/vxlan.ba.go409
-rw-r--r--internal/testbinapi/binapi2001/vxlan/vxlan_rpc.ba.go93
-rw-r--r--internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp.ba.go1183
-rw-r--r--internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe.ba.go333
-rw-r--r--internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe_rpc.ba.go83
-rw-r--r--internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go688
-rw-r--r--internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export_rpc.ba.go30
414 files changed, 189330 insertions, 27037 deletions
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/gen.go b/binapi/gen.go
index 6b70a9c..aefde2b 100644
--- a/gen.go
+++ b/binapi/gen.go
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package govpp
+package binapi
// To generate bindings for VPP API files in the default system directory, run:
//
-// go generate gen.go
+// go generate ./binapi
//
-//go:generate binapi-generator -input-dir=/usr/share/vpp/api -output-dir=binapi -gen=rpc,rest
+//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/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/definitions.go b/binapigen/strings.go
index 3c8a874..1ab24e9 100644
--- a/binapigen/definitions.go
+++ b/binapigen/strings.go
@@ -15,8 +15,10 @@
package binapigen
import (
+ "go/token"
"strings"
"unicode"
+ "unicode/utf8"
)
// commonInitialisms is a set of common initialisms that need to stay in upper case.
@@ -74,7 +76,8 @@ var specialInitialisms = map[string]string{
}
func usesInitialism(s string) string {
- if u := strings.ToUpper(s); commonInitialisms[u] {
+ u := strings.ToUpper(s)
+ if commonInitialisms[u] {
return u
} else if su, ok := specialInitialisms[u]; ok {
return su
@@ -151,3 +154,12 @@ func camelCaseName(name string) (should string) {
}
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/definitions_test.go b/binapigen/strings_test.go
index 761c95f..761c95f 100644
--- a/binapigen/definitions_test.go
+++ b/binapigen/strings_test.go
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/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<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// FibPathNhProto defines enum 'fib_path_nh_proto'.
+type FibPathNhProto uint32
+
+const (
+ FIB_API_PATH_NH_PROTO_IP4 FibPathNhProto = 0
+ FIB_API_PATH_NH_PROTO_IP6 FibPathNhProto = 1
+ FIB_API_PATH_NH_PROTO_MPLS FibPathNhProto = 2
+ FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
+ FIB_API_PATH_NH_PROTO_BIER FibPathNhProto = 4
+)
+
+var (
+ FibPathNhProto_name = map[uint32]string{
+ 0: "FIB_API_PATH_NH_PROTO_IP4",
+ 1: "FIB_API_PATH_NH_PROTO_IP6",
+ 2: "FIB_API_PATH_NH_PROTO_MPLS",
+ 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
+ 4: "FIB_API_PATH_NH_PROTO_BIER",
+ }
+ FibPathNhProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathNhProto) String() string {
+ s, ok := FibPathNhProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// FibPathType defines enum 'fib_path_type'.
+type FibPathType uint32
+
+const (
+ FIB_API_PATH_TYPE_NORMAL FibPathType = 0
+ FIB_API_PATH_TYPE_LOCAL FibPathType = 1
+ FIB_API_PATH_TYPE_DROP FibPathType = 2
+ FIB_API_PATH_TYPE_UDP_ENCAP FibPathType = 3
+ FIB_API_PATH_TYPE_BIER_IMP FibPathType = 4
+ FIB_API_PATH_TYPE_ICMP_UNREACH FibPathType = 5
+ FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
+ FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
+ FIB_API_PATH_TYPE_DVR FibPathType = 8
+ FIB_API_PATH_TYPE_INTERFACE_RX FibPathType = 9
+ FIB_API_PATH_TYPE_CLASSIFY FibPathType = 10
+)
+
+var (
+ FibPathType_name = map[uint32]string{
+ 0: "FIB_API_PATH_TYPE_NORMAL",
+ 1: "FIB_API_PATH_TYPE_LOCAL",
+ 2: "FIB_API_PATH_TYPE_DROP",
+ 3: "FIB_API_PATH_TYPE_UDP_ENCAP",
+ 4: "FIB_API_PATH_TYPE_BIER_IMP",
+ 5: "FIB_API_PATH_TYPE_ICMP_UNREACH",
+ 6: "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
+ 7: "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
+ 8: "FIB_API_PATH_TYPE_DVR",
+ 9: "FIB_API_PATH_TYPE_INTERFACE_RX",
+ 10: "FIB_API_PATH_TYPE_CLASSIFY",
+ }
+ FibPathType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathType) String() string {
+ s, ok := FibPathType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// AbfItfAttach defines type 'abf_itf_attach'.
+type AbfItfAttach struct {
+ PolicyID uint32 `binapi:"u32,name=policy_id" json:"policy_id,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Priority uint32 `binapi:"u32,name=priority" json:"priority,omitempty"`
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+}
+
+// AbfPolicy defines type 'abf_policy'.
+type AbfPolicy struct {
+ PolicyID uint32 `binapi:"u32,name=policy_id" json:"policy_id,omitempty"`
+ ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
+ NPaths uint8 `binapi:"u8,name=n_paths" json:"-"`
+ Paths []FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// FibMplsLabel defines type 'fib_mpls_label'.
+type FibMplsLabel struct {
+ IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
+ Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
+ TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
+ Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
+}
+
+// FibPath defines type 'fib_path'.
+type FibPath struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+ Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
+ Type FibPathType `binapi:"fib_path_type,name=type" json:"type,omitempty"`
+ Flags FibPathFlags `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
+ Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
+ Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
+ NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
+ LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
+}
+
+// FibPathNh defines type 'fib_path_nh'.
+type FibPathNh struct {
+ Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
+ ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
+ ObjID uint32 `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
+ ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// AbfItfAttachAddDel defines message 'abf_itf_attach_add_del'.
+type AbfItfAttachAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Attach AbfItfAttach `binapi:"abf_itf_attach,name=attach" json:"attach,omitempty"`
+}
+
+func (m *AbfItfAttachAddDel) Reset() { *m = AbfItfAttachAddDel{} }
+func (*AbfItfAttachAddDel) GetMessageName() string { return "abf_itf_attach_add_del" }
+func (*AbfItfAttachAddDel) GetCrcString() string { return "25c8621b" }
+func (*AbfItfAttachAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AbfItfAttachAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Attach.PolicyID
+ size += 4 // m.Attach.SwIfIndex
+ size += 4 // m.Attach.Priority
+ size += 1 // m.Attach.IsIPv6
+ return size
+}
+func (m *AbfItfAttachAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(m.Attach.PolicyID)
+ buf.EncodeUint32(uint32(m.Attach.SwIfIndex))
+ buf.EncodeUint32(m.Attach.Priority)
+ buf.EncodeBool(m.Attach.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *AbfItfAttachAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Attach.PolicyID = buf.DecodeUint32()
+ m.Attach.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Attach.Priority = buf.DecodeUint32()
+ m.Attach.IsIPv6 = buf.DecodeBool()
+ return nil
+}
+
+// AbfItfAttachAddDelReply defines message 'abf_itf_attach_add_del_reply'.
+type AbfItfAttachAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *AbfItfAttachAddDelReply) Reset() { *m = AbfItfAttachAddDelReply{} }
+func (*AbfItfAttachAddDelReply) GetMessageName() string { return "abf_itf_attach_add_del_reply" }
+func (*AbfItfAttachAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*AbfItfAttachAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AbfItfAttachAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *AbfItfAttachAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// AbfItfAttachDetails defines message 'abf_itf_attach_details'.
+type AbfItfAttachDetails struct {
+ Attach AbfItfAttach `binapi:"abf_itf_attach,name=attach" json:"attach,omitempty"`
+}
+
+func (m *AbfItfAttachDetails) Reset() { *m = AbfItfAttachDetails{} }
+func (*AbfItfAttachDetails) GetMessageName() string { return "abf_itf_attach_details" }
+func (*AbfItfAttachDetails) GetCrcString() string { return "7819523e" }
+func (*AbfItfAttachDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AbfItfAttachDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Attach.PolicyID
+ size += 4 // m.Attach.SwIfIndex
+ size += 4 // m.Attach.Priority
+ size += 1 // m.Attach.IsIPv6
+ return size
+}
+func (m *AbfItfAttachDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Attach.PolicyID)
+ buf.EncodeUint32(uint32(m.Attach.SwIfIndex))
+ buf.EncodeUint32(m.Attach.Priority)
+ buf.EncodeBool(m.Attach.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *AbfItfAttachDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Attach.PolicyID = buf.DecodeUint32()
+ m.Attach.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Attach.Priority = buf.DecodeUint32()
+ m.Attach.IsIPv6 = buf.DecodeBool()
+ return nil
+}
+
+// AbfItfAttachDump defines message 'abf_itf_attach_dump'.
+type AbfItfAttachDump struct{}
+
+func (m *AbfItfAttachDump) Reset() { *m = AbfItfAttachDump{} }
+func (*AbfItfAttachDump) GetMessageName() string { return "abf_itf_attach_dump" }
+func (*AbfItfAttachDump) GetCrcString() string { return "51077d14" }
+func (*AbfItfAttachDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AbfItfAttachDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *AbfItfAttachDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *AbfItfAttachDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// AbfPluginGetVersion defines message 'abf_plugin_get_version'.
+type AbfPluginGetVersion struct{}
+
+func (m *AbfPluginGetVersion) Reset() { *m = AbfPluginGetVersion{} }
+func (*AbfPluginGetVersion) GetMessageName() string { return "abf_plugin_get_version" }
+func (*AbfPluginGetVersion) GetCrcString() string { return "51077d14" }
+func (*AbfPluginGetVersion) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AbfPluginGetVersion) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *AbfPluginGetVersion) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *AbfPluginGetVersion) Unmarshal(b []byte) error {
+ return nil
+}
+
+// AbfPluginGetVersionReply defines message 'abf_plugin_get_version_reply'.
+type AbfPluginGetVersionReply struct {
+ Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
+ Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
+}
+
+func (m *AbfPluginGetVersionReply) Reset() { *m = AbfPluginGetVersionReply{} }
+func (*AbfPluginGetVersionReply) GetMessageName() string { return "abf_plugin_get_version_reply" }
+func (*AbfPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
+func (*AbfPluginGetVersionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AbfPluginGetVersionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Major
+ size += 4 // m.Minor
+ return size
+}
+func (m *AbfPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Major)
+ buf.EncodeUint32(m.Minor)
+ return buf.Bytes(), nil
+}
+func (m *AbfPluginGetVersionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Major = buf.DecodeUint32()
+ m.Minor = buf.DecodeUint32()
+ return nil
+}
+
+// AbfPolicyAddDel defines message 'abf_policy_add_del'.
+type AbfPolicyAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Policy AbfPolicy `binapi:"abf_policy,name=policy" json:"policy,omitempty"`
+}
+
+func (m *AbfPolicyAddDel) Reset() { *m = AbfPolicyAddDel{} }
+func (*AbfPolicyAddDel) GetMessageName() string { return "abf_policy_add_del" }
+func (*AbfPolicyAddDel) GetCrcString() string { return "ee66f93e" }
+func (*AbfPolicyAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AbfPolicyAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Policy.PolicyID
+ size += 4 // m.Policy.ACLIndex
+ size += 1 // m.Policy.NPaths
+ for j2 := 0; j2 < len(m.Policy.Paths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.Policy.Paths) {
+ s2 = m.Policy.Paths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ 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 FibPath // Paths
+ if j1 < len(m.Policy.Paths) {
+ v1 = m.Policy.Paths[j1]
+ }
+ 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[:], 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++ {
+ 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 *AbfPolicyAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Policy.PolicyID = buf.DecodeUint32()
+ m.Policy.ACLIndex = buf.DecodeUint32()
+ m.Policy.NPaths = buf.DecodeUint8()
+ m.Policy.Paths = make([]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()
+ m.Policy.Paths[j1].RpfID = buf.DecodeUint32()
+ m.Policy.Paths[j1].Weight = buf.DecodeUint8()
+ m.Policy.Paths[j1].Preference = buf.DecodeUint8()
+ m.Policy.Paths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.Policy.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.Policy.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Policy.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Policy.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.Policy.Paths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.Policy.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Policy.Paths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.Policy.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.Policy.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.Policy.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.Policy.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// AbfPolicyAddDelReply defines message 'abf_policy_add_del_reply'.
+type AbfPolicyAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *AbfPolicyAddDelReply) Reset() { *m = AbfPolicyAddDelReply{} }
+func (*AbfPolicyAddDelReply) GetMessageName() string { return "abf_policy_add_del_reply" }
+func (*AbfPolicyAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*AbfPolicyAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AbfPolicyAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *AbfPolicyAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// AbfPolicyDetails defines message 'abf_policy_details'.
+type AbfPolicyDetails struct {
+ Policy AbfPolicy `binapi:"abf_policy,name=policy" json:"policy,omitempty"`
+}
+
+func (m *AbfPolicyDetails) Reset() { *m = AbfPolicyDetails{} }
+func (*AbfPolicyDetails) GetMessageName() string { return "abf_policy_details" }
+func (*AbfPolicyDetails) GetCrcString() string { return "6769e504" }
+func (*AbfPolicyDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AbfPolicyDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Policy.PolicyID
+ size += 4 // m.Policy.ACLIndex
+ size += 1 // m.Policy.NPaths
+ for j2 := 0; j2 < len(m.Policy.Paths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.Policy.Paths) {
+ s2 = m.Policy.Paths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 FibPath // Paths
+ if j1 < len(m.Policy.Paths) {
+ v1 = m.Policy.Paths[j1]
+ }
+ 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[:], 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++ {
+ 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 *AbfPolicyDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Policy.PolicyID = buf.DecodeUint32()
+ m.Policy.ACLIndex = buf.DecodeUint32()
+ m.Policy.NPaths = buf.DecodeUint8()
+ m.Policy.Paths = make([]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()
+ m.Policy.Paths[j1].RpfID = buf.DecodeUint32()
+ m.Policy.Paths[j1].Weight = buf.DecodeUint8()
+ m.Policy.Paths[j1].Preference = buf.DecodeUint8()
+ m.Policy.Paths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.Policy.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.Policy.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Policy.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Policy.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.Policy.Paths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.Policy.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Policy.Paths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.Policy.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.Policy.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.Policy.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.Policy.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// AbfPolicyDump defines message 'abf_policy_dump'.
+type AbfPolicyDump struct{}
+
+func (m *AbfPolicyDump) Reset() { *m = AbfPolicyDump{} }
+func (*AbfPolicyDump) GetMessageName() string { return "abf_policy_dump" }
+func (*AbfPolicyDump) GetCrcString() string { return "51077d14" }
+func (*AbfPolicyDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AbfPolicyDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *AbfPolicyDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *AbfPolicyDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_abf_binapi_init() }
+func file_abf_binapi_init() {
+ api.RegisterMessage((*AbfItfAttachAddDel)(nil), "abf_itf_attach_add_del_25c8621b")
+ api.RegisterMessage((*AbfItfAttachAddDelReply)(nil), "abf_itf_attach_add_del_reply_e8d4e804")
+ api.RegisterMessage((*AbfItfAttachDetails)(nil), "abf_itf_attach_details_7819523e")
+ api.RegisterMessage((*AbfItfAttachDump)(nil), "abf_itf_attach_dump_51077d14")
+ api.RegisterMessage((*AbfPluginGetVersion)(nil), "abf_plugin_get_version_51077d14")
+ api.RegisterMessage((*AbfPluginGetVersionReply)(nil), "abf_plugin_get_version_reply_9b32cf86")
+ api.RegisterMessage((*AbfPolicyAddDel)(nil), "abf_policy_add_del_ee66f93e")
+ api.RegisterMessage((*AbfPolicyAddDelReply)(nil), "abf_policy_add_del_reply_e8d4e804")
+ api.RegisterMessage((*AbfPolicyDetails)(nil), "abf_policy_details_6769e504")
+ api.RegisterMessage((*AbfPolicyDump)(nil), "abf_policy_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*AbfItfAttachAddDel)(nil),
+ (*AbfItfAttachAddDelReply)(nil),
+ (*AbfItfAttachDetails)(nil),
+ (*AbfItfAttachDump)(nil),
+ (*AbfPluginGetVersion)(nil),
+ (*AbfPluginGetVersionReply)(nil),
+ (*AbfPolicyAddDel)(nil),
+ (*AbfPolicyAddDelReply)(nil),
+ (*AbfPolicyDetails)(nil),
+ (*AbfPolicyDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/abf/abf_rpc.ba.go b/internal/testbinapi/binapi2001/abf/abf_rpc.ba.go
new file mode 100644
index 0000000..0d98cfc
--- /dev/null
+++ b/internal/testbinapi/binapi2001/abf/abf_rpc.ba.go
@@ -0,0 +1,133 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package abf
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service abf.
+type RPCService interface {
+ AbfItfAttachAddDel(ctx context.Context, in *AbfItfAttachAddDel) (*AbfItfAttachAddDelReply, error)
+ AbfItfAttachDump(ctx context.Context, in *AbfItfAttachDump) (RPCService_AbfItfAttachDumpClient, error)
+ AbfPluginGetVersion(ctx context.Context, in *AbfPluginGetVersion) (*AbfPluginGetVersionReply, error)
+ AbfPolicyAddDel(ctx context.Context, in *AbfPolicyAddDel) (*AbfPolicyAddDelReply, error)
+ AbfPolicyDump(ctx context.Context, in *AbfPolicyDump) (RPCService_AbfPolicyDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) AbfItfAttachAddDel(ctx context.Context, in *AbfItfAttachAddDel) (*AbfItfAttachAddDelReply, error) {
+ out := new(AbfItfAttachAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) AbfItfAttachDump(ctx context.Context, in *AbfItfAttachDump) (RPCService_AbfItfAttachDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_AbfItfAttachDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_AbfItfAttachDumpClient interface {
+ Recv() (*AbfItfAttachDetails, error)
+ api.Stream
+}
+
+type serviceClient_AbfItfAttachDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_AbfItfAttachDumpClient) Recv() (*AbfItfAttachDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *AbfItfAttachDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) AbfPluginGetVersion(ctx context.Context, in *AbfPluginGetVersion) (*AbfPluginGetVersionReply, error) {
+ out := new(AbfPluginGetVersionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) AbfPolicyAddDel(ctx context.Context, in *AbfPolicyAddDel) (*AbfPolicyAddDelReply, error) {
+ out := new(AbfPolicyAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) AbfPolicyDump(ctx context.Context, in *AbfPolicyDump) (RPCService_AbfPolicyDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_AbfPolicyDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_AbfPolicyDumpClient interface {
+ Recv() (*AbfPolicyDetails, error)
+ api.Stream
+}
+
+type serviceClient_AbfPolicyDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_AbfPolicyDumpClient) Recv() (*AbfPolicyDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *AbfPolicyDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/acl/acl.ba.go b/internal/testbinapi/binapi2001/acl/acl.ba.go
index 7253552..091f63a 100644
--- a/internal/testbinapi/binapi2001/acl/acl.ba.go
+++ b/internal/testbinapi/binapi2001/acl/acl.ba.go
@@ -1,53 +1,41 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.4.0-dev
-// VPP: 20.01-45~g7a071e370~b63
-// source: /usr/share/vpp/api/plugins/acl.api.json
-
-/*
-Package acl contains generated code for VPP binary API defined by acl.api (version 1.0.1).
-
-It consists of:
- 38 messages
- 2 types
-*/
+// VPP: 20.01
+// source: .vppapi/plugins/acl.api.json
+
+// Package acl contains generated bindings for API file acl.api.
+//
+// Contents:
+// 2 structs
+// 38 messages
+//
package acl
import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "math"
- "strconv"
-
api "git.fd.io/govpp.git/api"
codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
)
// 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 // please upgrade the GoVPP api package
+const _ = api.GoVppAPIPackageIsVersion2
const (
- // ModuleName is the name of this module.
- ModuleName = "acl"
- // APIVersion is the API version of this module.
+ APIFile = "acl"
APIVersion = "1.0.1"
- // VersionCrc is the CRC of this module.
VersionCrc = 0x11c5c1e5
)
-// ACLRule represents VPP binary API type 'acl_rule'.
+// ACLRule defines type 'acl_rule'.
type ACLRule struct {
IsPermit uint8 `binapi:"u8,name=is_permit" json:"is_permit,omitempty"`
IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
- SrcIPAddr []byte `binapi:"u8[16],name=src_ip_addr" json:"src_ip_addr,omitempty" struc:"[16]byte"`
+ SrcIPAddr []byte `binapi:"u8[16],name=src_ip_addr" json:"src_ip_addr,omitempty"`
SrcIPPrefixLen uint8 `binapi:"u8,name=src_ip_prefix_len" json:"src_ip_prefix_len,omitempty"`
- DstIPAddr []byte `binapi:"u8[16],name=dst_ip_addr" json:"dst_ip_addr,omitempty" struc:"[16]byte"`
+ DstIPAddr []byte `binapi:"u8[16],name=dst_ip_addr" json:"dst_ip_addr,omitempty"`
DstIPPrefixLen uint8 `binapi:"u8,name=dst_ip_prefix_len" json:"dst_ip_prefix_len,omitempty"`
Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
SrcportOrIcmptypeFirst uint16 `binapi:"u16,name=srcport_or_icmptype_first" json:"srcport_or_icmptype_first,omitempty"`
@@ -58,644 +46,353 @@ type ACLRule struct {
TCPFlagsValue uint8 `binapi:"u8,name=tcp_flags_value" json:"tcp_flags_value,omitempty"`
}
-func (*ACLRule) GetTypeName() string { return "acl_rule" }
-
-// MacipACLRule represents VPP binary API type 'macip_acl_rule'.
+// MacipACLRule defines type 'macip_acl_rule'.
type MacipACLRule struct {
IsPermit uint8 `binapi:"u8,name=is_permit" json:"is_permit,omitempty"`
IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
- SrcMac []byte `binapi:"u8[6],name=src_mac" json:"src_mac,omitempty" struc:"[6]byte"`
- SrcMacMask []byte `binapi:"u8[6],name=src_mac_mask" json:"src_mac_mask,omitempty" struc:"[6]byte"`
- SrcIPAddr []byte `binapi:"u8[16],name=src_ip_addr" json:"src_ip_addr,omitempty" struc:"[16]byte"`
+ SrcMac []byte `binapi:"u8[6],name=src_mac" json:"src_mac,omitempty"`
+ SrcMacMask []byte `binapi:"u8[6],name=src_mac_mask" json:"src_mac_mask,omitempty"`
+ SrcIPAddr []byte `binapi:"u8[16],name=src_ip_addr" json:"src_ip_addr,omitempty"`
SrcIPPrefixLen uint8 `binapi:"u8,name=src_ip_prefix_len" json:"src_ip_prefix_len,omitempty"`
}
-func (*MacipACLRule) GetTypeName() string { return "macip_acl_rule" }
-
-// ACLAddReplace represents VPP binary API message 'acl_add_replace'.
+// ACLAddReplace defines message 'acl_add_replace'.
type ACLAddReplace struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
+ Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
R []ACLRule `binapi:"acl_rule[count],name=r" json:"r,omitempty"`
}
-func (m *ACLAddReplace) Reset() { *m = ACLAddReplace{} }
-func (*ACLAddReplace) GetMessageName() string { return "acl_add_replace" }
-func (*ACLAddReplace) GetCrcString() string { return "13bc8539" }
-func (*ACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ACLAddReplace) Reset() { *m = ACLAddReplace{} }
+func (*ACLAddReplace) GetMessageName() string { return "acl_add_replace" }
+func (*ACLAddReplace) GetCrcString() string { return "13bc8539" }
+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
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
+ size += 4 // m.ACLIndex
+ size += 1 * 64 // m.Tag
+ size += 4 // m.Count
for j1 := 0; j1 < len(m.R); j1++ {
var s1 ACLRule
_ = s1
if j1 < len(m.R) {
s1 = m.R[j1]
}
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.IsIPv6
- size += 1
- // field[2] s1.SrcIPAddr
- size += 16
- // field[2] s1.SrcIPPrefixLen
- size += 1
- // field[2] s1.DstIPAddr
- size += 16
- // field[2] s1.DstIPPrefixLen
- size += 1
- // field[2] s1.Proto
- size += 1
- // field[2] s1.SrcportOrIcmptypeFirst
- size += 2
- // field[2] s1.SrcportOrIcmptypeLast
- size += 2
- // field[2] s1.DstportOrIcmpcodeFirst
- size += 2
- // field[2] s1.DstportOrIcmpcodeLast
- size += 2
- // field[2] s1.TCPFlagsMask
- size += 1
- // field[2] s1.TCPFlagsValue
- size += 1
+ size += 1 // s1.IsPermit
+ size += 1 // s1.IsIPv6
+ size += 1 * 16 // s1.SrcIPAddr
+ size += 1 // s1.SrcIPPrefixLen
+ size += 1 * 16 // s1.DstIPAddr
+ size += 1 // s1.DstIPPrefixLen
+ size += 1 // s1.Proto
+ size += 2 // s1.SrcportOrIcmptypeFirst
+ size += 2 // s1.SrcportOrIcmptypeLast
+ size += 2 // s1.DstportOrIcmpcodeFirst
+ size += 2 // s1.DstportOrIcmpcodeLast
+ size += 1 // s1.TCPFlagsMask
+ size += 1 // s1.TCPFlagsValue
}
return size
}
func (m *ACLAddReplace) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ACLIndex)
+ buf.EncodeBytes(m.Tag, 64)
+ buf.EncodeUint32(uint32(len(m.R)))
+ for j0 := 0; j0 < len(m.R); j0++ {
+ var v0 ACLRule // R
+ if j0 < len(m.R) {
+ v0 = m.R[j0]
}
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 ACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
- pos += 1
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
- pos += 1
- // field[2] v1.DstIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.DstIPAddr) {
- x = uint8(v1.DstIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.DstIPPrefixLen
- buf[pos] = uint8(v1.DstIPPrefixLen)
- pos += 1
- // field[2] v1.Proto
- buf[pos] = uint8(v1.Proto)
- pos += 1
- // field[2] v1.SrcportOrIcmptypeFirst
- o.PutUint16(buf[pos:pos+2], uint16(v1.SrcportOrIcmptypeFirst))
- pos += 2
- // field[2] v1.SrcportOrIcmptypeLast
- o.PutUint16(buf[pos:pos+2], uint16(v1.SrcportOrIcmptypeLast))
- pos += 2
- // field[2] v1.DstportOrIcmpcodeFirst
- o.PutUint16(buf[pos:pos+2], uint16(v1.DstportOrIcmpcodeFirst))
- pos += 2
- // field[2] v1.DstportOrIcmpcodeLast
- o.PutUint16(buf[pos:pos+2], uint16(v1.DstportOrIcmpcodeLast))
- pos += 2
- // field[2] v1.TCPFlagsMask
- buf[pos] = uint8(v1.TCPFlagsMask)
- pos += 1
- // field[2] v1.TCPFlagsValue
- buf[pos] = uint8(v1.TCPFlagsValue)
- pos += 1
- }
- return buf, nil
-}
-func (m *ACLAddReplace) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]ACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].DstIPAddr
- m.R[j1].DstIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].DstIPAddr); i++ {
- m.R[j1].DstIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].DstIPPrefixLen
- m.R[j1].DstIPPrefixLen = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].Proto
- m.R[j1].Proto = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcportOrIcmptypeFirst
- m.R[j1].SrcportOrIcmptypeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].SrcportOrIcmptypeLast
- m.R[j1].SrcportOrIcmptypeLast = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].DstportOrIcmpcodeFirst
- m.R[j1].DstportOrIcmpcodeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].DstportOrIcmpcodeLast
- m.R[j1].DstportOrIcmpcodeLast = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].TCPFlagsMask
- m.R[j1].TCPFlagsMask = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].TCPFlagsValue
- m.R[j1].TCPFlagsValue = uint8(tmp[pos])
- pos += 1
+ buf.EncodeUint8(v0.IsPermit)
+ buf.EncodeUint8(v0.IsIPv6)
+ buf.EncodeBytes(v0.SrcIPAddr, 16)
+ buf.EncodeUint8(v0.SrcIPPrefixLen)
+ buf.EncodeBytes(v0.DstIPAddr, 16)
+ buf.EncodeUint8(v0.DstIPPrefixLen)
+ buf.EncodeUint8(v0.Proto)
+ 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
+}
+func (m *ACLAddReplace) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ACLIndex = buf.DecodeUint32()
+ m.Tag = make([]byte, 64)
+ copy(m.Tag, buf.DecodeBytes(len(m.Tag)))
+ m.Count = buf.DecodeUint32()
+ m.R = make([]ACLRule, m.Count)
+ for j0 := 0; j0 < len(m.R); j0++ {
+ m.R[j0].IsPermit = buf.DecodeUint8()
+ m.R[j0].IsIPv6 = buf.DecodeUint8()
+ m.R[j0].SrcIPAddr = make([]byte, 16)
+ copy(m.R[j0].SrcIPAddr, buf.DecodeBytes(len(m.R[j0].SrcIPAddr)))
+ m.R[j0].SrcIPPrefixLen = buf.DecodeUint8()
+ m.R[j0].DstIPAddr = make([]byte, 16)
+ copy(m.R[j0].DstIPAddr, buf.DecodeBytes(len(m.R[j0].DstIPAddr)))
+ m.R[j0].DstIPPrefixLen = buf.DecodeUint8()
+ m.R[j0].Proto = buf.DecodeUint8()
+ m.R[j0].SrcportOrIcmptypeFirst = buf.DecodeUint16()
+ m.R[j0].SrcportOrIcmptypeLast = buf.DecodeUint16()
+ m.R[j0].DstportOrIcmpcodeFirst = buf.DecodeUint16()
+ m.R[j0].DstportOrIcmpcodeLast = buf.DecodeUint16()
+ m.R[j0].TCPFlagsMask = buf.DecodeUint8()
+ m.R[j0].TCPFlagsValue = buf.DecodeUint8()
}
return nil
}
-// ACLAddReplaceReply represents VPP binary API message 'acl_add_replace_reply'.
+// ACLAddReplaceReply defines message 'acl_add_replace_reply'.
type ACLAddReplaceReply struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *ACLAddReplaceReply) Reset() { *m = ACLAddReplaceReply{} }
-func (*ACLAddReplaceReply) GetMessageName() string { return "acl_add_replace_reply" }
-func (*ACLAddReplaceReply) GetCrcString() string { return "ac407b0c" }
-func (*ACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ACLAddReplaceReply) Reset() { *m = ACLAddReplaceReply{} }
+func (*ACLAddReplaceReply) GetMessageName() string { return "acl_add_replace_reply" }
+func (*ACLAddReplaceReply) GetCrcString() string { return "ac407b0c" }
+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
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Retval
- size += 4
+ size += 4 // m.ACLIndex
+ size += 4 // m.Retval
return size
}
func (m *ACLAddReplaceReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *ACLAddReplaceReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// ACLDel represents VPP binary API message 'acl_del'.
+// ACLDel defines message 'acl_del'.
type ACLDel struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
}
-func (m *ACLDel) Reset() { *m = ACLDel{} }
-func (*ACLDel) GetMessageName() string { return "acl_del" }
-func (*ACLDel) GetCrcString() string { return "ef34fea4" }
-func (*ACLDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ACLDel) Reset() { *m = ACLDel{} }
+func (*ACLDel) GetMessageName() string { return "acl_del" }
+func (*ACLDel) GetCrcString() string { return "ef34fea4" }
+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
- // field[1] m.ACLIndex
- size += 4
+ size += 4 // m.ACLIndex
return size
}
func (m *ACLDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *ACLDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ACLIndex)
+ return buf.Bytes(), nil
+}
+func (m *ACLDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ACLIndex = buf.DecodeUint32()
return nil
}
-// ACLDelReply represents VPP binary API message 'acl_del_reply'.
+// ACLDelReply defines message 'acl_del_reply'.
type ACLDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *ACLDelReply) Reset() { *m = ACLDelReply{} }
-func (*ACLDelReply) GetMessageName() string { return "acl_del_reply" }
-func (*ACLDelReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ACLDelReply) Reset() { *m = ACLDelReply{} }
+func (*ACLDelReply) GetMessageName() string { return "acl_del_reply" }
+func (*ACLDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *ACLDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *ACLDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// ACLDetails represents VPP binary API message 'acl_details'.
+// ACLDetails defines message 'acl_details'.
type ACLDetails struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
+ Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
R []ACLRule `binapi:"acl_rule[count],name=r" json:"r,omitempty"`
}
-func (m *ACLDetails) Reset() { *m = ACLDetails{} }
-func (*ACLDetails) GetMessageName() string { return "acl_details" }
-func (*ACLDetails) GetCrcString() string { return "f89d7a88" }
-func (*ACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ACLDetails) Reset() { *m = ACLDetails{} }
+func (*ACLDetails) GetMessageName() string { return "acl_details" }
+func (*ACLDetails) GetCrcString() string { return "f89d7a88" }
+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
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
+ size += 4 // m.ACLIndex
+ size += 1 * 64 // m.Tag
+ size += 4 // m.Count
for j1 := 0; j1 < len(m.R); j1++ {
var s1 ACLRule
_ = s1
if j1 < len(m.R) {
s1 = m.R[j1]
}
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.IsIPv6
- size += 1
- // field[2] s1.SrcIPAddr
- size += 16
- // field[2] s1.SrcIPPrefixLen
- size += 1
- // field[2] s1.DstIPAddr
- size += 16
- // field[2] s1.DstIPPrefixLen
- size += 1
- // field[2] s1.Proto
- size += 1
- // field[2] s1.SrcportOrIcmptypeFirst
- size += 2
- // field[2] s1.SrcportOrIcmptypeLast
- size += 2
- // field[2] s1.DstportOrIcmpcodeFirst
- size += 2
- // field[2] s1.DstportOrIcmpcodeLast
- size += 2
- // field[2] s1.TCPFlagsMask
- size += 1
- // field[2] s1.TCPFlagsValue
- size += 1
+ size += 1 // s1.IsPermit
+ size += 1 // s1.IsIPv6
+ size += 1 * 16 // s1.SrcIPAddr
+ size += 1 // s1.SrcIPPrefixLen
+ size += 1 * 16 // s1.DstIPAddr
+ size += 1 // s1.DstIPPrefixLen
+ size += 1 // s1.Proto
+ size += 2 // s1.SrcportOrIcmptypeFirst
+ size += 2 // s1.SrcportOrIcmptypeLast
+ size += 2 // s1.DstportOrIcmpcodeFirst
+ size += 2 // s1.DstportOrIcmpcodeLast
+ size += 1 // s1.TCPFlagsMask
+ size += 1 // s1.TCPFlagsValue
}
return size
}
func (m *ACLDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ACLIndex)
+ buf.EncodeBytes(m.Tag, 64)
+ buf.EncodeUint32(uint32(len(m.R)))
+ for j0 := 0; j0 < len(m.R); j0++ {
+ var v0 ACLRule // R
+ if j0 < len(m.R) {
+ v0 = m.R[j0]
}
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 ACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
- pos += 1
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
- pos += 1
- // field[2] v1.DstIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.DstIPAddr) {
- x = uint8(v1.DstIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.DstIPPrefixLen
- buf[pos] = uint8(v1.DstIPPrefixLen)
- pos += 1
- // field[2] v1.Proto
- buf[pos] = uint8(v1.Proto)
- pos += 1
- // field[2] v1.SrcportOrIcmptypeFirst
- o.PutUint16(buf[pos:pos+2], uint16(v1.SrcportOrIcmptypeFirst))
- pos += 2
- // field[2] v1.SrcportOrIcmptypeLast
- o.PutUint16(buf[pos:pos+2], uint16(v1.SrcportOrIcmptypeLast))
- pos += 2
- // field[2] v1.DstportOrIcmpcodeFirst
- o.PutUint16(buf[pos:pos+2], uint16(v1.DstportOrIcmpcodeFirst))
- pos += 2
- // field[2] v1.DstportOrIcmpcodeLast
- o.PutUint16(buf[pos:pos+2], uint16(v1.DstportOrIcmpcodeLast))
- pos += 2
- // field[2] v1.TCPFlagsMask
- buf[pos] = uint8(v1.TCPFlagsMask)
- pos += 1
- // field[2] v1.TCPFlagsValue
- buf[pos] = uint8(v1.TCPFlagsValue)
- pos += 1
- }
- return buf, nil
-}
-func (m *ACLDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]ACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].DstIPAddr
- m.R[j1].DstIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].DstIPAddr); i++ {
- m.R[j1].DstIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].DstIPPrefixLen
- m.R[j1].DstIPPrefixLen = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].Proto
- m.R[j1].Proto = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcportOrIcmptypeFirst
- m.R[j1].SrcportOrIcmptypeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].SrcportOrIcmptypeLast
- m.R[j1].SrcportOrIcmptypeLast = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].DstportOrIcmpcodeFirst
- m.R[j1].DstportOrIcmpcodeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].DstportOrIcmpcodeLast
- m.R[j1].DstportOrIcmpcodeLast = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].TCPFlagsMask
- m.R[j1].TCPFlagsMask = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].TCPFlagsValue
- m.R[j1].TCPFlagsValue = uint8(tmp[pos])
- pos += 1
+ buf.EncodeUint8(v0.IsPermit)
+ buf.EncodeUint8(v0.IsIPv6)
+ buf.EncodeBytes(v0.SrcIPAddr, 16)
+ buf.EncodeUint8(v0.SrcIPPrefixLen)
+ buf.EncodeBytes(v0.DstIPAddr, 16)
+ buf.EncodeUint8(v0.DstIPPrefixLen)
+ buf.EncodeUint8(v0.Proto)
+ 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
+}
+func (m *ACLDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ACLIndex = buf.DecodeUint32()
+ m.Tag = make([]byte, 64)
+ copy(m.Tag, buf.DecodeBytes(len(m.Tag)))
+ m.Count = buf.DecodeUint32()
+ m.R = make([]ACLRule, m.Count)
+ for j0 := 0; j0 < len(m.R); j0++ {
+ m.R[j0].IsPermit = buf.DecodeUint8()
+ m.R[j0].IsIPv6 = buf.DecodeUint8()
+ m.R[j0].SrcIPAddr = make([]byte, 16)
+ copy(m.R[j0].SrcIPAddr, buf.DecodeBytes(len(m.R[j0].SrcIPAddr)))
+ m.R[j0].SrcIPPrefixLen = buf.DecodeUint8()
+ m.R[j0].DstIPAddr = make([]byte, 16)
+ copy(m.R[j0].DstIPAddr, buf.DecodeBytes(len(m.R[j0].DstIPAddr)))
+ m.R[j0].DstIPPrefixLen = buf.DecodeUint8()
+ m.R[j0].Proto = buf.DecodeUint8()
+ m.R[j0].SrcportOrIcmptypeFirst = buf.DecodeUint16()
+ m.R[j0].SrcportOrIcmptypeLast = buf.DecodeUint16()
+ m.R[j0].DstportOrIcmpcodeFirst = buf.DecodeUint16()
+ m.R[j0].DstportOrIcmpcodeLast = buf.DecodeUint16()
+ m.R[j0].TCPFlagsMask = buf.DecodeUint8()
+ m.R[j0].TCPFlagsValue = buf.DecodeUint8()
}
return nil
}
-// ACLDump represents VPP binary API message 'acl_dump'.
+// ACLDump defines message 'acl_dump'.
type ACLDump struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
}
-func (m *ACLDump) Reset() { *m = ACLDump{} }
-func (*ACLDump) GetMessageName() string { return "acl_dump" }
-func (*ACLDump) GetCrcString() string { return "ef34fea4" }
-func (*ACLDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ACLDump) Reset() { *m = ACLDump{} }
+func (*ACLDump) GetMessageName() string { return "acl_dump" }
+func (*ACLDump) GetCrcString() string { return "ef34fea4" }
+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
- // field[1] m.ACLIndex
- size += 4
+ size += 4 // m.ACLIndex
return size
}
func (m *ACLDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *ACLDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ACLIndex)
+ return buf.Bytes(), nil
+}
+func (m *ACLDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ACLIndex = buf.DecodeUint32()
return nil
}
-// ACLInterfaceAddDel represents VPP binary API message 'acl_interface_add_del'.
+// ACLInterfaceAddDel defines message 'acl_interface_add_del'.
type ACLInterfaceAddDel struct {
IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
IsInput uint8 `binapi:"u8,name=is_input" json:"is_input,omitempty"`
@@ -703,121 +400,80 @@ type ACLInterfaceAddDel struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
}
-func (m *ACLInterfaceAddDel) Reset() { *m = ACLInterfaceAddDel{} }
-func (*ACLInterfaceAddDel) GetMessageName() string { return "acl_interface_add_del" }
-func (*ACLInterfaceAddDel) GetCrcString() string { return "0b2aedd1" }
-func (*ACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ACLInterfaceAddDel) Reset() { *m = ACLInterfaceAddDel{} }
+func (*ACLInterfaceAddDel) GetMessageName() string { return "acl_interface_add_del" }
+func (*ACLInterfaceAddDel) GetCrcString() string { return "0b2aedd1" }
+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
- // field[1] m.IsAdd
- size += 1
- // field[1] m.IsInput
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.ACLIndex
- size += 4
+ size += 1 // m.IsAdd
+ size += 1 // m.IsInput
+ size += 4 // m.SwIfIndex
+ size += 4 // m.ACLIndex
return size
}
func (m *ACLInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- buf[pos] = uint8(m.IsAdd)
- pos += 1
- // field[1] m.IsInput
- buf[pos] = uint8(m.IsInput)
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *ACLInterfaceAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = uint8(tmp[pos])
- pos += 1
- // field[1] m.IsInput
- m.IsInput = uint8(tmp[pos])
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.IsInput)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.ACLIndex)
+ return buf.Bytes(), nil
+}
+func (m *ACLInterfaceAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.IsInput = buf.DecodeUint8()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.ACLIndex = buf.DecodeUint32()
return nil
}
-// ACLInterfaceAddDelReply represents VPP binary API message 'acl_interface_add_del_reply'.
+// ACLInterfaceAddDelReply defines message 'acl_interface_add_del_reply'.
type ACLInterfaceAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *ACLInterfaceAddDelReply) Reset() { *m = ACLInterfaceAddDelReply{} }
-func (*ACLInterfaceAddDelReply) GetMessageName() string { return "acl_interface_add_del_reply" }
-func (*ACLInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ACLInterfaceAddDelReply) Reset() { *m = ACLInterfaceAddDelReply{} }
+func (*ACLInterfaceAddDelReply) GetMessageName() string { return "acl_interface_add_del_reply" }
+func (*ACLInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *ACLInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *ACLInterfaceAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// ACLInterfaceEtypeWhitelistDetails represents VPP binary API message 'acl_interface_etype_whitelist_details'.
+// ACLInterfaceEtypeWhitelistDetails defines message 'acl_interface_etype_whitelist_details'.
type ACLInterfaceEtypeWhitelistDetails struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Whitelist"`
+ Count uint8 `binapi:"u8,name=count" json:"-"`
NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
Whitelist []uint16 `binapi:"u16[count],name=whitelist" json:"whitelist,omitempty"`
}
@@ -826,79 +482,51 @@ func (m *ACLInterfaceEtypeWhitelistDetails) Reset() { *m = ACLInterfaceEtypeWhit
func (*ACLInterfaceEtypeWhitelistDetails) GetMessageName() string {
return "acl_interface_etype_whitelist_details"
}
-func (*ACLInterfaceEtypeWhitelistDetails) GetCrcString() string { return "6a5d4e81" }
-func (*ACLInterfaceEtypeWhitelistDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*ACLInterfaceEtypeWhitelistDetails) GetCrcString() string { return "6a5d4e81" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.NInput
- size += 1
- // field[1] m.Whitelist
- size += 2 * len(m.Whitelist)
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Count
+ size += 1 // m.NInput
+ size += 2 * len(m.Whitelist) // m.Whitelist
return size
}
func (m *ACLInterfaceEtypeWhitelistDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Count
- buf[pos] = uint8(len(m.Whitelist))
- pos += 1
- // field[1] m.NInput
- buf[pos] = uint8(m.NInput)
- pos += 1
- // field[1] m.Whitelist
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(uint8(len(m.Whitelist)))
+ 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])
}
- o.PutUint16(buf[pos:pos+2], uint16(x))
- pos += 2
- }
- return buf, nil
-}
-func (m *ACLInterfaceEtypeWhitelistDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.NInput
- m.NInput = uint8(tmp[pos])
- pos += 1
- // field[1] m.Whitelist
+ buf.EncodeUint16(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *ACLInterfaceEtypeWhitelistDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Count = buf.DecodeUint8()
+ m.NInput = buf.DecodeUint8()
m.Whitelist = make([]uint16, m.Count)
for i := 0; i < len(m.Whitelist); i++ {
- m.Whitelist[i] = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ m.Whitelist[i] = buf.DecodeUint16()
}
return nil
}
-// ACLInterfaceEtypeWhitelistDump represents VPP binary API message 'acl_interface_etype_whitelist_dump'.
+// ACLInterfaceEtypeWhitelistDump defines message 'acl_interface_etype_whitelist_dump'.
type ACLInterfaceEtypeWhitelistDump struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
}
@@ -907,256 +535,174 @@ func (m *ACLInterfaceEtypeWhitelistDump) Reset() { *m = ACLInterfaceEtypeWhiteli
func (*ACLInterfaceEtypeWhitelistDump) GetMessageName() string {
return "acl_interface_etype_whitelist_dump"
}
-func (*ACLInterfaceEtypeWhitelistDump) GetCrcString() string { return "529cb13f" }
-func (*ACLInterfaceEtypeWhitelistDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (*ACLInterfaceEtypeWhitelistDump) GetCrcString() string { return "529cb13f" }
+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
- // field[1] m.SwIfIndex
- size += 4
+ size += 4 // m.SwIfIndex
return size
}
func (m *ACLInterfaceEtypeWhitelistDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *ACLInterfaceEtypeWhitelistDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *ACLInterfaceEtypeWhitelistDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
return nil
}
-// ACLInterfaceListDetails represents VPP binary API message 'acl_interface_list_details'.
+// ACLInterfaceListDetails defines message 'acl_interface_list_details'.
type ACLInterfaceListDetails struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
+ Count uint8 `binapi:"u8,name=count" json:"-"`
NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
}
-func (m *ACLInterfaceListDetails) Reset() { *m = ACLInterfaceListDetails{} }
-func (*ACLInterfaceListDetails) GetMessageName() string { return "acl_interface_list_details" }
-func (*ACLInterfaceListDetails) GetCrcString() string { return "d5e80809" }
-func (*ACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ACLInterfaceListDetails) Reset() { *m = ACLInterfaceListDetails{} }
+func (*ACLInterfaceListDetails) GetMessageName() string { return "acl_interface_list_details" }
+func (*ACLInterfaceListDetails) GetCrcString() string { return "d5e80809" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.NInput
- size += 1
- // field[1] m.Acls
- size += 4 * len(m.Acls)
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Count
+ size += 1 // m.NInput
+ size += 4 * len(m.Acls) // m.Acls
return size
}
func (m *ACLInterfaceListDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Count
- buf[pos] = uint8(len(m.Acls))
- pos += 1
- // field[1] m.NInput
- buf[pos] = uint8(m.NInput)
- pos += 1
- // field[1] m.Acls
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(uint8(len(m.Acls)))
+ 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])
}
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *ACLInterfaceListDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.NInput
- m.NInput = uint8(tmp[pos])
- pos += 1
- // field[1] m.Acls
+ buf.EncodeUint32(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *ACLInterfaceListDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Count = buf.DecodeUint8()
+ m.NInput = buf.DecodeUint8()
m.Acls = make([]uint32, m.Count)
for i := 0; i < len(m.Acls); i++ {
- m.Acls[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ m.Acls[i] = buf.DecodeUint32()
}
return nil
}
-// ACLInterfaceListDump represents VPP binary API message 'acl_interface_list_dump'.
+// ACLInterfaceListDump defines message 'acl_interface_list_dump'.
type ACLInterfaceListDump struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
}
-func (m *ACLInterfaceListDump) Reset() { *m = ACLInterfaceListDump{} }
-func (*ACLInterfaceListDump) GetMessageName() string { return "acl_interface_list_dump" }
-func (*ACLInterfaceListDump) GetCrcString() string { return "529cb13f" }
-func (*ACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ACLInterfaceListDump) Reset() { *m = ACLInterfaceListDump{} }
+func (*ACLInterfaceListDump) GetMessageName() string { return "acl_interface_list_dump" }
+func (*ACLInterfaceListDump) GetCrcString() string { return "529cb13f" }
+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
- // field[1] m.SwIfIndex
- size += 4
+ size += 4 // m.SwIfIndex
return size
}
func (m *ACLInterfaceListDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *ACLInterfaceListDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *ACLInterfaceListDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
return nil
}
-// ACLInterfaceSetACLList represents VPP binary API message 'acl_interface_set_acl_list'.
+// ACLInterfaceSetACLList defines message 'acl_interface_set_acl_list'.
type ACLInterfaceSetACLList struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
+ Count uint8 `binapi:"u8,name=count" json:"-"`
NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
}
-func (m *ACLInterfaceSetACLList) Reset() { *m = ACLInterfaceSetACLList{} }
-func (*ACLInterfaceSetACLList) GetMessageName() string { return "acl_interface_set_acl_list" }
-func (*ACLInterfaceSetACLList) GetCrcString() string { return "8baece38" }
-func (*ACLInterfaceSetACLList) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ACLInterfaceSetACLList) Reset() { *m = ACLInterfaceSetACLList{} }
+func (*ACLInterfaceSetACLList) GetMessageName() string { return "acl_interface_set_acl_list" }
+func (*ACLInterfaceSetACLList) GetCrcString() string { return "8baece38" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.NInput
- size += 1
- // field[1] m.Acls
- size += 4 * len(m.Acls)
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Count
+ size += 1 // m.NInput
+ size += 4 * len(m.Acls) // m.Acls
return size
}
func (m *ACLInterfaceSetACLList) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Count
- buf[pos] = uint8(len(m.Acls))
- pos += 1
- // field[1] m.NInput
- buf[pos] = uint8(m.NInput)
- pos += 1
- // field[1] m.Acls
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(uint8(len(m.Acls)))
+ 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])
}
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *ACLInterfaceSetACLList) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.NInput
- m.NInput = uint8(tmp[pos])
- pos += 1
- // field[1] m.Acls
+ buf.EncodeUint32(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *ACLInterfaceSetACLList) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Count = buf.DecodeUint8()
+ m.NInput = buf.DecodeUint8()
m.Acls = make([]uint32, m.Count)
for i := 0; i < len(m.Acls); i++ {
- m.Acls[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ m.Acls[i] = buf.DecodeUint32()
}
return nil
}
-// ACLInterfaceSetACLListReply represents VPP binary API message 'acl_interface_set_acl_list_reply'.
+// ACLInterfaceSetACLListReply defines message 'acl_interface_set_acl_list_reply'.
type ACLInterfaceSetACLListReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -1165,49 +711,36 @@ func (m *ACLInterfaceSetACLListReply) Reset() { *m = ACLInterfaceSetACLListReply
func (*ACLInterfaceSetACLListReply) GetMessageName() string {
return "acl_interface_set_acl_list_reply"
}
-func (*ACLInterfaceSetACLListReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLInterfaceSetACLListReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*ACLInterfaceSetACLListReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *ACLInterfaceSetACLListReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *ACLInterfaceSetACLListReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// ACLInterfaceSetEtypeWhitelist represents VPP binary API message 'acl_interface_set_etype_whitelist'.
+// ACLInterfaceSetEtypeWhitelist defines message 'acl_interface_set_etype_whitelist'.
type ACLInterfaceSetEtypeWhitelist struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Whitelist"`
+ Count uint8 `binapi:"u8,name=count" json:"-"`
NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
Whitelist []uint16 `binapi:"u16[count],name=whitelist" json:"whitelist,omitempty"`
}
@@ -1216,79 +749,51 @@ func (m *ACLInterfaceSetEtypeWhitelist) Reset() { *m = ACLInterfaceSetEtypeWhite
func (*ACLInterfaceSetEtypeWhitelist) GetMessageName() string {
return "acl_interface_set_etype_whitelist"
}
-func (*ACLInterfaceSetEtypeWhitelist) GetCrcString() string { return "f515efc5" }
-func (*ACLInterfaceSetEtypeWhitelist) GetMessageType() api.MessageType { return api.RequestMessage }
+func (*ACLInterfaceSetEtypeWhitelist) GetCrcString() string { return "f515efc5" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.NInput
- size += 1
- // field[1] m.Whitelist
- size += 2 * len(m.Whitelist)
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Count
+ size += 1 // m.NInput
+ size += 2 * len(m.Whitelist) // m.Whitelist
return size
}
func (m *ACLInterfaceSetEtypeWhitelist) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Count
- buf[pos] = uint8(len(m.Whitelist))
- pos += 1
- // field[1] m.NInput
- buf[pos] = uint8(m.NInput)
- pos += 1
- // field[1] m.Whitelist
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(uint8(len(m.Whitelist)))
+ 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])
}
- o.PutUint16(buf[pos:pos+2], uint16(x))
- pos += 2
- }
- return buf, nil
-}
-func (m *ACLInterfaceSetEtypeWhitelist) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.NInput
- m.NInput = uint8(tmp[pos])
- pos += 1
- // field[1] m.Whitelist
+ buf.EncodeUint16(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *ACLInterfaceSetEtypeWhitelist) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Count = buf.DecodeUint8()
+ m.NInput = buf.DecodeUint8()
m.Whitelist = make([]uint16, m.Count)
for i := 0; i < len(m.Whitelist); i++ {
- m.Whitelist[i] = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ m.Whitelist[i] = buf.DecodeUint16()
}
return nil
}
-// ACLInterfaceSetEtypeWhitelistReply represents VPP binary API message 'acl_interface_set_etype_whitelist_reply'.
+// ACLInterfaceSetEtypeWhitelistReply defines message 'acl_interface_set_etype_whitelist_reply'.
type ACLInterfaceSetEtypeWhitelistReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -1297,184 +802,130 @@ func (m *ACLInterfaceSetEtypeWhitelistReply) Reset() { *m = ACLInterfaceSetEtype
func (*ACLInterfaceSetEtypeWhitelistReply) GetMessageName() string {
return "acl_interface_set_etype_whitelist_reply"
}
-func (*ACLInterfaceSetEtypeWhitelistReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLInterfaceSetEtypeWhitelistReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*ACLInterfaceSetEtypeWhitelistReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *ACLInterfaceSetEtypeWhitelistReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *ACLInterfaceSetEtypeWhitelistReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// ACLPluginControlPing represents VPP binary API message 'acl_plugin_control_ping'.
+// ACLPluginControlPing defines message 'acl_plugin_control_ping'.
type ACLPluginControlPing struct{}
-func (m *ACLPluginControlPing) Reset() { *m = ACLPluginControlPing{} }
-func (*ACLPluginControlPing) GetMessageName() string { return "acl_plugin_control_ping" }
-func (*ACLPluginControlPing) GetCrcString() string { return "51077d14" }
-func (*ACLPluginControlPing) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ACLPluginControlPing) Reset() { *m = ACLPluginControlPing{} }
+func (*ACLPluginControlPing) GetMessageName() string { return "acl_plugin_control_ping" }
+func (*ACLPluginControlPing) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *ACLPluginControlPing) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *ACLPluginControlPing) Unmarshal(b []byte) error {
return nil
}
-// ACLPluginControlPingReply represents VPP binary API message 'acl_plugin_control_ping_reply'.
+// ACLPluginControlPingReply defines message 'acl_plugin_control_ping_reply'.
type ACLPluginControlPingReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
ClientIndex uint32 `binapi:"u32,name=client_index" json:"client_index,omitempty"`
VpePID uint32 `binapi:"u32,name=vpe_pid" json:"vpe_pid,omitempty"`
}
-func (m *ACLPluginControlPingReply) Reset() { *m = ACLPluginControlPingReply{} }
-func (*ACLPluginControlPingReply) GetMessageName() string { return "acl_plugin_control_ping_reply" }
-func (*ACLPluginControlPingReply) GetCrcString() string { return "f6b0b8ca" }
-func (*ACLPluginControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ACLPluginControlPingReply) Reset() { *m = ACLPluginControlPingReply{} }
+func (*ACLPluginControlPingReply) GetMessageName() string { return "acl_plugin_control_ping_reply" }
+func (*ACLPluginControlPingReply) GetCrcString() string { return "f6b0b8ca" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.ClientIndex
- size += 4
- // field[1] m.VpePID
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.ClientIndex
+ size += 4 // m.VpePID
return size
}
func (m *ACLPluginControlPingReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.ClientIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ClientIndex))
- pos += 4
- // field[1] m.VpePID
- o.PutUint32(buf[pos:pos+4], uint32(m.VpePID))
- pos += 4
- return buf, nil
-}
-func (m *ACLPluginControlPingReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ClientIndex
- m.ClientIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VpePID
- m.VpePID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.ClientIndex = buf.DecodeUint32()
+ m.VpePID = buf.DecodeUint32()
return nil
}
-// ACLPluginGetConnTableMaxEntries represents VPP binary API message 'acl_plugin_get_conn_table_max_entries'.
+// ACLPluginGetConnTableMaxEntries defines message 'acl_plugin_get_conn_table_max_entries'.
type ACLPluginGetConnTableMaxEntries struct{}
func (m *ACLPluginGetConnTableMaxEntries) Reset() { *m = ACLPluginGetConnTableMaxEntries{} }
func (*ACLPluginGetConnTableMaxEntries) GetMessageName() string {
return "acl_plugin_get_conn_table_max_entries"
}
-func (*ACLPluginGetConnTableMaxEntries) GetCrcString() string { return "51077d14" }
-func (*ACLPluginGetConnTableMaxEntries) GetMessageType() api.MessageType { return api.RequestMessage }
+func (*ACLPluginGetConnTableMaxEntries) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *ACLPluginGetConnTableMaxEntries) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *ACLPluginGetConnTableMaxEntries) Unmarshal(b []byte) error {
return nil
}
-// ACLPluginGetConnTableMaxEntriesReply represents VPP binary API message 'acl_plugin_get_conn_table_max_entries_reply'.
+// ACLPluginGetConnTableMaxEntriesReply defines message 'acl_plugin_get_conn_table_max_entries_reply'.
type ACLPluginGetConnTableMaxEntriesReply struct {
ConnTableMaxEntries uint64 `binapi:"u64,name=conn_table_max_entries" json:"conn_table_max_entries,omitempty"`
}
@@ -1488,182 +939,125 @@ 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
- // field[1] m.ConnTableMaxEntries
- size += 8
+ size += 8 // m.ConnTableMaxEntries
return size
}
func (m *ACLPluginGetConnTableMaxEntriesReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ConnTableMaxEntries
- o.PutUint64(buf[pos:pos+8], uint64(m.ConnTableMaxEntries))
- pos += 8
- return buf, nil
-}
-func (m *ACLPluginGetConnTableMaxEntriesReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ConnTableMaxEntries
- m.ConnTableMaxEntries = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint64(m.ConnTableMaxEntries)
+ return buf.Bytes(), nil
+}
+func (m *ACLPluginGetConnTableMaxEntriesReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ConnTableMaxEntries = buf.DecodeUint64()
return nil
}
-// ACLPluginGetVersion represents VPP binary API message 'acl_plugin_get_version'.
+// ACLPluginGetVersion defines message 'acl_plugin_get_version'.
type ACLPluginGetVersion struct{}
-func (m *ACLPluginGetVersion) Reset() { *m = ACLPluginGetVersion{} }
-func (*ACLPluginGetVersion) GetMessageName() string { return "acl_plugin_get_version" }
-func (*ACLPluginGetVersion) GetCrcString() string { return "51077d14" }
-func (*ACLPluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ACLPluginGetVersion) Reset() { *m = ACLPluginGetVersion{} }
+func (*ACLPluginGetVersion) GetMessageName() string { return "acl_plugin_get_version" }
+func (*ACLPluginGetVersion) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *ACLPluginGetVersion) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *ACLPluginGetVersion) Unmarshal(b []byte) error {
return nil
}
-// ACLPluginGetVersionReply represents VPP binary API message 'acl_plugin_get_version_reply'.
+// ACLPluginGetVersionReply defines message 'acl_plugin_get_version_reply'.
type ACLPluginGetVersionReply struct {
Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
}
-func (m *ACLPluginGetVersionReply) Reset() { *m = ACLPluginGetVersionReply{} }
-func (*ACLPluginGetVersionReply) GetMessageName() string { return "acl_plugin_get_version_reply" }
-func (*ACLPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
-func (*ACLPluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ACLPluginGetVersionReply) Reset() { *m = ACLPluginGetVersionReply{} }
+func (*ACLPluginGetVersionReply) GetMessageName() string { return "acl_plugin_get_version_reply" }
+func (*ACLPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
+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
- // field[1] m.Major
- size += 4
- // field[1] m.Minor
- size += 4
+ size += 4 // m.Major
+ size += 4 // m.Minor
return size
}
func (m *ACLPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Major
- o.PutUint32(buf[pos:pos+4], uint32(m.Major))
- pos += 4
- // field[1] m.Minor
- o.PutUint32(buf[pos:pos+4], uint32(m.Minor))
- pos += 4
- return buf, nil
-}
-func (m *ACLPluginGetVersionReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Major
- m.Major = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Minor
- m.Minor = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Major)
+ buf.EncodeUint32(m.Minor)
+ return buf.Bytes(), nil
+}
+func (m *ACLPluginGetVersionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Major = buf.DecodeUint32()
+ m.Minor = buf.DecodeUint32()
return nil
}
-// ACLStatsIntfCountersEnable represents VPP binary API message 'acl_stats_intf_counters_enable'.
+// ACLStatsIntfCountersEnable defines message 'acl_stats_intf_counters_enable'.
type ACLStatsIntfCountersEnable struct {
Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
}
-func (m *ACLStatsIntfCountersEnable) Reset() { *m = ACLStatsIntfCountersEnable{} }
-func (*ACLStatsIntfCountersEnable) GetMessageName() string { return "acl_stats_intf_counters_enable" }
-func (*ACLStatsIntfCountersEnable) GetCrcString() string { return "b3e225d2" }
-func (*ACLStatsIntfCountersEnable) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ACLStatsIntfCountersEnable) Reset() { *m = ACLStatsIntfCountersEnable{} }
+func (*ACLStatsIntfCountersEnable) GetMessageName() string { return "acl_stats_intf_counters_enable" }
+func (*ACLStatsIntfCountersEnable) GetCrcString() string { return "b3e225d2" }
+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
- // field[1] m.Enable
- size += 1
+ size += 1 // m.Enable
return size
}
func (m *ACLStatsIntfCountersEnable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Enable
- if m.Enable {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *ACLStatsIntfCountersEnable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Enable
- m.Enable = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *ACLStatsIntfCountersEnable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
return nil
}
-// ACLStatsIntfCountersEnableReply represents VPP binary API message 'acl_stats_intf_counters_enable_reply'.
+// ACLStatsIntfCountersEnableReply defines message 'acl_stats_intf_counters_enable_reply'.
type ACLStatsIntfCountersEnableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -1672,853 +1066,483 @@ func (m *ACLStatsIntfCountersEnableReply) Reset() { *m = ACLStatsIntfCountersEna
func (*ACLStatsIntfCountersEnableReply) GetMessageName() string {
return "acl_stats_intf_counters_enable_reply"
}
-func (*ACLStatsIntfCountersEnableReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLStatsIntfCountersEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*ACLStatsIntfCountersEnableReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *ACLStatsIntfCountersEnableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *ACLStatsIntfCountersEnableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// MacipACLAdd represents VPP binary API message 'macip_acl_add'.
+// MacipACLAdd defines message 'macip_acl_add'.
type MacipACLAdd struct {
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
+ Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
R []MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"`
}
-func (m *MacipACLAdd) Reset() { *m = MacipACLAdd{} }
-func (*MacipACLAdd) GetMessageName() string { return "macip_acl_add" }
-func (*MacipACLAdd) GetCrcString() string { return "0c680ca5" }
-func (*MacipACLAdd) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MacipACLAdd) Reset() { *m = MacipACLAdd{} }
+func (*MacipACLAdd) GetMessageName() string { return "macip_acl_add" }
+func (*MacipACLAdd) GetCrcString() string { return "0c680ca5" }
+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
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
+ size += 1 * 64 // m.Tag
+ size += 4 // m.Count
for j1 := 0; j1 < len(m.R); j1++ {
var s1 MacipACLRule
_ = s1
if j1 < len(m.R) {
s1 = m.R[j1]
}
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.IsIPv6
- size += 1
- // field[2] s1.SrcMac
- size += 6
- // field[2] s1.SrcMacMask
- size += 6
- // field[2] s1.SrcIPAddr
- size += 16
- // field[2] s1.SrcIPPrefixLen
- size += 1
+ size += 1 // s1.IsPermit
+ size += 1 // s1.IsIPv6
+ size += 1 * 6 // s1.SrcMac
+ size += 1 * 6 // s1.SrcMacMask
+ size += 1 * 16 // s1.SrcIPAddr
+ size += 1 // s1.SrcIPPrefixLen
}
return size
}
func (m *MacipACLAdd) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 MacipACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
- pos += 1
- // field[2] v1.SrcMac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMac) {
- x = uint8(v1.SrcMac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcMacMask
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMacMask) {
- x = uint8(v1.SrcMacMask[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
- pos += 1
- }
- return buf, nil
-}
-func (m *MacipACLAdd) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]MacipACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcMac
- m.R[j1].SrcMac = make([]uint8, 6)
- for i := 0; i < len(m.R[j1].SrcMac); i++ {
- m.R[j1].SrcMac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcMacMask
- m.R[j1].SrcMacMask = make([]uint8, 6)
- for i := 0; i < len(m.R[j1].SrcMacMask); i++ {
- m.R[j1].SrcMacMask[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Tag, 64)
+ buf.EncodeUint32(uint32(len(m.R)))
+ for j0 := 0; j0 < len(m.R); j0++ {
+ var v0 MacipACLRule // R
+ if j0 < len(m.R) {
+ v0 = m.R[j0]
}
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
- pos += 1
+ buf.EncodeUint8(v0.IsPermit)
+ buf.EncodeUint8(v0.IsIPv6)
+ buf.EncodeBytes(v0.SrcMac, 6)
+ buf.EncodeBytes(v0.SrcMacMask, 6)
+ buf.EncodeBytes(v0.SrcIPAddr, 16)
+ buf.EncodeUint8(v0.SrcIPPrefixLen)
+ }
+ return buf.Bytes(), nil
+}
+func (m *MacipACLAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Tag = make([]byte, 64)
+ copy(m.Tag, buf.DecodeBytes(len(m.Tag)))
+ m.Count = buf.DecodeUint32()
+ m.R = make([]MacipACLRule, m.Count)
+ for j0 := 0; j0 < len(m.R); j0++ {
+ m.R[j0].IsPermit = buf.DecodeUint8()
+ m.R[j0].IsIPv6 = buf.DecodeUint8()
+ m.R[j0].SrcMac = make([]byte, 6)
+ copy(m.R[j0].SrcMac, buf.DecodeBytes(len(m.R[j0].SrcMac)))
+ m.R[j0].SrcMacMask = make([]byte, 6)
+ copy(m.R[j0].SrcMacMask, buf.DecodeBytes(len(m.R[j0].SrcMacMask)))
+ m.R[j0].SrcIPAddr = make([]byte, 16)
+ copy(m.R[j0].SrcIPAddr, buf.DecodeBytes(len(m.R[j0].SrcIPAddr)))
+ m.R[j0].SrcIPPrefixLen = buf.DecodeUint8()
}
return nil
}
-// MacipACLAddReplace represents VPP binary API message 'macip_acl_add_replace'.
+// MacipACLAddReplace defines message 'macip_acl_add_replace'.
type MacipACLAddReplace struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
+ Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
R []MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"`
}
-func (m *MacipACLAddReplace) Reset() { *m = MacipACLAddReplace{} }
-func (*MacipACLAddReplace) GetMessageName() string { return "macip_acl_add_replace" }
-func (*MacipACLAddReplace) GetCrcString() string { return "d3d313e7" }
-func (*MacipACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MacipACLAddReplace) Reset() { *m = MacipACLAddReplace{} }
+func (*MacipACLAddReplace) GetMessageName() string { return "macip_acl_add_replace" }
+func (*MacipACLAddReplace) GetCrcString() string { return "d3d313e7" }
+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
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
+ size += 4 // m.ACLIndex
+ size += 1 * 64 // m.Tag
+ size += 4 // m.Count
for j1 := 0; j1 < len(m.R); j1++ {
var s1 MacipACLRule
_ = s1
if j1 < len(m.R) {
s1 = m.R[j1]
}
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.IsIPv6
- size += 1
- // field[2] s1.SrcMac
- size += 6
- // field[2] s1.SrcMacMask
- size += 6
- // field[2] s1.SrcIPAddr
- size += 16
- // field[2] s1.SrcIPPrefixLen
- size += 1
+ size += 1 // s1.IsPermit
+ size += 1 // s1.IsIPv6
+ size += 1 * 6 // s1.SrcMac
+ size += 1 * 6 // s1.SrcMacMask
+ size += 1 * 16 // s1.SrcIPAddr
+ size += 1 // s1.SrcIPPrefixLen
}
return size
}
func (m *MacipACLAddReplace) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 MacipACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
- pos += 1
- // field[2] v1.SrcMac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMac) {
- x = uint8(v1.SrcMac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcMacMask
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMacMask) {
- x = uint8(v1.SrcMacMask[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
- pos += 1
- }
- return buf, nil
-}
-func (m *MacipACLAddReplace) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]MacipACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcMac
- m.R[j1].SrcMac = make([]uint8, 6)
- for i := 0; i < len(m.R[j1].SrcMac); i++ {
- m.R[j1].SrcMac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcMacMask
- m.R[j1].SrcMacMask = make([]uint8, 6)
- for i := 0; i < len(m.R[j1].SrcMacMask); i++ {
- m.R[j1].SrcMacMask[i] = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ACLIndex)
+ buf.EncodeBytes(m.Tag, 64)
+ buf.EncodeUint32(uint32(len(m.R)))
+ for j0 := 0; j0 < len(m.R); j0++ {
+ var v0 MacipACLRule // R
+ if j0 < len(m.R) {
+ v0 = m.R[j0]
}
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
- pos += 1
+ buf.EncodeUint8(v0.IsPermit)
+ buf.EncodeUint8(v0.IsIPv6)
+ buf.EncodeBytes(v0.SrcMac, 6)
+ buf.EncodeBytes(v0.SrcMacMask, 6)
+ buf.EncodeBytes(v0.SrcIPAddr, 16)
+ buf.EncodeUint8(v0.SrcIPPrefixLen)
+ }
+ return buf.Bytes(), nil
+}
+func (m *MacipACLAddReplace) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ACLIndex = buf.DecodeUint32()
+ m.Tag = make([]byte, 64)
+ copy(m.Tag, buf.DecodeBytes(len(m.Tag)))
+ m.Count = buf.DecodeUint32()
+ m.R = make([]MacipACLRule, m.Count)
+ for j0 := 0; j0 < len(m.R); j0++ {
+ m.R[j0].IsPermit = buf.DecodeUint8()
+ m.R[j0].IsIPv6 = buf.DecodeUint8()
+ m.R[j0].SrcMac = make([]byte, 6)
+ copy(m.R[j0].SrcMac, buf.DecodeBytes(len(m.R[j0].SrcMac)))
+ m.R[j0].SrcMacMask = make([]byte, 6)
+ copy(m.R[j0].SrcMacMask, buf.DecodeBytes(len(m.R[j0].SrcMacMask)))
+ m.R[j0].SrcIPAddr = make([]byte, 16)
+ copy(m.R[j0].SrcIPAddr, buf.DecodeBytes(len(m.R[j0].SrcIPAddr)))
+ m.R[j0].SrcIPPrefixLen = buf.DecodeUint8()
}
return nil
}
-// MacipACLAddReplaceReply represents VPP binary API message 'macip_acl_add_replace_reply'.
+// MacipACLAddReplaceReply defines message 'macip_acl_add_replace_reply'.
type MacipACLAddReplaceReply struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *MacipACLAddReplaceReply) Reset() { *m = MacipACLAddReplaceReply{} }
-func (*MacipACLAddReplaceReply) GetMessageName() string { return "macip_acl_add_replace_reply" }
-func (*MacipACLAddReplaceReply) GetCrcString() string { return "ac407b0c" }
-func (*MacipACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MacipACLAddReplaceReply) Reset() { *m = MacipACLAddReplaceReply{} }
+func (*MacipACLAddReplaceReply) GetMessageName() string { return "macip_acl_add_replace_reply" }
+func (*MacipACLAddReplaceReply) GetCrcString() string { return "ac407b0c" }
+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
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Retval
- size += 4
+ size += 4 // m.ACLIndex
+ size += 4 // m.Retval
return size
}
func (m *MacipACLAddReplaceReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLAddReplaceReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// MacipACLAddReply represents VPP binary API message 'macip_acl_add_reply'.
+// MacipACLAddReply defines message 'macip_acl_add_reply'.
type MacipACLAddReply struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *MacipACLAddReply) Reset() { *m = MacipACLAddReply{} }
-func (*MacipACLAddReply) GetMessageName() string { return "macip_acl_add_reply" }
-func (*MacipACLAddReply) GetCrcString() string { return "ac407b0c" }
-func (*MacipACLAddReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MacipACLAddReply) Reset() { *m = MacipACLAddReply{} }
+func (*MacipACLAddReply) GetMessageName() string { return "macip_acl_add_reply" }
+func (*MacipACLAddReply) GetCrcString() string { return "ac407b0c" }
+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
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Retval
- size += 4
+ size += 4 // m.ACLIndex
+ size += 4 // m.Retval
return size
}
func (m *MacipACLAddReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLAddReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// MacipACLDel represents VPP binary API message 'macip_acl_del'.
+// MacipACLDel defines message 'macip_acl_del'.
type MacipACLDel struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
}
-func (m *MacipACLDel) Reset() { *m = MacipACLDel{} }
-func (*MacipACLDel) GetMessageName() string { return "macip_acl_del" }
-func (*MacipACLDel) GetCrcString() string { return "ef34fea4" }
-func (*MacipACLDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MacipACLDel) Reset() { *m = MacipACLDel{} }
+func (*MacipACLDel) GetMessageName() string { return "macip_acl_del" }
+func (*MacipACLDel) GetCrcString() string { return "ef34fea4" }
+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
- // field[1] m.ACLIndex
- size += 4
+ size += 4 // m.ACLIndex
return size
}
func (m *MacipACLDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ACLIndex)
+ return buf.Bytes(), nil
+}
+func (m *MacipACLDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ACLIndex = buf.DecodeUint32()
return nil
}
-// MacipACLDelReply represents VPP binary API message 'macip_acl_del_reply'.
+// MacipACLDelReply defines message 'macip_acl_del_reply'.
type MacipACLDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *MacipACLDelReply) Reset() { *m = MacipACLDelReply{} }
-func (*MacipACLDelReply) GetMessageName() string { return "macip_acl_del_reply" }
-func (*MacipACLDelReply) GetCrcString() string { return "e8d4e804" }
-func (*MacipACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MacipACLDelReply) Reset() { *m = MacipACLDelReply{} }
+func (*MacipACLDelReply) GetMessageName() string { return "macip_acl_del_reply" }
+func (*MacipACLDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *MacipACLDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// MacipACLDetails represents VPP binary API message 'macip_acl_details'.
+// MacipACLDetails defines message 'macip_acl_details'.
type MacipACLDetails struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
+ Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
R []MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"`
}
-func (m *MacipACLDetails) Reset() { *m = MacipACLDetails{} }
-func (*MacipACLDetails) GetMessageName() string { return "macip_acl_details" }
-func (*MacipACLDetails) GetCrcString() string { return "e164e69a" }
-func (*MacipACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MacipACLDetails) Reset() { *m = MacipACLDetails{} }
+func (*MacipACLDetails) GetMessageName() string { return "macip_acl_details" }
+func (*MacipACLDetails) GetCrcString() string { return "e164e69a" }
+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
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
+ size += 4 // m.ACLIndex
+ size += 1 * 64 // m.Tag
+ size += 4 // m.Count
for j1 := 0; j1 < len(m.R); j1++ {
var s1 MacipACLRule
_ = s1
if j1 < len(m.R) {
s1 = m.R[j1]
}
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.IsIPv6
- size += 1
- // field[2] s1.SrcMac
- size += 6
- // field[2] s1.SrcMacMask
- size += 6
- // field[2] s1.SrcIPAddr
- size += 16
- // field[2] s1.SrcIPPrefixLen
- size += 1
+ size += 1 // s1.IsPermit
+ size += 1 // s1.IsIPv6
+ size += 1 * 6 // s1.SrcMac
+ size += 1 * 6 // s1.SrcMacMask
+ size += 1 * 16 // s1.SrcIPAddr
+ size += 1 // s1.SrcIPPrefixLen
}
return size
}
func (m *MacipACLDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ACLIndex)
+ buf.EncodeBytes(m.Tag, 64)
+ buf.EncodeUint32(uint32(len(m.R)))
+ for j0 := 0; j0 < len(m.R); j0++ {
+ var v0 MacipACLRule // R
+ if j0 < len(m.R) {
+ v0 = m.R[j0]
}
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 MacipACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
- pos += 1
- // field[2] v1.SrcMac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMac) {
- x = uint8(v1.SrcMac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcMacMask
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMacMask) {
- x = uint8(v1.SrcMacMask[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
- pos += 1
- }
- return buf, nil
-}
-func (m *MacipACLDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]MacipACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcMac
- m.R[j1].SrcMac = make([]uint8, 6)
- for i := 0; i < len(m.R[j1].SrcMac); i++ {
- m.R[j1].SrcMac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcMacMask
- m.R[j1].SrcMacMask = make([]uint8, 6)
- for i := 0; i < len(m.R[j1].SrcMacMask); i++ {
- m.R[j1].SrcMacMask[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
- pos += 1
+ buf.EncodeUint8(v0.IsPermit)
+ buf.EncodeUint8(v0.IsIPv6)
+ buf.EncodeBytes(v0.SrcMac, 6)
+ buf.EncodeBytes(v0.SrcMacMask, 6)
+ buf.EncodeBytes(v0.SrcIPAddr, 16)
+ buf.EncodeUint8(v0.SrcIPPrefixLen)
+ }
+ return buf.Bytes(), nil
+}
+func (m *MacipACLDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ACLIndex = buf.DecodeUint32()
+ m.Tag = make([]byte, 64)
+ copy(m.Tag, buf.DecodeBytes(len(m.Tag)))
+ m.Count = buf.DecodeUint32()
+ m.R = make([]MacipACLRule, m.Count)
+ for j0 := 0; j0 < len(m.R); j0++ {
+ m.R[j0].IsPermit = buf.DecodeUint8()
+ m.R[j0].IsIPv6 = buf.DecodeUint8()
+ m.R[j0].SrcMac = make([]byte, 6)
+ copy(m.R[j0].SrcMac, buf.DecodeBytes(len(m.R[j0].SrcMac)))
+ m.R[j0].SrcMacMask = make([]byte, 6)
+ copy(m.R[j0].SrcMacMask, buf.DecodeBytes(len(m.R[j0].SrcMacMask)))
+ m.R[j0].SrcIPAddr = make([]byte, 16)
+ copy(m.R[j0].SrcIPAddr, buf.DecodeBytes(len(m.R[j0].SrcIPAddr)))
+ m.R[j0].SrcIPPrefixLen = buf.DecodeUint8()
}
return nil
}
-// MacipACLDump represents VPP binary API message 'macip_acl_dump'.
+// MacipACLDump defines message 'macip_acl_dump'.
type MacipACLDump struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
}
-func (m *MacipACLDump) Reset() { *m = MacipACLDump{} }
-func (*MacipACLDump) GetMessageName() string { return "macip_acl_dump" }
-func (*MacipACLDump) GetCrcString() string { return "ef34fea4" }
-func (*MacipACLDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MacipACLDump) Reset() { *m = MacipACLDump{} }
+func (*MacipACLDump) GetMessageName() string { return "macip_acl_dump" }
+func (*MacipACLDump) GetCrcString() string { return "ef34fea4" }
+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
- // field[1] m.ACLIndex
- size += 4
+ size += 4 // m.ACLIndex
return size
}
func (m *MacipACLDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ACLIndex)
+ return buf.Bytes(), nil
+}
+func (m *MacipACLDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ACLIndex = buf.DecodeUint32()
return nil
}
-// MacipACLInterfaceAddDel represents VPP binary API message 'macip_acl_interface_add_del'.
+// MacipACLInterfaceAddDel defines message 'macip_acl_interface_add_del'.
type MacipACLInterfaceAddDel struct {
IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
}
-func (m *MacipACLInterfaceAddDel) Reset() { *m = MacipACLInterfaceAddDel{} }
-func (*MacipACLInterfaceAddDel) GetMessageName() string { return "macip_acl_interface_add_del" }
-func (*MacipACLInterfaceAddDel) GetCrcString() string { return "6a6be97c" }
-func (*MacipACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MacipACLInterfaceAddDel) Reset() { *m = MacipACLInterfaceAddDel{} }
+func (*MacipACLInterfaceAddDel) GetMessageName() string { return "macip_acl_interface_add_del" }
+func (*MacipACLInterfaceAddDel) GetCrcString() string { return "6a6be97c" }
+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
- // field[1] m.IsAdd
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.ACLIndex
- size += 4
+ size += 1 // m.IsAdd
+ size += 4 // m.SwIfIndex
+ size += 4 // m.ACLIndex
return size
}
func (m *MacipACLInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- buf[pos] = uint8(m.IsAdd)
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLInterfaceAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = uint8(tmp[pos])
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.ACLIndex)
+ return buf.Bytes(), nil
+}
+func (m *MacipACLInterfaceAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.ACLIndex = buf.DecodeUint32()
return nil
}
-// MacipACLInterfaceAddDelReply represents VPP binary API message 'macip_acl_interface_add_del_reply'.
+// MacipACLInterfaceAddDelReply defines message 'macip_acl_interface_add_del_reply'.
type MacipACLInterfaceAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -2527,149 +1551,109 @@ func (m *MacipACLInterfaceAddDelReply) Reset() { *m = MacipACLInterfaceAddDelRep
func (*MacipACLInterfaceAddDelReply) GetMessageName() string {
return "macip_acl_interface_add_del_reply"
}
-func (*MacipACLInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*MacipACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*MacipACLInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *MacipACLInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLInterfaceAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// MacipACLInterfaceGet represents VPP binary API message 'macip_acl_interface_get'.
+// MacipACLInterfaceGet defines message 'macip_acl_interface_get'.
type MacipACLInterfaceGet struct{}
-func (m *MacipACLInterfaceGet) Reset() { *m = MacipACLInterfaceGet{} }
-func (*MacipACLInterfaceGet) GetMessageName() string { return "macip_acl_interface_get" }
-func (*MacipACLInterfaceGet) GetCrcString() string { return "51077d14" }
-func (*MacipACLInterfaceGet) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MacipACLInterfaceGet) Reset() { *m = MacipACLInterfaceGet{} }
+func (*MacipACLInterfaceGet) GetMessageName() string { return "macip_acl_interface_get" }
+func (*MacipACLInterfaceGet) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *MacipACLInterfaceGet) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *MacipACLInterfaceGet) Unmarshal(b []byte) error {
return nil
}
-// MacipACLInterfaceGetReply represents VPP binary API message 'macip_acl_interface_get_reply'.
+// MacipACLInterfaceGetReply defines message 'macip_acl_interface_get_reply'.
type MacipACLInterfaceGetReply struct {
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
}
-func (m *MacipACLInterfaceGetReply) Reset() { *m = MacipACLInterfaceGetReply{} }
-func (*MacipACLInterfaceGetReply) GetMessageName() string { return "macip_acl_interface_get_reply" }
-func (*MacipACLInterfaceGetReply) GetCrcString() string { return "accf9b05" }
-func (*MacipACLInterfaceGetReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MacipACLInterfaceGetReply) Reset() { *m = MacipACLInterfaceGetReply{} }
+func (*MacipACLInterfaceGetReply) GetMessageName() string { return "macip_acl_interface_get_reply" }
+func (*MacipACLInterfaceGetReply) GetCrcString() string { return "accf9b05" }
+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
- // field[1] m.Count
- size += 4
- // field[1] m.Acls
- size += 4 * len(m.Acls)
+ size += 4 // m.Count
+ size += 4 * len(m.Acls) // m.Acls
return size
}
func (m *MacipACLInterfaceGetReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.Acls)))
- pos += 4
- // field[1] m.Acls
+ 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])
}
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *MacipACLInterfaceGetReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Acls
+ buf.EncodeUint32(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *MacipACLInterfaceGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Count = buf.DecodeUint32()
m.Acls = make([]uint32, m.Count)
for i := 0; i < len(m.Acls); i++ {
- m.Acls[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ m.Acls[i] = buf.DecodeUint32()
}
return nil
}
-// MacipACLInterfaceListDetails represents VPP binary API message 'macip_acl_interface_list_details'.
+// MacipACLInterfaceListDetails defines message 'macip_acl_interface_list_details'.
type MacipACLInterfaceListDetails struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
+ Count uint8 `binapi:"u8,name=count" json:"-"`
Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
}
@@ -2677,156 +1661,120 @@ func (m *MacipACLInterfaceListDetails) Reset() { *m = MacipACLInterfaceListDetai
func (*MacipACLInterfaceListDetails) GetMessageName() string {
return "macip_acl_interface_list_details"
}
-func (*MacipACLInterfaceListDetails) GetCrcString() string { return "29783fa0" }
-func (*MacipACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*MacipACLInterfaceListDetails) GetCrcString() string { return "29783fa0" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.Acls
- size += 4 * len(m.Acls)
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Count
- buf[pos] = uint8(len(m.Acls))
- pos += 1
- // field[1] m.Acls
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(uint8(len(m.Acls)))
for i := 0; i < len(m.Acls); i++ {
var x uint32
if i < len(m.Acls) {
x = uint32(m.Acls[i])
}
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *MacipACLInterfaceListDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.Acls
+ buf.EncodeUint32(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *MacipACLInterfaceListDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Count = buf.DecodeUint8()
m.Acls = make([]uint32, m.Count)
for i := 0; i < len(m.Acls); i++ {
- m.Acls[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ m.Acls[i] = buf.DecodeUint32()
}
return nil
}
-// MacipACLInterfaceListDump represents VPP binary API message 'macip_acl_interface_list_dump'.
+// MacipACLInterfaceListDump defines message 'macip_acl_interface_list_dump'.
type MacipACLInterfaceListDump struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
}
-func (m *MacipACLInterfaceListDump) Reset() { *m = MacipACLInterfaceListDump{} }
-func (*MacipACLInterfaceListDump) GetMessageName() string { return "macip_acl_interface_list_dump" }
-func (*MacipACLInterfaceListDump) GetCrcString() string { return "529cb13f" }
-func (*MacipACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MacipACLInterfaceListDump) Reset() { *m = MacipACLInterfaceListDump{} }
+func (*MacipACLInterfaceListDump) GetMessageName() string { return "macip_acl_interface_list_dump" }
+func (*MacipACLInterfaceListDump) GetCrcString() string { return "529cb13f" }
+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
- // field[1] m.SwIfIndex
- size += 4
+ size += 4 // m.SwIfIndex
return size
}
func (m *MacipACLInterfaceListDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLInterfaceListDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *MacipACLInterfaceListDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
return nil
}
func init() { file_acl_binapi_init() }
func file_acl_binapi_init() {
- api.RegisterMessage((*ACLAddReplace)(nil), "acl.ACLAddReplace")
- api.RegisterMessage((*ACLAddReplaceReply)(nil), "acl.ACLAddReplaceReply")
- api.RegisterMessage((*ACLDel)(nil), "acl.ACLDel")
- api.RegisterMessage((*ACLDelReply)(nil), "acl.ACLDelReply")
- api.RegisterMessage((*ACLDetails)(nil), "acl.ACLDetails")
- api.RegisterMessage((*ACLDump)(nil), "acl.ACLDump")
- api.RegisterMessage((*ACLInterfaceAddDel)(nil), "acl.ACLInterfaceAddDel")
- api.RegisterMessage((*ACLInterfaceAddDelReply)(nil), "acl.ACLInterfaceAddDelReply")
- api.RegisterMessage((*ACLInterfaceEtypeWhitelistDetails)(nil), "acl.ACLInterfaceEtypeWhitelistDetails")
- api.RegisterMessage((*ACLInterfaceEtypeWhitelistDump)(nil), "acl.ACLInterfaceEtypeWhitelistDump")
- api.RegisterMessage((*ACLInterfaceListDetails)(nil), "acl.ACLInterfaceListDetails")
- api.RegisterMessage((*ACLInterfaceListDump)(nil), "acl.ACLInterfaceListDump")
- api.RegisterMessage((*ACLInterfaceSetACLList)(nil), "acl.ACLInterfaceSetACLList")
- api.RegisterMessage((*ACLInterfaceSetACLListReply)(nil), "acl.ACLInterfaceSetACLListReply")
- api.RegisterMessage((*ACLInterfaceSetEtypeWhitelist)(nil), "acl.ACLInterfaceSetEtypeWhitelist")
- api.RegisterMessage((*ACLInterfaceSetEtypeWhitelistReply)(nil), "acl.ACLInterfaceSetEtypeWhitelistReply")
- api.RegisterMessage((*ACLPluginControlPing)(nil), "acl.ACLPluginControlPing")
- api.RegisterMessage((*ACLPluginControlPingReply)(nil), "acl.ACLPluginControlPingReply")
- api.RegisterMessage((*ACLPluginGetConnTableMaxEntries)(nil), "acl.ACLPluginGetConnTableMaxEntries")
- api.RegisterMessage((*ACLPluginGetConnTableMaxEntriesReply)(nil), "acl.ACLPluginGetConnTableMaxEntriesReply")
- api.RegisterMessage((*ACLPluginGetVersion)(nil), "acl.ACLPluginGetVersion")
- api.RegisterMessage((*ACLPluginGetVersionReply)(nil), "acl.ACLPluginGetVersionReply")
- api.RegisterMessage((*ACLStatsIntfCountersEnable)(nil), "acl.ACLStatsIntfCountersEnable")
- api.RegisterMessage((*ACLStatsIntfCountersEnableReply)(nil), "acl.ACLStatsIntfCountersEnableReply")
- api.RegisterMessage((*MacipACLAdd)(nil), "acl.MacipACLAdd")
- api.RegisterMessage((*MacipACLAddReplace)(nil), "acl.MacipACLAddReplace")
- api.RegisterMessage((*MacipACLAddReplaceReply)(nil), "acl.MacipACLAddReplaceReply")
- api.RegisterMessage((*MacipACLAddReply)(nil), "acl.MacipACLAddReply")
- api.RegisterMessage((*MacipACLDel)(nil), "acl.MacipACLDel")
- api.RegisterMessage((*MacipACLDelReply)(nil), "acl.MacipACLDelReply")
- api.RegisterMessage((*MacipACLDetails)(nil), "acl.MacipACLDetails")
- api.RegisterMessage((*MacipACLDump)(nil), "acl.MacipACLDump")
- api.RegisterMessage((*MacipACLInterfaceAddDel)(nil), "acl.MacipACLInterfaceAddDel")
- api.RegisterMessage((*MacipACLInterfaceAddDelReply)(nil), "acl.MacipACLInterfaceAddDelReply")
- api.RegisterMessage((*MacipACLInterfaceGet)(nil), "acl.MacipACLInterfaceGet")
- api.RegisterMessage((*MacipACLInterfaceGetReply)(nil), "acl.MacipACLInterfaceGetReply")
- api.RegisterMessage((*MacipACLInterfaceListDetails)(nil), "acl.MacipACLInterfaceListDetails")
- api.RegisterMessage((*MacipACLInterfaceListDump)(nil), "acl.MacipACLInterfaceListDump")
+ api.RegisterMessage((*ACLAddReplace)(nil), "acl_add_replace_13bc8539")
+ api.RegisterMessage((*ACLAddReplaceReply)(nil), "acl_add_replace_reply_ac407b0c")
+ api.RegisterMessage((*ACLDel)(nil), "acl_del_ef34fea4")
+ api.RegisterMessage((*ACLDelReply)(nil), "acl_del_reply_e8d4e804")
+ api.RegisterMessage((*ACLDetails)(nil), "acl_details_f89d7a88")
+ api.RegisterMessage((*ACLDump)(nil), "acl_dump_ef34fea4")
+ api.RegisterMessage((*ACLInterfaceAddDel)(nil), "acl_interface_add_del_0b2aedd1")
+ api.RegisterMessage((*ACLInterfaceAddDelReply)(nil), "acl_interface_add_del_reply_e8d4e804")
+ api.RegisterMessage((*ACLInterfaceEtypeWhitelistDetails)(nil), "acl_interface_etype_whitelist_details_6a5d4e81")
+ api.RegisterMessage((*ACLInterfaceEtypeWhitelistDump)(nil), "acl_interface_etype_whitelist_dump_529cb13f")
+ api.RegisterMessage((*ACLInterfaceListDetails)(nil), "acl_interface_list_details_d5e80809")
+ api.RegisterMessage((*ACLInterfaceListDump)(nil), "acl_interface_list_dump_529cb13f")
+ api.RegisterMessage((*ACLInterfaceSetACLList)(nil), "acl_interface_set_acl_list_8baece38")
+ api.RegisterMessage((*ACLInterfaceSetACLListReply)(nil), "acl_interface_set_acl_list_reply_e8d4e804")
+ api.RegisterMessage((*ACLInterfaceSetEtypeWhitelist)(nil), "acl_interface_set_etype_whitelist_f515efc5")
+ api.RegisterMessage((*ACLInterfaceSetEtypeWhitelistReply)(nil), "acl_interface_set_etype_whitelist_reply_e8d4e804")
+ api.RegisterMessage((*ACLPluginControlPing)(nil), "acl_plugin_control_ping_51077d14")
+ api.RegisterMessage((*ACLPluginControlPingReply)(nil), "acl_plugin_control_ping_reply_f6b0b8ca")
+ api.RegisterMessage((*ACLPluginGetConnTableMaxEntries)(nil), "acl_plugin_get_conn_table_max_entries_51077d14")
+ api.RegisterMessage((*ACLPluginGetConnTableMaxEntriesReply)(nil), "acl_plugin_get_conn_table_max_entries_reply_7a096d3d")
+ api.RegisterMessage((*ACLPluginGetVersion)(nil), "acl_plugin_get_version_51077d14")
+ api.RegisterMessage((*ACLPluginGetVersionReply)(nil), "acl_plugin_get_version_reply_9b32cf86")
+ api.RegisterMessage((*ACLStatsIntfCountersEnable)(nil), "acl_stats_intf_counters_enable_b3e225d2")
+ api.RegisterMessage((*ACLStatsIntfCountersEnableReply)(nil), "acl_stats_intf_counters_enable_reply_e8d4e804")
+ api.RegisterMessage((*MacipACLAdd)(nil), "macip_acl_add_0c680ca5")
+ api.RegisterMessage((*MacipACLAddReplace)(nil), "macip_acl_add_replace_d3d313e7")
+ api.RegisterMessage((*MacipACLAddReplaceReply)(nil), "macip_acl_add_replace_reply_ac407b0c")
+ api.RegisterMessage((*MacipACLAddReply)(nil), "macip_acl_add_reply_ac407b0c")
+ api.RegisterMessage((*MacipACLDel)(nil), "macip_acl_del_ef34fea4")
+ api.RegisterMessage((*MacipACLDelReply)(nil), "macip_acl_del_reply_e8d4e804")
+ api.RegisterMessage((*MacipACLDetails)(nil), "macip_acl_details_e164e69a")
+ api.RegisterMessage((*MacipACLDump)(nil), "macip_acl_dump_ef34fea4")
+ api.RegisterMessage((*MacipACLInterfaceAddDel)(nil), "macip_acl_interface_add_del_6a6be97c")
+ api.RegisterMessage((*MacipACLInterfaceAddDelReply)(nil), "macip_acl_interface_add_del_reply_e8d4e804")
+ api.RegisterMessage((*MacipACLInterfaceGet)(nil), "macip_acl_interface_get_51077d14")
+ api.RegisterMessage((*MacipACLInterfaceGetReply)(nil), "macip_acl_interface_get_reply_accf9b05")
+ api.RegisterMessage((*MacipACLInterfaceListDetails)(nil), "macip_acl_interface_list_details_29783fa0")
+ api.RegisterMessage((*MacipACLInterfaceListDump)(nil), "macip_acl_interface_list_dump_529cb13f")
}
// Messages returns list of all messages in this module.
@@ -2872,14 +1820,3 @@ func AllMessages() []api.Message {
(*MacipACLInterfaceListDump)(nil),
}
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
diff --git a/internal/testbinapi/binapi2001/acl/acl_rpc.ba.go b/internal/testbinapi/binapi2001/acl/acl_rpc.ba.go
index 62b10c3..5e23fef 100644
--- a/internal/testbinapi/binapi2001/acl/acl_rpc.ba.go
+++ b/internal/testbinapi/binapi2001/acl/acl_rpc.ba.go
@@ -4,21 +4,20 @@ package acl
import (
"context"
- "io"
-
+ "fmt"
api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
)
-// RPCService represents RPC service API for acl module.
+// RPCService defines RPC service acl.
type RPCService interface {
- DumpACL(ctx context.Context, in *ACLDump) (RPCService_DumpACLClient, error)
- DumpACLInterfaceEtypeWhitelist(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_DumpACLInterfaceEtypeWhitelistClient, error)
- DumpACLInterfaceList(ctx context.Context, in *ACLInterfaceListDump) (RPCService_DumpACLInterfaceListClient, error)
- DumpMacipACL(ctx context.Context, in *MacipACLDump) (RPCService_DumpMacipACLClient, error)
- DumpMacipACLInterfaceList(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_DumpMacipACLInterfaceListClient, error)
ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error)
ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error)
+ ACLDump(ctx context.Context, in *ACLDump) (RPCService_ACLDumpClient, error)
ACLInterfaceAddDel(ctx context.Context, in *ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error)
+ ACLInterfaceEtypeWhitelistDump(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_ACLInterfaceEtypeWhitelistDumpClient, error)
+ ACLInterfaceListDump(ctx context.Context, in *ACLInterfaceListDump) (RPCService_ACLInterfaceListDumpClient, error)
ACLInterfaceSetACLList(ctx context.Context, in *ACLInterfaceSetACLList) (*ACLInterfaceSetACLListReply, error)
ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error)
ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error)
@@ -28,178 +27,167 @@ type RPCService interface {
MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error)
MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error)
MacipACLDel(ctx context.Context, in *MacipACLDel) (*MacipACLDelReply, error)
+ MacipACLDump(ctx context.Context, in *MacipACLDump) (RPCService_MacipACLDumpClient, error)
MacipACLInterfaceAddDel(ctx context.Context, in *MacipACLInterfaceAddDel) (*MacipACLInterfaceAddDelReply, error)
MacipACLInterfaceGet(ctx context.Context, in *MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error)
+ MacipACLInterfaceListDump(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_MacipACLInterfaceListDumpClient, error)
}
type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpACL(ctx context.Context, in *ACLDump) (RPCService_DumpACLClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpACLClient{stream}
- return x, nil
+ conn api.Connection
}
-type RPCService_DumpACLClient interface {
- Recv() (*ACLDetails, error)
-}
-
-type serviceClient_DumpACLClient struct {
- api.MultiRequestCtx
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
}
-func (c *serviceClient_DumpACLClient) Recv() (*ACLDetails, error) {
- m := new(ACLDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error) {
+ out := new(ACLAddReplaceReply)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpACLInterfaceEtypeWhitelist(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_DumpACLInterfaceEtypeWhitelistClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpACLInterfaceEtypeWhitelistClient{stream}
- return x, nil
-}
-
-type RPCService_DumpACLInterfaceEtypeWhitelistClient interface {
- Recv() (*ACLInterfaceEtypeWhitelistDetails, error)
+ return out, nil
}
-type serviceClient_DumpACLInterfaceEtypeWhitelistClient struct {
- api.MultiRequestCtx
+func (c *serviceClient) ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error) {
+ out := new(ACLDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-func (c *serviceClient_DumpACLInterfaceEtypeWhitelistClient) Recv() (*ACLInterfaceEtypeWhitelistDetails, error) {
- m := new(ACLInterfaceEtypeWhitelistDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) ACLDump(ctx context.Context, in *ACLDump) (RPCService_ACLDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
+ x := &serviceClient_ACLDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
}
- return m, nil
-}
-
-func (c *serviceClient) DumpACLInterfaceList(ctx context.Context, in *ACLInterfaceListDump) (RPCService_DumpACLInterfaceListClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpACLInterfaceListClient{stream}
return x, nil
}
-type RPCService_DumpACLInterfaceListClient interface {
- Recv() (*ACLInterfaceListDetails, error)
+type RPCService_ACLDumpClient interface {
+ Recv() (*ACLDetails, error)
+ api.Stream
}
-type serviceClient_DumpACLInterfaceListClient struct {
- api.MultiRequestCtx
+type serviceClient_ACLDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpACLInterfaceListClient) Recv() (*ACLInterfaceListDetails, error) {
- m := new(ACLInterfaceListDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_ACLDumpClient) Recv() (*ACLDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *ACLDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
-}
-
-func (c *serviceClient) DumpMacipACL(ctx context.Context, in *MacipACLDump) (RPCService_DumpMacipACLClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMacipACLClient{stream}
- return x, nil
}
-type RPCService_DumpMacipACLClient interface {
- Recv() (*MacipACLDetails, error)
-}
-
-type serviceClient_DumpMacipACLClient struct {
- api.MultiRequestCtx
+func (c *serviceClient) ACLInterfaceAddDel(ctx context.Context, in *ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error) {
+ out := new(ACLInterfaceAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-func (c *serviceClient_DumpMacipACLClient) Recv() (*MacipACLDetails, error) {
- m := new(MacipACLDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) ACLInterfaceEtypeWhitelistDump(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_ACLInterfaceEtypeWhitelistDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
+ x := &serviceClient_ACLInterfaceEtypeWhitelistDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
}
- return m, nil
-}
-
-func (c *serviceClient) DumpMacipACLInterfaceList(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_DumpMacipACLInterfaceListClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMacipACLInterfaceListClient{stream}
return x, nil
}
-type RPCService_DumpMacipACLInterfaceListClient interface {
- Recv() (*MacipACLInterfaceListDetails, error)
+type RPCService_ACLInterfaceEtypeWhitelistDumpClient interface {
+ Recv() (*ACLInterfaceEtypeWhitelistDetails, error)
+ api.Stream
}
-type serviceClient_DumpMacipACLInterfaceListClient struct {
- api.MultiRequestCtx
+type serviceClient_ACLInterfaceEtypeWhitelistDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpMacipACLInterfaceListClient) Recv() (*MacipACLInterfaceListDetails, error) {
- m := new(MacipACLInterfaceListDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_ACLInterfaceEtypeWhitelistDumpClient) Recv() (*ACLInterfaceEtypeWhitelistDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *ACLInterfaceEtypeWhitelistDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
}
-func (c *serviceClient) ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error) {
- out := new(ACLAddReplaceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+func (c *serviceClient) ACLInterfaceListDump(ctx context.Context, in *ACLInterfaceListDump) (RPCService_ACLInterfaceListDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- return out, nil
-}
-
-func (c *serviceClient) ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error) {
- out := new(ACLDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
+ x := &serviceClient_ACLInterfaceListDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
return nil, err
}
- return out, nil
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
}
-func (c *serviceClient) ACLInterfaceAddDel(ctx context.Context, in *ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error) {
- out := new(ACLInterfaceAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+type RPCService_ACLInterfaceListDumpClient interface {
+ Recv() (*ACLInterfaceListDetails, error)
+ api.Stream
+}
+
+type serviceClient_ACLInterfaceListDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_ACLInterfaceListDumpClient) Recv() (*ACLInterfaceListDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- return out, nil
+ switch m := msg.(type) {
+ case *ACLInterfaceListDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
}
func (c *serviceClient) ACLInterfaceSetACLList(ctx context.Context, in *ACLInterfaceSetACLList) (*ACLInterfaceSetACLListReply, error) {
out := new(ACLInterfaceSetACLListReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -208,7 +196,7 @@ func (c *serviceClient) ACLInterfaceSetACLList(ctx context.Context, in *ACLInter
func (c *serviceClient) ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error) {
out := new(ACLInterfaceSetEtypeWhitelistReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -217,7 +205,7 @@ func (c *serviceClient) ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *A
func (c *serviceClient) ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error) {
out := new(ACLPluginControlPingReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -226,7 +214,7 @@ func (c *serviceClient) ACLPluginControlPing(ctx context.Context, in *ACLPluginC
func (c *serviceClient) ACLPluginGetConnTableMaxEntries(ctx context.Context, in *ACLPluginGetConnTableMaxEntries) (*ACLPluginGetConnTableMaxEntriesReply, error) {
out := new(ACLPluginGetConnTableMaxEntriesReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -235,7 +223,7 @@ func (c *serviceClient) ACLPluginGetConnTableMaxEntries(ctx context.Context, in
func (c *serviceClient) ACLPluginGetVersion(ctx context.Context, in *ACLPluginGetVersion) (*ACLPluginGetVersionReply, error) {
out := new(ACLPluginGetVersionReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -244,7 +232,7 @@ func (c *serviceClient) ACLPluginGetVersion(ctx context.Context, in *ACLPluginGe
func (c *serviceClient) ACLStatsIntfCountersEnable(ctx context.Context, in *ACLStatsIntfCountersEnable) (*ACLStatsIntfCountersEnableReply, error) {
out := new(ACLStatsIntfCountersEnableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -253,7 +241,7 @@ func (c *serviceClient) ACLStatsIntfCountersEnable(ctx context.Context, in *ACLS
func (c *serviceClient) MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error) {
out := new(MacipACLAddReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -262,7 +250,7 @@ func (c *serviceClient) MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*Maci
func (c *serviceClient) MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error) {
out := new(MacipACLAddReplaceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -271,16 +259,55 @@ func (c *serviceClient) MacipACLAddReplace(ctx context.Context, in *MacipACLAddR
func (c *serviceClient) MacipACLDel(ctx context.Context, in *MacipACLDel) (*MacipACLDelReply, error) {
out := new(MacipACLDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
+func (c *serviceClient) MacipACLDump(ctx context.Context, in *MacipACLDump) (RPCService_MacipACLDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_MacipACLDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_MacipACLDumpClient interface {
+ Recv() (*MacipACLDetails, error)
+ api.Stream
+}
+
+type serviceClient_MacipACLDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MacipACLDumpClient) Recv() (*MacipACLDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *MacipACLDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
func (c *serviceClient) MacipACLInterfaceAddDel(ctx context.Context, in *MacipACLInterfaceAddDel) (*MacipACLInterfaceAddDelReply, error) {
out := new(MacipACLInterfaceAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -289,14 +316,48 @@ func (c *serviceClient) MacipACLInterfaceAddDel(ctx context.Context, in *MacipAC
func (c *serviceClient) MacipACLInterfaceGet(ctx context.Context, in *MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error) {
out := new(MacipACLInterfaceGetReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
+func (c *serviceClient) MacipACLInterfaceListDump(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_MacipACLInterfaceListDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_MacipACLInterfaceListDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_MacipACLInterfaceListDumpClient interface {
+ Recv() (*MacipACLInterfaceListDetails, error)
+ api.Stream
+}
+
+type serviceClient_MacipACLInterfaceListDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MacipACLInterfaceListDumpClient) Recv() (*MacipACLInterfaceListDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *MacipACLInterfaceListDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/acl_types/acl_types.ba.go b/internal/testbinapi/binapi2001/acl_types/acl_types.ba.go
new file mode 100644
index 0000000..6f8d39d
--- /dev/null
+++ b/internal/testbinapi/binapi2001/acl_types/acl_types.ba.go
@@ -0,0 +1,49 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/acl_types.api.json
+
+// Package acl_types contains generated bindings for API file acl_types.api.
+//
+// Contents:
+// 2 structs
+//
+package acl_types
+
+import (
+ api "git.fd.io/govpp.git/api"
+)
+
+// 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
+
+// ACLRule defines type 'acl_rule'.
+type ACLRule struct {
+ IsPermit uint8 `binapi:"u8,name=is_permit" json:"is_permit,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ SrcIPAddr []byte `binapi:"u8[16],name=src_ip_addr" json:"src_ip_addr,omitempty"`
+ SrcIPPrefixLen uint8 `binapi:"u8,name=src_ip_prefix_len" json:"src_ip_prefix_len,omitempty"`
+ DstIPAddr []byte `binapi:"u8[16],name=dst_ip_addr" json:"dst_ip_addr,omitempty"`
+ DstIPPrefixLen uint8 `binapi:"u8,name=dst_ip_prefix_len" json:"dst_ip_prefix_len,omitempty"`
+ Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
+ SrcportOrIcmptypeFirst uint16 `binapi:"u16,name=srcport_or_icmptype_first" json:"srcport_or_icmptype_first,omitempty"`
+ SrcportOrIcmptypeLast uint16 `binapi:"u16,name=srcport_or_icmptype_last" json:"srcport_or_icmptype_last,omitempty"`
+ DstportOrIcmpcodeFirst uint16 `binapi:"u16,name=dstport_or_icmpcode_first" json:"dstport_or_icmpcode_first,omitempty"`
+ DstportOrIcmpcodeLast uint16 `binapi:"u16,name=dstport_or_icmpcode_last" json:"dstport_or_icmpcode_last,omitempty"`
+ TCPFlagsMask uint8 `binapi:"u8,name=tcp_flags_mask" json:"tcp_flags_mask,omitempty"`
+ TCPFlagsValue uint8 `binapi:"u8,name=tcp_flags_value" json:"tcp_flags_value,omitempty"`
+}
+
+// MacipACLRule defines type 'macip_acl_rule'.
+type MacipACLRule struct {
+ IsPermit uint8 `binapi:"u8,name=is_permit" json:"is_permit,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ SrcMac []byte `binapi:"u8[6],name=src_mac" json:"src_mac,omitempty"`
+ SrcMacMask []byte `binapi:"u8[6],name=src_mac_mask" json:"src_mac_mask,omitempty"`
+ SrcIPAddr []byte `binapi:"u8[16],name=src_ip_addr" json:"src_ip_addr,omitempty"`
+ SrcIPPrefixLen uint8 `binapi:"u8,name=src_ip_prefix_len" json:"src_ip_prefix_len,omitempty"`
+}
diff --git a/internal/testbinapi/binapi2001/af_packet/af_packet.ba.go b/internal/testbinapi/binapi2001/af_packet/af_packet.ba.go
index 82b89b3..ff82ee7 100644
--- a/internal/testbinapi/binapi2001/af_packet/af_packet.ba.go
+++ b/internal/testbinapi/binapi2001/af_packet/af_packet.ba.go
@@ -1,48 +1,38 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.4.0-dev
-// VPP: 20.01-45~g7a071e370~b63
-// source: /usr/share/vpp/api/core/af_packet.api.json
-
-/*
-Package af_packet contains generated code for VPP binary API defined by af_packet.api (version 2.0.0).
-
-It consists of:
- 2 aliases
- 6 enums
- 8 messages
-*/
+// VPP: 20.01
+// source: .vppapi/core/af_packet.api.json
+
+// Package af_packet contains generated bindings for API file af_packet.api.
+//
+// Contents:
+// 2 aliases
+// 6 enums
+// 8 messages
+//
package af_packet
import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "math"
- "strconv"
-
api "git.fd.io/govpp.git/api"
codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
+ "net"
+ "strconv"
)
// 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 // please upgrade the GoVPP api package
+const _ = api.GoVppAPIPackageIsVersion2
const (
- // ModuleName is the name of this module.
- ModuleName = "af_packet"
- // APIVersion is the API version of this module.
+ APIFile = "af_packet"
APIVersion = "2.0.0"
- // VersionCrc is the CRC of this module.
VersionCrc = 0xba745e20
)
-// IfStatusFlags represents VPP binary API enum 'if_status_flags'.
+// IfStatusFlags defines enum 'if_status_flags'.
type IfStatusFlags uint32
const (
@@ -66,10 +56,29 @@ func (x IfStatusFlags) String() string {
if ok {
return s
}
- return "IfStatusFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// IfType represents VPP binary API enum 'if_type'.
+// IfType defines enum 'if_type'.
type IfType uint32
const (
@@ -102,7 +111,7 @@ func (x IfType) String() string {
return "IfType(" + strconv.Itoa(int(x)) + ")"
}
-// LinkDuplex represents VPP binary API enum 'link_duplex'.
+// LinkDuplex defines enum 'link_duplex'.
type LinkDuplex uint32
const (
@@ -132,7 +141,7 @@ func (x LinkDuplex) String() string {
return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
}
-// MtuProto represents VPP binary API enum 'mtu_proto'.
+// MtuProto defines enum 'mtu_proto'.
type MtuProto uint32
const (
@@ -168,7 +177,7 @@ func (x MtuProto) String() string {
return "MtuProto(" + strconv.Itoa(int(x)) + ")"
}
-// RxMode represents VPP binary API enum 'rx_mode'.
+// RxMode defines enum 'rx_mode'.
type RxMode uint32
const (
@@ -204,7 +213,7 @@ func (x RxMode) String() string {
return "RxMode(" + strconv.Itoa(int(x)) + ")"
}
-// SubIfFlags represents VPP binary API enum 'sub_if_flags'.
+// SubIfFlags defines enum 'sub_if_flags'.
type SubIfFlags uint32
const (
@@ -252,394 +261,307 @@ func (x SubIfFlags) String() string {
if ok {
return s
}
- return "SubIfFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// InterfaceIndex represents VPP binary API alias 'interface_index'.
+// InterfaceIndex defines alias 'interface_index'.
type InterfaceIndex uint32
-// MacAddress represents VPP binary API alias 'mac_address'.
+// MacAddress defines alias 'mac_address'.
type MacAddress [6]uint8
-// AfPacketCreate represents VPP binary API message 'af_packet_create'.
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// AfPacketCreate defines message 'af_packet_create'.
type AfPacketCreate struct {
HwAddr MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"`
- HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty" struc:"[64]byte"`
+ HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
}
-func (m *AfPacketCreate) Reset() { *m = AfPacketCreate{} }
-func (*AfPacketCreate) GetMessageName() string { return "af_packet_create" }
-func (*AfPacketCreate) GetCrcString() string { return "a190415f" }
-func (*AfPacketCreate) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *AfPacketCreate) Reset() { *m = AfPacketCreate{} }
+func (*AfPacketCreate) GetMessageName() string { return "af_packet_create" }
+func (*AfPacketCreate) GetCrcString() string { return "a190415f" }
+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
- // field[1] m.HwAddr
- size += 6
- // field[1] m.UseRandomHwAddr
- size += 1
- // field[1] m.HostIfName
- size += 64
+ size += 1 * 6 // m.HwAddr
+ size += 1 // m.UseRandomHwAddr
+ size += 64 // m.HostIfName
return size
}
func (m *AfPacketCreate) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.HwAddr
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.HwAddr) {
- x = uint8(m.HwAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.UseRandomHwAddr
- if m.UseRandomHwAddr {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.HostIfName
- copy(buf[pos:pos+64], m.HostIfName)
- pos += 64
- return buf, nil
-}
-func (m *AfPacketCreate) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.HwAddr
- for i := 0; i < len(m.HwAddr); i++ {
- m.HwAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.UseRandomHwAddr
- m.UseRandomHwAddr = tmp[pos] != 0
- pos += 1
- // field[1] m.HostIfName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.HostIfName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.HwAddr[:], 6)
+ buf.EncodeBool(m.UseRandomHwAddr)
+ buf.EncodeString(m.HostIfName, 64)
+ return buf.Bytes(), nil
+}
+func (m *AfPacketCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.HwAddr[:], buf.DecodeBytes(6))
+ m.UseRandomHwAddr = buf.DecodeBool()
+ m.HostIfName = buf.DecodeString(64)
return nil
}
-// AfPacketCreateReply represents VPP binary API message 'af_packet_create_reply'.
+// AfPacketCreateReply defines message 'af_packet_create_reply'.
type AfPacketCreateReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
-func (m *AfPacketCreateReply) Reset() { *m = AfPacketCreateReply{} }
-func (*AfPacketCreateReply) GetMessageName() string { return "af_packet_create_reply" }
-func (*AfPacketCreateReply) GetCrcString() string { return "5383d31f" }
-func (*AfPacketCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *AfPacketCreateReply) Reset() { *m = AfPacketCreateReply{} }
+func (*AfPacketCreateReply) GetMessageName() string { return "af_packet_create_reply" }
+func (*AfPacketCreateReply) GetCrcString() string { return "5383d31f" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
return size
}
func (m *AfPacketCreateReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *AfPacketCreateReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
return nil
}
-// AfPacketDelete represents VPP binary API message 'af_packet_delete'.
+// AfPacketDelete defines message 'af_packet_delete'.
type AfPacketDelete struct {
- HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty" struc:"[64]byte"`
+ HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
}
-func (m *AfPacketDelete) Reset() { *m = AfPacketDelete{} }
-func (*AfPacketDelete) GetMessageName() string { return "af_packet_delete" }
-func (*AfPacketDelete) GetCrcString() string { return "863fa648" }
-func (*AfPacketDelete) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *AfPacketDelete) Reset() { *m = AfPacketDelete{} }
+func (*AfPacketDelete) GetMessageName() string { return "af_packet_delete" }
+func (*AfPacketDelete) GetCrcString() string { return "863fa648" }
+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
- // field[1] m.HostIfName
- size += 64
+ size += 64 // m.HostIfName
return size
}
func (m *AfPacketDelete) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.HostIfName
- copy(buf[pos:pos+64], m.HostIfName)
- pos += 64
- return buf, nil
-}
-func (m *AfPacketDelete) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.HostIfName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.HostIfName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.HostIfName, 64)
+ return buf.Bytes(), nil
+}
+func (m *AfPacketDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.HostIfName = buf.DecodeString(64)
return nil
}
-// AfPacketDeleteReply represents VPP binary API message 'af_packet_delete_reply'.
+// AfPacketDeleteReply defines message 'af_packet_delete_reply'.
type AfPacketDeleteReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *AfPacketDeleteReply) Reset() { *m = AfPacketDeleteReply{} }
-func (*AfPacketDeleteReply) GetMessageName() string { return "af_packet_delete_reply" }
-func (*AfPacketDeleteReply) GetCrcString() string { return "e8d4e804" }
-func (*AfPacketDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *AfPacketDeleteReply) Reset() { *m = AfPacketDeleteReply{} }
+func (*AfPacketDeleteReply) GetMessageName() string { return "af_packet_delete_reply" }
+func (*AfPacketDeleteReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *AfPacketDeleteReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *AfPacketDeleteReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// AfPacketDetails represents VPP binary API message 'af_packet_details'.
+// AfPacketDetails defines message 'af_packet_details'.
type AfPacketDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty" struc:"[64]byte"`
+ HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
}
-func (m *AfPacketDetails) Reset() { *m = AfPacketDetails{} }
-func (*AfPacketDetails) GetMessageName() string { return "af_packet_details" }
-func (*AfPacketDetails) GetCrcString() string { return "58c7c042" }
-func (*AfPacketDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *AfPacketDetails) Reset() { *m = AfPacketDetails{} }
+func (*AfPacketDetails) GetMessageName() string { return "af_packet_details" }
+func (*AfPacketDetails) GetCrcString() string { return "58c7c042" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.HostIfName
- size += 64
+ size += 4 // m.SwIfIndex
+ size += 64 // m.HostIfName
return size
}
func (m *AfPacketDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.HostIfName
- copy(buf[pos:pos+64], m.HostIfName)
- pos += 64
- return buf, nil
-}
-func (m *AfPacketDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.HostIfName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.HostIfName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeString(m.HostIfName, 64)
+ return buf.Bytes(), nil
+}
+func (m *AfPacketDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.HostIfName = buf.DecodeString(64)
return nil
}
-// AfPacketDump represents VPP binary API message 'af_packet_dump'.
+// AfPacketDump defines message 'af_packet_dump'.
type AfPacketDump struct{}
-func (m *AfPacketDump) Reset() { *m = AfPacketDump{} }
-func (*AfPacketDump) GetMessageName() string { return "af_packet_dump" }
-func (*AfPacketDump) GetCrcString() string { return "51077d14" }
-func (*AfPacketDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *AfPacketDump) Reset() { *m = AfPacketDump{} }
+func (*AfPacketDump) GetMessageName() string { return "af_packet_dump" }
+func (*AfPacketDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *AfPacketDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *AfPacketDump) Unmarshal(b []byte) error {
return nil
}
-// AfPacketSetL4CksumOffload represents VPP binary API message 'af_packet_set_l4_cksum_offload'.
+// AfPacketSetL4CksumOffload defines message 'af_packet_set_l4_cksum_offload'.
type AfPacketSetL4CksumOffload struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
Set bool `binapi:"bool,name=set" json:"set,omitempty"`
}
-func (m *AfPacketSetL4CksumOffload) Reset() { *m = AfPacketSetL4CksumOffload{} }
-func (*AfPacketSetL4CksumOffload) GetMessageName() string { return "af_packet_set_l4_cksum_offload" }
-func (*AfPacketSetL4CksumOffload) GetCrcString() string { return "319cd5c8" }
-func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *AfPacketSetL4CksumOffload) Reset() { *m = AfPacketSetL4CksumOffload{} }
+func (*AfPacketSetL4CksumOffload) GetMessageName() string { return "af_packet_set_l4_cksum_offload" }
+func (*AfPacketSetL4CksumOffload) GetCrcString() string { return "319cd5c8" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Set
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Set
return size
}
func (m *AfPacketSetL4CksumOffload) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Set
- if m.Set {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *AfPacketSetL4CksumOffload) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Set
- m.Set = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Set)
+ return buf.Bytes(), nil
+}
+func (m *AfPacketSetL4CksumOffload) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Set = buf.DecodeBool()
return nil
}
-// AfPacketSetL4CksumOffloadReply represents VPP binary API message 'af_packet_set_l4_cksum_offload_reply'.
+// AfPacketSetL4CksumOffloadReply defines message 'af_packet_set_l4_cksum_offload_reply'.
type AfPacketSetL4CksumOffloadReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -648,55 +570,42 @@ func (m *AfPacketSetL4CksumOffloadReply) Reset() { *m = AfPacketSetL4CksumOffloa
func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string {
return "af_packet_set_l4_cksum_offload_reply"
}
-func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { return "e8d4e804" }
-func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *AfPacketSetL4CksumOffloadReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *AfPacketSetL4CksumOffloadReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
func init() { file_af_packet_binapi_init() }
func file_af_packet_binapi_init() {
- api.RegisterMessage((*AfPacketCreate)(nil), "af_packet.AfPacketCreate")
- api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet.AfPacketCreateReply")
- api.RegisterMessage((*AfPacketDelete)(nil), "af_packet.AfPacketDelete")
- api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet.AfPacketDeleteReply")
- api.RegisterMessage((*AfPacketDetails)(nil), "af_packet.AfPacketDetails")
- api.RegisterMessage((*AfPacketDump)(nil), "af_packet.AfPacketDump")
- api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet.AfPacketSetL4CksumOffload")
- api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet.AfPacketSetL4CksumOffloadReply")
+ api.RegisterMessage((*AfPacketCreate)(nil), "af_packet_create_a190415f")
+ api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet_create_reply_5383d31f")
+ api.RegisterMessage((*AfPacketDelete)(nil), "af_packet_delete_863fa648")
+ api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet_delete_reply_e8d4e804")
+ api.RegisterMessage((*AfPacketDetails)(nil), "af_packet_details_58c7c042")
+ api.RegisterMessage((*AfPacketDump)(nil), "af_packet_dump_51077d14")
+ api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet_set_l4_cksum_offload_319cd5c8")
+ api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet_set_l4_cksum_offload_reply_e8d4e804")
}
// Messages returns list of all messages in this module.
@@ -712,14 +621,3 @@ func AllMessages() []api.Message {
(*AfPacketSetL4CksumOffloadReply)(nil),
}
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
diff --git a/internal/testbinapi/binapi2001/af_packet/af_packet_rpc.ba.go b/internal/testbinapi/binapi2001/af_packet/af_packet_rpc.ba.go
index d2df47a..4b0fc7c 100644
--- a/internal/testbinapi/binapi2001/af_packet/af_packet_rpc.ba.go
+++ b/internal/testbinapi/binapi2001/af_packet/af_packet_rpc.ba.go
@@ -4,81 +4,90 @@ package af_packet
import (
"context"
- "io"
-
+ "fmt"
api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
)
-// RPCService represents RPC service API for af_packet module.
+// RPCService defines RPC service af_packet.
type RPCService interface {
- DumpAfPacket(ctx context.Context, in *AfPacketDump) (RPCService_DumpAfPacketClient, error)
AfPacketCreate(ctx context.Context, in *AfPacketCreate) (*AfPacketCreateReply, error)
AfPacketDelete(ctx context.Context, in *AfPacketDelete) (*AfPacketDeleteReply, error)
+ AfPacketDump(ctx context.Context, in *AfPacketDump) (RPCService_AfPacketDumpClient, error)
AfPacketSetL4CksumOffload(ctx context.Context, in *AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error)
}
type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
+ conn api.Connection
}
-func (c *serviceClient) DumpAfPacket(ctx context.Context, in *AfPacketDump) (RPCService_DumpAfPacketClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpAfPacketClient{stream}
- return x, nil
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
}
-type RPCService_DumpAfPacketClient interface {
- Recv() (*AfPacketDetails, error)
-}
-
-type serviceClient_DumpAfPacketClient struct {
- api.MultiRequestCtx
+func (c *serviceClient) AfPacketCreate(ctx context.Context, in *AfPacketCreate) (*AfPacketCreateReply, error) {
+ out := new(AfPacketCreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-func (c *serviceClient_DumpAfPacketClient) Recv() (*AfPacketDetails, error) {
- m := new(AfPacketDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) AfPacketDelete(ctx context.Context, in *AfPacketDelete) (*AfPacketDeleteReply, error) {
+ out := new(AfPacketDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
- }
- return m, nil
+ return out, nil
}
-func (c *serviceClient) AfPacketCreate(ctx context.Context, in *AfPacketCreate) (*AfPacketCreateReply, error) {
- out := new(AfPacketCreateReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+func (c *serviceClient) AfPacketDump(ctx context.Context, in *AfPacketDump) (RPCService_AfPacketDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- return out, nil
+ x := &serviceClient_AfPacketDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
}
-func (c *serviceClient) AfPacketDelete(ctx context.Context, in *AfPacketDelete) (*AfPacketDeleteReply, error) {
- out := new(AfPacketDeleteReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+type RPCService_AfPacketDumpClient interface {
+ Recv() (*AfPacketDetails, error)
+ api.Stream
+}
+
+type serviceClient_AfPacketDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_AfPacketDumpClient) Recv() (*AfPacketDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- return out, nil
+ switch m := msg.(type) {
+ case *AfPacketDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
}
func (c *serviceClient) AfPacketSetL4CksumOffload(ctx context.Context, in *AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error) {
out := new(AfPacketSetL4CksumOffloadReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/internal/testbinapi/binapi2001/arp/arp.ba.go b/internal/testbinapi/binapi2001/arp/arp.ba.go
new file mode 100644
index 0000000..988cfb3
--- /dev/null
+++ b/internal/testbinapi/binapi2001/arp/arp.ba.go
@@ -0,0 +1,1187 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/arp.api.json
+
+// Package arp contains generated bindings for API file arp.api.
+//
+// Contents:
+// 7 aliases
+// 10 enums
+// 7 structs
+// 1 union
+// 8 messages
+//
+package arp
+
+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 = "arp"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xa818aaf3
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// ProxyArp defines type 'proxy_arp'.
+type ProxyArp struct {
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ Low IP4Address `binapi:"ip4_address,name=low" json:"low,omitempty"`
+ Hi IP4Address `binapi:"ip4_address,name=hi" json:"hi,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// ProxyArpAddDel defines message 'proxy_arp_add_del'.
+type ProxyArpAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Proxy ProxyArp `binapi:"proxy_arp,name=proxy" json:"proxy,omitempty"`
+}
+
+func (m *ProxyArpAddDel) Reset() { *m = ProxyArpAddDel{} }
+func (*ProxyArpAddDel) GetMessageName() string { return "proxy_arp_add_del" }
+func (*ProxyArpAddDel) GetCrcString() string { return "85486cbd" }
+func (*ProxyArpAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ProxyArpAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Proxy.TableID
+ size += 1 * 4 // m.Proxy.Low
+ size += 1 * 4 // m.Proxy.Hi
+ return size
+}
+func (m *ProxyArpAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(m.Proxy.TableID)
+ buf.EncodeBytes(m.Proxy.Low[:], 4)
+ buf.EncodeBytes(m.Proxy.Hi[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *ProxyArpAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Proxy.TableID = buf.DecodeUint32()
+ copy(m.Proxy.Low[:], buf.DecodeBytes(4))
+ copy(m.Proxy.Hi[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// ProxyArpAddDelReply defines message 'proxy_arp_add_del_reply'.
+type ProxyArpAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ProxyArpAddDelReply) Reset() { *m = ProxyArpAddDelReply{} }
+func (*ProxyArpAddDelReply) GetMessageName() string { return "proxy_arp_add_del_reply" }
+func (*ProxyArpAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*ProxyArpAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ProxyArpAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ProxyArpAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// ProxyArpDetails defines message 'proxy_arp_details'.
+type ProxyArpDetails struct {
+ Proxy ProxyArp `binapi:"proxy_arp,name=proxy" json:"proxy,omitempty"`
+}
+
+func (m *ProxyArpDetails) Reset() { *m = ProxyArpDetails{} }
+func (*ProxyArpDetails) GetMessageName() string { return "proxy_arp_details" }
+func (*ProxyArpDetails) GetCrcString() string { return "9228c150" }
+func (*ProxyArpDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ProxyArpDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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
+}
+func (m *ProxyArpDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Proxy.TableID = buf.DecodeUint32()
+ copy(m.Proxy.Low[:], buf.DecodeBytes(4))
+ copy(m.Proxy.Hi[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// ProxyArpDump defines message 'proxy_arp_dump'.
+type ProxyArpDump struct{}
+
+func (m *ProxyArpDump) Reset() { *m = ProxyArpDump{} }
+func (*ProxyArpDump) GetMessageName() string { return "proxy_arp_dump" }
+func (*ProxyArpDump) GetCrcString() string { return "51077d14" }
+func (*ProxyArpDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ProxyArpDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ProxyArpDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ProxyArpDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ProxyArpIntfcDetails defines message 'proxy_arp_intfc_details'.
+type ProxyArpIntfcDetails struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *ProxyArpIntfcDetails) Reset() { *m = ProxyArpIntfcDetails{} }
+func (*ProxyArpIntfcDetails) GetMessageName() string { return "proxy_arp_intfc_details" }
+func (*ProxyArpIntfcDetails) GetCrcString() string { return "f6458e5f" }
+func (*ProxyArpIntfcDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ProxyArpIntfcDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *ProxyArpIntfcDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *ProxyArpIntfcDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// ProxyArpIntfcDump defines message 'proxy_arp_intfc_dump'.
+type ProxyArpIntfcDump struct{}
+
+func (m *ProxyArpIntfcDump) Reset() { *m = ProxyArpIntfcDump{} }
+func (*ProxyArpIntfcDump) GetMessageName() string { return "proxy_arp_intfc_dump" }
+func (*ProxyArpIntfcDump) GetCrcString() string { return "51077d14" }
+func (*ProxyArpIntfcDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ProxyArpIntfcDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ProxyArpIntfcDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ProxyArpIntfcDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ProxyArpIntfcEnableDisable defines message 'proxy_arp_intfc_enable_disable'.
+type ProxyArpIntfcEnableDisable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *ProxyArpIntfcEnableDisable) Reset() { *m = ProxyArpIntfcEnableDisable{} }
+func (*ProxyArpIntfcEnableDisable) GetMessageName() string { return "proxy_arp_intfc_enable_disable" }
+func (*ProxyArpIntfcEnableDisable) GetCrcString() string { return "ae6cfcfb" }
+func (*ProxyArpIntfcEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ProxyArpIntfcEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
+ return size
+}
+func (m *ProxyArpIntfcEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *ProxyArpIntfcEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// ProxyArpIntfcEnableDisableReply defines message 'proxy_arp_intfc_enable_disable_reply'.
+type ProxyArpIntfcEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ProxyArpIntfcEnableDisableReply) Reset() { *m = ProxyArpIntfcEnableDisableReply{} }
+func (*ProxyArpIntfcEnableDisableReply) GetMessageName() string {
+ return "proxy_arp_intfc_enable_disable_reply"
+}
+func (*ProxyArpIntfcEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*ProxyArpIntfcEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ProxyArpIntfcEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ProxyArpIntfcEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_arp_binapi_init() }
+func file_arp_binapi_init() {
+ api.RegisterMessage((*ProxyArpAddDel)(nil), "proxy_arp_add_del_85486cbd")
+ api.RegisterMessage((*ProxyArpAddDelReply)(nil), "proxy_arp_add_del_reply_e8d4e804")
+ api.RegisterMessage((*ProxyArpDetails)(nil), "proxy_arp_details_9228c150")
+ api.RegisterMessage((*ProxyArpDump)(nil), "proxy_arp_dump_51077d14")
+ api.RegisterMessage((*ProxyArpIntfcDetails)(nil), "proxy_arp_intfc_details_f6458e5f")
+ api.RegisterMessage((*ProxyArpIntfcDump)(nil), "proxy_arp_intfc_dump_51077d14")
+ api.RegisterMessage((*ProxyArpIntfcEnableDisable)(nil), "proxy_arp_intfc_enable_disable_ae6cfcfb")
+ api.RegisterMessage((*ProxyArpIntfcEnableDisableReply)(nil), "proxy_arp_intfc_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*ProxyArpAddDel)(nil),
+ (*ProxyArpAddDelReply)(nil),
+ (*ProxyArpDetails)(nil),
+ (*ProxyArpDump)(nil),
+ (*ProxyArpIntfcDetails)(nil),
+ (*ProxyArpIntfcDump)(nil),
+ (*ProxyArpIntfcEnableDisable)(nil),
+ (*ProxyArpIntfcEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/arp/arp_rpc.ba.go b/internal/testbinapi/binapi2001/arp/arp_rpc.ba.go
new file mode 100644
index 0000000..77e6a26
--- /dev/null
+++ b/internal/testbinapi/binapi2001/arp/arp_rpc.ba.go
@@ -0,0 +1,123 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package arp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service arp.
+type RPCService interface {
+ ProxyArpAddDel(ctx context.Context, in *ProxyArpAddDel) (*ProxyArpAddDelReply, error)
+ ProxyArpDump(ctx context.Context, in *ProxyArpDump) (RPCService_ProxyArpDumpClient, error)
+ ProxyArpIntfcDump(ctx context.Context, in *ProxyArpIntfcDump) (RPCService_ProxyArpIntfcDumpClient, error)
+ ProxyArpIntfcEnableDisable(ctx context.Context, in *ProxyArpIntfcEnableDisable) (*ProxyArpIntfcEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) ProxyArpAddDel(ctx context.Context, in *ProxyArpAddDel) (*ProxyArpAddDelReply, error) {
+ out := new(ProxyArpAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ProxyArpDump(ctx context.Context, in *ProxyArpDump) (RPCService_ProxyArpDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_ProxyArpDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_ProxyArpDumpClient interface {
+ Recv() (*ProxyArpDetails, error)
+ api.Stream
+}
+
+type serviceClient_ProxyArpDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_ProxyArpDumpClient) Recv() (*ProxyArpDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *ProxyArpDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) ProxyArpIntfcDump(ctx context.Context, in *ProxyArpIntfcDump) (RPCService_ProxyArpIntfcDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_ProxyArpIntfcDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_ProxyArpIntfcDumpClient interface {
+ Recv() (*ProxyArpIntfcDetails, error)
+ api.Stream
+}
+
+type serviceClient_ProxyArpIntfcDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_ProxyArpIntfcDumpClient) Recv() (*ProxyArpIntfcDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *ProxyArpIntfcDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) ProxyArpIntfcEnableDisable(ctx context.Context, in *ProxyArpIntfcEnableDisable) (*ProxyArpIntfcEnableDisableReply, error) {
+ out := new(ProxyArpIntfcEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/avf/avf.ba.go b/internal/testbinapi/binapi2001/avf/avf.ba.go
new file mode 100644
index 0000000..06b17e5
--- /dev/null
+++ b/internal/testbinapi/binapi2001/avf/avf.ba.go
@@ -0,0 +1,456 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/avf.api.json
+
+// Package avf contains generated bindings for API file avf.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 4 messages
+//
+package avf
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "avf"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xb7c68e1d
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// AvfCreate defines message 'avf_create'.
+type AvfCreate struct {
+ PciAddr uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
+ EnableElog int32 `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
+ RxqNum uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
+ RxqSize uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
+ TxqSize uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
+}
+
+func (m *AvfCreate) Reset() { *m = AvfCreate{} }
+func (*AvfCreate) GetMessageName() string { return "avf_create" }
+func (*AvfCreate) GetCrcString() string { return "daab8ae2" }
+func (*AvfCreate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AvfCreate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PciAddr
+ size += 4 // m.EnableElog
+ size += 2 // m.RxqNum
+ size += 2 // m.RxqSize
+ size += 2 // m.TxqSize
+ return size
+}
+func (m *AvfCreate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.RxqNum = buf.DecodeUint16()
+ m.RxqSize = buf.DecodeUint16()
+ m.TxqSize = buf.DecodeUint16()
+ return nil
+}
+
+// AvfCreateReply defines message 'avf_create_reply'.
+type AvfCreateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *AvfCreateReply) Reset() { *m = AvfCreateReply{} }
+func (*AvfCreateReply) GetMessageName() string { return "avf_create_reply" }
+func (*AvfCreateReply) GetCrcString() string { return "5383d31f" }
+func (*AvfCreateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AvfCreateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *AvfCreateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// AvfDelete defines message 'avf_delete'.
+type AvfDelete struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *AvfDelete) Reset() { *m = AvfDelete{} }
+func (*AvfDelete) GetMessageName() string { return "avf_delete" }
+func (*AvfDelete) GetCrcString() string { return "f9e6675e" }
+func (*AvfDelete) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AvfDelete) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *AvfDelete) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *AvfDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// AvfDeleteReply defines message 'avf_delete_reply'.
+type AvfDeleteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *AvfDeleteReply) Reset() { *m = AvfDeleteReply{} }
+func (*AvfDeleteReply) GetMessageName() string { return "avf_delete_reply" }
+func (*AvfDeleteReply) GetCrcString() string { return "e8d4e804" }
+func (*AvfDeleteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AvfDeleteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *AvfDeleteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_avf_binapi_init() }
+func file_avf_binapi_init() {
+ api.RegisterMessage((*AvfCreate)(nil), "avf_create_daab8ae2")
+ api.RegisterMessage((*AvfCreateReply)(nil), "avf_create_reply_5383d31f")
+ api.RegisterMessage((*AvfDelete)(nil), "avf_delete_f9e6675e")
+ api.RegisterMessage((*AvfDeleteReply)(nil), "avf_delete_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*AvfCreate)(nil),
+ (*AvfCreateReply)(nil),
+ (*AvfDelete)(nil),
+ (*AvfDeleteReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/avf/avf_rpc.ba.go b/internal/testbinapi/binapi2001/avf/avf_rpc.ba.go
new file mode 100644
index 0000000..90f854e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/avf/avf_rpc.ba.go
@@ -0,0 +1,40 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package avf
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service avf.
+type RPCService interface {
+ AvfCreate(ctx context.Context, in *AvfCreate) (*AvfCreateReply, error)
+ AvfDelete(ctx context.Context, in *AvfDelete) (*AvfDeleteReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) AvfCreate(ctx context.Context, in *AvfCreate) (*AvfCreateReply, error) {
+ out := new(AvfCreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) AvfDelete(ctx context.Context, in *AvfDelete) (*AvfDeleteReply, error) {
+ out := new(AvfDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/bfd/bfd.ba.go b/internal/testbinapi/binapi2001/bfd/bfd.ba.go
new file mode 100644
index 0000000..236c511
--- /dev/null
+++ b/internal/testbinapi/binapi2001/bfd/bfd.ba.go
@@ -0,0 +1,2080 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/bfd.api.json
+
+// Package bfd contains generated bindings for API file bfd.api.
+//
+// Contents:
+// 6 aliases
+// 11 enums
+// 6 structs
+// 1 union
+// 28 messages
+//
+package bfd
+
+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 = "bfd"
+ APIVersion = "2.0.0"
+ VersionCrc = 0xfd792c8c
+)
+
+// 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)) + ")"
+}
+
+// BfdState defines enum 'bfd_state'.
+type BfdState uint32
+
+const (
+ BFD_STATE_API_ADMIN_DOWN BfdState = 0
+ BFD_STATE_API_DOWN BfdState = 1
+ BFD_STATE_API_INIT BfdState = 2
+ BFD_STATE_API_UP BfdState = 3
+)
+
+var (
+ BfdState_name = map[uint32]string{
+ 0: "BFD_STATE_API_ADMIN_DOWN",
+ 1: "BFD_STATE_API_DOWN",
+ 2: "BFD_STATE_API_INIT",
+ 3: "BFD_STATE_API_UP",
+ }
+ BfdState_value = map[string]uint32{
+ "BFD_STATE_API_ADMIN_DOWN": 0,
+ "BFD_STATE_API_DOWN": 1,
+ "BFD_STATE_API_INIT": 2,
+ "BFD_STATE_API_UP": 3,
+ }
+)
+
+func (x BfdState) String() string {
+ s, ok := BfdState_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "BfdState(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// BfdAuthDelKey defines message 'bfd_auth_del_key'.
+type BfdAuthDelKey struct {
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+}
+
+func (m *BfdAuthDelKey) Reset() { *m = BfdAuthDelKey{} }
+func (*BfdAuthDelKey) GetMessageName() string { return "bfd_auth_del_key" }
+func (*BfdAuthDelKey) GetCrcString() string { return "65310b22" }
+func (*BfdAuthDelKey) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdAuthDelKey) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ConfKeyID
+ return size
+}
+func (m *BfdAuthDelKey) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ConfKeyID)
+ return buf.Bytes(), nil
+}
+func (m *BfdAuthDelKey) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ConfKeyID = buf.DecodeUint32()
+ return nil
+}
+
+// BfdAuthDelKeyReply defines message 'bfd_auth_del_key_reply'.
+type BfdAuthDelKeyReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdAuthDelKeyReply) Reset() { *m = BfdAuthDelKeyReply{} }
+func (*BfdAuthDelKeyReply) GetMessageName() string { return "bfd_auth_del_key_reply" }
+func (*BfdAuthDelKeyReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdAuthDelKeyReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdAuthDelKeyReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdAuthDelKeyReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BfdAuthKeysDetails defines message 'bfd_auth_keys_details'.
+type BfdAuthKeysDetails struct {
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+ UseCount uint32 `binapi:"u32,name=use_count" json:"use_count,omitempty"`
+ AuthType uint8 `binapi:"u8,name=auth_type" json:"auth_type,omitempty"`
+}
+
+func (m *BfdAuthKeysDetails) Reset() { *m = BfdAuthKeysDetails{} }
+func (*BfdAuthKeysDetails) GetMessageName() string { return "bfd_auth_keys_details" }
+func (*BfdAuthKeysDetails) GetCrcString() string { return "84130e9f" }
+func (*BfdAuthKeysDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdAuthKeysDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ConfKeyID
+ size += 4 // m.UseCount
+ size += 1 // m.AuthType
+ return size
+}
+func (m *BfdAuthKeysDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.ConfKeyID = buf.DecodeUint32()
+ m.UseCount = buf.DecodeUint32()
+ m.AuthType = buf.DecodeUint8()
+ return nil
+}
+
+// BfdAuthKeysDump defines message 'bfd_auth_keys_dump'.
+type BfdAuthKeysDump struct{}
+
+func (m *BfdAuthKeysDump) Reset() { *m = BfdAuthKeysDump{} }
+func (*BfdAuthKeysDump) GetMessageName() string { return "bfd_auth_keys_dump" }
+func (*BfdAuthKeysDump) GetCrcString() string { return "51077d14" }
+func (*BfdAuthKeysDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdAuthKeysDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *BfdAuthKeysDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *BfdAuthKeysDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BfdAuthSetKey defines message 'bfd_auth_set_key'.
+type BfdAuthSetKey struct {
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+ KeyLen uint8 `binapi:"u8,name=key_len" json:"key_len,omitempty"`
+ AuthType uint8 `binapi:"u8,name=auth_type" json:"auth_type,omitempty"`
+ Key []byte `binapi:"u8[20],name=key" json:"key,omitempty"`
+}
+
+func (m *BfdAuthSetKey) Reset() { *m = BfdAuthSetKey{} }
+func (*BfdAuthSetKey) GetMessageName() string { return "bfd_auth_set_key" }
+func (*BfdAuthSetKey) GetCrcString() string { return "690b8877" }
+func (*BfdAuthSetKey) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdAuthSetKey) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ConfKeyID
+ size += 1 // m.KeyLen
+ size += 1 // m.AuthType
+ size += 1 * 20 // m.Key
+ return size
+}
+func (m *BfdAuthSetKey) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.ConfKeyID = buf.DecodeUint32()
+ m.KeyLen = buf.DecodeUint8()
+ m.AuthType = buf.DecodeUint8()
+ m.Key = make([]byte, 20)
+ copy(m.Key, buf.DecodeBytes(len(m.Key)))
+ return nil
+}
+
+// BfdAuthSetKeyReply defines message 'bfd_auth_set_key_reply'.
+type BfdAuthSetKeyReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdAuthSetKeyReply) Reset() { *m = BfdAuthSetKeyReply{} }
+func (*BfdAuthSetKeyReply) GetMessageName() string { return "bfd_auth_set_key_reply" }
+func (*BfdAuthSetKeyReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdAuthSetKeyReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdAuthSetKeyReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdAuthSetKeyReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BfdUDPAdd defines message 'bfd_udp_add'.
+type BfdUDPAdd struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ DesiredMinTx uint32 `binapi:"u32,name=desired_min_tx" json:"desired_min_tx,omitempty"`
+ RequiredMinRx uint32 `binapi:"u32,name=required_min_rx" json:"required_min_rx,omitempty"`
+ LocalAddr Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ DetectMult uint8 `binapi:"u8,name=detect_mult" json:"detect_mult,omitempty"`
+ IsAuthenticated bool `binapi:"bool,name=is_authenticated" json:"is_authenticated,omitempty"`
+ BfdKeyID uint8 `binapi:"u8,name=bfd_key_id" json:"bfd_key_id,omitempty"`
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+}
+
+func (m *BfdUDPAdd) Reset() { *m = BfdUDPAdd{} }
+func (*BfdUDPAdd) GetMessageName() string { return "bfd_udp_add" }
+func (*BfdUDPAdd) GetCrcString() string { return "7a6d1185" }
+func (*BfdUDPAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.DesiredMinTx
+ size += 4 // m.RequiredMinRx
+ size += 4 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 4 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 1 // m.DetectMult
+ size += 1 // m.IsAuthenticated
+ size += 1 // m.BfdKeyID
+ size += 4 // m.ConfKeyID
+ return size
+}
+func (m *BfdUDPAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.DesiredMinTx)
+ buf.EncodeUint32(m.RequiredMinRx)
+ buf.EncodeUint32(uint32(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.DetectMult)
+ buf.EncodeBool(m.IsAuthenticated)
+ buf.EncodeUint8(m.BfdKeyID)
+ buf.EncodeUint32(m.ConfKeyID)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.DesiredMinTx = buf.DecodeUint32()
+ m.RequiredMinRx = buf.DecodeUint32()
+ m.LocalAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DetectMult = buf.DecodeUint8()
+ m.IsAuthenticated = buf.DecodeBool()
+ m.BfdKeyID = buf.DecodeUint8()
+ m.ConfKeyID = buf.DecodeUint32()
+ return nil
+}
+
+// BfdUDPAddReply defines message 'bfd_udp_add_reply'.
+type BfdUDPAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPAddReply) Reset() { *m = BfdUDPAddReply{} }
+func (*BfdUDPAddReply) GetMessageName() string { return "bfd_udp_add_reply" }
+func (*BfdUDPAddReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BfdUDPAuthActivate defines message 'bfd_udp_auth_activate'.
+type BfdUDPAuthActivate struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ IsDelayed bool `binapi:"bool,name=is_delayed" json:"is_delayed,omitempty"`
+ BfdKeyID uint8 `binapi:"u8,name=bfd_key_id" json:"bfd_key_id,omitempty"`
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+}
+
+func (m *BfdUDPAuthActivate) Reset() { *m = BfdUDPAuthActivate{} }
+func (*BfdUDPAuthActivate) GetMessageName() string { return "bfd_udp_auth_activate" }
+func (*BfdUDPAuthActivate) GetCrcString() string { return "493ee0ec" }
+func (*BfdUDPAuthActivate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPAuthActivate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 4 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 1 // m.IsDelayed
+ size += 1 // m.BfdKeyID
+ size += 4 // m.ConfKeyID
+ return size
+}
+func (m *BfdUDPAuthActivate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeBool(m.IsDelayed)
+ buf.EncodeUint8(m.BfdKeyID)
+ buf.EncodeUint32(m.ConfKeyID)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPAuthActivate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.IsDelayed = buf.DecodeBool()
+ m.BfdKeyID = buf.DecodeUint8()
+ m.ConfKeyID = buf.DecodeUint32()
+ return nil
+}
+
+// BfdUDPAuthActivateReply defines message 'bfd_udp_auth_activate_reply'.
+type BfdUDPAuthActivateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPAuthActivateReply) Reset() { *m = BfdUDPAuthActivateReply{} }
+func (*BfdUDPAuthActivateReply) GetMessageName() string { return "bfd_udp_auth_activate_reply" }
+func (*BfdUDPAuthActivateReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPAuthActivateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPAuthActivateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPAuthActivateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BfdUDPAuthDeactivate defines message 'bfd_udp_auth_deactivate'.
+type BfdUDPAuthDeactivate struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ IsDelayed bool `binapi:"bool,name=is_delayed" json:"is_delayed,omitempty"`
+}
+
+func (m *BfdUDPAuthDeactivate) Reset() { *m = BfdUDPAuthDeactivate{} }
+func (*BfdUDPAuthDeactivate) GetMessageName() string { return "bfd_udp_auth_deactivate" }
+func (*BfdUDPAuthDeactivate) GetCrcString() string { return "99978c32" }
+func (*BfdUDPAuthDeactivate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPAuthDeactivate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 4 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 1 // m.IsDelayed
+ return size
+}
+func (m *BfdUDPAuthDeactivate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeBool(m.IsDelayed)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPAuthDeactivate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.IsDelayed = buf.DecodeBool()
+ return nil
+}
+
+// BfdUDPAuthDeactivateReply defines message 'bfd_udp_auth_deactivate_reply'.
+type BfdUDPAuthDeactivateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPAuthDeactivateReply) Reset() { *m = BfdUDPAuthDeactivateReply{} }
+func (*BfdUDPAuthDeactivateReply) GetMessageName() string { return "bfd_udp_auth_deactivate_reply" }
+func (*BfdUDPAuthDeactivateReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPAuthDeactivateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPAuthDeactivateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPAuthDeactivateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BfdUDPDel defines message 'bfd_udp_del'.
+type BfdUDPDel struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+}
+
+func (m *BfdUDPDel) Reset() { *m = BfdUDPDel{} }
+func (*BfdUDPDel) GetMessageName() string { return "bfd_udp_del" }
+func (*BfdUDPDel) GetCrcString() string { return "8096514d" }
+func (*BfdUDPDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 4 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ return size
+}
+func (m *BfdUDPDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// BfdUDPDelEchoSource defines message 'bfd_udp_del_echo_source'.
+type BfdUDPDelEchoSource struct{}
+
+func (m *BfdUDPDelEchoSource) Reset() { *m = BfdUDPDelEchoSource{} }
+func (*BfdUDPDelEchoSource) GetMessageName() string { return "bfd_udp_del_echo_source" }
+func (*BfdUDPDelEchoSource) GetCrcString() string { return "51077d14" }
+func (*BfdUDPDelEchoSource) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPDelEchoSource) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *BfdUDPDelEchoSource) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPDelEchoSource) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BfdUDPDelEchoSourceReply defines message 'bfd_udp_del_echo_source_reply'.
+type BfdUDPDelEchoSourceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPDelEchoSourceReply) Reset() { *m = BfdUDPDelEchoSourceReply{} }
+func (*BfdUDPDelEchoSourceReply) GetMessageName() string { return "bfd_udp_del_echo_source_reply" }
+func (*BfdUDPDelEchoSourceReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPDelEchoSourceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPDelEchoSourceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPDelEchoSourceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BfdUDPDelReply defines message 'bfd_udp_del_reply'.
+type BfdUDPDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPDelReply) Reset() { *m = BfdUDPDelReply{} }
+func (*BfdUDPDelReply) GetMessageName() string { return "bfd_udp_del_reply" }
+func (*BfdUDPDelReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BfdUDPGetEchoSource defines message 'bfd_udp_get_echo_source'.
+type BfdUDPGetEchoSource struct{}
+
+func (m *BfdUDPGetEchoSource) Reset() { *m = BfdUDPGetEchoSource{} }
+func (*BfdUDPGetEchoSource) GetMessageName() string { return "bfd_udp_get_echo_source" }
+func (*BfdUDPGetEchoSource) GetCrcString() string { return "51077d14" }
+func (*BfdUDPGetEchoSource) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPGetEchoSource) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *BfdUDPGetEchoSource) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPGetEchoSource) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BfdUDPGetEchoSourceReply defines message 'bfd_udp_get_echo_source_reply'.
+type BfdUDPGetEchoSourceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsSet bool `binapi:"bool,name=is_set" json:"is_set,omitempty"`
+ HaveUsableIP4 bool `binapi:"bool,name=have_usable_ip4" json:"have_usable_ip4,omitempty"`
+ IP4Addr IP4Address `binapi:"ip4_address,name=ip4_addr" json:"ip4_addr,omitempty"`
+ HaveUsableIP6 bool `binapi:"bool,name=have_usable_ip6" json:"have_usable_ip6,omitempty"`
+ IP6Addr IP6Address `binapi:"ip6_address,name=ip6_addr" json:"ip6_addr,omitempty"`
+}
+
+func (m *BfdUDPGetEchoSourceReply) Reset() { *m = BfdUDPGetEchoSourceReply{} }
+func (*BfdUDPGetEchoSourceReply) GetMessageName() string { return "bfd_udp_get_echo_source_reply" }
+func (*BfdUDPGetEchoSourceReply) GetCrcString() string { return "1e00cfce" }
+func (*BfdUDPGetEchoSourceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPGetEchoSourceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsSet
+ size += 1 // m.HaveUsableIP4
+ size += 1 * 4 // m.IP4Addr
+ size += 1 // m.HaveUsableIP6
+ size += 1 * 16 // m.IP6Addr
+ return size
+}
+func (m *BfdUDPGetEchoSourceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsSet)
+ buf.EncodeBool(m.HaveUsableIP4)
+ buf.EncodeBytes(m.IP4Addr[:], 4)
+ buf.EncodeBool(m.HaveUsableIP6)
+ buf.EncodeBytes(m.IP6Addr[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPGetEchoSourceReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsSet = buf.DecodeBool()
+ m.HaveUsableIP4 = buf.DecodeBool()
+ copy(m.IP4Addr[:], buf.DecodeBytes(4))
+ m.HaveUsableIP6 = buf.DecodeBool()
+ copy(m.IP6Addr[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// BfdUDPMod defines message 'bfd_udp_mod'.
+type BfdUDPMod struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ DesiredMinTx uint32 `binapi:"u32,name=desired_min_tx" json:"desired_min_tx,omitempty"`
+ RequiredMinRx uint32 `binapi:"u32,name=required_min_rx" json:"required_min_rx,omitempty"`
+ LocalAddr Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ DetectMult uint8 `binapi:"u8,name=detect_mult" json:"detect_mult,omitempty"`
+}
+
+func (m *BfdUDPMod) Reset() { *m = BfdUDPMod{} }
+func (*BfdUDPMod) GetMessageName() string { return "bfd_udp_mod" }
+func (*BfdUDPMod) GetCrcString() string { return "783a3ff6" }
+func (*BfdUDPMod) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPMod) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.DesiredMinTx
+ size += 4 // m.RequiredMinRx
+ size += 4 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 4 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 1 // m.DetectMult
+ return size
+}
+func (m *BfdUDPMod) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.DesiredMinTx)
+ buf.EncodeUint32(m.RequiredMinRx)
+ buf.EncodeUint32(uint32(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.DetectMult)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPMod) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.DesiredMinTx = buf.DecodeUint32()
+ m.RequiredMinRx = buf.DecodeUint32()
+ m.LocalAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DetectMult = buf.DecodeUint8()
+ return nil
+}
+
+// BfdUDPModReply defines message 'bfd_udp_mod_reply'.
+type BfdUDPModReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPModReply) Reset() { *m = BfdUDPModReply{} }
+func (*BfdUDPModReply) GetMessageName() string { return "bfd_udp_mod_reply" }
+func (*BfdUDPModReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPModReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPModReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPModReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BfdUDPSessionDetails defines message 'bfd_udp_session_details'.
+type BfdUDPSessionDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ State BfdState `binapi:"bfd_state,name=state" json:"state,omitempty"`
+ IsAuthenticated bool `binapi:"bool,name=is_authenticated" json:"is_authenticated,omitempty"`
+ BfdKeyID uint8 `binapi:"u8,name=bfd_key_id" json:"bfd_key_id,omitempty"`
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+ RequiredMinRx uint32 `binapi:"u32,name=required_min_rx" json:"required_min_rx,omitempty"`
+ DesiredMinTx uint32 `binapi:"u32,name=desired_min_tx" json:"desired_min_tx,omitempty"`
+ DetectMult uint8 `binapi:"u8,name=detect_mult" json:"detect_mult,omitempty"`
+}
+
+func (m *BfdUDPSessionDetails) Reset() { *m = BfdUDPSessionDetails{} }
+func (*BfdUDPSessionDetails) GetMessageName() string { return "bfd_udp_session_details" }
+func (*BfdUDPSessionDetails) GetCrcString() string { return "60653c02" }
+func (*BfdUDPSessionDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPSessionDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 4 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 4 // m.State
+ size += 1 // m.IsAuthenticated
+ size += 1 // m.BfdKeyID
+ size += 4 // m.ConfKeyID
+ size += 4 // m.RequiredMinRx
+ size += 4 // m.DesiredMinTx
+ size += 1 // m.DetectMult
+ return size
+}
+func (m *BfdUDPSessionDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.State))
+ buf.EncodeBool(m.IsAuthenticated)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.State = BfdState(buf.DecodeUint32())
+ m.IsAuthenticated = buf.DecodeBool()
+ m.BfdKeyID = buf.DecodeUint8()
+ m.ConfKeyID = buf.DecodeUint32()
+ m.RequiredMinRx = buf.DecodeUint32()
+ m.DesiredMinTx = buf.DecodeUint32()
+ m.DetectMult = buf.DecodeUint8()
+ return nil
+}
+
+// BfdUDPSessionDump defines message 'bfd_udp_session_dump'.
+type BfdUDPSessionDump struct{}
+
+func (m *BfdUDPSessionDump) Reset() { *m = BfdUDPSessionDump{} }
+func (*BfdUDPSessionDump) GetMessageName() string { return "bfd_udp_session_dump" }
+func (*BfdUDPSessionDump) GetCrcString() string { return "51077d14" }
+func (*BfdUDPSessionDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPSessionDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *BfdUDPSessionDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPSessionDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BfdUDPSessionSetFlags defines message 'bfd_udp_session_set_flags'.
+type BfdUDPSessionSetFlags struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ Flags IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
+}
+
+func (m *BfdUDPSessionSetFlags) Reset() { *m = BfdUDPSessionSetFlags{} }
+func (*BfdUDPSessionSetFlags) GetMessageName() string { return "bfd_udp_session_set_flags" }
+func (*BfdUDPSessionSetFlags) GetCrcString() string { return "cf313851" }
+func (*BfdUDPSessionSetFlags) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPSessionSetFlags) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 4 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 4 // m.Flags
+ return size
+}
+func (m *BfdUDPSessionSetFlags) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Flags))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPSessionSetFlags) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Flags = IfStatusFlags(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPSessionSetFlagsReply defines message 'bfd_udp_session_set_flags_reply'.
+type BfdUDPSessionSetFlagsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPSessionSetFlagsReply) Reset() { *m = BfdUDPSessionSetFlagsReply{} }
+func (*BfdUDPSessionSetFlagsReply) GetMessageName() string { return "bfd_udp_session_set_flags_reply" }
+func (*BfdUDPSessionSetFlagsReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPSessionSetFlagsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPSessionSetFlagsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPSessionSetFlagsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BfdUDPSetEchoSource defines message 'bfd_udp_set_echo_source'.
+type BfdUDPSetEchoSource struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *BfdUDPSetEchoSource) Reset() { *m = BfdUDPSetEchoSource{} }
+func (*BfdUDPSetEchoSource) GetMessageName() string { return "bfd_udp_set_echo_source" }
+func (*BfdUDPSetEchoSource) GetCrcString() string { return "f9e6675e" }
+func (*BfdUDPSetEchoSource) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPSetEchoSource) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *BfdUDPSetEchoSource) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPSetEchoSource) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPSetEchoSourceReply defines message 'bfd_udp_set_echo_source_reply'.
+type BfdUDPSetEchoSourceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPSetEchoSourceReply) Reset() { *m = BfdUDPSetEchoSourceReply{} }
+func (*BfdUDPSetEchoSourceReply) GetMessageName() string { return "bfd_udp_set_echo_source_reply" }
+func (*BfdUDPSetEchoSourceReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPSetEchoSourceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPSetEchoSourceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPSetEchoSourceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// WantBfdEvents defines message 'want_bfd_events'.
+type WantBfdEvents struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *WantBfdEvents) Reset() { *m = WantBfdEvents{} }
+func (*WantBfdEvents) GetMessageName() string { return "want_bfd_events" }
+func (*WantBfdEvents) GetCrcString() string { return "c5e2af94" }
+func (*WantBfdEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantBfdEvents) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ size += 4 // m.PID
+ return size
+}
+func (m *WantBfdEvents) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeUint32(m.PID)
+ return buf.Bytes(), nil
+}
+func (m *WantBfdEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// WantBfdEventsReply defines message 'want_bfd_events_reply'.
+type WantBfdEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantBfdEventsReply) Reset() { *m = WantBfdEventsReply{} }
+func (*WantBfdEventsReply) GetMessageName() string { return "want_bfd_events_reply" }
+func (*WantBfdEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantBfdEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantBfdEventsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantBfdEventsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_bfd_binapi_init() }
+func file_bfd_binapi_init() {
+ api.RegisterMessage((*BfdAuthDelKey)(nil), "bfd_auth_del_key_65310b22")
+ api.RegisterMessage((*BfdAuthDelKeyReply)(nil), "bfd_auth_del_key_reply_e8d4e804")
+ api.RegisterMessage((*BfdAuthKeysDetails)(nil), "bfd_auth_keys_details_84130e9f")
+ api.RegisterMessage((*BfdAuthKeysDump)(nil), "bfd_auth_keys_dump_51077d14")
+ api.RegisterMessage((*BfdAuthSetKey)(nil), "bfd_auth_set_key_690b8877")
+ api.RegisterMessage((*BfdAuthSetKeyReply)(nil), "bfd_auth_set_key_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPAdd)(nil), "bfd_udp_add_7a6d1185")
+ api.RegisterMessage((*BfdUDPAddReply)(nil), "bfd_udp_add_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPAuthActivate)(nil), "bfd_udp_auth_activate_493ee0ec")
+ api.RegisterMessage((*BfdUDPAuthActivateReply)(nil), "bfd_udp_auth_activate_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPAuthDeactivate)(nil), "bfd_udp_auth_deactivate_99978c32")
+ api.RegisterMessage((*BfdUDPAuthDeactivateReply)(nil), "bfd_udp_auth_deactivate_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPDel)(nil), "bfd_udp_del_8096514d")
+ api.RegisterMessage((*BfdUDPDelEchoSource)(nil), "bfd_udp_del_echo_source_51077d14")
+ api.RegisterMessage((*BfdUDPDelEchoSourceReply)(nil), "bfd_udp_del_echo_source_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPDelReply)(nil), "bfd_udp_del_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPGetEchoSource)(nil), "bfd_udp_get_echo_source_51077d14")
+ api.RegisterMessage((*BfdUDPGetEchoSourceReply)(nil), "bfd_udp_get_echo_source_reply_1e00cfce")
+ api.RegisterMessage((*BfdUDPMod)(nil), "bfd_udp_mod_783a3ff6")
+ api.RegisterMessage((*BfdUDPModReply)(nil), "bfd_udp_mod_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPSessionDetails)(nil), "bfd_udp_session_details_60653c02")
+ api.RegisterMessage((*BfdUDPSessionDump)(nil), "bfd_udp_session_dump_51077d14")
+ api.RegisterMessage((*BfdUDPSessionSetFlags)(nil), "bfd_udp_session_set_flags_cf313851")
+ api.RegisterMessage((*BfdUDPSessionSetFlagsReply)(nil), "bfd_udp_session_set_flags_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPSetEchoSource)(nil), "bfd_udp_set_echo_source_f9e6675e")
+ api.RegisterMessage((*BfdUDPSetEchoSourceReply)(nil), "bfd_udp_set_echo_source_reply_e8d4e804")
+ api.RegisterMessage((*WantBfdEvents)(nil), "want_bfd_events_c5e2af94")
+ api.RegisterMessage((*WantBfdEventsReply)(nil), "want_bfd_events_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*BfdAuthDelKey)(nil),
+ (*BfdAuthDelKeyReply)(nil),
+ (*BfdAuthKeysDetails)(nil),
+ (*BfdAuthKeysDump)(nil),
+ (*BfdAuthSetKey)(nil),
+ (*BfdAuthSetKeyReply)(nil),
+ (*BfdUDPAdd)(nil),
+ (*BfdUDPAddReply)(nil),
+ (*BfdUDPAuthActivate)(nil),
+ (*BfdUDPAuthActivateReply)(nil),
+ (*BfdUDPAuthDeactivate)(nil),
+ (*BfdUDPAuthDeactivateReply)(nil),
+ (*BfdUDPDel)(nil),
+ (*BfdUDPDelEchoSource)(nil),
+ (*BfdUDPDelEchoSourceReply)(nil),
+ (*BfdUDPDelReply)(nil),
+ (*BfdUDPGetEchoSource)(nil),
+ (*BfdUDPGetEchoSourceReply)(nil),
+ (*BfdUDPMod)(nil),
+ (*BfdUDPModReply)(nil),
+ (*BfdUDPSessionDetails)(nil),
+ (*BfdUDPSessionDump)(nil),
+ (*BfdUDPSessionSetFlags)(nil),
+ (*BfdUDPSessionSetFlagsReply)(nil),
+ (*BfdUDPSetEchoSource)(nil),
+ (*BfdUDPSetEchoSourceReply)(nil),
+ (*WantBfdEvents)(nil),
+ (*WantBfdEventsReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/bfd/bfd_rpc.ba.go b/internal/testbinapi/binapi2001/bfd/bfd_rpc.ba.go
new file mode 100644
index 0000000..214b2a3
--- /dev/null
+++ b/internal/testbinapi/binapi2001/bfd/bfd_rpc.ba.go
@@ -0,0 +1,223 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package bfd
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service bfd.
+type RPCService interface {
+ BfdAuthDelKey(ctx context.Context, in *BfdAuthDelKey) (*BfdAuthDelKeyReply, error)
+ BfdAuthKeysDump(ctx context.Context, in *BfdAuthKeysDump) (RPCService_BfdAuthKeysDumpClient, error)
+ BfdAuthSetKey(ctx context.Context, in *BfdAuthSetKey) (*BfdAuthSetKeyReply, error)
+ BfdUDPAdd(ctx context.Context, in *BfdUDPAdd) (*BfdUDPAddReply, error)
+ BfdUDPAuthActivate(ctx context.Context, in *BfdUDPAuthActivate) (*BfdUDPAuthActivateReply, error)
+ BfdUDPAuthDeactivate(ctx context.Context, in *BfdUDPAuthDeactivate) (*BfdUDPAuthDeactivateReply, error)
+ BfdUDPDel(ctx context.Context, in *BfdUDPDel) (*BfdUDPDelReply, error)
+ BfdUDPDelEchoSource(ctx context.Context, in *BfdUDPDelEchoSource) (*BfdUDPDelEchoSourceReply, error)
+ BfdUDPGetEchoSource(ctx context.Context, in *BfdUDPGetEchoSource) (*BfdUDPGetEchoSourceReply, error)
+ BfdUDPMod(ctx context.Context, in *BfdUDPMod) (*BfdUDPModReply, error)
+ BfdUDPSessionDump(ctx context.Context, in *BfdUDPSessionDump) (RPCService_BfdUDPSessionDumpClient, error)
+ BfdUDPSessionSetFlags(ctx context.Context, in *BfdUDPSessionSetFlags) (*BfdUDPSessionSetFlagsReply, error)
+ BfdUDPSetEchoSource(ctx context.Context, in *BfdUDPSetEchoSource) (*BfdUDPSetEchoSourceReply, error)
+ WantBfdEvents(ctx context.Context, in *WantBfdEvents) (*WantBfdEventsReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) BfdAuthDelKey(ctx context.Context, in *BfdAuthDelKey) (*BfdAuthDelKeyReply, error) {
+ out := new(BfdAuthDelKeyReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdAuthKeysDump(ctx context.Context, in *BfdAuthKeysDump) (RPCService_BfdAuthKeysDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BfdAuthKeysDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BfdAuthKeysDumpClient interface {
+ Recv() (*BfdAuthKeysDetails, error)
+ api.Stream
+}
+
+type serviceClient_BfdAuthKeysDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BfdAuthKeysDumpClient) Recv() (*BfdAuthKeysDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BfdAuthKeysDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BfdAuthSetKey(ctx context.Context, in *BfdAuthSetKey) (*BfdAuthSetKeyReply, error) {
+ out := new(BfdAuthSetKeyReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPAdd(ctx context.Context, in *BfdUDPAdd) (*BfdUDPAddReply, error) {
+ out := new(BfdUDPAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPAuthActivate(ctx context.Context, in *BfdUDPAuthActivate) (*BfdUDPAuthActivateReply, error) {
+ out := new(BfdUDPAuthActivateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPAuthDeactivate(ctx context.Context, in *BfdUDPAuthDeactivate) (*BfdUDPAuthDeactivateReply, error) {
+ out := new(BfdUDPAuthDeactivateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPDel(ctx context.Context, in *BfdUDPDel) (*BfdUDPDelReply, error) {
+ out := new(BfdUDPDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPDelEchoSource(ctx context.Context, in *BfdUDPDelEchoSource) (*BfdUDPDelEchoSourceReply, error) {
+ out := new(BfdUDPDelEchoSourceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPGetEchoSource(ctx context.Context, in *BfdUDPGetEchoSource) (*BfdUDPGetEchoSourceReply, error) {
+ out := new(BfdUDPGetEchoSourceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPMod(ctx context.Context, in *BfdUDPMod) (*BfdUDPModReply, error) {
+ out := new(BfdUDPModReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPSessionDump(ctx context.Context, in *BfdUDPSessionDump) (RPCService_BfdUDPSessionDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BfdUDPSessionDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BfdUDPSessionDumpClient interface {
+ Recv() (*BfdUDPSessionDetails, error)
+ api.Stream
+}
+
+type serviceClient_BfdUDPSessionDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BfdUDPSessionDumpClient) Recv() (*BfdUDPSessionDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BfdUDPSessionDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BfdUDPSessionSetFlags(ctx context.Context, in *BfdUDPSessionSetFlags) (*BfdUDPSessionSetFlagsReply, error) {
+ out := new(BfdUDPSessionSetFlagsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPSetEchoSource(ctx context.Context, in *BfdUDPSetEchoSource) (*BfdUDPSetEchoSourceReply, error) {
+ out := new(BfdUDPSetEchoSourceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) WantBfdEvents(ctx context.Context, in *WantBfdEvents) (*WantBfdEventsReply, error) {
+ out := new(WantBfdEventsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/bier/bier.ba.go b/internal/testbinapi/binapi2001/bier/bier.ba.go
new file mode 100644
index 0000000..238aa23
--- /dev/null
+++ b/internal/testbinapi/binapi2001/bier/bier.ba.go
@@ -0,0 +1,1980 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/bier.api.json
+
+// Package bier contains generated bindings for API file bier.api.
+//
+// Contents:
+// 5 aliases
+// 7 enums
+// 11 structs
+// 1 union
+// 22 messages
+//
+package bier
+
+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 = "bier"
+ APIVersion = "1.2.1"
+ VersionCrc = 0x27c878c4
+)
+
+// 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<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// FibPathNhProto defines enum 'fib_path_nh_proto'.
+type FibPathNhProto uint32
+
+const (
+ FIB_API_PATH_NH_PROTO_IP4 FibPathNhProto = 0
+ FIB_API_PATH_NH_PROTO_IP6 FibPathNhProto = 1
+ FIB_API_PATH_NH_PROTO_MPLS FibPathNhProto = 2
+ FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
+ FIB_API_PATH_NH_PROTO_BIER FibPathNhProto = 4
+)
+
+var (
+ FibPathNhProto_name = map[uint32]string{
+ 0: "FIB_API_PATH_NH_PROTO_IP4",
+ 1: "FIB_API_PATH_NH_PROTO_IP6",
+ 2: "FIB_API_PATH_NH_PROTO_MPLS",
+ 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
+ 4: "FIB_API_PATH_NH_PROTO_BIER",
+ }
+ FibPathNhProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathNhProto) String() string {
+ s, ok := FibPathNhProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// FibPathType defines enum 'fib_path_type'.
+type FibPathType uint32
+
+const (
+ FIB_API_PATH_TYPE_NORMAL FibPathType = 0
+ FIB_API_PATH_TYPE_LOCAL FibPathType = 1
+ FIB_API_PATH_TYPE_DROP FibPathType = 2
+ FIB_API_PATH_TYPE_UDP_ENCAP FibPathType = 3
+ FIB_API_PATH_TYPE_BIER_IMP FibPathType = 4
+ FIB_API_PATH_TYPE_ICMP_UNREACH FibPathType = 5
+ FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
+ FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
+ FIB_API_PATH_TYPE_DVR FibPathType = 8
+ FIB_API_PATH_TYPE_INTERFACE_RX FibPathType = 9
+ FIB_API_PATH_TYPE_CLASSIFY FibPathType = 10
+)
+
+var (
+ FibPathType_name = map[uint32]string{
+ 0: "FIB_API_PATH_TYPE_NORMAL",
+ 1: "FIB_API_PATH_TYPE_LOCAL",
+ 2: "FIB_API_PATH_TYPE_DROP",
+ 3: "FIB_API_PATH_TYPE_UDP_ENCAP",
+ 4: "FIB_API_PATH_TYPE_BIER_IMP",
+ 5: "FIB_API_PATH_TYPE_ICMP_UNREACH",
+ 6: "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
+ 7: "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
+ 8: "FIB_API_PATH_TYPE_DVR",
+ 9: "FIB_API_PATH_TYPE_INTERFACE_RX",
+ 10: "FIB_API_PATH_TYPE_CLASSIFY",
+ }
+ FibPathType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathType) String() string {
+ s, ok := FibPathType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// BierRoute defines type 'bier_route'.
+type BierRoute struct {
+ BrBp uint32 `binapi:"u32,name=br_bp" json:"br_bp,omitempty"`
+ BrTblID BierTableID `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"`
+ BrNPaths uint8 `binapi:"u8,name=br_n_paths" json:"-"`
+ BrPaths []FibPath `binapi:"fib_path[br_n_paths],name=br_paths" json:"br_paths,omitempty"`
+}
+
+// BierTableID defines type 'bier_table_id'.
+type BierTableID struct {
+ BtSet uint8 `binapi:"u8,name=bt_set" json:"bt_set,omitempty"`
+ BtSubDomain uint8 `binapi:"u8,name=bt_sub_domain" json:"bt_sub_domain,omitempty"`
+ BtHdrLenID uint8 `binapi:"u8,name=bt_hdr_len_id" json:"bt_hdr_len_id,omitempty"`
+}
+
+// FibMplsLabel defines type 'fib_mpls_label'.
+type FibMplsLabel struct {
+ IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
+ Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
+ TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
+ Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
+}
+
+// FibPath defines type 'fib_path'.
+type FibPath struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+ Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
+ Type FibPathType `binapi:"fib_path_type,name=type" json:"type,omitempty"`
+ Flags FibPathFlags `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
+ Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
+ Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
+ NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
+ LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
+}
+
+// FibPathNh defines type 'fib_path_nh'.
+type FibPathNh struct {
+ Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
+ ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
+ ObjID uint32 `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
+ ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// BierDispEntryAddDel defines message 'bier_disp_entry_add_del'.
+type BierDispEntryAddDel struct {
+ BdeBp uint16 `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"`
+ BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
+ BdeIsAdd bool `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"`
+ BdePayloadProto uint8 `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"`
+ BdeNPaths uint8 `binapi:"u8,name=bde_n_paths" json:"-"`
+ BdePaths []FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"`
+}
+
+func (m *BierDispEntryAddDel) Reset() { *m = BierDispEntryAddDel{} }
+func (*BierDispEntryAddDel) GetMessageName() string { return "bier_disp_entry_add_del" }
+func (*BierDispEntryAddDel) GetCrcString() string { return "648323eb" }
+func (*BierDispEntryAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierDispEntryAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.BdeBp
+ size += 4 // m.BdeTblID
+ size += 1 // m.BdeIsAdd
+ size += 1 // m.BdePayloadProto
+ size += 1 // m.BdeNPaths
+ for j1 := 0; j1 < len(m.BdePaths); j1++ {
+ var s1 FibPath
+ _ = s1
+ if j1 < len(m.BdePaths) {
+ s1 = m.BdePaths[j1]
+ }
+ size += 4 // s1.SwIfIndex
+ size += 4 // s1.TableID
+ size += 4 // s1.RpfID
+ size += 1 // s1.Weight
+ size += 1 // s1.Preference
+ size += 4 // s1.Type
+ size += 4 // s1.Flags
+ size += 4 // s1.Proto
+ size += 1 * 16 // s1.Nh.Address
+ size += 4 // s1.Nh.ViaLabel
+ size += 4 // s1.Nh.ObjID
+ size += 4 // s1.Nh.ClassifyTableIndex
+ size += 1 // s1.NLabels
+ for j2 := 0; j2 < 16; j2++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.BdeBp)
+ buf.EncodeUint32(m.BdeTblID)
+ buf.EncodeBool(m.BdeIsAdd)
+ buf.EncodeUint8(m.BdePayloadProto)
+ buf.EncodeUint8(uint8(len(m.BdePaths)))
+ for j0 := 0; j0 < len(m.BdePaths); j0++ {
+ var v0 FibPath // BdePaths
+ if j0 < len(m.BdePaths) {
+ v0 = m.BdePaths[j0]
+ }
+ 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[:], 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++ {
+ 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
+}
+func (m *BierDispEntryAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdeBp = buf.DecodeUint16()
+ m.BdeTblID = buf.DecodeUint32()
+ m.BdeIsAdd = buf.DecodeBool()
+ m.BdePayloadProto = buf.DecodeUint8()
+ m.BdeNPaths = buf.DecodeUint8()
+ m.BdePaths = make([]FibPath, m.BdeNPaths)
+ for j0 := 0; j0 < len(m.BdePaths); j0++ {
+ m.BdePaths[j0].SwIfIndex = buf.DecodeUint32()
+ m.BdePaths[j0].TableID = buf.DecodeUint32()
+ m.BdePaths[j0].RpfID = buf.DecodeUint32()
+ m.BdePaths[j0].Weight = buf.DecodeUint8()
+ m.BdePaths[j0].Preference = buf.DecodeUint8()
+ m.BdePaths[j0].Type = FibPathType(buf.DecodeUint32())
+ m.BdePaths[j0].Flags = FibPathFlags(buf.DecodeUint32())
+ m.BdePaths[j0].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32()
+ m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32()
+ m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.BdePaths[j0].NLabels = buf.DecodeUint8()
+ for j1 := 0; j1 < 16; j1++ {
+ m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8()
+ m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32()
+ m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8()
+ m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// BierDispEntryAddDelReply defines message 'bier_disp_entry_add_del_reply'.
+type BierDispEntryAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BierDispEntryAddDelReply) Reset() { *m = BierDispEntryAddDelReply{} }
+func (*BierDispEntryAddDelReply) GetMessageName() string { return "bier_disp_entry_add_del_reply" }
+func (*BierDispEntryAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*BierDispEntryAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierDispEntryAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BierDispEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BierDispEntryDetails defines message 'bier_disp_entry_details'.
+type BierDispEntryDetails struct {
+ BdeBp uint16 `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"`
+ BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
+ BdeIsAdd bool `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"`
+ BdePayloadProto uint8 `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"`
+ BdeNPaths uint8 `binapi:"u8,name=bde_n_paths" json:"-"`
+ BdePaths []FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"`
+}
+
+func (m *BierDispEntryDetails) Reset() { *m = BierDispEntryDetails{} }
+func (*BierDispEntryDetails) GetMessageName() string { return "bier_disp_entry_details" }
+func (*BierDispEntryDetails) GetCrcString() string { return "e5b039a9" }
+func (*BierDispEntryDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierDispEntryDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.BdeBp
+ size += 4 // m.BdeTblID
+ size += 1 // m.BdeIsAdd
+ size += 1 // m.BdePayloadProto
+ size += 1 // m.BdeNPaths
+ for j1 := 0; j1 < len(m.BdePaths); j1++ {
+ var s1 FibPath
+ _ = s1
+ if j1 < len(m.BdePaths) {
+ s1 = m.BdePaths[j1]
+ }
+ size += 4 // s1.SwIfIndex
+ size += 4 // s1.TableID
+ size += 4 // s1.RpfID
+ size += 1 // s1.Weight
+ size += 1 // s1.Preference
+ size += 4 // s1.Type
+ size += 4 // s1.Flags
+ size += 4 // s1.Proto
+ size += 1 * 16 // s1.Nh.Address
+ size += 4 // s1.Nh.ViaLabel
+ size += 4 // s1.Nh.ObjID
+ size += 4 // s1.Nh.ClassifyTableIndex
+ size += 1 // s1.NLabels
+ for j2 := 0; j2 < 16; j2++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.BdeBp)
+ buf.EncodeUint32(m.BdeTblID)
+ buf.EncodeBool(m.BdeIsAdd)
+ buf.EncodeUint8(m.BdePayloadProto)
+ buf.EncodeUint8(uint8(len(m.BdePaths)))
+ for j0 := 0; j0 < len(m.BdePaths); j0++ {
+ var v0 FibPath // BdePaths
+ if j0 < len(m.BdePaths) {
+ v0 = m.BdePaths[j0]
+ }
+ 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[:], 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++ {
+ 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
+}
+func (m *BierDispEntryDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdeBp = buf.DecodeUint16()
+ m.BdeTblID = buf.DecodeUint32()
+ m.BdeIsAdd = buf.DecodeBool()
+ m.BdePayloadProto = buf.DecodeUint8()
+ m.BdeNPaths = buf.DecodeUint8()
+ m.BdePaths = make([]FibPath, m.BdeNPaths)
+ for j0 := 0; j0 < len(m.BdePaths); j0++ {
+ m.BdePaths[j0].SwIfIndex = buf.DecodeUint32()
+ m.BdePaths[j0].TableID = buf.DecodeUint32()
+ m.BdePaths[j0].RpfID = buf.DecodeUint32()
+ m.BdePaths[j0].Weight = buf.DecodeUint8()
+ m.BdePaths[j0].Preference = buf.DecodeUint8()
+ m.BdePaths[j0].Type = FibPathType(buf.DecodeUint32())
+ m.BdePaths[j0].Flags = FibPathFlags(buf.DecodeUint32())
+ m.BdePaths[j0].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32()
+ m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32()
+ m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.BdePaths[j0].NLabels = buf.DecodeUint8()
+ for j1 := 0; j1 < 16; j1++ {
+ m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8()
+ m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32()
+ m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8()
+ m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// BierDispEntryDump defines message 'bier_disp_entry_dump'.
+type BierDispEntryDump struct {
+ BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
+}
+
+func (m *BierDispEntryDump) Reset() { *m = BierDispEntryDump{} }
+func (*BierDispEntryDump) GetMessageName() string { return "bier_disp_entry_dump" }
+func (*BierDispEntryDump) GetCrcString() string { return "b5fa54ad" }
+func (*BierDispEntryDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierDispEntryDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdeTblID
+ return size
+}
+func (m *BierDispEntryDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdeTblID)
+ return buf.Bytes(), nil
+}
+func (m *BierDispEntryDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdeTblID = buf.DecodeUint32()
+ return nil
+}
+
+// BierDispTableAddDel defines message 'bier_disp_table_add_del'.
+type BierDispTableAddDel struct {
+ BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"`
+ BdtIsAdd bool `binapi:"bool,name=bdt_is_add" json:"bdt_is_add,omitempty"`
+}
+
+func (m *BierDispTableAddDel) Reset() { *m = BierDispTableAddDel{} }
+func (*BierDispTableAddDel) GetMessageName() string { return "bier_disp_table_add_del" }
+func (*BierDispTableAddDel) GetCrcString() string { return "889657ac" }
+func (*BierDispTableAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierDispTableAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdtTblID
+ size += 1 // m.BdtIsAdd
+ return size
+}
+func (m *BierDispTableAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdtTblID)
+ buf.EncodeBool(m.BdtIsAdd)
+ return buf.Bytes(), nil
+}
+func (m *BierDispTableAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdtTblID = buf.DecodeUint32()
+ m.BdtIsAdd = buf.DecodeBool()
+ return nil
+}
+
+// BierDispTableAddDelReply defines message 'bier_disp_table_add_del_reply'.
+type BierDispTableAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BierDispTableAddDelReply) Reset() { *m = BierDispTableAddDelReply{} }
+func (*BierDispTableAddDelReply) GetMessageName() string { return "bier_disp_table_add_del_reply" }
+func (*BierDispTableAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*BierDispTableAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierDispTableAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BierDispTableAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BierDispTableDetails defines message 'bier_disp_table_details'.
+type BierDispTableDetails struct {
+ BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"`
+}
+
+func (m *BierDispTableDetails) Reset() { *m = BierDispTableDetails{} }
+func (*BierDispTableDetails) GetMessageName() string { return "bier_disp_table_details" }
+func (*BierDispTableDetails) GetCrcString() string { return "d27942c0" }
+func (*BierDispTableDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierDispTableDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdtTblID
+ return size
+}
+func (m *BierDispTableDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdtTblID)
+ return buf.Bytes(), nil
+}
+func (m *BierDispTableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdtTblID = buf.DecodeUint32()
+ return nil
+}
+
+// BierDispTableDump defines message 'bier_disp_table_dump'.
+type BierDispTableDump struct{}
+
+func (m *BierDispTableDump) Reset() { *m = BierDispTableDump{} }
+func (*BierDispTableDump) GetMessageName() string { return "bier_disp_table_dump" }
+func (*BierDispTableDump) GetCrcString() string { return "51077d14" }
+func (*BierDispTableDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierDispTableDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *BierDispTableDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *BierDispTableDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BierImpAdd defines message 'bier_imp_add'.
+type BierImpAdd struct {
+ BiTblID BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"`
+ BiSrc uint16 `binapi:"u16,name=bi_src" json:"bi_src,omitempty"`
+ BiNBytes uint8 `binapi:"u8,name=bi_n_bytes" json:"-"`
+ BiBytes []byte `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"`
+}
+
+func (m *BierImpAdd) Reset() { *m = BierImpAdd{} }
+func (*BierImpAdd) GetMessageName() string { return "bier_imp_add" }
+func (*BierImpAdd) GetCrcString() string { return "3856dc3d" }
+func (*BierImpAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierImpAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.BiTblID.BtSet
+ size += 1 // m.BiTblID.BtSubDomain
+ size += 1 // m.BiTblID.BtHdrLenID
+ size += 2 // m.BiSrc
+ size += 1 // m.BiNBytes
+ size += 1 * len(m.BiBytes) // m.BiBytes
+ return size
+}
+func (m *BierImpAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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)
+ return buf.Bytes(), nil
+}
+func (m *BierImpAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BiTblID.BtSet = buf.DecodeUint8()
+ m.BiTblID.BtSubDomain = buf.DecodeUint8()
+ m.BiTblID.BtHdrLenID = buf.DecodeUint8()
+ m.BiSrc = buf.DecodeUint16()
+ m.BiNBytes = buf.DecodeUint8()
+ m.BiBytes = make([]byte, m.BiNBytes)
+ copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes)))
+ return nil
+}
+
+// BierImpAddReply defines message 'bier_imp_add_reply'.
+type BierImpAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"`
+}
+
+func (m *BierImpAddReply) Reset() { *m = BierImpAddReply{} }
+func (*BierImpAddReply) GetMessageName() string { return "bier_imp_add_reply" }
+func (*BierImpAddReply) GetCrcString() string { return "d49c5793" }
+func (*BierImpAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierImpAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.BiIndex
+ return size
+}
+func (m *BierImpAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.BiIndex = buf.DecodeUint32()
+ return nil
+}
+
+// BierImpDel defines message 'bier_imp_del'.
+type BierImpDel struct {
+ BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"`
+}
+
+func (m *BierImpDel) Reset() { *m = BierImpDel{} }
+func (*BierImpDel) GetMessageName() string { return "bier_imp_del" }
+func (*BierImpDel) GetCrcString() string { return "7d45edf6" }
+func (*BierImpDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierImpDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BiIndex
+ return size
+}
+func (m *BierImpDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BiIndex)
+ return buf.Bytes(), nil
+}
+func (m *BierImpDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BiIndex = buf.DecodeUint32()
+ return nil
+}
+
+// BierImpDelReply defines message 'bier_imp_del_reply'.
+type BierImpDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BierImpDelReply) Reset() { *m = BierImpDelReply{} }
+func (*BierImpDelReply) GetMessageName() string { return "bier_imp_del_reply" }
+func (*BierImpDelReply) GetCrcString() string { return "e8d4e804" }
+func (*BierImpDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierImpDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BierImpDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BierImpDetails defines message 'bier_imp_details'.
+type BierImpDetails struct {
+ BiTblID BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"`
+ BiSrc uint16 `binapi:"u16,name=bi_src" json:"bi_src,omitempty"`
+ BiNBytes uint8 `binapi:"u8,name=bi_n_bytes" json:"-"`
+ BiBytes []byte `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"`
+}
+
+func (m *BierImpDetails) Reset() { *m = BierImpDetails{} }
+func (*BierImpDetails) GetMessageName() string { return "bier_imp_details" }
+func (*BierImpDetails) GetCrcString() string { return "b76192df" }
+func (*BierImpDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierImpDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.BiTblID.BtSet
+ size += 1 // m.BiTblID.BtSubDomain
+ size += 1 // m.BiTblID.BtHdrLenID
+ size += 2 // m.BiSrc
+ size += 1 // m.BiNBytes
+ size += 1 * len(m.BiBytes) // m.BiBytes
+ return size
+}
+func (m *BierImpDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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)
+ return buf.Bytes(), nil
+}
+func (m *BierImpDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BiTblID.BtSet = buf.DecodeUint8()
+ m.BiTblID.BtSubDomain = buf.DecodeUint8()
+ m.BiTblID.BtHdrLenID = buf.DecodeUint8()
+ m.BiSrc = buf.DecodeUint16()
+ m.BiNBytes = buf.DecodeUint8()
+ m.BiBytes = make([]byte, m.BiNBytes)
+ copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes)))
+ return nil
+}
+
+// BierImpDump defines message 'bier_imp_dump'.
+type BierImpDump struct{}
+
+func (m *BierImpDump) Reset() { *m = BierImpDump{} }
+func (*BierImpDump) GetMessageName() string { return "bier_imp_dump" }
+func (*BierImpDump) GetCrcString() string { return "51077d14" }
+func (*BierImpDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierImpDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *BierImpDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *BierImpDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BierRouteAddDel defines message 'bier_route_add_del'.
+type BierRouteAddDel struct {
+ BrIsAdd bool `binapi:"bool,name=br_is_add" json:"br_is_add,omitempty"`
+ BrIsReplace bool `binapi:"bool,name=br_is_replace" json:"br_is_replace,omitempty"`
+ BrRoute BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"`
+}
+
+func (m *BierRouteAddDel) Reset() { *m = BierRouteAddDel{} }
+func (*BierRouteAddDel) GetMessageName() string { return "bier_route_add_del" }
+func (*BierRouteAddDel) GetCrcString() string { return "f29edca0" }
+func (*BierRouteAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierRouteAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.BrIsAdd
+ size += 1 // m.BrIsReplace
+ size += 4 // m.BrRoute.BrBp
+ size += 1 // m.BrRoute.BrTblID.BtSet
+ size += 1 // m.BrRoute.BrTblID.BtSubDomain
+ size += 1 // m.BrRoute.BrTblID.BtHdrLenID
+ size += 1 // m.BrRoute.BrNPaths
+ for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.BrRoute.BrPaths) {
+ s2 = m.BrRoute.BrPaths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.BrIsAdd)
+ buf.EncodeBool(m.BrIsReplace)
+ 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 FibPath // BrPaths
+ if j1 < len(m.BrRoute.BrPaths) {
+ v1 = m.BrRoute.BrPaths[j1]
+ }
+ 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[:], 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++ {
+ 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 *BierRouteAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BrIsAdd = buf.DecodeBool()
+ m.BrIsReplace = buf.DecodeBool()
+ m.BrRoute.BrBp = buf.DecodeUint32()
+ m.BrRoute.BrTblID.BtSet = buf.DecodeUint8()
+ m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8()
+ m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8()
+ m.BrRoute.BrNPaths = buf.DecodeUint8()
+ m.BrRoute.BrPaths = make([]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()
+ m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8()
+ m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8()
+ m.BrRoute.BrPaths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.BrRoute.BrPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.BrRoute.BrPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// BierRouteAddDelReply defines message 'bier_route_add_del_reply'.
+type BierRouteAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BierRouteAddDelReply) Reset() { *m = BierRouteAddDelReply{} }
+func (*BierRouteAddDelReply) GetMessageName() string { return "bier_route_add_del_reply" }
+func (*BierRouteAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*BierRouteAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierRouteAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BierRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BierRouteDetails defines message 'bier_route_details'.
+type BierRouteDetails struct {
+ BrRoute BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"`
+}
+
+func (m *BierRouteDetails) Reset() { *m = BierRouteDetails{} }
+func (*BierRouteDetails) GetMessageName() string { return "bier_route_details" }
+func (*BierRouteDetails) GetCrcString() string { return "39ee6a56" }
+func (*BierRouteDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierRouteDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BrRoute.BrBp
+ size += 1 // m.BrRoute.BrTblID.BtSet
+ size += 1 // m.BrRoute.BrTblID.BtSubDomain
+ size += 1 // m.BrRoute.BrTblID.BtHdrLenID
+ size += 1 // m.BrRoute.BrNPaths
+ for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.BrRoute.BrPaths) {
+ s2 = m.BrRoute.BrPaths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 FibPath // BrPaths
+ if j1 < len(m.BrRoute.BrPaths) {
+ v1 = m.BrRoute.BrPaths[j1]
+ }
+ 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[:], 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++ {
+ 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 *BierRouteDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BrRoute.BrBp = buf.DecodeUint32()
+ m.BrRoute.BrTblID.BtSet = buf.DecodeUint8()
+ m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8()
+ m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8()
+ m.BrRoute.BrNPaths = buf.DecodeUint8()
+ m.BrRoute.BrPaths = make([]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()
+ m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8()
+ m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8()
+ m.BrRoute.BrPaths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.BrRoute.BrPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.BrRoute.BrPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// BierRouteDump defines message 'bier_route_dump'.
+type BierRouteDump struct {
+ BrTblID BierTableID `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"`
+}
+
+func (m *BierRouteDump) Reset() { *m = BierRouteDump{} }
+func (*BierRouteDump) GetMessageName() string { return "bier_route_dump" }
+func (*BierRouteDump) GetCrcString() string { return "38339846" }
+func (*BierRouteDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierRouteDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.BrTblID.BtSet = buf.DecodeUint8()
+ m.BrTblID.BtSubDomain = buf.DecodeUint8()
+ m.BrTblID.BtHdrLenID = buf.DecodeUint8()
+ return nil
+}
+
+// BierTableAddDel defines message 'bier_table_add_del'.
+type BierTableAddDel struct {
+ BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"`
+ BtLabel uint32 `binapi:"u32,name=bt_label" json:"bt_label,omitempty"`
+ BtIsAdd bool `binapi:"bool,name=bt_is_add" json:"bt_is_add,omitempty"`
+}
+
+func (m *BierTableAddDel) Reset() { *m = BierTableAddDel{} }
+func (*BierTableAddDel) GetMessageName() string { return "bier_table_add_del" }
+func (*BierTableAddDel) GetCrcString() string { return "35e59209" }
+func (*BierTableAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierTableAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.BtTblID.BtSet
+ size += 1 // m.BtTblID.BtSubDomain
+ size += 1 // m.BtTblID.BtHdrLenID
+ size += 4 // m.BtLabel
+ size += 1 // m.BtIsAdd
+ return size
+}
+func (m *BierTableAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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
+}
+func (m *BierTableAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BtTblID.BtSet = buf.DecodeUint8()
+ m.BtTblID.BtSubDomain = buf.DecodeUint8()
+ m.BtTblID.BtHdrLenID = buf.DecodeUint8()
+ m.BtLabel = buf.DecodeUint32()
+ m.BtIsAdd = buf.DecodeBool()
+ return nil
+}
+
+// BierTableAddDelReply defines message 'bier_table_add_del_reply'.
+type BierTableAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BierTableAddDelReply) Reset() { *m = BierTableAddDelReply{} }
+func (*BierTableAddDelReply) GetMessageName() string { return "bier_table_add_del_reply" }
+func (*BierTableAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*BierTableAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierTableAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BierTableAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BierTableDetails defines message 'bier_table_details'.
+type BierTableDetails struct {
+ BtLabel uint32 `binapi:"u32,name=bt_label" json:"bt_label,omitempty"`
+ BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"`
+}
+
+func (m *BierTableDetails) Reset() { *m = BierTableDetails{} }
+func (*BierTableDetails) GetMessageName() string { return "bier_table_details" }
+func (*BierTableDetails) GetCrcString() string { return "fc44a9dd" }
+func (*BierTableDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BierTableDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BtLabel
+ size += 1 // m.BtTblID.BtSet
+ size += 1 // m.BtTblID.BtSubDomain
+ size += 1 // m.BtTblID.BtHdrLenID
+ return size
+}
+func (m *BierTableDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.BtLabel = buf.DecodeUint32()
+ m.BtTblID.BtSet = buf.DecodeUint8()
+ m.BtTblID.BtSubDomain = buf.DecodeUint8()
+ m.BtTblID.BtHdrLenID = buf.DecodeUint8()
+ return nil
+}
+
+// BierTableDump defines message 'bier_table_dump'.
+type BierTableDump struct{}
+
+func (m *BierTableDump) Reset() { *m = BierTableDump{} }
+func (*BierTableDump) GetMessageName() string { return "bier_table_dump" }
+func (*BierTableDump) GetCrcString() string { return "51077d14" }
+func (*BierTableDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BierTableDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *BierTableDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *BierTableDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_bier_binapi_init() }
+func file_bier_binapi_init() {
+ api.RegisterMessage((*BierDispEntryAddDel)(nil), "bier_disp_entry_add_del_648323eb")
+ api.RegisterMessage((*BierDispEntryAddDelReply)(nil), "bier_disp_entry_add_del_reply_e8d4e804")
+ api.RegisterMessage((*BierDispEntryDetails)(nil), "bier_disp_entry_details_e5b039a9")
+ api.RegisterMessage((*BierDispEntryDump)(nil), "bier_disp_entry_dump_b5fa54ad")
+ api.RegisterMessage((*BierDispTableAddDel)(nil), "bier_disp_table_add_del_889657ac")
+ api.RegisterMessage((*BierDispTableAddDelReply)(nil), "bier_disp_table_add_del_reply_e8d4e804")
+ api.RegisterMessage((*BierDispTableDetails)(nil), "bier_disp_table_details_d27942c0")
+ api.RegisterMessage((*BierDispTableDump)(nil), "bier_disp_table_dump_51077d14")
+ api.RegisterMessage((*BierImpAdd)(nil), "bier_imp_add_3856dc3d")
+ api.RegisterMessage((*BierImpAddReply)(nil), "bier_imp_add_reply_d49c5793")
+ api.RegisterMessage((*BierImpDel)(nil), "bier_imp_del_7d45edf6")
+ api.RegisterMessage((*BierImpDelReply)(nil), "bier_imp_del_reply_e8d4e804")
+ api.RegisterMessage((*BierImpDetails)(nil), "bier_imp_details_b76192df")
+ api.RegisterMessage((*BierImpDump)(nil), "bier_imp_dump_51077d14")
+ api.RegisterMessage((*BierRouteAddDel)(nil), "bier_route_add_del_f29edca0")
+ api.RegisterMessage((*BierRouteAddDelReply)(nil), "bier_route_add_del_reply_e8d4e804")
+ api.RegisterMessage((*BierRouteDetails)(nil), "bier_route_details_39ee6a56")
+ api.RegisterMessage((*BierRouteDump)(nil), "bier_route_dump_38339846")
+ api.RegisterMessage((*BierTableAddDel)(nil), "bier_table_add_del_35e59209")
+ api.RegisterMessage((*BierTableAddDelReply)(nil), "bier_table_add_del_reply_e8d4e804")
+ api.RegisterMessage((*BierTableDetails)(nil), "bier_table_details_fc44a9dd")
+ api.RegisterMessage((*BierTableDump)(nil), "bier_table_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*BierDispEntryAddDel)(nil),
+ (*BierDispEntryAddDelReply)(nil),
+ (*BierDispEntryDetails)(nil),
+ (*BierDispEntryDump)(nil),
+ (*BierDispTableAddDel)(nil),
+ (*BierDispTableAddDelReply)(nil),
+ (*BierDispTableDetails)(nil),
+ (*BierDispTableDump)(nil),
+ (*BierImpAdd)(nil),
+ (*BierImpAddReply)(nil),
+ (*BierImpDel)(nil),
+ (*BierImpDelReply)(nil),
+ (*BierImpDetails)(nil),
+ (*BierImpDump)(nil),
+ (*BierRouteAddDel)(nil),
+ (*BierRouteAddDelReply)(nil),
+ (*BierRouteDetails)(nil),
+ (*BierRouteDump)(nil),
+ (*BierTableAddDel)(nil),
+ (*BierTableAddDelReply)(nil),
+ (*BierTableDetails)(nil),
+ (*BierTableDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/bier/bier_rpc.ba.go b/internal/testbinapi/binapi2001/bier/bier_rpc.ba.go
new file mode 100644
index 0000000..ae6d90f
--- /dev/null
+++ b/internal/testbinapi/binapi2001/bier/bier_rpc.ba.go
@@ -0,0 +1,283 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package bier
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service bier.
+type RPCService interface {
+ BierDispEntryAddDel(ctx context.Context, in *BierDispEntryAddDel) (*BierDispEntryAddDelReply, error)
+ BierDispEntryDump(ctx context.Context, in *BierDispEntryDump) (RPCService_BierDispEntryDumpClient, error)
+ BierDispTableAddDel(ctx context.Context, in *BierDispTableAddDel) (*BierDispTableAddDelReply, error)
+ BierDispTableDump(ctx context.Context, in *BierDispTableDump) (RPCService_BierDispTableDumpClient, error)
+ BierImpAdd(ctx context.Context, in *BierImpAdd) (*BierImpAddReply, error)
+ BierImpDel(ctx context.Context, in *BierImpDel) (*BierImpDelReply, error)
+ BierImpDump(ctx context.Context, in *BierImpDump) (RPCService_BierImpDumpClient, error)
+ BierRouteAddDel(ctx context.Context, in *BierRouteAddDel) (*BierRouteAddDelReply, error)
+ BierRouteDump(ctx context.Context, in *BierRouteDump) (RPCService_BierRouteDumpClient, error)
+ BierTableAddDel(ctx context.Context, in *BierTableAddDel) (*BierTableAddDelReply, error)
+ BierTableDump(ctx context.Context, in *BierTableDump) (RPCService_BierTableDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) BierDispEntryAddDel(ctx context.Context, in *BierDispEntryAddDel) (*BierDispEntryAddDelReply, error) {
+ out := new(BierDispEntryAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BierDispEntryDump(ctx context.Context, in *BierDispEntryDump) (RPCService_BierDispEntryDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BierDispEntryDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BierDispEntryDumpClient interface {
+ Recv() (*BierDispEntryDetails, error)
+ api.Stream
+}
+
+type serviceClient_BierDispEntryDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BierDispEntryDumpClient) Recv() (*BierDispEntryDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BierDispEntryDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BierDispTableAddDel(ctx context.Context, in *BierDispTableAddDel) (*BierDispTableAddDelReply, error) {
+ out := new(BierDispTableAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BierDispTableDump(ctx context.Context, in *BierDispTableDump) (RPCService_BierDispTableDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BierDispTableDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BierDispTableDumpClient interface {
+ Recv() (*BierDispTableDetails, error)
+ api.Stream
+}
+
+type serviceClient_BierDispTableDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BierDispTableDumpClient) Recv() (*BierDispTableDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BierDispTableDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BierImpAdd(ctx context.Context, in *BierImpAdd) (*BierImpAddReply, error) {
+ out := new(BierImpAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BierImpDel(ctx context.Context, in *BierImpDel) (*BierImpDelReply, error) {
+ out := new(BierImpDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BierImpDump(ctx context.Context, in *BierImpDump) (RPCService_BierImpDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BierImpDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BierImpDumpClient interface {
+ Recv() (*BierImpDetails, error)
+ api.Stream
+}
+
+type serviceClient_BierImpDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BierImpDumpClient) Recv() (*BierImpDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BierImpDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BierRouteAddDel(ctx context.Context, in *BierRouteAddDel) (*BierRouteAddDelReply, error) {
+ out := new(BierRouteAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BierRouteDump(ctx context.Context, in *BierRouteDump) (RPCService_BierRouteDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BierRouteDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BierRouteDumpClient interface {
+ Recv() (*BierRouteDetails, error)
+ api.Stream
+}
+
+type serviceClient_BierRouteDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BierRouteDumpClient) Recv() (*BierRouteDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BierRouteDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BierTableAddDel(ctx context.Context, in *BierTableAddDel) (*BierTableAddDelReply, error) {
+ out := new(BierTableAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BierTableDump(ctx context.Context, in *BierTableDump) (RPCService_BierTableDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BierTableDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BierTableDumpClient interface {
+ Recv() (*BierTableDetails, error)
+ api.Stream
+}
+
+type serviceClient_BierTableDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BierTableDumpClient) Recv() (*BierTableDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BierTableDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/bond/bond.ba.go b/internal/testbinapi/binapi2001/bond/bond.ba.go
new file mode 100644
index 0000000..acee8b8
--- /dev/null
+++ b/internal/testbinapi/binapi2001/bond/bond.ba.go
@@ -0,0 +1,976 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/bond.api.json
+
+// Package bond contains generated bindings for API file bond.api.
+//
+// Contents:
+// 2 aliases
+// 8 enums
+// 14 messages
+//
+package bond
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "net"
+ "strconv"
+)
+
+// 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 = "bond"
+ APIVersion = "2.0.0"
+ VersionCrc = 0x69f583ad
+)
+
+// BondLbAlgo defines enum 'bond_lb_algo'.
+type BondLbAlgo uint32
+
+const (
+ BOND_API_LB_ALGO_L2 BondLbAlgo = 0
+ BOND_API_LB_ALGO_L34 BondLbAlgo = 1
+ BOND_API_LB_ALGO_L23 BondLbAlgo = 2
+ BOND_API_LB_ALGO_RR BondLbAlgo = 3
+ BOND_API_LB_ALGO_BC BondLbAlgo = 4
+ BOND_API_LB_ALGO_AB BondLbAlgo = 5
+)
+
+var (
+ BondLbAlgo_name = map[uint32]string{
+ 0: "BOND_API_LB_ALGO_L2",
+ 1: "BOND_API_LB_ALGO_L34",
+ 2: "BOND_API_LB_ALGO_L23",
+ 3: "BOND_API_LB_ALGO_RR",
+ 4: "BOND_API_LB_ALGO_BC",
+ 5: "BOND_API_LB_ALGO_AB",
+ }
+ BondLbAlgo_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x BondLbAlgo) String() string {
+ s, ok := BondLbAlgo_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "BondLbAlgo(" + strconv.Itoa(int(x)) + ")"
+}
+
+// BondMode defines enum 'bond_mode'.
+type BondMode uint32
+
+const (
+ BOND_API_MODE_ROUND_ROBIN BondMode = 1
+ BOND_API_MODE_ACTIVE_BACKUP BondMode = 2
+ BOND_API_MODE_XOR BondMode = 3
+ BOND_API_MODE_BROADCAST BondMode = 4
+ BOND_API_MODE_LACP BondMode = 5
+)
+
+var (
+ BondMode_name = map[uint32]string{
+ 1: "BOND_API_MODE_ROUND_ROBIN",
+ 2: "BOND_API_MODE_ACTIVE_BACKUP",
+ 3: "BOND_API_MODE_XOR",
+ 4: "BOND_API_MODE_BROADCAST",
+ 5: "BOND_API_MODE_LACP",
+ }
+ BondMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x BondMode) String() string {
+ s, ok := BondMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "BondMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// BondCreate defines message 'bond_create'.
+type BondCreate struct {
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+ UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ Mode BondMode `binapi:"bond_mode,name=mode" json:"mode,omitempty"`
+ Lb BondLbAlgo `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"`
+ NumaOnly bool `binapi:"bool,name=numa_only" json:"numa_only,omitempty"`
+}
+
+func (m *BondCreate) Reset() { *m = BondCreate{} }
+func (*BondCreate) GetMessageName() string { return "bond_create" }
+func (*BondCreate) GetCrcString() string { return "48883c7e" }
+func (*BondCreate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BondCreate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ID
+ size += 1 // m.UseCustomMac
+ size += 1 * 6 // m.MacAddress
+ size += 4 // m.Mode
+ size += 4 // m.Lb
+ size += 1 // m.NumaOnly
+ return size
+}
+func (m *BondCreate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ID)
+ buf.EncodeBool(m.UseCustomMac)
+ buf.EncodeBytes(m.MacAddress[:], 6)
+ buf.EncodeUint32(uint32(m.Mode))
+ buf.EncodeUint32(uint32(m.Lb))
+ buf.EncodeBool(m.NumaOnly)
+ return buf.Bytes(), nil
+}
+func (m *BondCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint32()
+ m.UseCustomMac = buf.DecodeBool()
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ m.Mode = BondMode(buf.DecodeUint32())
+ m.Lb = BondLbAlgo(buf.DecodeUint32())
+ m.NumaOnly = buf.DecodeBool()
+ return nil
+}
+
+// BondCreateReply defines message 'bond_create_reply'.
+type BondCreateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *BondCreateReply) Reset() { *m = BondCreateReply{} }
+func (*BondCreateReply) GetMessageName() string { return "bond_create_reply" }
+func (*BondCreateReply) GetCrcString() string { return "5383d31f" }
+func (*BondCreateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BondCreateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *BondCreateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// BondDelete defines message 'bond_delete'.
+type BondDelete struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *BondDelete) Reset() { *m = BondDelete{} }
+func (*BondDelete) GetMessageName() string { return "bond_delete" }
+func (*BondDelete) GetCrcString() string { return "f9e6675e" }
+func (*BondDelete) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BondDelete) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *BondDelete) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *BondDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// BondDeleteReply defines message 'bond_delete_reply'.
+type BondDeleteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BondDeleteReply) Reset() { *m = BondDeleteReply{} }
+func (*BondDeleteReply) GetMessageName() string { return "bond_delete_reply" }
+func (*BondDeleteReply) GetCrcString() string { return "e8d4e804" }
+func (*BondDeleteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BondDeleteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BondDeleteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BondDetachSlave defines message 'bond_detach_slave'.
+type BondDetachSlave struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *BondDetachSlave) Reset() { *m = BondDetachSlave{} }
+func (*BondDetachSlave) GetMessageName() string { return "bond_detach_slave" }
+func (*BondDetachSlave) GetCrcString() string { return "f9e6675e" }
+func (*BondDetachSlave) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BondDetachSlave) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *BondDetachSlave) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *BondDetachSlave) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// BondDetachSlaveReply defines message 'bond_detach_slave_reply'.
+type BondDetachSlaveReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BondDetachSlaveReply) Reset() { *m = BondDetachSlaveReply{} }
+func (*BondDetachSlaveReply) GetMessageName() string { return "bond_detach_slave_reply" }
+func (*BondDetachSlaveReply) GetCrcString() string { return "e8d4e804" }
+func (*BondDetachSlaveReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BondDetachSlaveReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BondDetachSlaveReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BondEnslave defines message 'bond_enslave'.
+type BondEnslave struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ BondSwIfIndex InterfaceIndex `binapi:"interface_index,name=bond_sw_if_index" json:"bond_sw_if_index,omitempty"`
+ IsPassive bool `binapi:"bool,name=is_passive" json:"is_passive,omitempty"`
+ IsLongTimeout bool `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"`
+}
+
+func (m *BondEnslave) Reset() { *m = BondEnslave{} }
+func (*BondEnslave) GetMessageName() string { return "bond_enslave" }
+func (*BondEnslave) GetCrcString() string { return "076ecfa7" }
+func (*BondEnslave) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BondEnslave) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.BondSwIfIndex
+ size += 1 // m.IsPassive
+ size += 1 // m.IsLongTimeout
+ return size
+}
+func (m *BondEnslave) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.BondSwIfIndex))
+ buf.EncodeBool(m.IsPassive)
+ buf.EncodeBool(m.IsLongTimeout)
+ return buf.Bytes(), nil
+}
+func (m *BondEnslave) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.BondSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsPassive = buf.DecodeBool()
+ m.IsLongTimeout = buf.DecodeBool()
+ return nil
+}
+
+// BondEnslaveReply defines message 'bond_enslave_reply'.
+type BondEnslaveReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BondEnslaveReply) Reset() { *m = BondEnslaveReply{} }
+func (*BondEnslaveReply) GetMessageName() string { return "bond_enslave_reply" }
+func (*BondEnslaveReply) GetCrcString() string { return "e8d4e804" }
+func (*BondEnslaveReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BondEnslaveReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BondEnslaveReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceBondDetails defines message 'sw_interface_bond_details'.
+type SwInterfaceBondDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+ Mode BondMode `binapi:"bond_mode,name=mode" json:"mode,omitempty"`
+ Lb BondLbAlgo `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"`
+ NumaOnly bool `binapi:"bool,name=numa_only" json:"numa_only,omitempty"`
+ ActiveSlaves uint32 `binapi:"u32,name=active_slaves" json:"active_slaves,omitempty"`
+ Slaves uint32 `binapi:"u32,name=slaves" json:"slaves,omitempty"`
+ InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
+}
+
+func (m *SwInterfaceBondDetails) Reset() { *m = SwInterfaceBondDetails{} }
+func (*SwInterfaceBondDetails) GetMessageName() string { return "sw_interface_bond_details" }
+func (*SwInterfaceBondDetails) GetCrcString() string { return "f5ef2106" }
+func (*SwInterfaceBondDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceBondDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.ID
+ size += 4 // m.Mode
+ size += 4 // m.Lb
+ size += 1 // m.NumaOnly
+ size += 4 // m.ActiveSlaves
+ size += 4 // m.Slaves
+ size += 64 // m.InterfaceName
+ return size
+}
+func (m *SwInterfaceBondDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.ID)
+ buf.EncodeUint32(uint32(m.Mode))
+ buf.EncodeUint32(uint32(m.Lb))
+ buf.EncodeBool(m.NumaOnly)
+ buf.EncodeUint32(m.ActiveSlaves)
+ buf.EncodeUint32(m.Slaves)
+ buf.EncodeString(m.InterfaceName, 64)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceBondDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.ID = buf.DecodeUint32()
+ m.Mode = BondMode(buf.DecodeUint32())
+ m.Lb = BondLbAlgo(buf.DecodeUint32())
+ m.NumaOnly = buf.DecodeBool()
+ m.ActiveSlaves = buf.DecodeUint32()
+ m.Slaves = buf.DecodeUint32()
+ m.InterfaceName = buf.DecodeString(64)
+ return nil
+}
+
+// SwInterfaceBondDump defines message 'sw_interface_bond_dump'.
+type SwInterfaceBondDump struct{}
+
+func (m *SwInterfaceBondDump) Reset() { *m = SwInterfaceBondDump{} }
+func (*SwInterfaceBondDump) GetMessageName() string { return "sw_interface_bond_dump" }
+func (*SwInterfaceBondDump) GetCrcString() string { return "51077d14" }
+func (*SwInterfaceBondDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceBondDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *SwInterfaceBondDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceBondDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// SwInterfaceSetBondWeight defines message 'sw_interface_set_bond_weight'.
+type SwInterfaceSetBondWeight struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
+}
+
+func (m *SwInterfaceSetBondWeight) Reset() { *m = SwInterfaceSetBondWeight{} }
+func (*SwInterfaceSetBondWeight) GetMessageName() string { return "sw_interface_set_bond_weight" }
+func (*SwInterfaceSetBondWeight) GetCrcString() string { return "deb510a0" }
+func (*SwInterfaceSetBondWeight) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetBondWeight) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Weight
+ return size
+}
+func (m *SwInterfaceSetBondWeight) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.Weight)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetBondWeight) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Weight = buf.DecodeUint32()
+ return nil
+}
+
+// SwInterfaceSetBondWeightReply defines message 'sw_interface_set_bond_weight_reply'.
+type SwInterfaceSetBondWeightReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetBondWeightReply) Reset() { *m = SwInterfaceSetBondWeightReply{} }
+func (*SwInterfaceSetBondWeightReply) GetMessageName() string {
+ return "sw_interface_set_bond_weight_reply"
+}
+func (*SwInterfaceSetBondWeightReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetBondWeightReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetBondWeightReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetBondWeightReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSlaveDetails defines message 'sw_interface_slave_details'.
+type SwInterfaceSlaveDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
+ IsPassive bool `binapi:"bool,name=is_passive" json:"is_passive,omitempty"`
+ IsLongTimeout bool `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"`
+ IsLocalNuma bool `binapi:"bool,name=is_local_numa" json:"is_local_numa,omitempty"`
+ Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
+}
+
+func (m *SwInterfaceSlaveDetails) Reset() { *m = SwInterfaceSlaveDetails{} }
+func (*SwInterfaceSlaveDetails) GetMessageName() string { return "sw_interface_slave_details" }
+func (*SwInterfaceSlaveDetails) GetCrcString() string { return "3c4a0e23" }
+func (*SwInterfaceSlaveDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSlaveDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 64 // m.InterfaceName
+ size += 1 // m.IsPassive
+ size += 1 // m.IsLongTimeout
+ size += 1 // m.IsLocalNuma
+ size += 4 // m.Weight
+ return size
+}
+func (m *SwInterfaceSlaveDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(m.Weight)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSlaveDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.InterfaceName = buf.DecodeString(64)
+ m.IsPassive = buf.DecodeBool()
+ m.IsLongTimeout = buf.DecodeBool()
+ m.IsLocalNuma = buf.DecodeBool()
+ m.Weight = buf.DecodeUint32()
+ return nil
+}
+
+// SwInterfaceSlaveDump defines message 'sw_interface_slave_dump'.
+type SwInterfaceSlaveDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *SwInterfaceSlaveDump) Reset() { *m = SwInterfaceSlaveDump{} }
+func (*SwInterfaceSlaveDump) GetMessageName() string { return "sw_interface_slave_dump" }
+func (*SwInterfaceSlaveDump) GetCrcString() string { return "f9e6675e" }
+func (*SwInterfaceSlaveDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSlaveDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *SwInterfaceSlaveDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSlaveDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+func init() { file_bond_binapi_init() }
+func file_bond_binapi_init() {
+ api.RegisterMessage((*BondCreate)(nil), "bond_create_48883c7e")
+ api.RegisterMessage((*BondCreateReply)(nil), "bond_create_reply_5383d31f")
+ api.RegisterMessage((*BondDelete)(nil), "bond_delete_f9e6675e")
+ api.RegisterMessage((*BondDeleteReply)(nil), "bond_delete_reply_e8d4e804")
+ api.RegisterMessage((*BondDetachSlave)(nil), "bond_detach_slave_f9e6675e")
+ api.RegisterMessage((*BondDetachSlaveReply)(nil), "bond_detach_slave_reply_e8d4e804")
+ api.RegisterMessage((*BondEnslave)(nil), "bond_enslave_076ecfa7")
+ api.RegisterMessage((*BondEnslaveReply)(nil), "bond_enslave_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceBondDetails)(nil), "sw_interface_bond_details_f5ef2106")
+ api.RegisterMessage((*SwInterfaceBondDump)(nil), "sw_interface_bond_dump_51077d14")
+ api.RegisterMessage((*SwInterfaceSetBondWeight)(nil), "sw_interface_set_bond_weight_deb510a0")
+ api.RegisterMessage((*SwInterfaceSetBondWeightReply)(nil), "sw_interface_set_bond_weight_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSlaveDetails)(nil), "sw_interface_slave_details_3c4a0e23")
+ api.RegisterMessage((*SwInterfaceSlaveDump)(nil), "sw_interface_slave_dump_f9e6675e")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*BondCreate)(nil),
+ (*BondCreateReply)(nil),
+ (*BondDelete)(nil),
+ (*BondDeleteReply)(nil),
+ (*BondDetachSlave)(nil),
+ (*BondDetachSlaveReply)(nil),
+ (*BondEnslave)(nil),
+ (*BondEnslaveReply)(nil),
+ (*SwInterfaceBondDetails)(nil),
+ (*SwInterfaceBondDump)(nil),
+ (*SwInterfaceSetBondWeight)(nil),
+ (*SwInterfaceSetBondWeightReply)(nil),
+ (*SwInterfaceSlaveDetails)(nil),
+ (*SwInterfaceSlaveDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/bond/bond_rpc.ba.go b/internal/testbinapi/binapi2001/bond/bond_rpc.ba.go
new file mode 100644
index 0000000..e59e0b0
--- /dev/null
+++ b/internal/testbinapi/binapi2001/bond/bond_rpc.ba.go
@@ -0,0 +1,153 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package bond
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service bond.
+type RPCService interface {
+ BondCreate(ctx context.Context, in *BondCreate) (*BondCreateReply, error)
+ BondDelete(ctx context.Context, in *BondDelete) (*BondDeleteReply, error)
+ BondDetachSlave(ctx context.Context, in *BondDetachSlave) (*BondDetachSlaveReply, error)
+ BondEnslave(ctx context.Context, in *BondEnslave) (*BondEnslaveReply, error)
+ SwInterfaceBondDump(ctx context.Context, in *SwInterfaceBondDump) (RPCService_SwInterfaceBondDumpClient, error)
+ SwInterfaceSetBondWeight(ctx context.Context, in *SwInterfaceSetBondWeight) (*SwInterfaceSetBondWeightReply, error)
+ SwInterfaceSlaveDump(ctx context.Context, in *SwInterfaceSlaveDump) (RPCService_SwInterfaceSlaveDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) BondCreate(ctx context.Context, in *BondCreate) (*BondCreateReply, error) {
+ out := new(BondCreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BondDelete(ctx context.Context, in *BondDelete) (*BondDeleteReply, error) {
+ out := new(BondDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BondDetachSlave(ctx context.Context, in *BondDetachSlave) (*BondDetachSlaveReply, error) {
+ out := new(BondDetachSlaveReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BondEnslave(ctx context.Context, in *BondEnslave) (*BondEnslaveReply, error) {
+ out := new(BondEnslaveReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwInterfaceBondDump(ctx context.Context, in *SwInterfaceBondDump) (RPCService_SwInterfaceBondDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwInterfaceBondDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwInterfaceBondDumpClient interface {
+ Recv() (*SwInterfaceBondDetails, error)
+ api.Stream
+}
+
+type serviceClient_SwInterfaceBondDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwInterfaceBondDumpClient) Recv() (*SwInterfaceBondDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwInterfaceBondDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) SwInterfaceSetBondWeight(ctx context.Context, in *SwInterfaceSetBondWeight) (*SwInterfaceSetBondWeightReply, error) {
+ out := new(SwInterfaceSetBondWeightReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwInterfaceSlaveDump(ctx context.Context, in *SwInterfaceSlaveDump) (RPCService_SwInterfaceSlaveDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwInterfaceSlaveDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwInterfaceSlaveDumpClient interface {
+ Recv() (*SwInterfaceSlaveDetails, error)
+ api.Stream
+}
+
+type serviceClient_SwInterfaceSlaveDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwInterfaceSlaveDumpClient) Recv() (*SwInterfaceSlaveDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwInterfaceSlaveDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/builtinurl/builtinurl.ba.go b/internal/testbinapi/binapi2001/builtinurl/builtinurl.ba.go
new file mode 100644
index 0000000..5488027
--- /dev/null
+++ b/internal/testbinapi/binapi2001/builtinurl/builtinurl.ba.go
@@ -0,0 +1,103 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/builtinurl.api.json
+
+// Package builtinurl contains generated bindings for API file builtinurl.api.
+//
+// Contents:
+// 2 messages
+//
+package builtinurl
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "builtinurl"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x25045d63
+)
+
+// BuiltinurlEnable defines message 'builtinurl_enable'.
+type BuiltinurlEnable struct{}
+
+func (m *BuiltinurlEnable) Reset() { *m = BuiltinurlEnable{} }
+func (*BuiltinurlEnable) GetMessageName() string { return "builtinurl_enable" }
+func (*BuiltinurlEnable) GetCrcString() string { return "51077d14" }
+func (*BuiltinurlEnable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BuiltinurlEnable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *BuiltinurlEnable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *BuiltinurlEnable) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BuiltinurlEnableReply defines message 'builtinurl_enable_reply'.
+type BuiltinurlEnableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BuiltinurlEnableReply) Reset() { *m = BuiltinurlEnableReply{} }
+func (*BuiltinurlEnableReply) GetMessageName() string { return "builtinurl_enable_reply" }
+func (*BuiltinurlEnableReply) GetCrcString() string { return "e8d4e804" }
+func (*BuiltinurlEnableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BuiltinurlEnableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BuiltinurlEnableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_builtinurl_binapi_init() }
+func file_builtinurl_binapi_init() {
+ api.RegisterMessage((*BuiltinurlEnable)(nil), "builtinurl_enable_51077d14")
+ api.RegisterMessage((*BuiltinurlEnableReply)(nil), "builtinurl_enable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*BuiltinurlEnable)(nil),
+ (*BuiltinurlEnableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/builtinurl/builtinurl_rpc.ba.go b/internal/testbinapi/binapi2001/builtinurl/builtinurl_rpc.ba.go
new file mode 100644
index 0000000..6857de2
--- /dev/null
+++ b/internal/testbinapi/binapi2001/builtinurl/builtinurl_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package builtinurl
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service builtinurl.
+type RPCService interface {
+ BuiltinurlEnable(ctx context.Context, in *BuiltinurlEnable) (*BuiltinurlEnableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) BuiltinurlEnable(ctx context.Context, in *BuiltinurlEnable) (*BuiltinurlEnableReply, error) {
+ out := new(BuiltinurlEnableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/cdp/cdp.ba.go b/internal/testbinapi/binapi2001/cdp/cdp.ba.go
new file mode 100644
index 0000000..295be82
--- /dev/null
+++ b/internal/testbinapi/binapi2001/cdp/cdp.ba.go
@@ -0,0 +1,109 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/cdp.api.json
+
+// Package cdp contains generated bindings for API file cdp.api.
+//
+// Contents:
+// 2 messages
+//
+package cdp
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "cdp"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x8cfa825e
+)
+
+// CdpEnableDisable defines message 'cdp_enable_disable'.
+type CdpEnableDisable struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+}
+
+func (m *CdpEnableDisable) Reset() { *m = CdpEnableDisable{} }
+func (*CdpEnableDisable) GetMessageName() string { return "cdp_enable_disable" }
+func (*CdpEnableDisable) GetCrcString() string { return "2e7b47df" }
+func (*CdpEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CdpEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ return size
+}
+func (m *CdpEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ return buf.Bytes(), nil
+}
+func (m *CdpEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ return nil
+}
+
+// CdpEnableDisableReply defines message 'cdp_enable_disable_reply'.
+type CdpEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *CdpEnableDisableReply) Reset() { *m = CdpEnableDisableReply{} }
+func (*CdpEnableDisableReply) GetMessageName() string { return "cdp_enable_disable_reply" }
+func (*CdpEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*CdpEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CdpEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *CdpEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_cdp_binapi_init() }
+func file_cdp_binapi_init() {
+ api.RegisterMessage((*CdpEnableDisable)(nil), "cdp_enable_disable_2e7b47df")
+ api.RegisterMessage((*CdpEnableDisableReply)(nil), "cdp_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*CdpEnableDisable)(nil),
+ (*CdpEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/cdp/cdp_rpc.ba.go b/internal/testbinapi/binapi2001/cdp/cdp_rpc.ba.go
new file mode 100644
index 0000000..a910833
--- /dev/null
+++ b/internal/testbinapi/binapi2001/cdp/cdp_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package cdp
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service cdp.
+type RPCService interface {
+ CdpEnableDisable(ctx context.Context, in *CdpEnableDisable) (*CdpEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) CdpEnableDisable(ctx context.Context, in *CdpEnableDisable) (*CdpEnableDisableReply, error) {
+ out := new(CdpEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/classify/classify.ba.go b/internal/testbinapi/binapi2001/classify/classify.ba.go
new file mode 100644
index 0000000..9ec195e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/classify/classify.ba.go
@@ -0,0 +1,1661 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/classify.api.json
+
+// Package classify contains generated bindings for API file classify.api.
+//
+// Contents:
+// 1 alias
+// 9 enums
+// 28 messages
+//
+package classify
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "classify"
+ APIVersion = "3.0.0"
+ VersionCrc = 0x13587952
+)
+
+// ClassifyAction defines enum 'classify_action'.
+type ClassifyAction uint8
+
+const (
+ CLASSIFY_API_ACTION_NONE ClassifyAction = 0
+ CLASSIFY_API_ACTION_SET_IP4_FIB_INDEX ClassifyAction = 1
+ CLASSIFY_API_ACTION_SET_IP6_FIB_INDEX ClassifyAction = 2
+ CLASSIFY_API_ACTION_SET_METADATA ClassifyAction = 3
+)
+
+var (
+ ClassifyAction_name = map[uint8]string{
+ 0: "CLASSIFY_API_ACTION_NONE",
+ 1: "CLASSIFY_API_ACTION_SET_IP4_FIB_INDEX",
+ 2: "CLASSIFY_API_ACTION_SET_IP6_FIB_INDEX",
+ 3: "CLASSIFY_API_ACTION_SET_METADATA",
+ }
+ ClassifyAction_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x ClassifyAction) String() string {
+ s, ok := ClassifyAction_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "ClassifyAction(" + strconv.Itoa(int(x)) + ")"
+}
+
+// FlowClassifyTable defines enum 'flow_classify_table'.
+type FlowClassifyTable uint8
+
+const (
+ FLOW_CLASSIFY_API_TABLE_IP4 FlowClassifyTable = 1
+ FLOW_CLASSIFY_API_TABLE_IP6 FlowClassifyTable = 2
+)
+
+var (
+ FlowClassifyTable_name = map[uint8]string{
+ 1: "FLOW_CLASSIFY_API_TABLE_IP4",
+ 2: "FLOW_CLASSIFY_API_TABLE_IP6",
+ }
+ FlowClassifyTable_value = map[string]uint8{
+ "FLOW_CLASSIFY_API_TABLE_IP4": 1,
+ "FLOW_CLASSIFY_API_TABLE_IP6": 2,
+ }
+)
+
+func (x FlowClassifyTable) String() string {
+ s, ok := FlowClassifyTable_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "FlowClassifyTable(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// PolicerClassifyTable defines enum 'policer_classify_table'.
+type PolicerClassifyTable uint8
+
+const (
+ POLICER_CLASSIFY_API_TABLE_IP4 PolicerClassifyTable = 1
+ POLICER_CLASSIFY_API_TABLE_IP6 PolicerClassifyTable = 2
+ POLICER_CLASSIFY_API_TABLE_L2 PolicerClassifyTable = 3
+)
+
+var (
+ PolicerClassifyTable_name = map[uint8]string{
+ 1: "POLICER_CLASSIFY_API_TABLE_IP4",
+ 2: "POLICER_CLASSIFY_API_TABLE_IP6",
+ 3: "POLICER_CLASSIFY_API_TABLE_L2",
+ }
+ PolicerClassifyTable_value = map[string]uint8{
+ "POLICER_CLASSIFY_API_TABLE_IP4": 1,
+ "POLICER_CLASSIFY_API_TABLE_IP6": 2,
+ "POLICER_CLASSIFY_API_TABLE_L2": 3,
+ }
+)
+
+func (x PolicerClassifyTable) String() string {
+ s, ok := PolicerClassifyTable_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "PolicerClassifyTable(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// ClassifyAddDelSession defines message 'classify_add_del_session'.
+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=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"`
+}
+
+func (m *ClassifyAddDelSession) Reset() { *m = ClassifyAddDelSession{} }
+func (*ClassifyAddDelSession) GetMessageName() string { return "classify_add_del_session" }
+func (*ClassifyAddDelSession) GetCrcString() string { return "f20879f0" }
+func (*ClassifyAddDelSession) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ClassifyAddDelSession) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.TableIndex
+ size += 4 // m.HitNextIndex
+ size += 4 // m.OpaqueIndex
+ size += 4 // m.Advance
+ size += 1 // m.Action
+ size += 4 // m.Metadata
+ size += 4 // m.MatchLen
+ size += 1 * len(m.Match) // m.Match
+ return size
+}
+func (m *ClassifyAddDelSession) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(m.TableIndex)
+ buf.EncodeUint32(m.HitNextIndex)
+ buf.EncodeUint32(m.OpaqueIndex)
+ buf.EncodeInt32(m.Advance)
+ buf.EncodeUint8(uint8(m.Action))
+ buf.EncodeUint32(m.Metadata)
+ buf.EncodeUint32(uint32(len(m.Match)))
+ buf.EncodeBytes(m.Match, 0)
+ return buf.Bytes(), nil
+}
+func (m *ClassifyAddDelSession) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.TableIndex = buf.DecodeUint32()
+ m.HitNextIndex = buf.DecodeUint32()
+ m.OpaqueIndex = buf.DecodeUint32()
+ m.Advance = buf.DecodeInt32()
+ m.Action = ClassifyAction(buf.DecodeUint8())
+ m.Metadata = buf.DecodeUint32()
+ m.MatchLen = buf.DecodeUint32()
+ m.Match = make([]byte, m.MatchLen)
+ copy(m.Match, buf.DecodeBytes(len(m.Match)))
+ return nil
+}
+
+// ClassifyAddDelSessionReply defines message 'classify_add_del_session_reply'.
+type ClassifyAddDelSessionReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ClassifyAddDelSessionReply) Reset() { *m = ClassifyAddDelSessionReply{} }
+func (*ClassifyAddDelSessionReply) GetMessageName() string { return "classify_add_del_session_reply" }
+func (*ClassifyAddDelSessionReply) GetCrcString() string { return "e8d4e804" }
+func (*ClassifyAddDelSessionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ClassifyAddDelSessionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ClassifyAddDelSessionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// ClassifyAddDelTable defines message 'classify_add_del_table'.
+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=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"`
+}
+
+func (m *ClassifyAddDelTable) Reset() { *m = ClassifyAddDelTable{} }
+func (*ClassifyAddDelTable) GetMessageName() string { return "classify_add_del_table" }
+func (*ClassifyAddDelTable) GetCrcString() string { return "6849e39e" }
+func (*ClassifyAddDelTable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ClassifyAddDelTable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.DelChain
+ size += 4 // m.TableIndex
+ size += 4 // m.Nbuckets
+ size += 4 // m.MemorySize
+ size += 4 // m.SkipNVectors
+ size += 4 // m.MatchNVectors
+ size += 4 // m.NextTableIndex
+ size += 4 // m.MissNextIndex
+ size += 1 // m.CurrentDataFlag
+ size += 2 // m.CurrentDataOffset
+ size += 4 // m.MaskLen
+ size += 1 * len(m.Mask) // m.Mask
+ return size
+}
+func (m *ClassifyAddDelTable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.DelChain)
+ 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)
+ return buf.Bytes(), nil
+}
+func (m *ClassifyAddDelTable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.DelChain = buf.DecodeBool()
+ m.TableIndex = buf.DecodeUint32()
+ m.Nbuckets = buf.DecodeUint32()
+ m.MemorySize = buf.DecodeUint32()
+ m.SkipNVectors = buf.DecodeUint32()
+ m.MatchNVectors = buf.DecodeUint32()
+ m.NextTableIndex = buf.DecodeUint32()
+ m.MissNextIndex = buf.DecodeUint32()
+ m.CurrentDataFlag = buf.DecodeUint8()
+ m.CurrentDataOffset = buf.DecodeInt16()
+ m.MaskLen = buf.DecodeUint32()
+ m.Mask = make([]byte, m.MaskLen)
+ copy(m.Mask, buf.DecodeBytes(len(m.Mask)))
+ return nil
+}
+
+// ClassifyAddDelTableReply defines message 'classify_add_del_table_reply'.
+type ClassifyAddDelTableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ NewTableIndex uint32 `binapi:"u32,name=new_table_index" json:"new_table_index,omitempty"`
+ SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors" json:"skip_n_vectors,omitempty"`
+ MatchNVectors uint32 `binapi:"u32,name=match_n_vectors" json:"match_n_vectors,omitempty"`
+}
+
+func (m *ClassifyAddDelTableReply) Reset() { *m = ClassifyAddDelTableReply{} }
+func (*ClassifyAddDelTableReply) GetMessageName() string { return "classify_add_del_table_reply" }
+func (*ClassifyAddDelTableReply) GetCrcString() string { return "05486349" }
+func (*ClassifyAddDelTableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ClassifyAddDelTableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.NewTableIndex
+ size += 4 // m.SkipNVectors
+ size += 4 // m.MatchNVectors
+ return size
+}
+func (m *ClassifyAddDelTableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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 = buf.DecodeInt32()
+ m.NewTableIndex = buf.DecodeUint32()
+ m.SkipNVectors = buf.DecodeUint32()
+ m.MatchNVectors = buf.DecodeUint32()
+ return nil
+}
+
+// ClassifySessionDetails defines message 'classify_session_details'.
+type ClassifySessionDetails struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ HitNextIndex uint32 `binapi:"u32,name=hit_next_index" json:"hit_next_index,omitempty"`
+ Advance int32 `binapi:"i32,name=advance" json:"advance,omitempty"`
+ OpaqueIndex uint32 `binapi:"u32,name=opaque_index" json:"opaque_index,omitempty"`
+ MatchLength uint32 `binapi:"u32,name=match_length" json:"-"`
+ Match []byte `binapi:"u8[match_length],name=match" json:"match,omitempty"`
+}
+
+func (m *ClassifySessionDetails) Reset() { *m = ClassifySessionDetails{} }
+func (*ClassifySessionDetails) GetMessageName() string { return "classify_session_details" }
+func (*ClassifySessionDetails) GetCrcString() string { return "60e3ef94" }
+func (*ClassifySessionDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ClassifySessionDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.TableID
+ size += 4 // m.HitNextIndex
+ size += 4 // m.Advance
+ size += 4 // m.OpaqueIndex
+ size += 4 // m.MatchLength
+ size += 1 * len(m.Match) // m.Match
+ return size
+}
+func (m *ClassifySessionDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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)
+ return buf.Bytes(), nil
+}
+func (m *ClassifySessionDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.TableID = buf.DecodeUint32()
+ m.HitNextIndex = buf.DecodeUint32()
+ m.Advance = buf.DecodeInt32()
+ m.OpaqueIndex = buf.DecodeUint32()
+ m.MatchLength = buf.DecodeUint32()
+ m.Match = make([]byte, m.MatchLength)
+ copy(m.Match, buf.DecodeBytes(len(m.Match)))
+ return nil
+}
+
+// ClassifySessionDump defines message 'classify_session_dump'.
+type ClassifySessionDump struct {
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+}
+
+func (m *ClassifySessionDump) Reset() { *m = ClassifySessionDump{} }
+func (*ClassifySessionDump) GetMessageName() string { return "classify_session_dump" }
+func (*ClassifySessionDump) GetCrcString() string { return "0cca2cd9" }
+func (*ClassifySessionDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ClassifySessionDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.TableID
+ return size
+}
+func (m *ClassifySessionDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.TableID)
+ return buf.Bytes(), nil
+}
+func (m *ClassifySessionDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TableID = buf.DecodeUint32()
+ return nil
+}
+
+// ClassifySetInterfaceIPTable defines message 'classify_set_interface_ip_table'.
+type ClassifySetInterfaceIPTable struct {
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"`
+}
+
+func (m *ClassifySetInterfaceIPTable) Reset() { *m = ClassifySetInterfaceIPTable{} }
+func (*ClassifySetInterfaceIPTable) GetMessageName() string { return "classify_set_interface_ip_table" }
+func (*ClassifySetInterfaceIPTable) GetCrcString() string { return "e0b097c7" }
+func (*ClassifySetInterfaceIPTable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ClassifySetInterfaceIPTable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIPv6
+ size += 4 // m.SwIfIndex
+ size += 4 // m.TableIndex
+ return size
+}
+func (m *ClassifySetInterfaceIPTable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsIPv6)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.TableIndex)
+ return buf.Bytes(), nil
+}
+func (m *ClassifySetInterfaceIPTable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.TableIndex = buf.DecodeUint32()
+ return nil
+}
+
+// ClassifySetInterfaceIPTableReply defines message 'classify_set_interface_ip_table_reply'.
+type ClassifySetInterfaceIPTableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ClassifySetInterfaceIPTableReply) Reset() { *m = ClassifySetInterfaceIPTableReply{} }
+func (*ClassifySetInterfaceIPTableReply) GetMessageName() string {
+ return "classify_set_interface_ip_table_reply"
+}
+func (*ClassifySetInterfaceIPTableReply) GetCrcString() string { return "e8d4e804" }
+func (*ClassifySetInterfaceIPTableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ClassifySetInterfaceIPTableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ClassifySetInterfaceIPTableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// ClassifySetInterfaceL2Tables defines message 'classify_set_interface_l2_tables'.
+type ClassifySetInterfaceL2Tables struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"`
+ IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"`
+ OtherTableIndex uint32 `binapi:"u32,name=other_table_index" json:"other_table_index,omitempty"`
+ IsInput bool `binapi:"bool,name=is_input" json:"is_input,omitempty"`
+}
+
+func (m *ClassifySetInterfaceL2Tables) Reset() { *m = ClassifySetInterfaceL2Tables{} }
+func (*ClassifySetInterfaceL2Tables) GetMessageName() string {
+ return "classify_set_interface_l2_tables"
+}
+func (*ClassifySetInterfaceL2Tables) GetCrcString() string { return "5a6ddf65" }
+func (*ClassifySetInterfaceL2Tables) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ClassifySetInterfaceL2Tables) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.IP4TableIndex
+ size += 4 // m.IP6TableIndex
+ size += 4 // m.OtherTableIndex
+ size += 1 // m.IsInput
+ return size
+}
+func (m *ClassifySetInterfaceL2Tables) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.IP4TableIndex)
+ buf.EncodeUint32(m.IP6TableIndex)
+ buf.EncodeUint32(m.OtherTableIndex)
+ buf.EncodeBool(m.IsInput)
+ return buf.Bytes(), nil
+}
+func (m *ClassifySetInterfaceL2Tables) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IP4TableIndex = buf.DecodeUint32()
+ m.IP6TableIndex = buf.DecodeUint32()
+ m.OtherTableIndex = buf.DecodeUint32()
+ m.IsInput = buf.DecodeBool()
+ return nil
+}
+
+// ClassifySetInterfaceL2TablesReply defines message 'classify_set_interface_l2_tables_reply'.
+type ClassifySetInterfaceL2TablesReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ClassifySetInterfaceL2TablesReply) Reset() { *m = ClassifySetInterfaceL2TablesReply{} }
+func (*ClassifySetInterfaceL2TablesReply) GetMessageName() string {
+ return "classify_set_interface_l2_tables_reply"
+}
+func (*ClassifySetInterfaceL2TablesReply) GetCrcString() string { return "e8d4e804" }
+func (*ClassifySetInterfaceL2TablesReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ClassifySetInterfaceL2TablesReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ClassifySetInterfaceL2TablesReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// ClassifyTableByInterface defines message 'classify_table_by_interface'.
+type ClassifyTableByInterface struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *ClassifyTableByInterface) Reset() { *m = ClassifyTableByInterface{} }
+func (*ClassifyTableByInterface) GetMessageName() string { return "classify_table_by_interface" }
+func (*ClassifyTableByInterface) GetCrcString() string { return "f9e6675e" }
+func (*ClassifyTableByInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ClassifyTableByInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *ClassifyTableByInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *ClassifyTableByInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// ClassifyTableByInterfaceReply defines message 'classify_table_by_interface_reply'.
+type ClassifyTableByInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ L2TableID uint32 `binapi:"u32,name=l2_table_id" json:"l2_table_id,omitempty"`
+ IP4TableID uint32 `binapi:"u32,name=ip4_table_id" json:"ip4_table_id,omitempty"`
+ IP6TableID uint32 `binapi:"u32,name=ip6_table_id" json:"ip6_table_id,omitempty"`
+}
+
+func (m *ClassifyTableByInterfaceReply) Reset() { *m = ClassifyTableByInterfaceReply{} }
+func (*ClassifyTableByInterfaceReply) GetMessageName() string {
+ return "classify_table_by_interface_reply"
+}
+func (*ClassifyTableByInterfaceReply) GetCrcString() string { return "ed4197db" }
+func (*ClassifyTableByInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ClassifyTableByInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ size += 4 // m.L2TableID
+ size += 4 // m.IP4TableID
+ size += 4 // m.IP6TableID
+ return size
+}
+func (m *ClassifyTableByInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.L2TableID = buf.DecodeUint32()
+ m.IP4TableID = buf.DecodeUint32()
+ m.IP6TableID = buf.DecodeUint32()
+ return nil
+}
+
+// ClassifyTableIds defines message 'classify_table_ids'.
+type ClassifyTableIds struct{}
+
+func (m *ClassifyTableIds) Reset() { *m = ClassifyTableIds{} }
+func (*ClassifyTableIds) GetMessageName() string { return "classify_table_ids" }
+func (*ClassifyTableIds) GetCrcString() string { return "51077d14" }
+func (*ClassifyTableIds) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ClassifyTableIds) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ClassifyTableIds) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ClassifyTableIds) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ClassifyTableIdsReply defines message 'classify_table_ids_reply'.
+type ClassifyTableIdsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ Ids []uint32 `binapi:"u32[count],name=ids" json:"ids,omitempty"`
+}
+
+func (m *ClassifyTableIdsReply) Reset() { *m = ClassifyTableIdsReply{} }
+func (*ClassifyTableIdsReply) GetMessageName() string { return "classify_table_ids_reply" }
+func (*ClassifyTableIdsReply) GetCrcString() string { return "d1d20e1d" }
+func (*ClassifyTableIdsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ClassifyTableIdsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *ClassifyTableIdsReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.Ids = make([]uint32, m.Count)
+ for i := 0; i < len(m.Ids); i++ {
+ m.Ids[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// ClassifyTableInfo defines message 'classify_table_info'.
+type ClassifyTableInfo struct {
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+}
+
+func (m *ClassifyTableInfo) Reset() { *m = ClassifyTableInfo{} }
+func (*ClassifyTableInfo) GetMessageName() string { return "classify_table_info" }
+func (*ClassifyTableInfo) GetCrcString() string { return "0cca2cd9" }
+func (*ClassifyTableInfo) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ClassifyTableInfo) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.TableID
+ return size
+}
+func (m *ClassifyTableInfo) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.TableID)
+ return buf.Bytes(), nil
+}
+func (m *ClassifyTableInfo) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TableID = buf.DecodeUint32()
+ return nil
+}
+
+// ClassifyTableInfoReply defines message 'classify_table_info_reply'.
+type ClassifyTableInfoReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ Nbuckets uint32 `binapi:"u32,name=nbuckets" json:"nbuckets,omitempty"`
+ MatchNVectors uint32 `binapi:"u32,name=match_n_vectors" json:"match_n_vectors,omitempty"`
+ SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors" json:"skip_n_vectors,omitempty"`
+ ActiveSessions uint32 `binapi:"u32,name=active_sessions" json:"active_sessions,omitempty"`
+ NextTableIndex uint32 `binapi:"u32,name=next_table_index" json:"next_table_index,omitempty"`
+ MissNextIndex uint32 `binapi:"u32,name=miss_next_index" json:"miss_next_index,omitempty"`
+ MaskLength uint32 `binapi:"u32,name=mask_length" json:"-"`
+ Mask []byte `binapi:"u8[mask_length],name=mask" json:"mask,omitempty"`
+}
+
+func (m *ClassifyTableInfoReply) Reset() { *m = ClassifyTableInfoReply{} }
+func (*ClassifyTableInfoReply) GetMessageName() string { return "classify_table_info_reply" }
+func (*ClassifyTableInfoReply) GetCrcString() string { return "4a573c0e" }
+func (*ClassifyTableInfoReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ClassifyTableInfoReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.TableID
+ size += 4 // m.Nbuckets
+ size += 4 // m.MatchNVectors
+ size += 4 // m.SkipNVectors
+ size += 4 // m.ActiveSessions
+ size += 4 // m.NextTableIndex
+ size += 4 // m.MissNextIndex
+ size += 4 // m.MaskLength
+ size += 1 * len(m.Mask) // m.Mask
+ return size
+}
+func (m *ClassifyTableInfoReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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)
+ return buf.Bytes(), nil
+}
+func (m *ClassifyTableInfoReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.TableID = buf.DecodeUint32()
+ m.Nbuckets = buf.DecodeUint32()
+ m.MatchNVectors = buf.DecodeUint32()
+ m.SkipNVectors = buf.DecodeUint32()
+ m.ActiveSessions = buf.DecodeUint32()
+ m.NextTableIndex = buf.DecodeUint32()
+ m.MissNextIndex = buf.DecodeUint32()
+ m.MaskLength = buf.DecodeUint32()
+ m.Mask = make([]byte, m.MaskLength)
+ copy(m.Mask, buf.DecodeBytes(len(m.Mask)))
+ return nil
+}
+
+// FlowClassifyDetails defines message 'flow_classify_details'.
+type FlowClassifyDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"`
+}
+
+func (m *FlowClassifyDetails) Reset() { *m = FlowClassifyDetails{} }
+func (*FlowClassifyDetails) GetMessageName() string { return "flow_classify_details" }
+func (*FlowClassifyDetails) GetCrcString() string { return "dfd08765" }
+func (*FlowClassifyDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *FlowClassifyDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.TableIndex
+ return size
+}
+func (m *FlowClassifyDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.TableIndex)
+ return buf.Bytes(), nil
+}
+func (m *FlowClassifyDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.TableIndex = buf.DecodeUint32()
+ return nil
+}
+
+// FlowClassifyDump defines message 'flow_classify_dump'.
+type FlowClassifyDump struct {
+ Type FlowClassifyTable `binapi:"flow_classify_table,name=type" json:"type,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *FlowClassifyDump) Reset() { *m = FlowClassifyDump{} }
+func (*FlowClassifyDump) GetMessageName() string { return "flow_classify_dump" }
+func (*FlowClassifyDump) GetCrcString() string { return "8a6ad43d" }
+func (*FlowClassifyDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *FlowClassifyDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Type
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *FlowClassifyDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.Type))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *FlowClassifyDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Type = FlowClassifyTable(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// FlowClassifySetInterface defines message 'flow_classify_set_interface'.
+type FlowClassifySetInterface struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"`
+ IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *FlowClassifySetInterface) Reset() { *m = FlowClassifySetInterface{} }
+func (*FlowClassifySetInterface) GetMessageName() string { return "flow_classify_set_interface" }
+func (*FlowClassifySetInterface) GetCrcString() string { return "b6192f1c" }
+func (*FlowClassifySetInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *FlowClassifySetInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.IP4TableIndex
+ size += 4 // m.IP6TableIndex
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *FlowClassifySetInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.IP4TableIndex)
+ buf.EncodeUint32(m.IP6TableIndex)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *FlowClassifySetInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IP4TableIndex = buf.DecodeUint32()
+ m.IP6TableIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// FlowClassifySetInterfaceReply defines message 'flow_classify_set_interface_reply'.
+type FlowClassifySetInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *FlowClassifySetInterfaceReply) Reset() { *m = FlowClassifySetInterfaceReply{} }
+func (*FlowClassifySetInterfaceReply) GetMessageName() string {
+ return "flow_classify_set_interface_reply"
+}
+func (*FlowClassifySetInterfaceReply) GetCrcString() string { return "e8d4e804" }
+func (*FlowClassifySetInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *FlowClassifySetInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *FlowClassifySetInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// InputACLSetInterface defines message 'input_acl_set_interface'.
+type InputACLSetInterface struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"`
+ IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"`
+ L2TableIndex uint32 `binapi:"u32,name=l2_table_index" json:"l2_table_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *InputACLSetInterface) Reset() { *m = InputACLSetInterface{} }
+func (*InputACLSetInterface) GetMessageName() string { return "input_acl_set_interface" }
+func (*InputACLSetInterface) GetCrcString() string { return "de7ad708" }
+func (*InputACLSetInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *InputACLSetInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.IP4TableIndex
+ size += 4 // m.IP6TableIndex
+ size += 4 // m.L2TableIndex
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *InputACLSetInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.IP4TableIndex)
+ buf.EncodeUint32(m.IP6TableIndex)
+ buf.EncodeUint32(m.L2TableIndex)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *InputACLSetInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IP4TableIndex = buf.DecodeUint32()
+ m.IP6TableIndex = buf.DecodeUint32()
+ m.L2TableIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// InputACLSetInterfaceReply defines message 'input_acl_set_interface_reply'.
+type InputACLSetInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *InputACLSetInterfaceReply) Reset() { *m = InputACLSetInterfaceReply{} }
+func (*InputACLSetInterfaceReply) GetMessageName() string { return "input_acl_set_interface_reply" }
+func (*InputACLSetInterfaceReply) GetCrcString() string { return "e8d4e804" }
+func (*InputACLSetInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *InputACLSetInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *InputACLSetInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OutputACLSetInterface defines message 'output_acl_set_interface'.
+type OutputACLSetInterface struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"`
+ IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"`
+ L2TableIndex uint32 `binapi:"u32,name=l2_table_index" json:"l2_table_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *OutputACLSetInterface) Reset() { *m = OutputACLSetInterface{} }
+func (*OutputACLSetInterface) GetMessageName() string { return "output_acl_set_interface" }
+func (*OutputACLSetInterface) GetCrcString() string { return "de7ad708" }
+func (*OutputACLSetInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OutputACLSetInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.IP4TableIndex
+ size += 4 // m.IP6TableIndex
+ size += 4 // m.L2TableIndex
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *OutputACLSetInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.IP4TableIndex)
+ buf.EncodeUint32(m.IP6TableIndex)
+ buf.EncodeUint32(m.L2TableIndex)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *OutputACLSetInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IP4TableIndex = buf.DecodeUint32()
+ m.IP6TableIndex = buf.DecodeUint32()
+ m.L2TableIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// OutputACLSetInterfaceReply defines message 'output_acl_set_interface_reply'.
+type OutputACLSetInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OutputACLSetInterfaceReply) Reset() { *m = OutputACLSetInterfaceReply{} }
+func (*OutputACLSetInterfaceReply) GetMessageName() string { return "output_acl_set_interface_reply" }
+func (*OutputACLSetInterfaceReply) GetCrcString() string { return "e8d4e804" }
+func (*OutputACLSetInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OutputACLSetInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OutputACLSetInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// PolicerClassifyDetails defines message 'policer_classify_details'.
+type PolicerClassifyDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"`
+}
+
+func (m *PolicerClassifyDetails) Reset() { *m = PolicerClassifyDetails{} }
+func (*PolicerClassifyDetails) GetMessageName() string { return "policer_classify_details" }
+func (*PolicerClassifyDetails) GetCrcString() string { return "dfd08765" }
+func (*PolicerClassifyDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PolicerClassifyDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.TableIndex
+ return size
+}
+func (m *PolicerClassifyDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.TableIndex)
+ return buf.Bytes(), nil
+}
+func (m *PolicerClassifyDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.TableIndex = buf.DecodeUint32()
+ return nil
+}
+
+// PolicerClassifyDump defines message 'policer_classify_dump'.
+type PolicerClassifyDump struct {
+ Type PolicerClassifyTable `binapi:"policer_classify_table,name=type" json:"type,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *PolicerClassifyDump) Reset() { *m = PolicerClassifyDump{} }
+func (*PolicerClassifyDump) GetMessageName() string { return "policer_classify_dump" }
+func (*PolicerClassifyDump) GetCrcString() string { return "6bfe6603" }
+func (*PolicerClassifyDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PolicerClassifyDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Type
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *PolicerClassifyDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.Type))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *PolicerClassifyDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Type = PolicerClassifyTable(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// PolicerClassifySetInterface defines message 'policer_classify_set_interface'.
+type PolicerClassifySetInterface struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"`
+ IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"`
+ L2TableIndex uint32 `binapi:"u32,name=l2_table_index" json:"l2_table_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *PolicerClassifySetInterface) Reset() { *m = PolicerClassifySetInterface{} }
+func (*PolicerClassifySetInterface) GetMessageName() string { return "policer_classify_set_interface" }
+func (*PolicerClassifySetInterface) GetCrcString() string { return "de7ad708" }
+func (*PolicerClassifySetInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PolicerClassifySetInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.IP4TableIndex
+ size += 4 // m.IP6TableIndex
+ size += 4 // m.L2TableIndex
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *PolicerClassifySetInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.IP4TableIndex)
+ buf.EncodeUint32(m.IP6TableIndex)
+ buf.EncodeUint32(m.L2TableIndex)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *PolicerClassifySetInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IP4TableIndex = buf.DecodeUint32()
+ m.IP6TableIndex = buf.DecodeUint32()
+ m.L2TableIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// PolicerClassifySetInterfaceReply defines message 'policer_classify_set_interface_reply'.
+type PolicerClassifySetInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *PolicerClassifySetInterfaceReply) Reset() { *m = PolicerClassifySetInterfaceReply{} }
+func (*PolicerClassifySetInterfaceReply) GetMessageName() string {
+ return "policer_classify_set_interface_reply"
+}
+func (*PolicerClassifySetInterfaceReply) GetCrcString() string { return "e8d4e804" }
+func (*PolicerClassifySetInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PolicerClassifySetInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *PolicerClassifySetInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_classify_binapi_init() }
+func file_classify_binapi_init() {
+ api.RegisterMessage((*ClassifyAddDelSession)(nil), "classify_add_del_session_f20879f0")
+ api.RegisterMessage((*ClassifyAddDelSessionReply)(nil), "classify_add_del_session_reply_e8d4e804")
+ api.RegisterMessage((*ClassifyAddDelTable)(nil), "classify_add_del_table_6849e39e")
+ api.RegisterMessage((*ClassifyAddDelTableReply)(nil), "classify_add_del_table_reply_05486349")
+ api.RegisterMessage((*ClassifySessionDetails)(nil), "classify_session_details_60e3ef94")
+ api.RegisterMessage((*ClassifySessionDump)(nil), "classify_session_dump_0cca2cd9")
+ api.RegisterMessage((*ClassifySetInterfaceIPTable)(nil), "classify_set_interface_ip_table_e0b097c7")
+ api.RegisterMessage((*ClassifySetInterfaceIPTableReply)(nil), "classify_set_interface_ip_table_reply_e8d4e804")
+ api.RegisterMessage((*ClassifySetInterfaceL2Tables)(nil), "classify_set_interface_l2_tables_5a6ddf65")
+ api.RegisterMessage((*ClassifySetInterfaceL2TablesReply)(nil), "classify_set_interface_l2_tables_reply_e8d4e804")
+ api.RegisterMessage((*ClassifyTableByInterface)(nil), "classify_table_by_interface_f9e6675e")
+ api.RegisterMessage((*ClassifyTableByInterfaceReply)(nil), "classify_table_by_interface_reply_ed4197db")
+ api.RegisterMessage((*ClassifyTableIds)(nil), "classify_table_ids_51077d14")
+ api.RegisterMessage((*ClassifyTableIdsReply)(nil), "classify_table_ids_reply_d1d20e1d")
+ api.RegisterMessage((*ClassifyTableInfo)(nil), "classify_table_info_0cca2cd9")
+ api.RegisterMessage((*ClassifyTableInfoReply)(nil), "classify_table_info_reply_4a573c0e")
+ api.RegisterMessage((*FlowClassifyDetails)(nil), "flow_classify_details_dfd08765")
+ api.RegisterMessage((*FlowClassifyDump)(nil), "flow_classify_dump_8a6ad43d")
+ api.RegisterMessage((*FlowClassifySetInterface)(nil), "flow_classify_set_interface_b6192f1c")
+ api.RegisterMessage((*FlowClassifySetInterfaceReply)(nil), "flow_classify_set_interface_reply_e8d4e804")
+ api.RegisterMessage((*InputACLSetInterface)(nil), "input_acl_set_interface_de7ad708")
+ api.RegisterMessage((*InputACLSetInterfaceReply)(nil), "input_acl_set_interface_reply_e8d4e804")
+ api.RegisterMessage((*OutputACLSetInterface)(nil), "output_acl_set_interface_de7ad708")
+ api.RegisterMessage((*OutputACLSetInterfaceReply)(nil), "output_acl_set_interface_reply_e8d4e804")
+ api.RegisterMessage((*PolicerClassifyDetails)(nil), "policer_classify_details_dfd08765")
+ api.RegisterMessage((*PolicerClassifyDump)(nil), "policer_classify_dump_6bfe6603")
+ api.RegisterMessage((*PolicerClassifySetInterface)(nil), "policer_classify_set_interface_de7ad708")
+ api.RegisterMessage((*PolicerClassifySetInterfaceReply)(nil), "policer_classify_set_interface_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*ClassifyAddDelSession)(nil),
+ (*ClassifyAddDelSessionReply)(nil),
+ (*ClassifyAddDelTable)(nil),
+ (*ClassifyAddDelTableReply)(nil),
+ (*ClassifySessionDetails)(nil),
+ (*ClassifySessionDump)(nil),
+ (*ClassifySetInterfaceIPTable)(nil),
+ (*ClassifySetInterfaceIPTableReply)(nil),
+ (*ClassifySetInterfaceL2Tables)(nil),
+ (*ClassifySetInterfaceL2TablesReply)(nil),
+ (*ClassifyTableByInterface)(nil),
+ (*ClassifyTableByInterfaceReply)(nil),
+ (*ClassifyTableIds)(nil),
+ (*ClassifyTableIdsReply)(nil),
+ (*ClassifyTableInfo)(nil),
+ (*ClassifyTableInfoReply)(nil),
+ (*FlowClassifyDetails)(nil),
+ (*FlowClassifyDump)(nil),
+ (*FlowClassifySetInterface)(nil),
+ (*FlowClassifySetInterfaceReply)(nil),
+ (*InputACLSetInterface)(nil),
+ (*InputACLSetInterfaceReply)(nil),
+ (*OutputACLSetInterface)(nil),
+ (*OutputACLSetInterfaceReply)(nil),
+ (*PolicerClassifyDetails)(nil),
+ (*PolicerClassifyDump)(nil),
+ (*PolicerClassifySetInterface)(nil),
+ (*PolicerClassifySetInterfaceReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/classify/classify_rpc.ba.go b/internal/testbinapi/binapi2001/classify/classify_rpc.ba.go
new file mode 100644
index 0000000..fd2fcff
--- /dev/null
+++ b/internal/testbinapi/binapi2001/classify/classify_rpc.ba.go
@@ -0,0 +1,253 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package classify
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service classify.
+type RPCService interface {
+ ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error)
+ ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error)
+ ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error)
+ ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error)
+ ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error)
+ ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error)
+ ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error)
+ ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error)
+ FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error)
+ FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error)
+ InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error)
+ OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error)
+ PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error)
+ PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error) {
+ out := new(ClassifyAddDelSessionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error) {
+ out := new(ClassifyAddDelTableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_ClassifySessionDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_ClassifySessionDumpClient interface {
+ Recv() (*ClassifySessionDetails, error)
+ api.Stream
+}
+
+type serviceClient_ClassifySessionDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_ClassifySessionDumpClient) Recv() (*ClassifySessionDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *ClassifySessionDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error) {
+ out := new(ClassifySetInterfaceIPTableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error) {
+ out := new(ClassifySetInterfaceL2TablesReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error) {
+ out := new(ClassifyTableByInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error) {
+ out := new(ClassifyTableIdsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error) {
+ out := new(ClassifyTableInfoReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_FlowClassifyDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_FlowClassifyDumpClient interface {
+ Recv() (*FlowClassifyDetails, error)
+ api.Stream
+}
+
+type serviceClient_FlowClassifyDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_FlowClassifyDumpClient) Recv() (*FlowClassifyDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *FlowClassifyDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error) {
+ out := new(FlowClassifySetInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error) {
+ out := new(InputACLSetInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error) {
+ out := new(OutputACLSetInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_PolicerClassifyDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_PolicerClassifyDumpClient interface {
+ Recv() (*PolicerClassifyDetails, error)
+ api.Stream
+}
+
+type serviceClient_PolicerClassifyDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_PolicerClassifyDumpClient) Recv() (*PolicerClassifyDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *PolicerClassifyDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error) {
+ out := new(PolicerClassifySetInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/cop/cop.ba.go b/internal/testbinapi/binapi2001/cop/cop.ba.go
new file mode 100644
index 0000000..a65e454
--- /dev/null
+++ b/internal/testbinapi/binapi2001/cop/cop.ba.go
@@ -0,0 +1,460 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/cop.api.json
+
+// Package cop contains generated bindings for API file cop.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 4 messages
+//
+package cop
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "cop"
+ APIVersion = "1.0.1"
+ VersionCrc = 0x59bc1ad8
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// CopInterfaceEnableDisable defines message 'cop_interface_enable_disable'.
+type CopInterfaceEnableDisable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+}
+
+func (m *CopInterfaceEnableDisable) Reset() { *m = CopInterfaceEnableDisable{} }
+func (*CopInterfaceEnableDisable) GetMessageName() string { return "cop_interface_enable_disable" }
+func (*CopInterfaceEnableDisable) GetCrcString() string { return "5501adee" }
+func (*CopInterfaceEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CopInterfaceEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.EnableDisable
+ return size
+}
+func (m *CopInterfaceEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.EnableDisable)
+ return buf.Bytes(), nil
+}
+func (m *CopInterfaceEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.EnableDisable = buf.DecodeBool()
+ return nil
+}
+
+// CopInterfaceEnableDisableReply defines message 'cop_interface_enable_disable_reply'.
+type CopInterfaceEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *CopInterfaceEnableDisableReply) Reset() { *m = CopInterfaceEnableDisableReply{} }
+func (*CopInterfaceEnableDisableReply) GetMessageName() string {
+ return "cop_interface_enable_disable_reply"
+}
+func (*CopInterfaceEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*CopInterfaceEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CopInterfaceEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *CopInterfaceEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// CopWhitelistEnableDisable defines message 'cop_whitelist_enable_disable'.
+type CopWhitelistEnableDisable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ FibID uint32 `binapi:"u32,name=fib_id" json:"fib_id,omitempty"`
+ IP4 bool `binapi:"bool,name=ip4" json:"ip4,omitempty"`
+ IP6 bool `binapi:"bool,name=ip6" json:"ip6,omitempty"`
+ DefaultCop bool `binapi:"bool,name=default_cop" json:"default_cop,omitempty"`
+}
+
+func (m *CopWhitelistEnableDisable) Reset() { *m = CopWhitelistEnableDisable{} }
+func (*CopWhitelistEnableDisable) GetMessageName() string { return "cop_whitelist_enable_disable" }
+func (*CopWhitelistEnableDisable) GetCrcString() string { return "debe13ea" }
+func (*CopWhitelistEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CopWhitelistEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.FibID
+ size += 1 // m.IP4
+ size += 1 // m.IP6
+ size += 1 // m.DefaultCop
+ return size
+}
+func (m *CopWhitelistEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.FibID)
+ buf.EncodeBool(m.IP4)
+ buf.EncodeBool(m.IP6)
+ buf.EncodeBool(m.DefaultCop)
+ return buf.Bytes(), nil
+}
+func (m *CopWhitelistEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.FibID = buf.DecodeUint32()
+ m.IP4 = buf.DecodeBool()
+ m.IP6 = buf.DecodeBool()
+ m.DefaultCop = buf.DecodeBool()
+ return nil
+}
+
+// CopWhitelistEnableDisableReply defines message 'cop_whitelist_enable_disable_reply'.
+type CopWhitelistEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *CopWhitelistEnableDisableReply) Reset() { *m = CopWhitelistEnableDisableReply{} }
+func (*CopWhitelistEnableDisableReply) GetMessageName() string {
+ return "cop_whitelist_enable_disable_reply"
+}
+func (*CopWhitelistEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*CopWhitelistEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CopWhitelistEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *CopWhitelistEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_cop_binapi_init() }
+func file_cop_binapi_init() {
+ api.RegisterMessage((*CopInterfaceEnableDisable)(nil), "cop_interface_enable_disable_5501adee")
+ api.RegisterMessage((*CopInterfaceEnableDisableReply)(nil), "cop_interface_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*CopWhitelistEnableDisable)(nil), "cop_whitelist_enable_disable_debe13ea")
+ api.RegisterMessage((*CopWhitelistEnableDisableReply)(nil), "cop_whitelist_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*CopInterfaceEnableDisable)(nil),
+ (*CopInterfaceEnableDisableReply)(nil),
+ (*CopWhitelistEnableDisable)(nil),
+ (*CopWhitelistEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/cop/cop_rpc.ba.go b/internal/testbinapi/binapi2001/cop/cop_rpc.ba.go
new file mode 100644
index 0000000..9f6f84e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/cop/cop_rpc.ba.go
@@ -0,0 +1,40 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package cop
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service cop.
+type RPCService interface {
+ CopInterfaceEnableDisable(ctx context.Context, in *CopInterfaceEnableDisable) (*CopInterfaceEnableDisableReply, error)
+ CopWhitelistEnableDisable(ctx context.Context, in *CopWhitelistEnableDisable) (*CopWhitelistEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) CopInterfaceEnableDisable(ctx context.Context, in *CopInterfaceEnableDisable) (*CopInterfaceEnableDisableReply, error) {
+ out := new(CopInterfaceEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) CopWhitelistEnableDisable(ctx context.Context, in *CopWhitelistEnableDisable) (*CopWhitelistEnableDisableReply, error) {
+ out := new(CopWhitelistEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ct6/ct6.ba.go b/internal/testbinapi/binapi2001/ct6/ct6.ba.go
new file mode 100644
index 0000000..d8edfbd
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ct6/ct6.ba.go
@@ -0,0 +1,374 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/ct6.api.json
+
+// Package ct6 contains generated bindings for API file ct6.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 2 messages
+//
+package ct6
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "ct6"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xb294742c
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// Ct6EnableDisable defines message 'ct6_enable_disable'.
+type Ct6EnableDisable struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ IsInside bool `binapi:"bool,name=is_inside" json:"is_inside,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Ct6EnableDisable) Reset() { *m = Ct6EnableDisable{} }
+func (*Ct6EnableDisable) GetMessageName() string { return "ct6_enable_disable" }
+func (*Ct6EnableDisable) GetCrcString() string { return "5d02ac02" }
+func (*Ct6EnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ct6EnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ size += 1 // m.IsInside
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Ct6EnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeBool(m.IsInside)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Ct6EnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ m.IsInside = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Ct6EnableDisableReply defines message 'ct6_enable_disable_reply'.
+type Ct6EnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ct6EnableDisableReply) Reset() { *m = Ct6EnableDisableReply{} }
+func (*Ct6EnableDisableReply) GetMessageName() string { return "ct6_enable_disable_reply" }
+func (*Ct6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*Ct6EnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ct6EnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ct6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_ct6_binapi_init() }
+func file_ct6_binapi_init() {
+ api.RegisterMessage((*Ct6EnableDisable)(nil), "ct6_enable_disable_5d02ac02")
+ api.RegisterMessage((*Ct6EnableDisableReply)(nil), "ct6_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*Ct6EnableDisable)(nil),
+ (*Ct6EnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ct6/ct6_rpc.ba.go b/internal/testbinapi/binapi2001/ct6/ct6_rpc.ba.go
new file mode 100644
index 0000000..888fd32
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ct6/ct6_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ct6
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service ct6.
+type RPCService interface {
+ Ct6EnableDisable(ctx context.Context, in *Ct6EnableDisable) (*Ct6EnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) Ct6EnableDisable(ctx context.Context, in *Ct6EnableDisable) (*Ct6EnableDisableReply, error) {
+ out := new(Ct6EnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/dhcp/dhcp.ba.go b/internal/testbinapi/binapi2001/dhcp/dhcp.ba.go
new file mode 100644
index 0000000..f75e7ed
--- /dev/null
+++ b/internal/testbinapi/binapi2001/dhcp/dhcp.ba.go
@@ -0,0 +1,2606 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/dhcp.api.json
+
+// Package dhcp contains generated bindings for API file dhcp.api.
+//
+// Contents:
+// 7 aliases
+// 13 enums
+// 12 structs
+// 1 union
+// 29 messages
+//
+package dhcp
+
+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 = "dhcp"
+ APIVersion = "3.0.1"
+ VersionCrc = 0x96a5f046
+)
+
+// 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)) + ")"
+}
+
+// DHCPClientState defines enum 'dhcp_client_state'.
+type DHCPClientState uint32
+
+const (
+ DHCP_CLIENT_STATE_API_DISCOVER DHCPClientState = 1
+ DHCP_CLIENT_STATE_API_REQUEST DHCPClientState = 2
+ DHCP_CLIENT_STATE_API_BOUND DHCPClientState = 3
+)
+
+var (
+ DHCPClientState_name = map[uint32]string{
+ 1: "DHCP_CLIENT_STATE_API_DISCOVER",
+ 2: "DHCP_CLIENT_STATE_API_REQUEST",
+ 3: "DHCP_CLIENT_STATE_API_BOUND",
+ }
+ DHCPClientState_value = map[string]uint32{
+ "DHCP_CLIENT_STATE_API_DISCOVER": 1,
+ "DHCP_CLIENT_STATE_API_REQUEST": 2,
+ "DHCP_CLIENT_STATE_API_BOUND": 3,
+ }
+)
+
+func (x DHCPClientState) String() string {
+ s, ok := DHCPClientState_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "DHCPClientState(" + strconv.Itoa(int(x)) + ")"
+}
+
+// Dhcpv6MsgType defines enum 'dhcpv6_msg_type'.
+type Dhcpv6MsgType uint32
+
+const (
+ DHCPV6_MSG_API_SOLICIT Dhcpv6MsgType = 1
+ DHCPV6_MSG_API_ADVERTISE Dhcpv6MsgType = 2
+ DHCPV6_MSG_API_REQUEST Dhcpv6MsgType = 3
+ DHCPV6_MSG_API_CONFIRM Dhcpv6MsgType = 4
+ DHCPV6_MSG_API_RENEW Dhcpv6MsgType = 5
+ DHCPV6_MSG_API_REBIND Dhcpv6MsgType = 6
+ DHCPV6_MSG_API_REPLY Dhcpv6MsgType = 7
+ DHCPV6_MSG_API_RELEASE Dhcpv6MsgType = 8
+ DHCPV6_MSG_API_DECLINE Dhcpv6MsgType = 9
+ DHCPV6_MSG_API_RECONFIGURE Dhcpv6MsgType = 10
+ DHCPV6_MSG_API_INFORMATION_REQUEST Dhcpv6MsgType = 11
+ DHCPV6_MSG_API_RELAY_FORW Dhcpv6MsgType = 12
+ DHCPV6_MSG_API_RELAY_REPL Dhcpv6MsgType = 13
+)
+
+var (
+ Dhcpv6MsgType_name = map[uint32]string{
+ 1: "DHCPV6_MSG_API_SOLICIT",
+ 2: "DHCPV6_MSG_API_ADVERTISE",
+ 3: "DHCPV6_MSG_API_REQUEST",
+ 4: "DHCPV6_MSG_API_CONFIRM",
+ 5: "DHCPV6_MSG_API_RENEW",
+ 6: "DHCPV6_MSG_API_REBIND",
+ 7: "DHCPV6_MSG_API_REPLY",
+ 8: "DHCPV6_MSG_API_RELEASE",
+ 9: "DHCPV6_MSG_API_DECLINE",
+ 10: "DHCPV6_MSG_API_RECONFIGURE",
+ 11: "DHCPV6_MSG_API_INFORMATION_REQUEST",
+ 12: "DHCPV6_MSG_API_RELAY_FORW",
+ 13: "DHCPV6_MSG_API_RELAY_REPL",
+ }
+ Dhcpv6MsgType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x Dhcpv6MsgType) String() string {
+ s, ok := Dhcpv6MsgType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "Dhcpv6MsgType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// VssType defines enum 'vss_type'.
+type VssType uint32
+
+const (
+ VSS_TYPE_API_ASCII VssType = 0
+ VSS_TYPE_API_VPN_ID VssType = 1
+ VSS_TYPE_API_INVALID VssType = 123
+ VSS_TYPE_API_DEFAULT VssType = 255
+)
+
+var (
+ VssType_name = map[uint32]string{
+ 0: "VSS_TYPE_API_ASCII",
+ 1: "VSS_TYPE_API_VPN_ID",
+ 123: "VSS_TYPE_API_INVALID",
+ 255: "VSS_TYPE_API_DEFAULT",
+ }
+ VssType_value = map[string]uint32{
+ "VSS_TYPE_API_ASCII": 0,
+ "VSS_TYPE_API_VPN_ID": 1,
+ "VSS_TYPE_API_INVALID": 123,
+ "VSS_TYPE_API_DEFAULT": 255,
+ }
+)
+
+func (x VssType) String() string {
+ s, ok := VssType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "VssType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// DHCP6AddressInfo defines type 'dhcp6_address_info'.
+type DHCP6AddressInfo struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ ValidTime uint32 `binapi:"u32,name=valid_time" json:"valid_time,omitempty"`
+ PreferredTime uint32 `binapi:"u32,name=preferred_time" json:"preferred_time,omitempty"`
+}
+
+// DHCP6PdPrefixInfo defines type 'dhcp6_pd_prefix_info'.
+type DHCP6PdPrefixInfo struct {
+ Prefix IP6Prefix `binapi:"ip6_prefix,name=prefix" json:"prefix,omitempty"`
+ ValidTime uint32 `binapi:"u32,name=valid_time" json:"valid_time,omitempty"`
+ PreferredTime uint32 `binapi:"u32,name=preferred_time" json:"preferred_time,omitempty"`
+}
+
+// DHCPClient defines type 'dhcp_client'.
+type DHCPClient struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Hostname string `binapi:"string[64],name=hostname" json:"hostname,omitempty"`
+ ID []byte `binapi:"u8[64],name=id" json:"id,omitempty"`
+ WantDHCPEvent bool `binapi:"bool,name=want_dhcp_event" json:"want_dhcp_event,omitempty"`
+ SetBroadcastFlag bool `binapi:"bool,name=set_broadcast_flag" json:"set_broadcast_flag,omitempty"`
+ Dscp IPDscp `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+// DHCPLease defines type 'dhcp_lease'.
+type DHCPLease struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ State DHCPClientState `binapi:"dhcp_client_state,name=state" json:"state,omitempty"`
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+ Hostname string `binapi:"string[64],name=hostname" json:"hostname,omitempty"`
+ MaskWidth uint8 `binapi:"u8,name=mask_width" json:"mask_width,omitempty"`
+ HostAddress Address `binapi:"address,name=host_address" json:"host_address,omitempty"`
+ RouterAddress Address `binapi:"address,name=router_address" json:"router_address,omitempty"`
+ HostMac MacAddress `binapi:"mac_address,name=host_mac" json:"host_mac,omitempty"`
+ Count uint8 `binapi:"u8,name=count" json:"-"`
+ DomainServer []DomainServer `binapi:"domain_server[count],name=domain_server" json:"domain_server,omitempty"`
+}
+
+// DHCPServer defines type 'dhcp_server'.
+type DHCPServer struct {
+ ServerVrfID uint32 `binapi:"u32,name=server_vrf_id" json:"server_vrf_id,omitempty"`
+ DHCPServer Address `binapi:"address,name=dhcp_server" json:"dhcp_server,omitempty"`
+}
+
+// DomainServer defines type 'domain_server'.
+type DomainServer struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// DHCP6ClientsEnableDisable defines message 'dhcp6_clients_enable_disable'.
+type DHCP6ClientsEnableDisable struct {
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *DHCP6ClientsEnableDisable) Reset() { *m = DHCP6ClientsEnableDisable{} }
+func (*DHCP6ClientsEnableDisable) GetMessageName() string { return "dhcp6_clients_enable_disable" }
+func (*DHCP6ClientsEnableDisable) GetCrcString() string { return "b3e225d2" }
+func (*DHCP6ClientsEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCP6ClientsEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ return size
+}
+func (m *DHCP6ClientsEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *DHCP6ClientsEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// DHCP6ClientsEnableDisableReply defines message 'dhcp6_clients_enable_disable_reply'.
+type DHCP6ClientsEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DHCP6ClientsEnableDisableReply) Reset() { *m = DHCP6ClientsEnableDisableReply{} }
+func (*DHCP6ClientsEnableDisableReply) GetMessageName() string {
+ return "dhcp6_clients_enable_disable_reply"
+}
+func (*DHCP6ClientsEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*DHCP6ClientsEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCP6ClientsEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DHCP6ClientsEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DHCP6DuidLlSet defines message 'dhcp6_duid_ll_set'.
+type DHCP6DuidLlSet struct {
+ DuidLl []byte `binapi:"u8[10],name=duid_ll" json:"duid_ll,omitempty"`
+}
+
+func (m *DHCP6DuidLlSet) Reset() { *m = DHCP6DuidLlSet{} }
+func (*DHCP6DuidLlSet) GetMessageName() string { return "dhcp6_duid_ll_set" }
+func (*DHCP6DuidLlSet) GetCrcString() string { return "0f6ca323" }
+func (*DHCP6DuidLlSet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCP6DuidLlSet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 10 // m.DuidLl
+ return size
+}
+func (m *DHCP6DuidLlSet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.DuidLl, 10)
+ return buf.Bytes(), nil
+}
+func (m *DHCP6DuidLlSet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.DuidLl = make([]byte, 10)
+ copy(m.DuidLl, buf.DecodeBytes(len(m.DuidLl)))
+ return nil
+}
+
+// DHCP6DuidLlSetReply defines message 'dhcp6_duid_ll_set_reply'.
+type DHCP6DuidLlSetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DHCP6DuidLlSetReply) Reset() { *m = DHCP6DuidLlSetReply{} }
+func (*DHCP6DuidLlSetReply) GetMessageName() string { return "dhcp6_duid_ll_set_reply" }
+func (*DHCP6DuidLlSetReply) GetCrcString() string { return "e8d4e804" }
+func (*DHCP6DuidLlSetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCP6DuidLlSetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DHCP6DuidLlSetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DHCP6PdReplyEvent defines message 'dhcp6_pd_reply_event'.
+type DHCP6PdReplyEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ ServerIndex uint32 `binapi:"u32,name=server_index" json:"server_index,omitempty"`
+ MsgType Dhcpv6MsgType `binapi:"dhcpv6_msg_type,name=msg_type" json:"msg_type,omitempty"`
+ T1 uint32 `binapi:"u32,name=T1" json:"T1,omitempty"`
+ T2 uint32 `binapi:"u32,name=T2" json:"T2,omitempty"`
+ InnerStatusCode uint16 `binapi:"u16,name=inner_status_code" json:"inner_status_code,omitempty"`
+ StatusCode uint16 `binapi:"u16,name=status_code" json:"status_code,omitempty"`
+ Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
+ NPrefixes uint32 `binapi:"u32,name=n_prefixes" json:"-"`
+ Prefixes []DHCP6PdPrefixInfo `binapi:"dhcp6_pd_prefix_info[n_prefixes],name=prefixes" json:"prefixes,omitempty"`
+}
+
+func (m *DHCP6PdReplyEvent) Reset() { *m = DHCP6PdReplyEvent{} }
+func (*DHCP6PdReplyEvent) GetMessageName() string { return "dhcp6_pd_reply_event" }
+func (*DHCP6PdReplyEvent) GetCrcString() string { return "cb3e462b" }
+func (*DHCP6PdReplyEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *DHCP6PdReplyEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.SwIfIndex
+ size += 4 // m.ServerIndex
+ size += 4 // m.MsgType
+ size += 4 // m.T1
+ size += 4 // m.T2
+ size += 2 // m.InnerStatusCode
+ size += 2 // m.StatusCode
+ size += 1 // m.Preference
+ size += 4 // m.NPrefixes
+ for j1 := 0; j1 < len(m.Prefixes); j1++ {
+ var s1 DHCP6PdPrefixInfo
+ _ = s1
+ if j1 < len(m.Prefixes) {
+ s1 = m.Prefixes[j1]
+ }
+ size += 1 * 16 // s1.Prefix.Address
+ size += 1 // s1.Prefix.Len
+ size += 4 // s1.ValidTime
+ size += 4 // s1.PreferredTime
+ }
+ return size
+}
+func (m *DHCP6PdReplyEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PID)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.ServerIndex)
+ buf.EncodeUint32(uint32(m.MsgType))
+ 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 // Prefixes
+ if j0 < len(m.Prefixes) {
+ v0 = m.Prefixes[j0]
+ }
+ buf.EncodeBytes(v0.Prefix.Address[:], 16)
+ buf.EncodeUint8(v0.Prefix.Len)
+ buf.EncodeUint32(v0.ValidTime)
+ buf.EncodeUint32(v0.PreferredTime)
+ }
+ return buf.Bytes(), nil
+}
+func (m *DHCP6PdReplyEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.ServerIndex = buf.DecodeUint32()
+ m.MsgType = Dhcpv6MsgType(buf.DecodeUint32())
+ m.T1 = buf.DecodeUint32()
+ m.T2 = buf.DecodeUint32()
+ m.InnerStatusCode = buf.DecodeUint16()
+ m.StatusCode = buf.DecodeUint16()
+ m.Preference = buf.DecodeUint8()
+ m.NPrefixes = buf.DecodeUint32()
+ 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()
+ m.Prefixes[j0].ValidTime = buf.DecodeUint32()
+ m.Prefixes[j0].PreferredTime = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// DHCP6PdSendClientMessage defines message 'dhcp6_pd_send_client_message'.
+type DHCP6PdSendClientMessage struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ ServerIndex uint32 `binapi:"u32,name=server_index" json:"server_index,omitempty"`
+ Irt uint32 `binapi:"u32,name=irt" json:"irt,omitempty"`
+ Mrt uint32 `binapi:"u32,name=mrt" json:"mrt,omitempty"`
+ Mrc uint32 `binapi:"u32,name=mrc" json:"mrc,omitempty"`
+ Mrd uint32 `binapi:"u32,name=mrd" json:"mrd,omitempty"`
+ Stop bool `binapi:"bool,name=stop" json:"stop,omitempty"`
+ MsgType Dhcpv6MsgType `binapi:"dhcpv6_msg_type,name=msg_type" json:"msg_type,omitempty"`
+ T1 uint32 `binapi:"u32,name=T1" json:"T1,omitempty"`
+ T2 uint32 `binapi:"u32,name=T2" json:"T2,omitempty"`
+ NPrefixes uint32 `binapi:"u32,name=n_prefixes" json:"-"`
+ Prefixes []DHCP6PdPrefixInfo `binapi:"dhcp6_pd_prefix_info[n_prefixes],name=prefixes" json:"prefixes,omitempty"`
+}
+
+func (m *DHCP6PdSendClientMessage) Reset() { *m = DHCP6PdSendClientMessage{} }
+func (*DHCP6PdSendClientMessage) GetMessageName() string { return "dhcp6_pd_send_client_message" }
+func (*DHCP6PdSendClientMessage) GetCrcString() string { return "064badb8" }
+func (*DHCP6PdSendClientMessage) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCP6PdSendClientMessage) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.ServerIndex
+ size += 4 // m.Irt
+ size += 4 // m.Mrt
+ size += 4 // m.Mrc
+ size += 4 // m.Mrd
+ size += 1 // m.Stop
+ size += 4 // m.MsgType
+ size += 4 // m.T1
+ size += 4 // m.T2
+ size += 4 // m.NPrefixes
+ for j1 := 0; j1 < len(m.Prefixes); j1++ {
+ var s1 DHCP6PdPrefixInfo
+ _ = s1
+ if j1 < len(m.Prefixes) {
+ s1 = m.Prefixes[j1]
+ }
+ size += 1 * 16 // s1.Prefix.Address
+ size += 1 // s1.Prefix.Len
+ size += 4 // s1.ValidTime
+ size += 4 // s1.PreferredTime
+ }
+ return size
+}
+func (m *DHCP6PdSendClientMessage) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ 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(m.T1)
+ buf.EncodeUint32(m.T2)
+ buf.EncodeUint32(uint32(len(m.Prefixes)))
+ for j0 := 0; j0 < len(m.Prefixes); j0++ {
+ var v0 DHCP6PdPrefixInfo // Prefixes
+ if j0 < len(m.Prefixes) {
+ v0 = m.Prefixes[j0]
+ }
+ buf.EncodeBytes(v0.Prefix.Address[:], 16)
+ buf.EncodeUint8(v0.Prefix.Len)
+ buf.EncodeUint32(v0.ValidTime)
+ buf.EncodeUint32(v0.PreferredTime)
+ }
+ return buf.Bytes(), nil
+}
+func (m *DHCP6PdSendClientMessage) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.ServerIndex = buf.DecodeUint32()
+ m.Irt = buf.DecodeUint32()
+ m.Mrt = buf.DecodeUint32()
+ m.Mrc = buf.DecodeUint32()
+ m.Mrd = buf.DecodeUint32()
+ m.Stop = buf.DecodeBool()
+ m.MsgType = Dhcpv6MsgType(buf.DecodeUint32())
+ m.T1 = buf.DecodeUint32()
+ m.T2 = buf.DecodeUint32()
+ m.NPrefixes = buf.DecodeUint32()
+ 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()
+ m.Prefixes[j0].ValidTime = buf.DecodeUint32()
+ m.Prefixes[j0].PreferredTime = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// DHCP6PdSendClientMessageReply defines message 'dhcp6_pd_send_client_message_reply'.
+type DHCP6PdSendClientMessageReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DHCP6PdSendClientMessageReply) Reset() { *m = DHCP6PdSendClientMessageReply{} }
+func (*DHCP6PdSendClientMessageReply) GetMessageName() string {
+ return "dhcp6_pd_send_client_message_reply"
+}
+func (*DHCP6PdSendClientMessageReply) GetCrcString() string { return "e8d4e804" }
+func (*DHCP6PdSendClientMessageReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCP6PdSendClientMessageReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DHCP6PdSendClientMessageReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DHCP6ReplyEvent defines message 'dhcp6_reply_event'.
+type DHCP6ReplyEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ ServerIndex uint32 `binapi:"u32,name=server_index" json:"server_index,omitempty"`
+ MsgType Dhcpv6MsgType `binapi:"dhcpv6_msg_type,name=msg_type" json:"msg_type,omitempty"`
+ T1 uint32 `binapi:"u32,name=T1" json:"T1,omitempty"`
+ T2 uint32 `binapi:"u32,name=T2" json:"T2,omitempty"`
+ InnerStatusCode uint16 `binapi:"u16,name=inner_status_code" json:"inner_status_code,omitempty"`
+ StatusCode uint16 `binapi:"u16,name=status_code" json:"status_code,omitempty"`
+ Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
+ NAddresses uint32 `binapi:"u32,name=n_addresses" json:"-"`
+ Addresses []DHCP6AddressInfo `binapi:"dhcp6_address_info[n_addresses],name=addresses" json:"addresses,omitempty"`
+}
+
+func (m *DHCP6ReplyEvent) Reset() { *m = DHCP6ReplyEvent{} }
+func (*DHCP6ReplyEvent) GetMessageName() string { return "dhcp6_reply_event" }
+func (*DHCP6ReplyEvent) GetCrcString() string { return "9f3af9e5" }
+func (*DHCP6ReplyEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *DHCP6ReplyEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.SwIfIndex
+ size += 4 // m.ServerIndex
+ size += 4 // m.MsgType
+ size += 4 // m.T1
+ size += 4 // m.T2
+ size += 2 // m.InnerStatusCode
+ size += 2 // m.StatusCode
+ size += 1 // m.Preference
+ size += 4 // m.NAddresses
+ for j1 := 0; j1 < len(m.Addresses); j1++ {
+ var s1 DHCP6AddressInfo
+ _ = s1
+ if j1 < len(m.Addresses) {
+ s1 = m.Addresses[j1]
+ }
+ size += 1 * 16 // s1.Address
+ size += 4 // s1.ValidTime
+ size += 4 // s1.PreferredTime
+ }
+ return size
+}
+func (m *DHCP6ReplyEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PID)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.ServerIndex)
+ buf.EncodeUint32(uint32(m.MsgType))
+ 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 // Addresses
+ if j0 < len(m.Addresses) {
+ v0 = m.Addresses[j0]
+ }
+ buf.EncodeBytes(v0.Address[:], 16)
+ buf.EncodeUint32(v0.ValidTime)
+ buf.EncodeUint32(v0.PreferredTime)
+ }
+ return buf.Bytes(), nil
+}
+func (m *DHCP6ReplyEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.ServerIndex = buf.DecodeUint32()
+ m.MsgType = Dhcpv6MsgType(buf.DecodeUint32())
+ m.T1 = buf.DecodeUint32()
+ m.T2 = buf.DecodeUint32()
+ m.InnerStatusCode = buf.DecodeUint16()
+ m.StatusCode = buf.DecodeUint16()
+ m.Preference = buf.DecodeUint8()
+ m.NAddresses = buf.DecodeUint32()
+ 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()
+ m.Addresses[j0].PreferredTime = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// DHCP6SendClientMessage defines message 'dhcp6_send_client_message'.
+type DHCP6SendClientMessage struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ ServerIndex uint32 `binapi:"u32,name=server_index" json:"server_index,omitempty"`
+ Irt uint32 `binapi:"u32,name=irt" json:"irt,omitempty"`
+ Mrt uint32 `binapi:"u32,name=mrt" json:"mrt,omitempty"`
+ Mrc uint32 `binapi:"u32,name=mrc" json:"mrc,omitempty"`
+ Mrd uint32 `binapi:"u32,name=mrd" json:"mrd,omitempty"`
+ Stop bool `binapi:"bool,name=stop" json:"stop,omitempty"`
+ MsgType Dhcpv6MsgType `binapi:"dhcpv6_msg_type,name=msg_type" json:"msg_type,omitempty"`
+ T1 uint32 `binapi:"u32,name=T1" json:"T1,omitempty"`
+ T2 uint32 `binapi:"u32,name=T2" json:"T2,omitempty"`
+ NAddresses uint32 `binapi:"u32,name=n_addresses" json:"-"`
+ Addresses []DHCP6AddressInfo `binapi:"dhcp6_address_info[n_addresses],name=addresses" json:"addresses,omitempty"`
+}
+
+func (m *DHCP6SendClientMessage) Reset() { *m = DHCP6SendClientMessage{} }
+func (*DHCP6SendClientMessage) GetMessageName() string { return "dhcp6_send_client_message" }
+func (*DHCP6SendClientMessage) GetCrcString() string { return "f6f14ef0" }
+func (*DHCP6SendClientMessage) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCP6SendClientMessage) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.ServerIndex
+ size += 4 // m.Irt
+ size += 4 // m.Mrt
+ size += 4 // m.Mrc
+ size += 4 // m.Mrd
+ size += 1 // m.Stop
+ size += 4 // m.MsgType
+ size += 4 // m.T1
+ size += 4 // m.T2
+ size += 4 // m.NAddresses
+ for j1 := 0; j1 < len(m.Addresses); j1++ {
+ var s1 DHCP6AddressInfo
+ _ = s1
+ if j1 < len(m.Addresses) {
+ s1 = m.Addresses[j1]
+ }
+ size += 1 * 16 // s1.Address
+ size += 4 // s1.ValidTime
+ size += 4 // s1.PreferredTime
+ }
+ return size
+}
+func (m *DHCP6SendClientMessage) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ 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(m.T1)
+ buf.EncodeUint32(m.T2)
+ buf.EncodeUint32(uint32(len(m.Addresses)))
+ for j0 := 0; j0 < len(m.Addresses); j0++ {
+ var v0 DHCP6AddressInfo // Addresses
+ if j0 < len(m.Addresses) {
+ v0 = m.Addresses[j0]
+ }
+ buf.EncodeBytes(v0.Address[:], 16)
+ buf.EncodeUint32(v0.ValidTime)
+ buf.EncodeUint32(v0.PreferredTime)
+ }
+ return buf.Bytes(), nil
+}
+func (m *DHCP6SendClientMessage) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.ServerIndex = buf.DecodeUint32()
+ m.Irt = buf.DecodeUint32()
+ m.Mrt = buf.DecodeUint32()
+ m.Mrc = buf.DecodeUint32()
+ m.Mrd = buf.DecodeUint32()
+ m.Stop = buf.DecodeBool()
+ m.MsgType = Dhcpv6MsgType(buf.DecodeUint32())
+ m.T1 = buf.DecodeUint32()
+ m.T2 = buf.DecodeUint32()
+ m.NAddresses = buf.DecodeUint32()
+ 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()
+ m.Addresses[j0].PreferredTime = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// DHCP6SendClientMessageReply defines message 'dhcp6_send_client_message_reply'.
+type DHCP6SendClientMessageReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DHCP6SendClientMessageReply) Reset() { *m = DHCP6SendClientMessageReply{} }
+func (*DHCP6SendClientMessageReply) GetMessageName() string { return "dhcp6_send_client_message_reply" }
+func (*DHCP6SendClientMessageReply) GetCrcString() string { return "e8d4e804" }
+func (*DHCP6SendClientMessageReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCP6SendClientMessageReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DHCP6SendClientMessageReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DHCPClientConfig defines message 'dhcp_client_config'.
+type DHCPClientConfig struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Client DHCPClient `binapi:"dhcp_client,name=client" json:"client,omitempty"`
+}
+
+func (m *DHCPClientConfig) Reset() { *m = DHCPClientConfig{} }
+func (*DHCPClientConfig) GetMessageName() string { return "dhcp_client_config" }
+func (*DHCPClientConfig) GetCrcString() string { return "959b80a3" }
+func (*DHCPClientConfig) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCPClientConfig) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Client.SwIfIndex
+ size += 64 // m.Client.Hostname
+ size += 1 * 64 // m.Client.ID
+ size += 1 // m.Client.WantDHCPEvent
+ size += 1 // m.Client.SetBroadcastFlag
+ size += 1 // m.Client.Dscp
+ size += 4 // m.Client.PID
+ return size
+}
+func (m *DHCPClientConfig) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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.EncodeBool(m.Client.WantDHCPEvent)
+ buf.EncodeBool(m.Client.SetBroadcastFlag)
+ buf.EncodeUint8(uint8(m.Client.Dscp))
+ buf.EncodeUint32(m.Client.PID)
+ return buf.Bytes(), nil
+}
+func (m *DHCPClientConfig) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Client.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Client.Hostname = buf.DecodeString(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 = IPDscp(buf.DecodeUint8())
+ m.Client.PID = buf.DecodeUint32()
+ return nil
+}
+
+// DHCPClientConfigReply defines message 'dhcp_client_config_reply'.
+type DHCPClientConfigReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DHCPClientConfigReply) Reset() { *m = DHCPClientConfigReply{} }
+func (*DHCPClientConfigReply) GetMessageName() string { return "dhcp_client_config_reply" }
+func (*DHCPClientConfigReply) GetCrcString() string { return "e8d4e804" }
+func (*DHCPClientConfigReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCPClientConfigReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DHCPClientConfigReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DHCPClientDetails defines message 'dhcp_client_details'.
+type DHCPClientDetails struct {
+ Client DHCPClient `binapi:"dhcp_client,name=client" json:"client,omitempty"`
+ Lease DHCPLease `binapi:"dhcp_lease,name=lease" json:"lease,omitempty"`
+}
+
+func (m *DHCPClientDetails) Reset() { *m = DHCPClientDetails{} }
+func (*DHCPClientDetails) GetMessageName() string { return "dhcp_client_details" }
+func (*DHCPClientDetails) GetCrcString() string { return "acd82f5a" }
+func (*DHCPClientDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCPClientDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Client.SwIfIndex
+ size += 64 // m.Client.Hostname
+ size += 1 * 64 // m.Client.ID
+ size += 1 // m.Client.WantDHCPEvent
+ size += 1 // m.Client.SetBroadcastFlag
+ size += 1 // m.Client.Dscp
+ size += 4 // m.Client.PID
+ size += 4 // m.Lease.SwIfIndex
+ size += 4 // m.Lease.State
+ size += 1 // m.Lease.IsIPv6
+ size += 64 // m.Lease.Hostname
+ size += 1 // m.Lease.MaskWidth
+ size += 4 // m.Lease.HostAddress.Af
+ size += 1 * 16 // m.Lease.HostAddress.Un
+ size += 4 // m.Lease.RouterAddress.Af
+ size += 1 * 16 // m.Lease.RouterAddress.Un
+ size += 1 * 6 // m.Lease.HostMac
+ size += 1 // m.Lease.Count
+ for j2 := 0; j2 < len(m.Lease.DomainServer); j2++ {
+ var s2 DomainServer
+ _ = s2
+ if j2 < len(m.Lease.DomainServer) {
+ s2 = m.Lease.DomainServer[j2]
+ }
+ size += 4 // s2.Address.Af
+ size += 1 * 16 // s2.Address.Un
+ }
+ return size
+}
+func (m *DHCPClientDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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.EncodeBool(m.Client.WantDHCPEvent)
+ buf.EncodeBool(m.Client.SetBroadcastFlag)
+ buf.EncodeUint8(uint8(m.Client.Dscp))
+ 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(m.Lease.MaskWidth)
+ buf.EncodeUint32(uint32(m.Lease.HostAddress.Af))
+ buf.EncodeBytes(m.Lease.HostAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Lease.RouterAddress.Af))
+ 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 // DomainServer
+ if j1 < len(m.Lease.DomainServer) {
+ v1 = m.Lease.DomainServer[j1]
+ }
+ buf.EncodeUint32(uint32(v1.Address.Af))
+ buf.EncodeBytes(v1.Address.Un.XXX_UnionData[:], 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *DHCPClientDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Client.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Client.Hostname = buf.DecodeString(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 = IPDscp(buf.DecodeUint8())
+ m.Client.PID = buf.DecodeUint32()
+ m.Lease.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Lease.State = DHCPClientState(buf.DecodeUint32())
+ m.Lease.IsIPv6 = buf.DecodeBool()
+ m.Lease.Hostname = buf.DecodeString(64)
+ m.Lease.MaskWidth = buf.DecodeUint8()
+ m.Lease.HostAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Lease.HostAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Lease.RouterAddress.Af = AddressFamily(buf.DecodeUint32())
+ 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, m.Lease.Count)
+ for j1 := 0; j1 < len(m.Lease.DomainServer); j1++ {
+ m.Lease.DomainServer[j1].Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Lease.DomainServer[j1].Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ }
+ return nil
+}
+
+// DHCPClientDump defines message 'dhcp_client_dump'.
+type DHCPClientDump struct{}
+
+func (m *DHCPClientDump) Reset() { *m = DHCPClientDump{} }
+func (*DHCPClientDump) GetMessageName() string { return "dhcp_client_dump" }
+func (*DHCPClientDump) GetCrcString() string { return "51077d14" }
+func (*DHCPClientDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCPClientDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *DHCPClientDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *DHCPClientDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// DHCPComplEvent defines message 'dhcp_compl_event'.
+type DHCPComplEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ Lease DHCPLease `binapi:"dhcp_lease,name=lease" json:"lease,omitempty"`
+}
+
+func (m *DHCPComplEvent) Reset() { *m = DHCPComplEvent{} }
+func (*DHCPComplEvent) GetMessageName() string { return "dhcp_compl_event" }
+func (*DHCPComplEvent) GetCrcString() string { return "e908fd1d" }
+func (*DHCPComplEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *DHCPComplEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.Lease.SwIfIndex
+ size += 4 // m.Lease.State
+ size += 1 // m.Lease.IsIPv6
+ size += 64 // m.Lease.Hostname
+ size += 1 // m.Lease.MaskWidth
+ size += 4 // m.Lease.HostAddress.Af
+ size += 1 * 16 // m.Lease.HostAddress.Un
+ size += 4 // m.Lease.RouterAddress.Af
+ size += 1 * 16 // m.Lease.RouterAddress.Un
+ size += 1 * 6 // m.Lease.HostMac
+ size += 1 // m.Lease.Count
+ for j2 := 0; j2 < len(m.Lease.DomainServer); j2++ {
+ var s2 DomainServer
+ _ = s2
+ if j2 < len(m.Lease.DomainServer) {
+ s2 = m.Lease.DomainServer[j2]
+ }
+ size += 4 // s2.Address.Af
+ size += 1 * 16 // s2.Address.Un
+ }
+ return size
+}
+func (m *DHCPComplEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(m.Lease.MaskWidth)
+ buf.EncodeUint32(uint32(m.Lease.HostAddress.Af))
+ buf.EncodeBytes(m.Lease.HostAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Lease.RouterAddress.Af))
+ 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 // DomainServer
+ if j1 < len(m.Lease.DomainServer) {
+ v1 = m.Lease.DomainServer[j1]
+ }
+ buf.EncodeUint32(uint32(v1.Address.Af))
+ buf.EncodeBytes(v1.Address.Un.XXX_UnionData[:], 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *DHCPComplEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.Lease.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Lease.State = DHCPClientState(buf.DecodeUint32())
+ m.Lease.IsIPv6 = buf.DecodeBool()
+ m.Lease.Hostname = buf.DecodeString(64)
+ m.Lease.MaskWidth = buf.DecodeUint8()
+ m.Lease.HostAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Lease.HostAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Lease.RouterAddress.Af = AddressFamily(buf.DecodeUint32())
+ 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, m.Lease.Count)
+ for j1 := 0; j1 < len(m.Lease.DomainServer); j1++ {
+ m.Lease.DomainServer[j1].Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Lease.DomainServer[j1].Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ }
+ return nil
+}
+
+// DHCPPluginControlPing defines message 'dhcp_plugin_control_ping'.
+type DHCPPluginControlPing struct{}
+
+func (m *DHCPPluginControlPing) Reset() { *m = DHCPPluginControlPing{} }
+func (*DHCPPluginControlPing) GetMessageName() string { return "dhcp_plugin_control_ping" }
+func (*DHCPPluginControlPing) GetCrcString() string { return "51077d14" }
+func (*DHCPPluginControlPing) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCPPluginControlPing) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *DHCPPluginControlPing) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *DHCPPluginControlPing) Unmarshal(b []byte) error {
+ return nil
+}
+
+// DHCPPluginControlPingReply defines message 'dhcp_plugin_control_ping_reply'.
+type DHCPPluginControlPingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ ClientIndex uint32 `binapi:"u32,name=client_index" json:"client_index,omitempty"`
+ VpePID uint32 `binapi:"u32,name=vpe_pid" json:"vpe_pid,omitempty"`
+}
+
+func (m *DHCPPluginControlPingReply) Reset() { *m = DHCPPluginControlPingReply{} }
+func (*DHCPPluginControlPingReply) GetMessageName() string { return "dhcp_plugin_control_ping_reply" }
+func (*DHCPPluginControlPingReply) GetCrcString() string { return "f6b0b8ca" }
+func (*DHCPPluginControlPingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCPPluginControlPingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.ClientIndex
+ size += 4 // m.VpePID
+ return size
+}
+func (m *DHCPPluginControlPingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.ClientIndex = buf.DecodeUint32()
+ m.VpePID = buf.DecodeUint32()
+ return nil
+}
+
+// DHCPPluginGetVersion defines message 'dhcp_plugin_get_version'.
+type DHCPPluginGetVersion struct{}
+
+func (m *DHCPPluginGetVersion) Reset() { *m = DHCPPluginGetVersion{} }
+func (*DHCPPluginGetVersion) GetMessageName() string { return "dhcp_plugin_get_version" }
+func (*DHCPPluginGetVersion) GetCrcString() string { return "51077d14" }
+func (*DHCPPluginGetVersion) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCPPluginGetVersion) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *DHCPPluginGetVersion) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *DHCPPluginGetVersion) Unmarshal(b []byte) error {
+ return nil
+}
+
+// DHCPPluginGetVersionReply defines message 'dhcp_plugin_get_version_reply'.
+type DHCPPluginGetVersionReply struct {
+ Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
+ Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
+}
+
+func (m *DHCPPluginGetVersionReply) Reset() { *m = DHCPPluginGetVersionReply{} }
+func (*DHCPPluginGetVersionReply) GetMessageName() string { return "dhcp_plugin_get_version_reply" }
+func (*DHCPPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
+func (*DHCPPluginGetVersionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCPPluginGetVersionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Major
+ size += 4 // m.Minor
+ return size
+}
+func (m *DHCPPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Major)
+ buf.EncodeUint32(m.Minor)
+ return buf.Bytes(), nil
+}
+func (m *DHCPPluginGetVersionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Major = buf.DecodeUint32()
+ m.Minor = buf.DecodeUint32()
+ return nil
+}
+
+// DHCPProxyConfig defines message 'dhcp_proxy_config'.
+type DHCPProxyConfig struct {
+ RxVrfID uint32 `binapi:"u32,name=rx_vrf_id" json:"rx_vrf_id,omitempty"`
+ ServerVrfID uint32 `binapi:"u32,name=server_vrf_id" json:"server_vrf_id,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ DHCPServer Address `binapi:"address,name=dhcp_server" json:"dhcp_server,omitempty"`
+ DHCPSrcAddress Address `binapi:"address,name=dhcp_src_address" json:"dhcp_src_address,omitempty"`
+}
+
+func (m *DHCPProxyConfig) Reset() { *m = DHCPProxyConfig{} }
+func (*DHCPProxyConfig) GetMessageName() string { return "dhcp_proxy_config" }
+func (*DHCPProxyConfig) GetCrcString() string { return "6767230e" }
+func (*DHCPProxyConfig) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCPProxyConfig) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.RxVrfID
+ size += 4 // m.ServerVrfID
+ size += 1 // m.IsAdd
+ size += 4 // m.DHCPServer.Af
+ size += 1 * 16 // m.DHCPServer.Un
+ size += 4 // m.DHCPSrcAddress.Af
+ size += 1 * 16 // m.DHCPSrcAddress.Un
+ return size
+}
+func (m *DHCPProxyConfig) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.RxVrfID)
+ buf.EncodeUint32(m.ServerVrfID)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.DHCPServer.Af))
+ buf.EncodeBytes(m.DHCPServer.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.DHCPSrcAddress.Af))
+ buf.EncodeBytes(m.DHCPSrcAddress.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *DHCPProxyConfig) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.RxVrfID = buf.DecodeUint32()
+ m.ServerVrfID = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ m.DHCPServer.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.DHCPServer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DHCPSrcAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.DHCPSrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// DHCPProxyConfigReply defines message 'dhcp_proxy_config_reply'.
+type DHCPProxyConfigReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DHCPProxyConfigReply) Reset() { *m = DHCPProxyConfigReply{} }
+func (*DHCPProxyConfigReply) GetMessageName() string { return "dhcp_proxy_config_reply" }
+func (*DHCPProxyConfigReply) GetCrcString() string { return "e8d4e804" }
+func (*DHCPProxyConfigReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCPProxyConfigReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DHCPProxyConfigReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DHCPProxyDetails defines message 'dhcp_proxy_details'.
+type DHCPProxyDetails struct {
+ RxVrfID uint32 `binapi:"u32,name=rx_vrf_id" json:"rx_vrf_id,omitempty"`
+ VssOui uint32 `binapi:"u32,name=vss_oui" json:"vss_oui,omitempty"`
+ VssFibID uint32 `binapi:"u32,name=vss_fib_id" json:"vss_fib_id,omitempty"`
+ VssType VssType `binapi:"vss_type,name=vss_type" json:"vss_type,omitempty"`
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+ VssVPNAsciiID string `binapi:"string[129],name=vss_vpn_ascii_id" json:"vss_vpn_ascii_id,omitempty"`
+ DHCPSrcAddress Address `binapi:"address,name=dhcp_src_address" json:"dhcp_src_address,omitempty"`
+ Count uint8 `binapi:"u8,name=count" json:"-"`
+ Servers []DHCPServer `binapi:"dhcp_server[count],name=servers" json:"servers,omitempty"`
+}
+
+func (m *DHCPProxyDetails) Reset() { *m = DHCPProxyDetails{} }
+func (*DHCPProxyDetails) GetMessageName() string { return "dhcp_proxy_details" }
+func (*DHCPProxyDetails) GetCrcString() string { return "ce16f044" }
+func (*DHCPProxyDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCPProxyDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.RxVrfID
+ size += 4 // m.VssOui
+ size += 4 // m.VssFibID
+ size += 4 // m.VssType
+ size += 1 // m.IsIPv6
+ size += 129 // m.VssVPNAsciiID
+ size += 4 // m.DHCPSrcAddress.Af
+ size += 1 * 16 // m.DHCPSrcAddress.Un
+ size += 1 // m.Count
+ for j1 := 0; j1 < len(m.Servers); j1++ {
+ var s1 DHCPServer
+ _ = s1
+ if j1 < len(m.Servers) {
+ s1 = m.Servers[j1]
+ }
+ size += 4 // s1.ServerVrfID
+ size += 4 // s1.DHCPServer.Af
+ size += 1 * 16 // s1.DHCPServer.Un
+ }
+ return size
+}
+func (m *DHCPProxyDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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.EncodeUint32(uint32(m.DHCPSrcAddress.Af))
+ 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 // Servers
+ if j0 < len(m.Servers) {
+ v0 = m.Servers[j0]
+ }
+ buf.EncodeUint32(v0.ServerVrfID)
+ buf.EncodeUint32(uint32(v0.DHCPServer.Af))
+ buf.EncodeBytes(v0.DHCPServer.Un.XXX_UnionData[:], 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *DHCPProxyDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.RxVrfID = buf.DecodeUint32()
+ m.VssOui = buf.DecodeUint32()
+ m.VssFibID = buf.DecodeUint32()
+ m.VssType = VssType(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
+ m.VssVPNAsciiID = buf.DecodeString(129)
+ m.DHCPSrcAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.DHCPSrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Count = buf.DecodeUint8()
+ 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 = AddressFamily(buf.DecodeUint32())
+ copy(m.Servers[j0].DHCPServer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ }
+ return nil
+}
+
+// DHCPProxyDump defines message 'dhcp_proxy_dump'.
+type DHCPProxyDump struct {
+ IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
+}
+
+func (m *DHCPProxyDump) Reset() { *m = DHCPProxyDump{} }
+func (*DHCPProxyDump) GetMessageName() string { return "dhcp_proxy_dump" }
+func (*DHCPProxyDump) GetCrcString() string { return "5c5b063f" }
+func (*DHCPProxyDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCPProxyDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIP6
+ return size
+}
+func (m *DHCPProxyDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsIP6)
+ return buf.Bytes(), nil
+}
+func (m *DHCPProxyDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIP6 = buf.DecodeBool()
+ return nil
+}
+
+// DHCPProxySetVss defines message 'dhcp_proxy_set_vss'.
+type DHCPProxySetVss struct {
+ TblID uint32 `binapi:"u32,name=tbl_id" json:"tbl_id,omitempty"`
+ VssType VssType `binapi:"vss_type,name=vss_type" json:"vss_type,omitempty"`
+ VPNAsciiID string `binapi:"string[129],name=vpn_ascii_id" json:"vpn_ascii_id,omitempty"`
+ Oui uint32 `binapi:"u32,name=oui" json:"oui,omitempty"`
+ VPNIndex uint32 `binapi:"u32,name=vpn_index" json:"vpn_index,omitempty"`
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *DHCPProxySetVss) Reset() { *m = DHCPProxySetVss{} }
+func (*DHCPProxySetVss) GetMessageName() string { return "dhcp_proxy_set_vss" }
+func (*DHCPProxySetVss) GetCrcString() string { return "50537301" }
+func (*DHCPProxySetVss) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCPProxySetVss) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.TblID
+ size += 4 // m.VssType
+ size += 129 // m.VPNAsciiID
+ size += 4 // m.Oui
+ size += 4 // m.VPNIndex
+ size += 1 // m.IsIPv6
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *DHCPProxySetVss) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.TblID)
+ buf.EncodeUint32(uint32(m.VssType))
+ buf.EncodeString(m.VPNAsciiID, 129)
+ buf.EncodeUint32(m.Oui)
+ buf.EncodeUint32(m.VPNIndex)
+ buf.EncodeBool(m.IsIPv6)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *DHCPProxySetVss) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TblID = buf.DecodeUint32()
+ m.VssType = VssType(buf.DecodeUint32())
+ m.VPNAsciiID = buf.DecodeString(129)
+ m.Oui = buf.DecodeUint32()
+ m.VPNIndex = buf.DecodeUint32()
+ m.IsIPv6 = buf.DecodeBool()
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// DHCPProxySetVssReply defines message 'dhcp_proxy_set_vss_reply'.
+type DHCPProxySetVssReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DHCPProxySetVssReply) Reset() { *m = DHCPProxySetVssReply{} }
+func (*DHCPProxySetVssReply) GetMessageName() string { return "dhcp_proxy_set_vss_reply" }
+func (*DHCPProxySetVssReply) GetCrcString() string { return "e8d4e804" }
+func (*DHCPProxySetVssReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCPProxySetVssReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DHCPProxySetVssReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// WantDHCP6PdReplyEvents defines message 'want_dhcp6_pd_reply_events'.
+type WantDHCP6PdReplyEvents struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *WantDHCP6PdReplyEvents) Reset() { *m = WantDHCP6PdReplyEvents{} }
+func (*WantDHCP6PdReplyEvents) GetMessageName() string { return "want_dhcp6_pd_reply_events" }
+func (*WantDHCP6PdReplyEvents) GetCrcString() string { return "c5e2af94" }
+func (*WantDHCP6PdReplyEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantDHCP6PdReplyEvents) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ size += 4 // m.PID
+ return size
+}
+func (m *WantDHCP6PdReplyEvents) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeUint32(m.PID)
+ return buf.Bytes(), nil
+}
+func (m *WantDHCP6PdReplyEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// WantDHCP6PdReplyEventsReply defines message 'want_dhcp6_pd_reply_events_reply'.
+type WantDHCP6PdReplyEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantDHCP6PdReplyEventsReply) Reset() { *m = WantDHCP6PdReplyEventsReply{} }
+func (*WantDHCP6PdReplyEventsReply) GetMessageName() string {
+ return "want_dhcp6_pd_reply_events_reply"
+}
+func (*WantDHCP6PdReplyEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantDHCP6PdReplyEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantDHCP6PdReplyEventsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantDHCP6PdReplyEventsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// WantDHCP6ReplyEvents defines message 'want_dhcp6_reply_events'.
+type WantDHCP6ReplyEvents struct {
+ EnableDisable uint8 `binapi:"u8,name=enable_disable" json:"enable_disable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *WantDHCP6ReplyEvents) Reset() { *m = WantDHCP6ReplyEvents{} }
+func (*WantDHCP6ReplyEvents) GetMessageName() string { return "want_dhcp6_reply_events" }
+func (*WantDHCP6ReplyEvents) GetCrcString() string { return "05b454b5" }
+func (*WantDHCP6ReplyEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantDHCP6ReplyEvents) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ size += 4 // m.PID
+ return size
+}
+func (m *WantDHCP6ReplyEvents) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.EnableDisable)
+ buf.EncodeUint32(m.PID)
+ return buf.Bytes(), nil
+}
+func (m *WantDHCP6ReplyEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeUint8()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// WantDHCP6ReplyEventsReply defines message 'want_dhcp6_reply_events_reply'.
+type WantDHCP6ReplyEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantDHCP6ReplyEventsReply) Reset() { *m = WantDHCP6ReplyEventsReply{} }
+func (*WantDHCP6ReplyEventsReply) GetMessageName() string { return "want_dhcp6_reply_events_reply" }
+func (*WantDHCP6ReplyEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantDHCP6ReplyEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantDHCP6ReplyEventsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantDHCP6ReplyEventsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_dhcp_binapi_init() }
+func file_dhcp_binapi_init() {
+ api.RegisterMessage((*DHCP6ClientsEnableDisable)(nil), "dhcp6_clients_enable_disable_b3e225d2")
+ api.RegisterMessage((*DHCP6ClientsEnableDisableReply)(nil), "dhcp6_clients_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*DHCP6DuidLlSet)(nil), "dhcp6_duid_ll_set_0f6ca323")
+ api.RegisterMessage((*DHCP6DuidLlSetReply)(nil), "dhcp6_duid_ll_set_reply_e8d4e804")
+ api.RegisterMessage((*DHCP6PdReplyEvent)(nil), "dhcp6_pd_reply_event_cb3e462b")
+ api.RegisterMessage((*DHCP6PdSendClientMessage)(nil), "dhcp6_pd_send_client_message_064badb8")
+ api.RegisterMessage((*DHCP6PdSendClientMessageReply)(nil), "dhcp6_pd_send_client_message_reply_e8d4e804")
+ api.RegisterMessage((*DHCP6ReplyEvent)(nil), "dhcp6_reply_event_9f3af9e5")
+ api.RegisterMessage((*DHCP6SendClientMessage)(nil), "dhcp6_send_client_message_f6f14ef0")
+ api.RegisterMessage((*DHCP6SendClientMessageReply)(nil), "dhcp6_send_client_message_reply_e8d4e804")
+ api.RegisterMessage((*DHCPClientConfig)(nil), "dhcp_client_config_959b80a3")
+ api.RegisterMessage((*DHCPClientConfigReply)(nil), "dhcp_client_config_reply_e8d4e804")
+ api.RegisterMessage((*DHCPClientDetails)(nil), "dhcp_client_details_acd82f5a")
+ api.RegisterMessage((*DHCPClientDump)(nil), "dhcp_client_dump_51077d14")
+ api.RegisterMessage((*DHCPComplEvent)(nil), "dhcp_compl_event_e908fd1d")
+ api.RegisterMessage((*DHCPPluginControlPing)(nil), "dhcp_plugin_control_ping_51077d14")
+ api.RegisterMessage((*DHCPPluginControlPingReply)(nil), "dhcp_plugin_control_ping_reply_f6b0b8ca")
+ api.RegisterMessage((*DHCPPluginGetVersion)(nil), "dhcp_plugin_get_version_51077d14")
+ api.RegisterMessage((*DHCPPluginGetVersionReply)(nil), "dhcp_plugin_get_version_reply_9b32cf86")
+ api.RegisterMessage((*DHCPProxyConfig)(nil), "dhcp_proxy_config_6767230e")
+ api.RegisterMessage((*DHCPProxyConfigReply)(nil), "dhcp_proxy_config_reply_e8d4e804")
+ api.RegisterMessage((*DHCPProxyDetails)(nil), "dhcp_proxy_details_ce16f044")
+ api.RegisterMessage((*DHCPProxyDump)(nil), "dhcp_proxy_dump_5c5b063f")
+ api.RegisterMessage((*DHCPProxySetVss)(nil), "dhcp_proxy_set_vss_50537301")
+ api.RegisterMessage((*DHCPProxySetVssReply)(nil), "dhcp_proxy_set_vss_reply_e8d4e804")
+ api.RegisterMessage((*WantDHCP6PdReplyEvents)(nil), "want_dhcp6_pd_reply_events_c5e2af94")
+ api.RegisterMessage((*WantDHCP6PdReplyEventsReply)(nil), "want_dhcp6_pd_reply_events_reply_e8d4e804")
+ api.RegisterMessage((*WantDHCP6ReplyEvents)(nil), "want_dhcp6_reply_events_05b454b5")
+ api.RegisterMessage((*WantDHCP6ReplyEventsReply)(nil), "want_dhcp6_reply_events_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*DHCP6ClientsEnableDisable)(nil),
+ (*DHCP6ClientsEnableDisableReply)(nil),
+ (*DHCP6DuidLlSet)(nil),
+ (*DHCP6DuidLlSetReply)(nil),
+ (*DHCP6PdReplyEvent)(nil),
+ (*DHCP6PdSendClientMessage)(nil),
+ (*DHCP6PdSendClientMessageReply)(nil),
+ (*DHCP6ReplyEvent)(nil),
+ (*DHCP6SendClientMessage)(nil),
+ (*DHCP6SendClientMessageReply)(nil),
+ (*DHCPClientConfig)(nil),
+ (*DHCPClientConfigReply)(nil),
+ (*DHCPClientDetails)(nil),
+ (*DHCPClientDump)(nil),
+ (*DHCPComplEvent)(nil),
+ (*DHCPPluginControlPing)(nil),
+ (*DHCPPluginControlPingReply)(nil),
+ (*DHCPPluginGetVersion)(nil),
+ (*DHCPPluginGetVersionReply)(nil),
+ (*DHCPProxyConfig)(nil),
+ (*DHCPProxyConfigReply)(nil),
+ (*DHCPProxyDetails)(nil),
+ (*DHCPProxyDump)(nil),
+ (*DHCPProxySetVss)(nil),
+ (*DHCPProxySetVssReply)(nil),
+ (*WantDHCP6PdReplyEvents)(nil),
+ (*WantDHCP6PdReplyEventsReply)(nil),
+ (*WantDHCP6ReplyEvents)(nil),
+ (*WantDHCP6ReplyEventsReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/dhcp/dhcp_rpc.ba.go b/internal/testbinapi/binapi2001/dhcp/dhcp_rpc.ba.go
new file mode 100644
index 0000000..ae59820
--- /dev/null
+++ b/internal/testbinapi/binapi2001/dhcp/dhcp_rpc.ba.go
@@ -0,0 +1,213 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package dhcp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service dhcp.
+type RPCService interface {
+ DHCP6ClientsEnableDisable(ctx context.Context, in *DHCP6ClientsEnableDisable) (*DHCP6ClientsEnableDisableReply, error)
+ DHCP6DuidLlSet(ctx context.Context, in *DHCP6DuidLlSet) (*DHCP6DuidLlSetReply, error)
+ DHCP6PdSendClientMessage(ctx context.Context, in *DHCP6PdSendClientMessage) (*DHCP6PdSendClientMessageReply, error)
+ DHCP6SendClientMessage(ctx context.Context, in *DHCP6SendClientMessage) (*DHCP6SendClientMessageReply, error)
+ DHCPClientConfig(ctx context.Context, in *DHCPClientConfig) (*DHCPClientConfigReply, error)
+ DHCPClientDump(ctx context.Context, in *DHCPClientDump) (RPCService_DHCPClientDumpClient, error)
+ DHCPPluginControlPing(ctx context.Context, in *DHCPPluginControlPing) (*DHCPPluginControlPingReply, error)
+ DHCPPluginGetVersion(ctx context.Context, in *DHCPPluginGetVersion) (*DHCPPluginGetVersionReply, error)
+ DHCPProxyConfig(ctx context.Context, in *DHCPProxyConfig) (*DHCPProxyConfigReply, error)
+ DHCPProxyDump(ctx context.Context, in *DHCPProxyDump) (RPCService_DHCPProxyDumpClient, error)
+ DHCPProxySetVss(ctx context.Context, in *DHCPProxySetVss) (*DHCPProxySetVssReply, error)
+ WantDHCP6PdReplyEvents(ctx context.Context, in *WantDHCP6PdReplyEvents) (*WantDHCP6PdReplyEventsReply, error)
+ WantDHCP6ReplyEvents(ctx context.Context, in *WantDHCP6ReplyEvents) (*WantDHCP6ReplyEventsReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) DHCP6ClientsEnableDisable(ctx context.Context, in *DHCP6ClientsEnableDisable) (*DHCP6ClientsEnableDisableReply, error) {
+ out := new(DHCP6ClientsEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DHCP6DuidLlSet(ctx context.Context, in *DHCP6DuidLlSet) (*DHCP6DuidLlSetReply, error) {
+ out := new(DHCP6DuidLlSetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DHCP6PdSendClientMessage(ctx context.Context, in *DHCP6PdSendClientMessage) (*DHCP6PdSendClientMessageReply, error) {
+ out := new(DHCP6PdSendClientMessageReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DHCP6SendClientMessage(ctx context.Context, in *DHCP6SendClientMessage) (*DHCP6SendClientMessageReply, error) {
+ out := new(DHCP6SendClientMessageReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DHCPClientConfig(ctx context.Context, in *DHCPClientConfig) (*DHCPClientConfigReply, error) {
+ out := new(DHCPClientConfigReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DHCPClientDump(ctx context.Context, in *DHCPClientDump) (RPCService_DHCPClientDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_DHCPClientDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_DHCPClientDumpClient interface {
+ Recv() (*DHCPClientDetails, error)
+ api.Stream
+}
+
+type serviceClient_DHCPClientDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_DHCPClientDumpClient) Recv() (*DHCPClientDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *DHCPClientDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) DHCPPluginControlPing(ctx context.Context, in *DHCPPluginControlPing) (*DHCPPluginControlPingReply, error) {
+ out := new(DHCPPluginControlPingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DHCPPluginGetVersion(ctx context.Context, in *DHCPPluginGetVersion) (*DHCPPluginGetVersionReply, error) {
+ out := new(DHCPPluginGetVersionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DHCPProxyConfig(ctx context.Context, in *DHCPProxyConfig) (*DHCPProxyConfigReply, error) {
+ out := new(DHCPProxyConfigReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DHCPProxyDump(ctx context.Context, in *DHCPProxyDump) (RPCService_DHCPProxyDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_DHCPProxyDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_DHCPProxyDumpClient interface {
+ Recv() (*DHCPProxyDetails, error)
+ api.Stream
+}
+
+type serviceClient_DHCPProxyDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_DHCPProxyDumpClient) Recv() (*DHCPProxyDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *DHCPProxyDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) DHCPProxySetVss(ctx context.Context, in *DHCPProxySetVss) (*DHCPProxySetVssReply, error) {
+ out := new(DHCPProxySetVssReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) WantDHCP6PdReplyEvents(ctx context.Context, in *WantDHCP6PdReplyEvents) (*WantDHCP6PdReplyEventsReply, error) {
+ out := new(WantDHCP6PdReplyEventsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) WantDHCP6ReplyEvents(ctx context.Context, in *WantDHCP6ReplyEvents) (*WantDHCP6ReplyEventsReply, error) {
+ out := new(WantDHCP6ReplyEventsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go b/internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go
new file mode 100644
index 0000000..12059b2
--- /dev/null
+++ b/internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go
@@ -0,0 +1,372 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/dhcp6_ia_na_client_cp.api.json
+
+// Package dhcp6_ia_na_client_cp contains generated bindings for API file dhcp6_ia_na_client_cp.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 2 messages
+//
+package dhcp6_ia_na_client_cp
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "dhcp6_ia_na_client_cp"
+ APIVersion = "1.0.1"
+ VersionCrc = 0x541d3edd
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// DHCP6ClientEnableDisable defines message 'dhcp6_client_enable_disable'.
+type DHCP6ClientEnableDisable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *DHCP6ClientEnableDisable) Reset() { *m = DHCP6ClientEnableDisable{} }
+func (*DHCP6ClientEnableDisable) GetMessageName() string { return "dhcp6_client_enable_disable" }
+func (*DHCP6ClientEnableDisable) GetCrcString() string { return "ae6cfcfb" }
+func (*DHCP6ClientEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCP6ClientEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
+ return size
+}
+func (m *DHCP6ClientEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *DHCP6ClientEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// DHCP6ClientEnableDisableReply defines message 'dhcp6_client_enable_disable_reply'.
+type DHCP6ClientEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DHCP6ClientEnableDisableReply) Reset() { *m = DHCP6ClientEnableDisableReply{} }
+func (*DHCP6ClientEnableDisableReply) GetMessageName() string {
+ return "dhcp6_client_enable_disable_reply"
+}
+func (*DHCP6ClientEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*DHCP6ClientEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCP6ClientEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DHCP6ClientEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_dhcp6_ia_na_client_cp_binapi_init() }
+func file_dhcp6_ia_na_client_cp_binapi_init() {
+ api.RegisterMessage((*DHCP6ClientEnableDisable)(nil), "dhcp6_client_enable_disable_ae6cfcfb")
+ api.RegisterMessage((*DHCP6ClientEnableDisableReply)(nil), "dhcp6_client_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*DHCP6ClientEnableDisable)(nil),
+ (*DHCP6ClientEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp_rpc.ba.go b/internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp_rpc.ba.go
new file mode 100644
index 0000000..b975236
--- /dev/null
+++ b/internal/testbinapi/binapi2001/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package dhcp6_ia_na_client_cp
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service dhcp6_ia_na_client_cp.
+type RPCService interface {
+ DHCP6ClientEnableDisable(ctx context.Context, in *DHCP6ClientEnableDisable) (*DHCP6ClientEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) DHCP6ClientEnableDisable(ctx context.Context, in *DHCP6ClientEnableDisable) (*DHCP6ClientEnableDisableReply, error) {
+ out := new(DHCP6ClientEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go b/internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go
new file mode 100644
index 0000000..9f9ba1d
--- /dev/null
+++ b/internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go
@@ -0,0 +1,1029 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/dhcp6_pd_client_cp.api.json
+
+// Package dhcp6_pd_client_cp contains generated bindings for API file dhcp6_pd_client_cp.api.
+//
+// Contents:
+// 6 aliases
+// 10 enums
+// 6 structs
+// 1 union
+// 4 messages
+//
+package dhcp6_pd_client_cp
+
+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 = "dhcp6_pd_client_cp"
+ APIVersion = "2.0.0"
+ VersionCrc = 0xb44ae848
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// DHCP6PdClientEnableDisable defines message 'dhcp6_pd_client_enable_disable'.
+type DHCP6PdClientEnableDisable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ PrefixGroup string `binapi:"string[64],name=prefix_group" json:"prefix_group,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *DHCP6PdClientEnableDisable) Reset() { *m = DHCP6PdClientEnableDisable{} }
+func (*DHCP6PdClientEnableDisable) GetMessageName() string { return "dhcp6_pd_client_enable_disable" }
+func (*DHCP6PdClientEnableDisable) GetCrcString() string { return "a75a0772" }
+func (*DHCP6PdClientEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DHCP6PdClientEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 64 // m.PrefixGroup
+ size += 1 // m.Enable
+ return size
+}
+func (m *DHCP6PdClientEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeString(m.PrefixGroup, 64)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *DHCP6PdClientEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.PrefixGroup = buf.DecodeString(64)
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// DHCP6PdClientEnableDisableReply defines message 'dhcp6_pd_client_enable_disable_reply'.
+type DHCP6PdClientEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DHCP6PdClientEnableDisableReply) Reset() { *m = DHCP6PdClientEnableDisableReply{} }
+func (*DHCP6PdClientEnableDisableReply) GetMessageName() string {
+ return "dhcp6_pd_client_enable_disable_reply"
+}
+func (*DHCP6PdClientEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*DHCP6PdClientEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DHCP6PdClientEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DHCP6PdClientEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IP6AddDelAddressUsingPrefix defines message 'ip6_add_del_address_using_prefix'.
+type IP6AddDelAddressUsingPrefix struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ PrefixGroup string `binapi:"string[64],name=prefix_group" json:"prefix_group,omitempty"`
+ AddressWithPrefix IP6AddressWithPrefix `binapi:"ip6_address_with_prefix,name=address_with_prefix" json:"address_with_prefix,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *IP6AddDelAddressUsingPrefix) Reset() { *m = IP6AddDelAddressUsingPrefix{} }
+func (*IP6AddDelAddressUsingPrefix) GetMessageName() string {
+ return "ip6_add_del_address_using_prefix"
+}
+func (*IP6AddDelAddressUsingPrefix) GetCrcString() string { return "9b3d11e0" }
+func (*IP6AddDelAddressUsingPrefix) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IP6AddDelAddressUsingPrefix) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 64 // m.PrefixGroup
+ size += 1 * 16 // m.AddressWithPrefix.Address
+ size += 1 // m.AddressWithPrefix.Len
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *IP6AddDelAddressUsingPrefix) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(m.AddressWithPrefix.Len)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *IP6AddDelAddressUsingPrefix) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.PrefixGroup = buf.DecodeString(64)
+ copy(m.AddressWithPrefix.Address[:], buf.DecodeBytes(16))
+ m.AddressWithPrefix.Len = buf.DecodeUint8()
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// IP6AddDelAddressUsingPrefixReply defines message 'ip6_add_del_address_using_prefix_reply'.
+type IP6AddDelAddressUsingPrefixReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IP6AddDelAddressUsingPrefixReply) Reset() { *m = IP6AddDelAddressUsingPrefixReply{} }
+func (*IP6AddDelAddressUsingPrefixReply) GetMessageName() string {
+ return "ip6_add_del_address_using_prefix_reply"
+}
+func (*IP6AddDelAddressUsingPrefixReply) GetCrcString() string { return "e8d4e804" }
+func (*IP6AddDelAddressUsingPrefixReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IP6AddDelAddressUsingPrefixReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IP6AddDelAddressUsingPrefixReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_dhcp6_pd_client_cp_binapi_init() }
+func file_dhcp6_pd_client_cp_binapi_init() {
+ api.RegisterMessage((*DHCP6PdClientEnableDisable)(nil), "dhcp6_pd_client_enable_disable_a75a0772")
+ api.RegisterMessage((*DHCP6PdClientEnableDisableReply)(nil), "dhcp6_pd_client_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*IP6AddDelAddressUsingPrefix)(nil), "ip6_add_del_address_using_prefix_9b3d11e0")
+ api.RegisterMessage((*IP6AddDelAddressUsingPrefixReply)(nil), "ip6_add_del_address_using_prefix_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*DHCP6PdClientEnableDisable)(nil),
+ (*DHCP6PdClientEnableDisableReply)(nil),
+ (*IP6AddDelAddressUsingPrefix)(nil),
+ (*IP6AddDelAddressUsingPrefixReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp_rpc.ba.go b/internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp_rpc.ba.go
new file mode 100644
index 0000000..7199e5a
--- /dev/null
+++ b/internal/testbinapi/binapi2001/dhcp6_pd_client_cp/dhcp6_pd_client_cp_rpc.ba.go
@@ -0,0 +1,40 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package dhcp6_pd_client_cp
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service dhcp6_pd_client_cp.
+type RPCService interface {
+ DHCP6PdClientEnableDisable(ctx context.Context, in *DHCP6PdClientEnableDisable) (*DHCP6PdClientEnableDisableReply, error)
+ IP6AddDelAddressUsingPrefix(ctx context.Context, in *IP6AddDelAddressUsingPrefix) (*IP6AddDelAddressUsingPrefixReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) DHCP6PdClientEnableDisable(ctx context.Context, in *DHCP6PdClientEnableDisable) (*DHCP6PdClientEnableDisableReply, error) {
+ out := new(DHCP6PdClientEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IP6AddDelAddressUsingPrefix(ctx context.Context, in *IP6AddDelAddressUsingPrefix) (*IP6AddDelAddressUsingPrefixReply, error) {
+ out := new(IP6AddDelAddressUsingPrefixReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/dns/dns.ba.go b/internal/testbinapi/binapi2001/dns/dns.ba.go
new file mode 100644
index 0000000..c7a86e7
--- /dev/null
+++ b/internal/testbinapi/binapi2001/dns/dns.ba.go
@@ -0,0 +1,357 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/dns.api.json
+
+// Package dns contains generated bindings for API file dns.api.
+//
+// Contents:
+// 8 messages
+//
+package dns
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "dns"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x269575cd
+)
+
+// DNSEnableDisable defines message 'dns_enable_disable'.
+type DNSEnableDisable struct {
+ Enable uint8 `binapi:"u8,name=enable" json:"enable,omitempty"`
+}
+
+func (m *DNSEnableDisable) Reset() { *m = DNSEnableDisable{} }
+func (*DNSEnableDisable) GetMessageName() string { return "dns_enable_disable" }
+func (*DNSEnableDisable) GetCrcString() string { return "8050327d" }
+func (*DNSEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DNSEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ return size
+}
+func (m *DNSEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *DNSEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeUint8()
+ return nil
+}
+
+// DNSEnableDisableReply defines message 'dns_enable_disable_reply'.
+type DNSEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DNSEnableDisableReply) Reset() { *m = DNSEnableDisableReply{} }
+func (*DNSEnableDisableReply) GetMessageName() string { return "dns_enable_disable_reply" }
+func (*DNSEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*DNSEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DNSEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DNSEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DNSNameServerAddDel defines message 'dns_name_server_add_del'.
+type DNSNameServerAddDel struct {
+ IsIP6 uint8 `binapi:"u8,name=is_ip6" json:"is_ip6,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ ServerAddress []byte `binapi:"u8[16],name=server_address" json:"server_address,omitempty"`
+}
+
+func (m *DNSNameServerAddDel) Reset() { *m = DNSNameServerAddDel{} }
+func (*DNSNameServerAddDel) GetMessageName() string { return "dns_name_server_add_del" }
+func (*DNSNameServerAddDel) GetCrcString() string { return "3bb05d8c" }
+func (*DNSNameServerAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DNSNameServerAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIP6
+ size += 1 // m.IsAdd
+ size += 1 * 16 // m.ServerAddress
+ return size
+}
+func (m *DNSNameServerAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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()
+ m.ServerAddress = make([]byte, 16)
+ copy(m.ServerAddress, buf.DecodeBytes(len(m.ServerAddress)))
+ return nil
+}
+
+// DNSNameServerAddDelReply defines message 'dns_name_server_add_del_reply'.
+type DNSNameServerAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DNSNameServerAddDelReply) Reset() { *m = DNSNameServerAddDelReply{} }
+func (*DNSNameServerAddDelReply) GetMessageName() string { return "dns_name_server_add_del_reply" }
+func (*DNSNameServerAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*DNSNameServerAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DNSNameServerAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DNSNameServerAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DNSResolveIP defines message 'dns_resolve_ip'.
+type DNSResolveIP struct {
+ IsIP6 uint8 `binapi:"u8,name=is_ip6" json:"is_ip6,omitempty"`
+ Address []byte `binapi:"u8[16],name=address" json:"address,omitempty"`
+}
+
+func (m *DNSResolveIP) Reset() { *m = DNSResolveIP{} }
+func (*DNSResolveIP) GetMessageName() string { return "dns_resolve_ip" }
+func (*DNSResolveIP) GetCrcString() string { return "ae96a1a3" }
+func (*DNSResolveIP) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DNSResolveIP) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIP6
+ size += 1 * 16 // m.Address
+ return size
+}
+func (m *DNSResolveIP) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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()
+ m.Address = make([]byte, 16)
+ copy(m.Address, buf.DecodeBytes(len(m.Address)))
+ return nil
+}
+
+// DNSResolveIPReply defines message 'dns_resolve_ip_reply'.
+type DNSResolveIPReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Name []byte `binapi:"u8[256],name=name" json:"name,omitempty"`
+}
+
+func (m *DNSResolveIPReply) Reset() { *m = DNSResolveIPReply{} }
+func (*DNSResolveIPReply) GetMessageName() string { return "dns_resolve_ip_reply" }
+func (*DNSResolveIPReply) GetCrcString() string { return "49ed78d6" }
+func (*DNSResolveIPReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DNSResolveIPReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 256 // m.Name
+ return size
+}
+func (m *DNSResolveIPReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.Name = make([]byte, 256)
+ copy(m.Name, buf.DecodeBytes(len(m.Name)))
+ return nil
+}
+
+// DNSResolveName defines message 'dns_resolve_name'.
+type DNSResolveName struct {
+ Name []byte `binapi:"u8[256],name=name" json:"name,omitempty"`
+}
+
+func (m *DNSResolveName) Reset() { *m = DNSResolveName{} }
+func (*DNSResolveName) GetMessageName() string { return "dns_resolve_name" }
+func (*DNSResolveName) GetCrcString() string { return "c6566676" }
+func (*DNSResolveName) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DNSResolveName) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 256 // m.Name
+ return size
+}
+func (m *DNSResolveName) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Name, 256)
+ return buf.Bytes(), nil
+}
+func (m *DNSResolveName) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = make([]byte, 256)
+ copy(m.Name, buf.DecodeBytes(len(m.Name)))
+ return nil
+}
+
+// DNSResolveNameReply defines message 'dns_resolve_name_reply'.
+type DNSResolveNameReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IP4Set uint8 `binapi:"u8,name=ip4_set" json:"ip4_set,omitempty"`
+ IP6Set uint8 `binapi:"u8,name=ip6_set" json:"ip6_set,omitempty"`
+ IP4Address []byte `binapi:"u8[4],name=ip4_address" json:"ip4_address,omitempty"`
+ IP6Address []byte `binapi:"u8[16],name=ip6_address" json:"ip6_address,omitempty"`
+}
+
+func (m *DNSResolveNameReply) Reset() { *m = DNSResolveNameReply{} }
+func (*DNSResolveNameReply) GetMessageName() string { return "dns_resolve_name_reply" }
+func (*DNSResolveNameReply) GetCrcString() string { return "c2d758c3" }
+func (*DNSResolveNameReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DNSResolveNameReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IP4Set
+ size += 1 // m.IP6Set
+ size += 1 * 4 // m.IP4Address
+ size += 1 * 16 // m.IP6Address
+ return size
+}
+func (m *DNSResolveNameReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.IP4Set = buf.DecodeUint8()
+ m.IP6Set = buf.DecodeUint8()
+ 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
+}
+
+func init() { file_dns_binapi_init() }
+func file_dns_binapi_init() {
+ api.RegisterMessage((*DNSEnableDisable)(nil), "dns_enable_disable_8050327d")
+ api.RegisterMessage((*DNSEnableDisableReply)(nil), "dns_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*DNSNameServerAddDel)(nil), "dns_name_server_add_del_3bb05d8c")
+ api.RegisterMessage((*DNSNameServerAddDelReply)(nil), "dns_name_server_add_del_reply_e8d4e804")
+ api.RegisterMessage((*DNSResolveIP)(nil), "dns_resolve_ip_ae96a1a3")
+ api.RegisterMessage((*DNSResolveIPReply)(nil), "dns_resolve_ip_reply_49ed78d6")
+ api.RegisterMessage((*DNSResolveName)(nil), "dns_resolve_name_c6566676")
+ api.RegisterMessage((*DNSResolveNameReply)(nil), "dns_resolve_name_reply_c2d758c3")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*DNSEnableDisable)(nil),
+ (*DNSEnableDisableReply)(nil),
+ (*DNSNameServerAddDel)(nil),
+ (*DNSNameServerAddDelReply)(nil),
+ (*DNSResolveIP)(nil),
+ (*DNSResolveIPReply)(nil),
+ (*DNSResolveName)(nil),
+ (*DNSResolveNameReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/dns/dns_rpc.ba.go b/internal/testbinapi/binapi2001/dns/dns_rpc.ba.go
new file mode 100644
index 0000000..57760ab
--- /dev/null
+++ b/internal/testbinapi/binapi2001/dns/dns_rpc.ba.go
@@ -0,0 +1,60 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package dns
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service dns.
+type RPCService interface {
+ DNSEnableDisable(ctx context.Context, in *DNSEnableDisable) (*DNSEnableDisableReply, error)
+ DNSNameServerAddDel(ctx context.Context, in *DNSNameServerAddDel) (*DNSNameServerAddDelReply, error)
+ DNSResolveIP(ctx context.Context, in *DNSResolveIP) (*DNSResolveIPReply, error)
+ DNSResolveName(ctx context.Context, in *DNSResolveName) (*DNSResolveNameReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) DNSEnableDisable(ctx context.Context, in *DNSEnableDisable) (*DNSEnableDisableReply, error) {
+ out := new(DNSEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DNSNameServerAddDel(ctx context.Context, in *DNSNameServerAddDel) (*DNSNameServerAddDelReply, error) {
+ out := new(DNSNameServerAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DNSResolveIP(ctx context.Context, in *DNSResolveIP) (*DNSResolveIPReply, error) {
+ out := new(DNSResolveIPReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DNSResolveName(ctx context.Context, in *DNSResolveName) (*DNSResolveNameReply, error) {
+ out := new(DNSResolveNameReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ethernet_types/ethernet_types.ba.go b/internal/testbinapi/binapi2001/ethernet_types/ethernet_types.ba.go
new file mode 100644
index 0000000..bd6cdcd
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ethernet_types/ethernet_types.ba.go
@@ -0,0 +1,53 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/ethernet_types.api.json
+
+// Package ethernet_types contains generated bindings for API file ethernet_types.api.
+//
+// Contents:
+// 1 alias
+//
+package ethernet_types
+
+import (
+ api "git.fd.io/govpp.git/api"
+ "net"
+)
+
+// 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
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
diff --git a/internal/testbinapi/binapi2001/feature/feature.ba.go b/internal/testbinapi/binapi2001/feature/feature.ba.go
new file mode 100644
index 0000000..8ceca10
--- /dev/null
+++ b/internal/testbinapi/binapi2001/feature/feature.ba.go
@@ -0,0 +1,378 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/feature.api.json
+
+// Package feature contains generated bindings for API file feature.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 2 messages
+//
+package feature
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "feature"
+ APIVersion = "1.0.2"
+ VersionCrc = 0x3696c431
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// FeatureEnableDisable defines message 'feature_enable_disable'.
+type FeatureEnableDisable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+ ArcName string `binapi:"string[64],name=arc_name" json:"arc_name,omitempty"`
+ FeatureName string `binapi:"string[64],name=feature_name" json:"feature_name,omitempty"`
+}
+
+func (m *FeatureEnableDisable) Reset() { *m = FeatureEnableDisable{} }
+func (*FeatureEnableDisable) GetMessageName() string { return "feature_enable_disable" }
+func (*FeatureEnableDisable) GetCrcString() string { return "7531c862" }
+func (*FeatureEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *FeatureEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
+ size += 64 // m.ArcName
+ size += 64 // m.FeatureName
+ return size
+}
+func (m *FeatureEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Enable)
+ buf.EncodeString(m.ArcName, 64)
+ buf.EncodeString(m.FeatureName, 64)
+ return buf.Bytes(), nil
+}
+func (m *FeatureEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Enable = buf.DecodeBool()
+ m.ArcName = buf.DecodeString(64)
+ m.FeatureName = buf.DecodeString(64)
+ return nil
+}
+
+// FeatureEnableDisableReply defines message 'feature_enable_disable_reply'.
+type FeatureEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *FeatureEnableDisableReply) Reset() { *m = FeatureEnableDisableReply{} }
+func (*FeatureEnableDisableReply) GetMessageName() string { return "feature_enable_disable_reply" }
+func (*FeatureEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*FeatureEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *FeatureEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *FeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_feature_binapi_init() }
+func file_feature_binapi_init() {
+ api.RegisterMessage((*FeatureEnableDisable)(nil), "feature_enable_disable_7531c862")
+ api.RegisterMessage((*FeatureEnableDisableReply)(nil), "feature_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*FeatureEnableDisable)(nil),
+ (*FeatureEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/feature/feature_rpc.ba.go b/internal/testbinapi/binapi2001/feature/feature_rpc.ba.go
new file mode 100644
index 0000000..cd91188
--- /dev/null
+++ b/internal/testbinapi/binapi2001/feature/feature_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package feature
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service feature.
+type RPCService interface {
+ FeatureEnableDisable(ctx context.Context, in *FeatureEnableDisable) (*FeatureEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) FeatureEnableDisable(ctx context.Context, in *FeatureEnableDisable) (*FeatureEnableDisableReply, error) {
+ out := new(FeatureEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/fib_types/fib_types.ba.go b/internal/testbinapi/binapi2001/fib_types/fib_types.ba.go
new file mode 100644
index 0000000..16fe5b8
--- /dev/null
+++ b/internal/testbinapi/binapi2001/fib_types/fib_types.ba.go
@@ -0,0 +1,762 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/fib_types.api.json
+
+// Package fib_types contains generated bindings for API file fib_types.api.
+//
+// Contents:
+// 5 aliases
+// 7 enums
+// 9 structs
+// 1 union
+//
+package fib_types
+
+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
+
+// 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<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// FibPathNhProto defines enum 'fib_path_nh_proto'.
+type FibPathNhProto uint32
+
+const (
+ FIB_API_PATH_NH_PROTO_IP4 FibPathNhProto = 0
+ FIB_API_PATH_NH_PROTO_IP6 FibPathNhProto = 1
+ FIB_API_PATH_NH_PROTO_MPLS FibPathNhProto = 2
+ FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
+ FIB_API_PATH_NH_PROTO_BIER FibPathNhProto = 4
+)
+
+var (
+ FibPathNhProto_name = map[uint32]string{
+ 0: "FIB_API_PATH_NH_PROTO_IP4",
+ 1: "FIB_API_PATH_NH_PROTO_IP6",
+ 2: "FIB_API_PATH_NH_PROTO_MPLS",
+ 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
+ 4: "FIB_API_PATH_NH_PROTO_BIER",
+ }
+ FibPathNhProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathNhProto) String() string {
+ s, ok := FibPathNhProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// FibPathType defines enum 'fib_path_type'.
+type FibPathType uint32
+
+const (
+ FIB_API_PATH_TYPE_NORMAL FibPathType = 0
+ FIB_API_PATH_TYPE_LOCAL FibPathType = 1
+ FIB_API_PATH_TYPE_DROP FibPathType = 2
+ FIB_API_PATH_TYPE_UDP_ENCAP FibPathType = 3
+ FIB_API_PATH_TYPE_BIER_IMP FibPathType = 4
+ FIB_API_PATH_TYPE_ICMP_UNREACH FibPathType = 5
+ FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
+ FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
+ FIB_API_PATH_TYPE_DVR FibPathType = 8
+ FIB_API_PATH_TYPE_INTERFACE_RX FibPathType = 9
+ FIB_API_PATH_TYPE_CLASSIFY FibPathType = 10
+)
+
+var (
+ FibPathType_name = map[uint32]string{
+ 0: "FIB_API_PATH_TYPE_NORMAL",
+ 1: "FIB_API_PATH_TYPE_LOCAL",
+ 2: "FIB_API_PATH_TYPE_DROP",
+ 3: "FIB_API_PATH_TYPE_UDP_ENCAP",
+ 4: "FIB_API_PATH_TYPE_BIER_IMP",
+ 5: "FIB_API_PATH_TYPE_ICMP_UNREACH",
+ 6: "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
+ 7: "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
+ 8: "FIB_API_PATH_TYPE_DVR",
+ 9: "FIB_API_PATH_TYPE_INTERFACE_RX",
+ 10: "FIB_API_PATH_TYPE_CLASSIFY",
+ }
+ FibPathType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathType) String() string {
+ s, ok := FibPathType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// FibMplsLabel defines type 'fib_mpls_label'.
+type FibMplsLabel struct {
+ IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
+ Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
+ TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
+ Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
+}
+
+// FibPath defines type 'fib_path'.
+type FibPath struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+ Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
+ Type FibPathType `binapi:"fib_path_type,name=type" json:"type,omitempty"`
+ Flags FibPathFlags `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
+ Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
+ Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
+ NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
+ LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
+}
+
+// FibPathNh defines type 'fib_path_nh'.
+type FibPathNh struct {
+ Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
+ ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
+ ObjID uint32 `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
+ ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
diff --git a/internal/testbinapi/binapi2001/flowprobe/flowprobe.ba.go b/internal/testbinapi/binapi2001/flowprobe/flowprobe.ba.go
new file mode 100644
index 0000000..fc610eb
--- /dev/null
+++ b/internal/testbinapi/binapi2001/flowprobe/flowprobe.ba.go
@@ -0,0 +1,552 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/flowprobe.api.json
+
+// Package flowprobe contains generated bindings for API file flowprobe.api.
+//
+// Contents:
+// 1 alias
+// 8 enums
+// 4 messages
+//
+package flowprobe
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "flowprobe"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xbb4dfc0d
+)
+
+// FlowprobeRecordFlags defines enum 'flowprobe_record_flags'.
+type FlowprobeRecordFlags uint8
+
+const (
+ FLOWPROBE_RECORD_FLAG_L2 FlowprobeRecordFlags = 1
+ FLOWPROBE_RECORD_FLAG_L3 FlowprobeRecordFlags = 2
+ FLOWPROBE_RECORD_FLAG_L4 FlowprobeRecordFlags = 4
+)
+
+var (
+ FlowprobeRecordFlags_name = map[uint8]string{
+ 1: "FLOWPROBE_RECORD_FLAG_L2",
+ 2: "FLOWPROBE_RECORD_FLAG_L3",
+ 4: "FLOWPROBE_RECORD_FLAG_L4",
+ }
+ FlowprobeRecordFlags_value = map[string]uint8{
+ "FLOWPROBE_RECORD_FLAG_L2": 1,
+ "FLOWPROBE_RECORD_FLAG_L3": 2,
+ "FLOWPROBE_RECORD_FLAG_L4": 4,
+ }
+)
+
+func (x FlowprobeRecordFlags) String() string {
+ s, ok := FlowprobeRecordFlags_name[uint8(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint8) string {
+ s, ok := FlowprobeRecordFlags_name[uint8(n)]
+ if ok {
+ return s
+ }
+ return "FlowprobeRecordFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint8(0); i <= 8; i++ {
+ val := uint8(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint8(x))
+ }
+ return s
+}
+
+// FlowprobeWhichFlags defines enum 'flowprobe_which_flags'.
+type FlowprobeWhichFlags uint8
+
+const (
+ FLOWPROBE_WHICH_FLAG_IP4 FlowprobeWhichFlags = 1
+ FLOWPROBE_WHICH_FLAG_L2 FlowprobeWhichFlags = 2
+ FLOWPROBE_WHICH_FLAG_IP6 FlowprobeWhichFlags = 4
+)
+
+var (
+ FlowprobeWhichFlags_name = map[uint8]string{
+ 1: "FLOWPROBE_WHICH_FLAG_IP4",
+ 2: "FLOWPROBE_WHICH_FLAG_L2",
+ 4: "FLOWPROBE_WHICH_FLAG_IP6",
+ }
+ FlowprobeWhichFlags_value = map[string]uint8{
+ "FLOWPROBE_WHICH_FLAG_IP4": 1,
+ "FLOWPROBE_WHICH_FLAG_L2": 2,
+ "FLOWPROBE_WHICH_FLAG_IP6": 4,
+ }
+)
+
+func (x FlowprobeWhichFlags) String() string {
+ s, ok := FlowprobeWhichFlags_name[uint8(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint8) string {
+ s, ok := FlowprobeWhichFlags_name[uint8(n)]
+ if ok {
+ return s
+ }
+ return "FlowprobeWhichFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint8(0); i <= 8; i++ {
+ val := uint8(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint8(x))
+ }
+ return s
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// FlowprobeParams defines message 'flowprobe_params'.
+type FlowprobeParams struct {
+ RecordFlags FlowprobeRecordFlags `binapi:"flowprobe_record_flags,name=record_flags" json:"record_flags,omitempty"`
+ ActiveTimer uint32 `binapi:"u32,name=active_timer" json:"active_timer,omitempty"`
+ PassiveTimer uint32 `binapi:"u32,name=passive_timer" json:"passive_timer,omitempty"`
+}
+
+func (m *FlowprobeParams) Reset() { *m = FlowprobeParams{} }
+func (*FlowprobeParams) GetMessageName() string { return "flowprobe_params" }
+func (*FlowprobeParams) GetCrcString() string { return "baa46c09" }
+func (*FlowprobeParams) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *FlowprobeParams) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.RecordFlags
+ size += 4 // m.ActiveTimer
+ size += 4 // m.PassiveTimer
+ return size
+}
+func (m *FlowprobeParams) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.RecordFlags))
+ buf.EncodeUint32(m.ActiveTimer)
+ buf.EncodeUint32(m.PassiveTimer)
+ return buf.Bytes(), nil
+}
+func (m *FlowprobeParams) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.RecordFlags = FlowprobeRecordFlags(buf.DecodeUint8())
+ m.ActiveTimer = buf.DecodeUint32()
+ m.PassiveTimer = buf.DecodeUint32()
+ return nil
+}
+
+// FlowprobeParamsReply defines message 'flowprobe_params_reply'.
+type FlowprobeParamsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *FlowprobeParamsReply) Reset() { *m = FlowprobeParamsReply{} }
+func (*FlowprobeParamsReply) GetMessageName() string { return "flowprobe_params_reply" }
+func (*FlowprobeParamsReply) GetCrcString() string { return "e8d4e804" }
+func (*FlowprobeParamsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *FlowprobeParamsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *FlowprobeParamsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// FlowprobeTxInterfaceAddDel defines message 'flowprobe_tx_interface_add_del'.
+type FlowprobeTxInterfaceAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Which FlowprobeWhichFlags `binapi:"flowprobe_which_flags,name=which" json:"which,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *FlowprobeTxInterfaceAddDel) Reset() { *m = FlowprobeTxInterfaceAddDel{} }
+func (*FlowprobeTxInterfaceAddDel) GetMessageName() string { return "flowprobe_tx_interface_add_del" }
+func (*FlowprobeTxInterfaceAddDel) GetCrcString() string { return "b782c976" }
+func (*FlowprobeTxInterfaceAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *FlowprobeTxInterfaceAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Which
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *FlowprobeTxInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint8(uint8(m.Which))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *FlowprobeTxInterfaceAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Which = FlowprobeWhichFlags(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// FlowprobeTxInterfaceAddDelReply defines message 'flowprobe_tx_interface_add_del_reply'.
+type FlowprobeTxInterfaceAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *FlowprobeTxInterfaceAddDelReply) Reset() { *m = FlowprobeTxInterfaceAddDelReply{} }
+func (*FlowprobeTxInterfaceAddDelReply) GetMessageName() string {
+ return "flowprobe_tx_interface_add_del_reply"
+}
+func (*FlowprobeTxInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*FlowprobeTxInterfaceAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *FlowprobeTxInterfaceAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *FlowprobeTxInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_flowprobe_binapi_init() }
+func file_flowprobe_binapi_init() {
+ api.RegisterMessage((*FlowprobeParams)(nil), "flowprobe_params_baa46c09")
+ api.RegisterMessage((*FlowprobeParamsReply)(nil), "flowprobe_params_reply_e8d4e804")
+ api.RegisterMessage((*FlowprobeTxInterfaceAddDel)(nil), "flowprobe_tx_interface_add_del_b782c976")
+ api.RegisterMessage((*FlowprobeTxInterfaceAddDelReply)(nil), "flowprobe_tx_interface_add_del_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*FlowprobeParams)(nil),
+ (*FlowprobeParamsReply)(nil),
+ (*FlowprobeTxInterfaceAddDel)(nil),
+ (*FlowprobeTxInterfaceAddDelReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/flowprobe/flowprobe_rpc.ba.go b/internal/testbinapi/binapi2001/flowprobe/flowprobe_rpc.ba.go
new file mode 100644
index 0000000..42c6887
--- /dev/null
+++ b/internal/testbinapi/binapi2001/flowprobe/flowprobe_rpc.ba.go
@@ -0,0 +1,40 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package flowprobe
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service flowprobe.
+type RPCService interface {
+ FlowprobeParams(ctx context.Context, in *FlowprobeParams) (*FlowprobeParamsReply, error)
+ FlowprobeTxInterfaceAddDel(ctx context.Context, in *FlowprobeTxInterfaceAddDel) (*FlowprobeTxInterfaceAddDelReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) FlowprobeParams(ctx context.Context, in *FlowprobeParams) (*FlowprobeParamsReply, error) {
+ out := new(FlowprobeParamsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) FlowprobeTxInterfaceAddDel(ctx context.Context, in *FlowprobeTxInterfaceAddDel) (*FlowprobeTxInterfaceAddDelReply, error) {
+ out := new(FlowprobeTxInterfaceAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/gbp/gbp.ba.go b/internal/testbinapi/binapi2001/gbp/gbp.ba.go
new file mode 100644
index 0000000..1f00396
--- /dev/null
+++ b/internal/testbinapi/binapi2001/gbp/gbp.ba.go
@@ -0,0 +1,3363 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/gbp.api.json
+
+// Package gbp contains generated bindings for API file gbp.api.
+//
+// Contents:
+// 8 aliases
+// 17 enums
+// 20 structs
+// 1 union
+// 48 messages
+//
+package gbp
+
+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 = "gbp"
+ APIVersion = "2.0.0"
+ VersionCrc = 0xa891d6ff
+)
+
+// 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)) + ")"
+}
+
+// GbpBridgeDomainFlags defines enum 'gbp_bridge_domain_flags'.
+type GbpBridgeDomainFlags uint32
+
+const (
+ GBP_BD_API_FLAG_NONE GbpBridgeDomainFlags = 0
+ GBP_BD_API_FLAG_DO_NOT_LEARN GbpBridgeDomainFlags = 1
+ GBP_BD_API_FLAG_UU_FWD_DROP GbpBridgeDomainFlags = 2
+ GBP_BD_API_FLAG_MCAST_DROP GbpBridgeDomainFlags = 4
+ GBP_BD_API_FLAG_UCAST_ARP GbpBridgeDomainFlags = 8
+)
+
+var (
+ GbpBridgeDomainFlags_name = map[uint32]string{
+ 0: "GBP_BD_API_FLAG_NONE",
+ 1: "GBP_BD_API_FLAG_DO_NOT_LEARN",
+ 2: "GBP_BD_API_FLAG_UU_FWD_DROP",
+ 4: "GBP_BD_API_FLAG_MCAST_DROP",
+ 8: "GBP_BD_API_FLAG_UCAST_ARP",
+ }
+ GbpBridgeDomainFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x GbpBridgeDomainFlags) String() string {
+ s, ok := GbpBridgeDomainFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := GbpBridgeDomainFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "GbpBridgeDomainFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// GbpEndpointFlags defines enum 'gbp_endpoint_flags'.
+type GbpEndpointFlags uint32
+
+const (
+ GBP_API_ENDPOINT_FLAG_NONE GbpEndpointFlags = 0
+ GBP_API_ENDPOINT_FLAG_BOUNCE GbpEndpointFlags = 1
+ GBP_API_ENDPOINT_FLAG_REMOTE GbpEndpointFlags = 2
+ GBP_API_ENDPOINT_FLAG_LEARNT GbpEndpointFlags = 4
+ GBP_API_ENDPOINT_FLAG_EXTERNAL GbpEndpointFlags = 8
+)
+
+var (
+ GbpEndpointFlags_name = map[uint32]string{
+ 0: "GBP_API_ENDPOINT_FLAG_NONE",
+ 1: "GBP_API_ENDPOINT_FLAG_BOUNCE",
+ 2: "GBP_API_ENDPOINT_FLAG_REMOTE",
+ 4: "GBP_API_ENDPOINT_FLAG_LEARNT",
+ 8: "GBP_API_ENDPOINT_FLAG_EXTERNAL",
+ }
+ GbpEndpointFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x GbpEndpointFlags) String() string {
+ s, ok := GbpEndpointFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := GbpEndpointFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "GbpEndpointFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// GbpExtItfFlags defines enum 'gbp_ext_itf_flags'.
+type GbpExtItfFlags uint32
+
+const (
+ GBP_API_EXT_ITF_F_NONE GbpExtItfFlags = 0
+ GBP_API_EXT_ITF_F_ANON GbpExtItfFlags = 1
+)
+
+var (
+ GbpExtItfFlags_name = map[uint32]string{
+ 0: "GBP_API_EXT_ITF_F_NONE",
+ 1: "GBP_API_EXT_ITF_F_ANON",
+ }
+ GbpExtItfFlags_value = map[string]uint32{
+ "GBP_API_EXT_ITF_F_NONE": 0,
+ "GBP_API_EXT_ITF_F_ANON": 1,
+ }
+)
+
+func (x GbpExtItfFlags) String() string {
+ s, ok := GbpExtItfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := GbpExtItfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "GbpExtItfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// GbpHashMode defines enum 'gbp_hash_mode'.
+type GbpHashMode uint32
+
+const (
+ GBP_API_HASH_MODE_SRC_IP GbpHashMode = 1
+ GBP_API_HASH_MODE_DST_IP GbpHashMode = 2
+ GBP_API_HASH_MODE_SYMMETRIC GbpHashMode = 3
+)
+
+var (
+ GbpHashMode_name = map[uint32]string{
+ 1: "GBP_API_HASH_MODE_SRC_IP",
+ 2: "GBP_API_HASH_MODE_DST_IP",
+ 3: "GBP_API_HASH_MODE_SYMMETRIC",
+ }
+ GbpHashMode_value = map[string]uint32{
+ "GBP_API_HASH_MODE_SRC_IP": 1,
+ "GBP_API_HASH_MODE_DST_IP": 2,
+ "GBP_API_HASH_MODE_SYMMETRIC": 3,
+ }
+)
+
+func (x GbpHashMode) String() string {
+ s, ok := GbpHashMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "GbpHashMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// GbpRuleAction defines enum 'gbp_rule_action'.
+type GbpRuleAction uint32
+
+const (
+ GBP_API_RULE_PERMIT GbpRuleAction = 1
+ GBP_API_RULE_DENY GbpRuleAction = 2
+ GBP_API_RULE_REDIRECT GbpRuleAction = 3
+)
+
+var (
+ GbpRuleAction_name = map[uint32]string{
+ 1: "GBP_API_RULE_PERMIT",
+ 2: "GBP_API_RULE_DENY",
+ 3: "GBP_API_RULE_REDIRECT",
+ }
+ GbpRuleAction_value = map[string]uint32{
+ "GBP_API_RULE_PERMIT": 1,
+ "GBP_API_RULE_DENY": 2,
+ "GBP_API_RULE_REDIRECT": 3,
+ }
+)
+
+func (x GbpRuleAction) String() string {
+ s, ok := GbpRuleAction_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "GbpRuleAction(" + strconv.Itoa(int(x)) + ")"
+}
+
+// GbpSubnetType defines enum 'gbp_subnet_type'.
+type GbpSubnetType uint32
+
+const (
+ GBP_API_SUBNET_TRANSPORT GbpSubnetType = 1
+ GBP_API_SUBNET_STITCHED_INTERNAL GbpSubnetType = 2
+ GBP_API_SUBNET_STITCHED_EXTERNAL GbpSubnetType = 3
+ GBP_API_SUBNET_L3_OUT GbpSubnetType = 4
+ GBP_API_SUBNET_ANON_L3_OUT GbpSubnetType = 5
+)
+
+var (
+ GbpSubnetType_name = map[uint32]string{
+ 1: "GBP_API_SUBNET_TRANSPORT",
+ 2: "GBP_API_SUBNET_STITCHED_INTERNAL",
+ 3: "GBP_API_SUBNET_STITCHED_EXTERNAL",
+ 4: "GBP_API_SUBNET_L3_OUT",
+ 5: "GBP_API_SUBNET_ANON_L3_OUT",
+ }
+ GbpSubnetType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x GbpSubnetType) String() string {
+ s, ok := GbpSubnetType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "GbpSubnetType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// GbpVxlanTunnelMode defines enum 'gbp_vxlan_tunnel_mode'.
+type GbpVxlanTunnelMode uint32
+
+const (
+ GBP_VXLAN_TUNNEL_MODE_L2 GbpVxlanTunnelMode = 1
+ GBP_VXLAN_TUNNEL_MODE_L3 GbpVxlanTunnelMode = 2
+)
+
+var (
+ GbpVxlanTunnelMode_name = map[uint32]string{
+ 1: "GBP_VXLAN_TUNNEL_MODE_L2",
+ 2: "GBP_VXLAN_TUNNEL_MODE_L3",
+ }
+ GbpVxlanTunnelMode_value = map[string]uint32{
+ "GBP_VXLAN_TUNNEL_MODE_L2": 1,
+ "GBP_VXLAN_TUNNEL_MODE_L3": 2,
+ }
+)
+
+func (x GbpVxlanTunnelMode) String() string {
+ s, ok := GbpVxlanTunnelMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "GbpVxlanTunnelMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// GbpScope defines alias 'gbp_scope'.
+type GbpScope uint16
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// GbpBridgeDomain defines type 'gbp_bridge_domain'.
+type GbpBridgeDomain struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
+ Flags GbpBridgeDomainFlags `binapi:"gbp_bridge_domain_flags,name=flags" json:"flags,omitempty"`
+ BviSwIfIndex InterfaceIndex `binapi:"interface_index,name=bvi_sw_if_index" json:"bvi_sw_if_index,omitempty"`
+ UuFwdSwIfIndex InterfaceIndex `binapi:"interface_index,name=uu_fwd_sw_if_index" json:"uu_fwd_sw_if_index,omitempty"`
+ BmFloodSwIfIndex InterfaceIndex `binapi:"interface_index,name=bm_flood_sw_if_index" json:"bm_flood_sw_if_index,omitempty"`
+}
+
+// GbpContract defines type 'gbp_contract'.
+type GbpContract struct {
+ Scope GbpScope `binapi:"gbp_scope,name=scope" json:"scope,omitempty"`
+ Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"`
+ Dclass uint16 `binapi:"u16,name=dclass" json:"dclass,omitempty"`
+ ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
+ NEtherTypes uint8 `binapi:"u8,name=n_ether_types" json:"n_ether_types,omitempty"`
+ AllowedEthertypes []uint16 `binapi:"u16[16],name=allowed_ethertypes" json:"allowed_ethertypes,omitempty"`
+ NRules uint8 `binapi:"u8,name=n_rules" json:"-"`
+ Rules []GbpRule `binapi:"gbp_rule[n_rules],name=rules" json:"rules,omitempty"`
+}
+
+// GbpEndpoint defines type 'gbp_endpoint'.
+type GbpEndpoint struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"`
+ Flags GbpEndpointFlags `binapi:"gbp_endpoint_flags,name=flags" json:"flags,omitempty"`
+ Mac MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
+ Tun GbpEndpointTun `binapi:"gbp_endpoint_tun,name=tun" json:"tun,omitempty"`
+ NIps uint8 `binapi:"u8,name=n_ips" json:"-"`
+ Ips []Address `binapi:"address[n_ips],name=ips" json:"ips,omitempty"`
+}
+
+// GbpEndpointGroup defines type 'gbp_endpoint_group'.
+type GbpEndpointGroup struct {
+ Vnid uint32 `binapi:"u32,name=vnid" json:"vnid,omitempty"`
+ Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"`
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
+ UplinkSwIfIndex InterfaceIndex `binapi:"interface_index,name=uplink_sw_if_index" json:"uplink_sw_if_index,omitempty"`
+ Retention GbpEndpointRetention `binapi:"gbp_endpoint_retention,name=retention" json:"retention,omitempty"`
+}
+
+// GbpEndpointRetention defines type 'gbp_endpoint_retention'.
+type GbpEndpointRetention struct {
+ RemoteEpTimeout uint32 `binapi:"u32,name=remote_ep_timeout" json:"remote_ep_timeout,omitempty"`
+}
+
+// GbpEndpointTun defines type 'gbp_endpoint_tun'.
+type GbpEndpointTun struct {
+ Src Address `binapi:"address,name=src" json:"src,omitempty"`
+ Dst Address `binapi:"address,name=dst" json:"dst,omitempty"`
+}
+
+// GbpExtItf defines type 'gbp_ext_itf'.
+type GbpExtItf struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
+ Flags GbpExtItfFlags `binapi:"gbp_ext_itf_flags,name=flags" json:"flags,omitempty"`
+}
+
+// GbpNextHop defines type 'gbp_next_hop'.
+type GbpNextHop struct {
+ IP Address `binapi:"address,name=ip" json:"ip,omitempty"`
+ Mac MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
+}
+
+// GbpNextHopSet defines type 'gbp_next_hop_set'.
+type GbpNextHopSet struct {
+ HashMode GbpHashMode `binapi:"gbp_hash_mode,name=hash_mode" json:"hash_mode,omitempty"`
+ NNhs uint8 `binapi:"u8,name=n_nhs" json:"n_nhs,omitempty"`
+ Nhs [8]GbpNextHop `binapi:"gbp_next_hop[8],name=nhs" json:"nhs,omitempty"`
+}
+
+// GbpRecirc defines type 'gbp_recirc'.
+type GbpRecirc struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"`
+ IsExt bool `binapi:"bool,name=is_ext" json:"is_ext,omitempty"`
+}
+
+// GbpRouteDomain defines type 'gbp_route_domain'.
+type GbpRouteDomain struct {
+ RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
+ IP4TableID uint32 `binapi:"u32,name=ip4_table_id" json:"ip4_table_id,omitempty"`
+ IP6TableID uint32 `binapi:"u32,name=ip6_table_id" json:"ip6_table_id,omitempty"`
+ IP4UuSwIfIndex InterfaceIndex `binapi:"interface_index,name=ip4_uu_sw_if_index" json:"ip4_uu_sw_if_index,omitempty"`
+ IP6UuSwIfIndex InterfaceIndex `binapi:"interface_index,name=ip6_uu_sw_if_index" json:"ip6_uu_sw_if_index,omitempty"`
+ Scope GbpScope `binapi:"gbp_scope,name=scope" json:"scope,omitempty"`
+}
+
+// GbpRule defines type 'gbp_rule'.
+type GbpRule struct {
+ Action GbpRuleAction `binapi:"gbp_rule_action,name=action" json:"action,omitempty"`
+ NhSet GbpNextHopSet `binapi:"gbp_next_hop_set,name=nh_set" json:"nh_set,omitempty"`
+}
+
+// GbpSubnet defines type 'gbp_subnet'.
+type GbpSubnet struct {
+ RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"`
+ Type GbpSubnetType `binapi:"gbp_subnet_type,name=type" json:"type,omitempty"`
+ Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
+}
+
+// GbpVxlanTunnel defines type 'gbp_vxlan_tunnel'.
+type GbpVxlanTunnel struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ Mode GbpVxlanTunnelMode `binapi:"gbp_vxlan_tunnel_mode,name=mode" json:"mode,omitempty"`
+ BdRdID uint32 `binapi:"u32,name=bd_rd_id" json:"bd_rd_id,omitempty"`
+ Src IP4Address `binapi:"ip4_address,name=src" json:"src,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// GbpBridgeDomainAdd defines message 'gbp_bridge_domain_add'.
+type GbpBridgeDomainAdd struct {
+ Bd GbpBridgeDomain `binapi:"gbp_bridge_domain,name=bd" json:"bd,omitempty"`
+}
+
+func (m *GbpBridgeDomainAdd) Reset() { *m = GbpBridgeDomainAdd{} }
+func (*GbpBridgeDomainAdd) GetMessageName() string { return "gbp_bridge_domain_add" }
+func (*GbpBridgeDomainAdd) GetCrcString() string { return "8454bfdf" }
+func (*GbpBridgeDomainAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpBridgeDomainAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bd.BdID
+ size += 4 // m.Bd.RdID
+ size += 4 // m.Bd.Flags
+ size += 4 // m.Bd.BviSwIfIndex
+ size += 4 // m.Bd.UuFwdSwIfIndex
+ size += 4 // m.Bd.BmFloodSwIfIndex
+ return size
+}
+func (m *GbpBridgeDomainAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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))
+ buf.EncodeUint32(uint32(m.Bd.BmFloodSwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *GbpBridgeDomainAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bd.BdID = buf.DecodeUint32()
+ m.Bd.RdID = buf.DecodeUint32()
+ m.Bd.Flags = GbpBridgeDomainFlags(buf.DecodeUint32())
+ m.Bd.BviSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Bd.UuFwdSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Bd.BmFloodSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// GbpBridgeDomainAddReply defines message 'gbp_bridge_domain_add_reply'.
+type GbpBridgeDomainAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpBridgeDomainAddReply) Reset() { *m = GbpBridgeDomainAddReply{} }
+func (*GbpBridgeDomainAddReply) GetMessageName() string { return "gbp_bridge_domain_add_reply" }
+func (*GbpBridgeDomainAddReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpBridgeDomainAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpBridgeDomainAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpBridgeDomainAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpBridgeDomainDel defines message 'gbp_bridge_domain_del'.
+type GbpBridgeDomainDel struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+}
+
+func (m *GbpBridgeDomainDel) Reset() { *m = GbpBridgeDomainDel{} }
+func (*GbpBridgeDomainDel) GetMessageName() string { return "gbp_bridge_domain_del" }
+func (*GbpBridgeDomainDel) GetCrcString() string { return "c25fdce6" }
+func (*GbpBridgeDomainDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpBridgeDomainDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ return size
+}
+func (m *GbpBridgeDomainDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ return buf.Bytes(), nil
+}
+func (m *GbpBridgeDomainDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ return nil
+}
+
+// GbpBridgeDomainDelReply defines message 'gbp_bridge_domain_del_reply'.
+type GbpBridgeDomainDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpBridgeDomainDelReply) Reset() { *m = GbpBridgeDomainDelReply{} }
+func (*GbpBridgeDomainDelReply) GetMessageName() string { return "gbp_bridge_domain_del_reply" }
+func (*GbpBridgeDomainDelReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpBridgeDomainDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpBridgeDomainDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpBridgeDomainDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpBridgeDomainDetails defines message 'gbp_bridge_domain_details'.
+type GbpBridgeDomainDetails struct {
+ Bd GbpBridgeDomain `binapi:"gbp_bridge_domain,name=bd" json:"bd,omitempty"`
+}
+
+func (m *GbpBridgeDomainDetails) Reset() { *m = GbpBridgeDomainDetails{} }
+func (*GbpBridgeDomainDetails) GetMessageName() string { return "gbp_bridge_domain_details" }
+func (*GbpBridgeDomainDetails) GetCrcString() string { return "2acd15f9" }
+func (*GbpBridgeDomainDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpBridgeDomainDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bd.BdID
+ size += 4 // m.Bd.RdID
+ size += 4 // m.Bd.Flags
+ size += 4 // m.Bd.BviSwIfIndex
+ size += 4 // m.Bd.UuFwdSwIfIndex
+ size += 4 // m.Bd.BmFloodSwIfIndex
+ return size
+}
+func (m *GbpBridgeDomainDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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))
+ buf.EncodeUint32(uint32(m.Bd.BmFloodSwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *GbpBridgeDomainDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bd.BdID = buf.DecodeUint32()
+ m.Bd.RdID = buf.DecodeUint32()
+ m.Bd.Flags = GbpBridgeDomainFlags(buf.DecodeUint32())
+ m.Bd.BviSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Bd.UuFwdSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Bd.BmFloodSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// GbpBridgeDomainDump defines message 'gbp_bridge_domain_dump'.
+type GbpBridgeDomainDump struct{}
+
+func (m *GbpBridgeDomainDump) Reset() { *m = GbpBridgeDomainDump{} }
+func (*GbpBridgeDomainDump) GetMessageName() string { return "gbp_bridge_domain_dump" }
+func (*GbpBridgeDomainDump) GetCrcString() string { return "51077d14" }
+func (*GbpBridgeDomainDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpBridgeDomainDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GbpBridgeDomainDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GbpBridgeDomainDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GbpBridgeDomainDumpReply defines message 'gbp_bridge_domain_dump_reply'.
+type GbpBridgeDomainDumpReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpBridgeDomainDumpReply) Reset() { *m = GbpBridgeDomainDumpReply{} }
+func (*GbpBridgeDomainDumpReply) GetMessageName() string { return "gbp_bridge_domain_dump_reply" }
+func (*GbpBridgeDomainDumpReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpBridgeDomainDumpReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpBridgeDomainDumpReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpBridgeDomainDumpReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpContractAddDel defines message 'gbp_contract_add_del'.
+type GbpContractAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Contract GbpContract `binapi:"gbp_contract,name=contract" json:"contract,omitempty"`
+}
+
+func (m *GbpContractAddDel) Reset() { *m = GbpContractAddDel{} }
+func (*GbpContractAddDel) GetMessageName() string { return "gbp_contract_add_del" }
+func (*GbpContractAddDel) GetCrcString() string { return "553e275b" }
+func (*GbpContractAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpContractAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 2 // m.Contract.Scope
+ size += 2 // m.Contract.Sclass
+ size += 2 // m.Contract.Dclass
+ size += 4 // m.Contract.ACLIndex
+ size += 1 // m.Contract.NEtherTypes
+ size += 2 * 16 // m.Contract.AllowedEthertypes
+ size += 1 // m.Contract.NRules
+ for j2 := 0; j2 < len(m.Contract.Rules); j2++ {
+ var s2 GbpRule
+ _ = s2
+ if j2 < len(m.Contract.Rules) {
+ s2 = m.Contract.Rules[j2]
+ }
+ size += 4 // s2.Action
+ size += 4 // s2.NhSet.HashMode
+ size += 1 // s2.NhSet.NNhs
+ for j4 := 0; j4 < 8; j4++ {
+ size += 4 // 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint16(uint16(m.Contract.Scope))
+ 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(x)
+ }
+ buf.EncodeUint8(uint8(len(m.Contract.Rules)))
+ for j1 := 0; j1 < len(m.Contract.Rules); j1++ {
+ 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(v1.NhSet.NNhs)
+ for j3 := 0; j3 < 8; j3++ {
+ buf.EncodeUint32(uint32(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
+}
+func (m *GbpContractAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Contract.Scope = GbpScope(buf.DecodeUint16())
+ m.Contract.Sclass = buf.DecodeUint16()
+ m.Contract.Dclass = buf.DecodeUint16()
+ m.Contract.ACLIndex = buf.DecodeUint32()
+ m.Contract.NEtherTypes = buf.DecodeUint8()
+ m.Contract.AllowedEthertypes = make([]uint16, 16)
+ for i := 0; i < len(m.Contract.AllowedEthertypes); i++ {
+ m.Contract.AllowedEthertypes[i] = buf.DecodeUint16()
+ }
+ m.Contract.NRules = buf.DecodeUint8()
+ 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())
+ m.Contract.Rules[j1].NhSet.NNhs = buf.DecodeUint8()
+ for j3 := 0; j3 < 8; j3++ {
+ m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ copy(m.Contract.Rules[j1].NhSet.Nhs[j3].Mac[:], buf.DecodeBytes(6))
+ m.Contract.Rules[j1].NhSet.Nhs[j3].BdID = buf.DecodeUint32()
+ m.Contract.Rules[j1].NhSet.Nhs[j3].RdID = buf.DecodeUint32()
+ }
+ }
+ return nil
+}
+
+// GbpContractAddDelReply defines message 'gbp_contract_add_del_reply'.
+type GbpContractAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
+}
+
+func (m *GbpContractAddDelReply) Reset() { *m = GbpContractAddDelReply{} }
+func (*GbpContractAddDelReply) GetMessageName() string { return "gbp_contract_add_del_reply" }
+func (*GbpContractAddDelReply) GetCrcString() string { return "1992deab" }
+func (*GbpContractAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpContractAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.StatsIndex
+ return size
+}
+func (m *GbpContractAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.StatsIndex = buf.DecodeUint32()
+ return nil
+}
+
+// GbpContractDetails defines message 'gbp_contract_details'.
+type GbpContractDetails struct {
+ Contract GbpContract `binapi:"gbp_contract,name=contract" json:"contract,omitempty"`
+}
+
+func (m *GbpContractDetails) Reset() { *m = GbpContractDetails{} }
+func (*GbpContractDetails) GetMessageName() string { return "gbp_contract_details" }
+func (*GbpContractDetails) GetCrcString() string { return "2a18db6e" }
+func (*GbpContractDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpContractDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.Contract.Scope
+ size += 2 // m.Contract.Sclass
+ size += 2 // m.Contract.Dclass
+ size += 4 // m.Contract.ACLIndex
+ size += 1 // m.Contract.NEtherTypes
+ size += 2 * 16 // m.Contract.AllowedEthertypes
+ size += 1 // m.Contract.NRules
+ for j2 := 0; j2 < len(m.Contract.Rules); j2++ {
+ var s2 GbpRule
+ _ = s2
+ if j2 < len(m.Contract.Rules) {
+ s2 = m.Contract.Rules[j2]
+ }
+ size += 4 // s2.Action
+ size += 4 // s2.NhSet.HashMode
+ size += 1 // s2.NhSet.NNhs
+ for j4 := 0; j4 < 8; j4++ {
+ size += 4 // 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(uint16(m.Contract.Scope))
+ 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(x)
+ }
+ buf.EncodeUint8(uint8(len(m.Contract.Rules)))
+ for j1 := 0; j1 < len(m.Contract.Rules); j1++ {
+ 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(v1.NhSet.NNhs)
+ for j3 := 0; j3 < 8; j3++ {
+ buf.EncodeUint32(uint32(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
+}
+func (m *GbpContractDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Contract.Scope = GbpScope(buf.DecodeUint16())
+ m.Contract.Sclass = buf.DecodeUint16()
+ m.Contract.Dclass = buf.DecodeUint16()
+ m.Contract.ACLIndex = buf.DecodeUint32()
+ m.Contract.NEtherTypes = buf.DecodeUint8()
+ m.Contract.AllowedEthertypes = make([]uint16, 16)
+ for i := 0; i < len(m.Contract.AllowedEthertypes); i++ {
+ m.Contract.AllowedEthertypes[i] = buf.DecodeUint16()
+ }
+ m.Contract.NRules = buf.DecodeUint8()
+ 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())
+ m.Contract.Rules[j1].NhSet.NNhs = buf.DecodeUint8()
+ for j3 := 0; j3 < 8; j3++ {
+ m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ copy(m.Contract.Rules[j1].NhSet.Nhs[j3].Mac[:], buf.DecodeBytes(6))
+ m.Contract.Rules[j1].NhSet.Nhs[j3].BdID = buf.DecodeUint32()
+ m.Contract.Rules[j1].NhSet.Nhs[j3].RdID = buf.DecodeUint32()
+ }
+ }
+ return nil
+}
+
+// GbpContractDump defines message 'gbp_contract_dump'.
+type GbpContractDump struct{}
+
+func (m *GbpContractDump) Reset() { *m = GbpContractDump{} }
+func (*GbpContractDump) GetMessageName() string { return "gbp_contract_dump" }
+func (*GbpContractDump) GetCrcString() string { return "51077d14" }
+func (*GbpContractDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpContractDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GbpContractDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GbpContractDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GbpEndpointAdd defines message 'gbp_endpoint_add'.
+type GbpEndpointAdd struct {
+ Endpoint GbpEndpoint `binapi:"gbp_endpoint,name=endpoint" json:"endpoint,omitempty"`
+}
+
+func (m *GbpEndpointAdd) Reset() { *m = GbpEndpointAdd{} }
+func (*GbpEndpointAdd) GetMessageName() string { return "gbp_endpoint_add" }
+func (*GbpEndpointAdd) GetCrcString() string { return "9ce16d5a" }
+func (*GbpEndpointAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpEndpointAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Endpoint.SwIfIndex
+ size += 2 // m.Endpoint.Sclass
+ size += 4 // m.Endpoint.Flags
+ size += 1 * 6 // m.Endpoint.Mac
+ size += 4 // m.Endpoint.Tun.Src.Af
+ size += 1 * 16 // m.Endpoint.Tun.Src.Un
+ size += 4 // m.Endpoint.Tun.Dst.Af
+ size += 1 * 16 // m.Endpoint.Tun.Dst.Un
+ size += 1 // m.Endpoint.NIps
+ for j2 := 0; j2 < len(m.Endpoint.Ips); j2++ {
+ var s2 Address
+ _ = s2
+ if j2 < len(m.Endpoint.Ips) {
+ s2 = m.Endpoint.Ips[j2]
+ }
+ size += 4 // s2.Af
+ size += 1 * 16 // s2.Un
+ }
+ return size
+}
+func (m *GbpEndpointAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Endpoint.SwIfIndex))
+ buf.EncodeUint16(m.Endpoint.Sclass)
+ buf.EncodeUint32(uint32(m.Endpoint.Flags))
+ buf.EncodeBytes(m.Endpoint.Mac[:], 6)
+ buf.EncodeUint32(uint32(m.Endpoint.Tun.Src.Af))
+ buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Endpoint.Tun.Dst.Af))
+ 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 Address // Ips
+ if j1 < len(m.Endpoint.Ips) {
+ v1 = m.Endpoint.Ips[j1]
+ }
+ buf.EncodeUint32(uint32(v1.Af))
+ buf.EncodeBytes(v1.Un.XXX_UnionData[:], 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *GbpEndpointAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Endpoint.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Endpoint.Sclass = buf.DecodeUint16()
+ m.Endpoint.Flags = GbpEndpointFlags(buf.DecodeUint32())
+ copy(m.Endpoint.Mac[:], buf.DecodeBytes(6))
+ m.Endpoint.Tun.Src.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Endpoint.Tun.Dst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Endpoint.NIps = buf.DecodeUint8()
+ m.Endpoint.Ips = make([]Address, m.Endpoint.NIps)
+ for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ {
+ m.Endpoint.Ips[j1].Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Endpoint.Ips[j1].Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ }
+ return nil
+}
+
+// GbpEndpointAddReply defines message 'gbp_endpoint_add_reply'.
+type GbpEndpointAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Handle uint32 `binapi:"u32,name=handle" json:"handle,omitempty"`
+}
+
+func (m *GbpEndpointAddReply) Reset() { *m = GbpEndpointAddReply{} }
+func (*GbpEndpointAddReply) GetMessageName() string { return "gbp_endpoint_add_reply" }
+func (*GbpEndpointAddReply) GetCrcString() string { return "1dd3ff3e" }
+func (*GbpEndpointAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpEndpointAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Handle
+ return size
+}
+func (m *GbpEndpointAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.Handle = buf.DecodeUint32()
+ return nil
+}
+
+// GbpEndpointDel defines message 'gbp_endpoint_del'.
+type GbpEndpointDel struct {
+ Handle uint32 `binapi:"u32,name=handle" json:"handle,omitempty"`
+}
+
+func (m *GbpEndpointDel) Reset() { *m = GbpEndpointDel{} }
+func (*GbpEndpointDel) GetMessageName() string { return "gbp_endpoint_del" }
+func (*GbpEndpointDel) GetCrcString() string { return "b93cd566" }
+func (*GbpEndpointDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpEndpointDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Handle
+ return size
+}
+func (m *GbpEndpointDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Handle)
+ return buf.Bytes(), nil
+}
+func (m *GbpEndpointDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Handle = buf.DecodeUint32()
+ return nil
+}
+
+// GbpEndpointDelReply defines message 'gbp_endpoint_del_reply'.
+type GbpEndpointDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpEndpointDelReply) Reset() { *m = GbpEndpointDelReply{} }
+func (*GbpEndpointDelReply) GetMessageName() string { return "gbp_endpoint_del_reply" }
+func (*GbpEndpointDelReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpEndpointDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpEndpointDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpEndpointDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpEndpointDetails defines message 'gbp_endpoint_details'.
+type GbpEndpointDetails struct {
+ Age float64 `binapi:"f64,name=age" json:"age,omitempty"`
+ Handle uint32 `binapi:"u32,name=handle" json:"handle,omitempty"`
+ Endpoint GbpEndpoint `binapi:"gbp_endpoint,name=endpoint" json:"endpoint,omitempty"`
+}
+
+func (m *GbpEndpointDetails) Reset() { *m = GbpEndpointDetails{} }
+func (*GbpEndpointDetails) GetMessageName() string { return "gbp_endpoint_details" }
+func (*GbpEndpointDetails) GetCrcString() string { return "08aecb60" }
+func (*GbpEndpointDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpEndpointDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 8 // m.Age
+ size += 4 // m.Handle
+ size += 4 // m.Endpoint.SwIfIndex
+ size += 2 // m.Endpoint.Sclass
+ size += 4 // m.Endpoint.Flags
+ size += 1 * 6 // m.Endpoint.Mac
+ size += 4 // m.Endpoint.Tun.Src.Af
+ size += 1 * 16 // m.Endpoint.Tun.Src.Un
+ size += 4 // m.Endpoint.Tun.Dst.Af
+ size += 1 * 16 // m.Endpoint.Tun.Dst.Un
+ size += 1 // m.Endpoint.NIps
+ for j2 := 0; j2 < len(m.Endpoint.Ips); j2++ {
+ var s2 Address
+ _ = s2
+ if j2 < len(m.Endpoint.Ips) {
+ s2 = m.Endpoint.Ips[j2]
+ }
+ size += 4 // s2.Af
+ size += 1 * 16 // s2.Un
+ }
+ return size
+}
+func (m *GbpEndpointDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeFloat64(m.Age)
+ buf.EncodeUint32(m.Handle)
+ buf.EncodeUint32(uint32(m.Endpoint.SwIfIndex))
+ buf.EncodeUint16(m.Endpoint.Sclass)
+ buf.EncodeUint32(uint32(m.Endpoint.Flags))
+ buf.EncodeBytes(m.Endpoint.Mac[:], 6)
+ buf.EncodeUint32(uint32(m.Endpoint.Tun.Src.Af))
+ buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Endpoint.Tun.Dst.Af))
+ 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 Address // Ips
+ if j1 < len(m.Endpoint.Ips) {
+ v1 = m.Endpoint.Ips[j1]
+ }
+ buf.EncodeUint32(uint32(v1.Af))
+ buf.EncodeBytes(v1.Un.XXX_UnionData[:], 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *GbpEndpointDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Age = buf.DecodeFloat64()
+ m.Handle = buf.DecodeUint32()
+ m.Endpoint.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Endpoint.Sclass = buf.DecodeUint16()
+ m.Endpoint.Flags = GbpEndpointFlags(buf.DecodeUint32())
+ copy(m.Endpoint.Mac[:], buf.DecodeBytes(6))
+ m.Endpoint.Tun.Src.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Endpoint.Tun.Dst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Endpoint.NIps = buf.DecodeUint8()
+ m.Endpoint.Ips = make([]Address, m.Endpoint.NIps)
+ for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ {
+ m.Endpoint.Ips[j1].Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Endpoint.Ips[j1].Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ }
+ return nil
+}
+
+// GbpEndpointDump defines message 'gbp_endpoint_dump'.
+type GbpEndpointDump struct{}
+
+func (m *GbpEndpointDump) Reset() { *m = GbpEndpointDump{} }
+func (*GbpEndpointDump) GetMessageName() string { return "gbp_endpoint_dump" }
+func (*GbpEndpointDump) GetCrcString() string { return "51077d14" }
+func (*GbpEndpointDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpEndpointDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GbpEndpointDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GbpEndpointDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GbpEndpointGroupAdd defines message 'gbp_endpoint_group_add'.
+type GbpEndpointGroupAdd struct {
+ Epg GbpEndpointGroup `binapi:"gbp_endpoint_group,name=epg" json:"epg,omitempty"`
+}
+
+func (m *GbpEndpointGroupAdd) Reset() { *m = GbpEndpointGroupAdd{} }
+func (*GbpEndpointGroupAdd) GetMessageName() string { return "gbp_endpoint_group_add" }
+func (*GbpEndpointGroupAdd) GetCrcString() string { return "8e0f4054" }
+func (*GbpEndpointGroupAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpEndpointGroupAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Epg.Vnid
+ size += 2 // m.Epg.Sclass
+ size += 4 // m.Epg.BdID
+ size += 4 // m.Epg.RdID
+ size += 4 // m.Epg.UplinkSwIfIndex
+ size += 4 // m.Epg.Retention.RemoteEpTimeout
+ return size
+}
+func (m *GbpEndpointGroupAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(m.Epg.Retention.RemoteEpTimeout)
+ return buf.Bytes(), nil
+}
+func (m *GbpEndpointGroupAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Epg.Vnid = buf.DecodeUint32()
+ m.Epg.Sclass = buf.DecodeUint16()
+ m.Epg.BdID = buf.DecodeUint32()
+ m.Epg.RdID = buf.DecodeUint32()
+ m.Epg.UplinkSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Epg.Retention.RemoteEpTimeout = buf.DecodeUint32()
+ return nil
+}
+
+// GbpEndpointGroupAddReply defines message 'gbp_endpoint_group_add_reply'.
+type GbpEndpointGroupAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpEndpointGroupAddReply) Reset() { *m = GbpEndpointGroupAddReply{} }
+func (*GbpEndpointGroupAddReply) GetMessageName() string { return "gbp_endpoint_group_add_reply" }
+func (*GbpEndpointGroupAddReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpEndpointGroupAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpEndpointGroupAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpEndpointGroupAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpEndpointGroupDel defines message 'gbp_endpoint_group_del'.
+type GbpEndpointGroupDel struct {
+ Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"`
+}
+
+func (m *GbpEndpointGroupDel) Reset() { *m = GbpEndpointGroupDel{} }
+func (*GbpEndpointGroupDel) GetMessageName() string { return "gbp_endpoint_group_del" }
+func (*GbpEndpointGroupDel) GetCrcString() string { return "3436b8b7" }
+func (*GbpEndpointGroupDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpEndpointGroupDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.Sclass
+ return size
+}
+func (m *GbpEndpointGroupDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.Sclass)
+ return buf.Bytes(), nil
+}
+func (m *GbpEndpointGroupDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Sclass = buf.DecodeUint16()
+ return nil
+}
+
+// GbpEndpointGroupDelReply defines message 'gbp_endpoint_group_del_reply'.
+type GbpEndpointGroupDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpEndpointGroupDelReply) Reset() { *m = GbpEndpointGroupDelReply{} }
+func (*GbpEndpointGroupDelReply) GetMessageName() string { return "gbp_endpoint_group_del_reply" }
+func (*GbpEndpointGroupDelReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpEndpointGroupDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpEndpointGroupDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpEndpointGroupDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpEndpointGroupDetails defines message 'gbp_endpoint_group_details'.
+type GbpEndpointGroupDetails struct {
+ Epg GbpEndpointGroup `binapi:"gbp_endpoint_group,name=epg" json:"epg,omitempty"`
+}
+
+func (m *GbpEndpointGroupDetails) Reset() { *m = GbpEndpointGroupDetails{} }
+func (*GbpEndpointGroupDetails) GetMessageName() string { return "gbp_endpoint_group_details" }
+func (*GbpEndpointGroupDetails) GetCrcString() string { return "8f38292c" }
+func (*GbpEndpointGroupDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpEndpointGroupDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Epg.Vnid
+ size += 2 // m.Epg.Sclass
+ size += 4 // m.Epg.BdID
+ size += 4 // m.Epg.RdID
+ size += 4 // m.Epg.UplinkSwIfIndex
+ size += 4 // m.Epg.Retention.RemoteEpTimeout
+ return size
+}
+func (m *GbpEndpointGroupDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(m.Epg.Retention.RemoteEpTimeout)
+ return buf.Bytes(), nil
+}
+func (m *GbpEndpointGroupDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Epg.Vnid = buf.DecodeUint32()
+ m.Epg.Sclass = buf.DecodeUint16()
+ m.Epg.BdID = buf.DecodeUint32()
+ m.Epg.RdID = buf.DecodeUint32()
+ m.Epg.UplinkSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Epg.Retention.RemoteEpTimeout = buf.DecodeUint32()
+ return nil
+}
+
+// GbpEndpointGroupDump defines message 'gbp_endpoint_group_dump'.
+type GbpEndpointGroupDump struct{}
+
+func (m *GbpEndpointGroupDump) Reset() { *m = GbpEndpointGroupDump{} }
+func (*GbpEndpointGroupDump) GetMessageName() string { return "gbp_endpoint_group_dump" }
+func (*GbpEndpointGroupDump) GetCrcString() string { return "51077d14" }
+func (*GbpEndpointGroupDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpEndpointGroupDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GbpEndpointGroupDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GbpEndpointGroupDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GbpExtItfAddDel defines message 'gbp_ext_itf_add_del'.
+type GbpExtItfAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ ExtItf GbpExtItf `binapi:"gbp_ext_itf,name=ext_itf" json:"ext_itf,omitempty"`
+}
+
+func (m *GbpExtItfAddDel) Reset() { *m = GbpExtItfAddDel{} }
+func (*GbpExtItfAddDel) GetMessageName() string { return "gbp_ext_itf_add_del" }
+func (*GbpExtItfAddDel) GetCrcString() string { return "12ed5700" }
+func (*GbpExtItfAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpExtItfAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.ExtItf.SwIfIndex
+ size += 4 // m.ExtItf.BdID
+ size += 4 // m.ExtItf.RdID
+ size += 4 // m.ExtItf.Flags
+ return size
+}
+func (m *GbpExtItfAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.ExtItf.SwIfIndex))
+ buf.EncodeUint32(m.ExtItf.BdID)
+ buf.EncodeUint32(m.ExtItf.RdID)
+ buf.EncodeUint32(uint32(m.ExtItf.Flags))
+ return buf.Bytes(), nil
+}
+func (m *GbpExtItfAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.ExtItf.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.ExtItf.BdID = buf.DecodeUint32()
+ m.ExtItf.RdID = buf.DecodeUint32()
+ m.ExtItf.Flags = GbpExtItfFlags(buf.DecodeUint32())
+ return nil
+}
+
+// GbpExtItfAddDelReply defines message 'gbp_ext_itf_add_del_reply'.
+type GbpExtItfAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpExtItfAddDelReply) Reset() { *m = GbpExtItfAddDelReply{} }
+func (*GbpExtItfAddDelReply) GetMessageName() string { return "gbp_ext_itf_add_del_reply" }
+func (*GbpExtItfAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpExtItfAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpExtItfAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpExtItfAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpExtItfDetails defines message 'gbp_ext_itf_details'.
+type GbpExtItfDetails struct {
+ ExtItf GbpExtItf `binapi:"gbp_ext_itf,name=ext_itf" json:"ext_itf,omitempty"`
+}
+
+func (m *GbpExtItfDetails) Reset() { *m = GbpExtItfDetails{} }
+func (*GbpExtItfDetails) GetMessageName() string { return "gbp_ext_itf_details" }
+func (*GbpExtItfDetails) GetCrcString() string { return "408a45c0" }
+func (*GbpExtItfDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpExtItfDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ExtItf.SwIfIndex
+ size += 4 // m.ExtItf.BdID
+ size += 4 // m.ExtItf.RdID
+ size += 4 // m.ExtItf.Flags
+ return size
+}
+func (m *GbpExtItfDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.ExtItf.SwIfIndex))
+ buf.EncodeUint32(m.ExtItf.BdID)
+ buf.EncodeUint32(m.ExtItf.RdID)
+ buf.EncodeUint32(uint32(m.ExtItf.Flags))
+ return buf.Bytes(), nil
+}
+func (m *GbpExtItfDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ExtItf.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.ExtItf.BdID = buf.DecodeUint32()
+ m.ExtItf.RdID = buf.DecodeUint32()
+ m.ExtItf.Flags = GbpExtItfFlags(buf.DecodeUint32())
+ return nil
+}
+
+// GbpExtItfDump defines message 'gbp_ext_itf_dump'.
+type GbpExtItfDump struct{}
+
+func (m *GbpExtItfDump) Reset() { *m = GbpExtItfDump{} }
+func (*GbpExtItfDump) GetMessageName() string { return "gbp_ext_itf_dump" }
+func (*GbpExtItfDump) GetCrcString() string { return "51077d14" }
+func (*GbpExtItfDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpExtItfDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GbpExtItfDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GbpExtItfDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GbpRecircAddDel defines message 'gbp_recirc_add_del'.
+type GbpRecircAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Recirc GbpRecirc `binapi:"gbp_recirc,name=recirc" json:"recirc,omitempty"`
+}
+
+func (m *GbpRecircAddDel) Reset() { *m = GbpRecircAddDel{} }
+func (*GbpRecircAddDel) GetMessageName() string { return "gbp_recirc_add_del" }
+func (*GbpRecircAddDel) GetCrcString() string { return "718c69c3" }
+func (*GbpRecircAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpRecircAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Recirc.SwIfIndex
+ size += 2 // m.Recirc.Sclass
+ size += 1 // m.Recirc.IsExt
+ return size
+}
+func (m *GbpRecircAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.Recirc.SwIfIndex))
+ buf.EncodeUint16(m.Recirc.Sclass)
+ buf.EncodeBool(m.Recirc.IsExt)
+ return buf.Bytes(), nil
+}
+func (m *GbpRecircAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Recirc.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Recirc.Sclass = buf.DecodeUint16()
+ m.Recirc.IsExt = buf.DecodeBool()
+ return nil
+}
+
+// GbpRecircAddDelReply defines message 'gbp_recirc_add_del_reply'.
+type GbpRecircAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpRecircAddDelReply) Reset() { *m = GbpRecircAddDelReply{} }
+func (*GbpRecircAddDelReply) GetMessageName() string { return "gbp_recirc_add_del_reply" }
+func (*GbpRecircAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpRecircAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpRecircAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpRecircAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpRecircDetails defines message 'gbp_recirc_details'.
+type GbpRecircDetails struct {
+ Recirc GbpRecirc `binapi:"gbp_recirc,name=recirc" json:"recirc,omitempty"`
+}
+
+func (m *GbpRecircDetails) Reset() { *m = GbpRecircDetails{} }
+func (*GbpRecircDetails) GetMessageName() string { return "gbp_recirc_details" }
+func (*GbpRecircDetails) GetCrcString() string { return "66ecc42e" }
+func (*GbpRecircDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpRecircDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Recirc.SwIfIndex))
+ buf.EncodeUint16(m.Recirc.Sclass)
+ buf.EncodeBool(m.Recirc.IsExt)
+ return buf.Bytes(), nil
+}
+func (m *GbpRecircDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Recirc.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Recirc.Sclass = buf.DecodeUint16()
+ m.Recirc.IsExt = buf.DecodeBool()
+ return nil
+}
+
+// GbpRecircDump defines message 'gbp_recirc_dump'.
+type GbpRecircDump struct{}
+
+func (m *GbpRecircDump) Reset() { *m = GbpRecircDump{} }
+func (*GbpRecircDump) GetMessageName() string { return "gbp_recirc_dump" }
+func (*GbpRecircDump) GetCrcString() string { return "51077d14" }
+func (*GbpRecircDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpRecircDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GbpRecircDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GbpRecircDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GbpRouteDomainAdd defines message 'gbp_route_domain_add'.
+type GbpRouteDomainAdd struct {
+ Rd GbpRouteDomain `binapi:"gbp_route_domain,name=rd" json:"rd,omitempty"`
+}
+
+func (m *GbpRouteDomainAdd) Reset() { *m = GbpRouteDomainAdd{} }
+func (*GbpRouteDomainAdd) GetMessageName() string { return "gbp_route_domain_add" }
+func (*GbpRouteDomainAdd) GetCrcString() string { return "2d0afe38" }
+func (*GbpRouteDomainAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpRouteDomainAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Rd.RdID
+ size += 4 // m.Rd.IP4TableID
+ size += 4 // m.Rd.IP6TableID
+ size += 4 // m.Rd.IP4UuSwIfIndex
+ size += 4 // m.Rd.IP6UuSwIfIndex
+ size += 2 // m.Rd.Scope
+ return size
+}
+func (m *GbpRouteDomainAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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))
+ return buf.Bytes(), nil
+}
+func (m *GbpRouteDomainAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Rd.RdID = buf.DecodeUint32()
+ m.Rd.IP4TableID = buf.DecodeUint32()
+ m.Rd.IP6TableID = buf.DecodeUint32()
+ m.Rd.IP4UuSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Rd.IP6UuSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Rd.Scope = GbpScope(buf.DecodeUint16())
+ return nil
+}
+
+// GbpRouteDomainAddReply defines message 'gbp_route_domain_add_reply'.
+type GbpRouteDomainAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpRouteDomainAddReply) Reset() { *m = GbpRouteDomainAddReply{} }
+func (*GbpRouteDomainAddReply) GetMessageName() string { return "gbp_route_domain_add_reply" }
+func (*GbpRouteDomainAddReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpRouteDomainAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpRouteDomainAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpRouteDomainAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpRouteDomainDel defines message 'gbp_route_domain_del'.
+type GbpRouteDomainDel struct {
+ RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
+}
+
+func (m *GbpRouteDomainDel) Reset() { *m = GbpRouteDomainDel{} }
+func (*GbpRouteDomainDel) GetMessageName() string { return "gbp_route_domain_del" }
+func (*GbpRouteDomainDel) GetCrcString() string { return "bee4edcd" }
+func (*GbpRouteDomainDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpRouteDomainDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.RdID
+ return size
+}
+func (m *GbpRouteDomainDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.RdID)
+ return buf.Bytes(), nil
+}
+func (m *GbpRouteDomainDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.RdID = buf.DecodeUint32()
+ return nil
+}
+
+// GbpRouteDomainDelReply defines message 'gbp_route_domain_del_reply'.
+type GbpRouteDomainDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpRouteDomainDelReply) Reset() { *m = GbpRouteDomainDelReply{} }
+func (*GbpRouteDomainDelReply) GetMessageName() string { return "gbp_route_domain_del_reply" }
+func (*GbpRouteDomainDelReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpRouteDomainDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpRouteDomainDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpRouteDomainDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpRouteDomainDetails defines message 'gbp_route_domain_details'.
+type GbpRouteDomainDetails struct {
+ Rd GbpRouteDomain `binapi:"gbp_route_domain,name=rd" json:"rd,omitempty"`
+}
+
+func (m *GbpRouteDomainDetails) Reset() { *m = GbpRouteDomainDetails{} }
+func (*GbpRouteDomainDetails) GetMessageName() string { return "gbp_route_domain_details" }
+func (*GbpRouteDomainDetails) GetCrcString() string { return "8ab11375" }
+func (*GbpRouteDomainDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpRouteDomainDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Rd.RdID
+ size += 4 // m.Rd.IP4TableID
+ size += 4 // m.Rd.IP6TableID
+ size += 4 // m.Rd.IP4UuSwIfIndex
+ size += 4 // m.Rd.IP6UuSwIfIndex
+ size += 2 // m.Rd.Scope
+ return size
+}
+func (m *GbpRouteDomainDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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))
+ return buf.Bytes(), nil
+}
+func (m *GbpRouteDomainDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Rd.RdID = buf.DecodeUint32()
+ m.Rd.IP4TableID = buf.DecodeUint32()
+ m.Rd.IP6TableID = buf.DecodeUint32()
+ m.Rd.IP4UuSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Rd.IP6UuSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Rd.Scope = GbpScope(buf.DecodeUint16())
+ return nil
+}
+
+// GbpRouteDomainDump defines message 'gbp_route_domain_dump'.
+type GbpRouteDomainDump struct{}
+
+func (m *GbpRouteDomainDump) Reset() { *m = GbpRouteDomainDump{} }
+func (*GbpRouteDomainDump) GetMessageName() string { return "gbp_route_domain_dump" }
+func (*GbpRouteDomainDump) GetCrcString() string { return "51077d14" }
+func (*GbpRouteDomainDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpRouteDomainDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GbpRouteDomainDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GbpRouteDomainDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GbpRouteDomainDumpReply defines message 'gbp_route_domain_dump_reply'.
+type GbpRouteDomainDumpReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpRouteDomainDumpReply) Reset() { *m = GbpRouteDomainDumpReply{} }
+func (*GbpRouteDomainDumpReply) GetMessageName() string { return "gbp_route_domain_dump_reply" }
+func (*GbpRouteDomainDumpReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpRouteDomainDumpReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpRouteDomainDumpReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpRouteDomainDumpReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpSubnetAddDel defines message 'gbp_subnet_add_del'.
+type GbpSubnetAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Subnet GbpSubnet `binapi:"gbp_subnet,name=subnet" json:"subnet,omitempty"`
+}
+
+func (m *GbpSubnetAddDel) Reset() { *m = GbpSubnetAddDel{} }
+func (*GbpSubnetAddDel) GetMessageName() string { return "gbp_subnet_add_del" }
+func (*GbpSubnetAddDel) GetCrcString() string { return "888aca35" }
+func (*GbpSubnetAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpSubnetAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Subnet.RdID
+ size += 4 // m.Subnet.SwIfIndex
+ size += 2 // m.Subnet.Sclass
+ size += 4 // m.Subnet.Type
+ size += 4 // m.Subnet.Prefix.Address.Af
+ size += 1 * 16 // m.Subnet.Prefix.Address.Un
+ size += 1 // m.Subnet.Prefix.Len
+ return size
+}
+func (m *GbpSubnetAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(m.Subnet.RdID)
+ buf.EncodeUint32(uint32(m.Subnet.SwIfIndex))
+ buf.EncodeUint16(m.Subnet.Sclass)
+ buf.EncodeUint32(uint32(m.Subnet.Type))
+ buf.EncodeUint32(uint32(m.Subnet.Prefix.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Subnet.RdID = buf.DecodeUint32()
+ m.Subnet.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Subnet.Sclass = buf.DecodeUint16()
+ m.Subnet.Type = GbpSubnetType(buf.DecodeUint32())
+ m.Subnet.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Subnet.Prefix.Len = buf.DecodeUint8()
+ return nil
+}
+
+// GbpSubnetAddDelReply defines message 'gbp_subnet_add_del_reply'.
+type GbpSubnetAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpSubnetAddDelReply) Reset() { *m = GbpSubnetAddDelReply{} }
+func (*GbpSubnetAddDelReply) GetMessageName() string { return "gbp_subnet_add_del_reply" }
+func (*GbpSubnetAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpSubnetAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpSubnetAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpSubnetAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpSubnetDetails defines message 'gbp_subnet_details'.
+type GbpSubnetDetails struct {
+ Subnet GbpSubnet `binapi:"gbp_subnet,name=subnet" json:"subnet,omitempty"`
+}
+
+func (m *GbpSubnetDetails) Reset() { *m = GbpSubnetDetails{} }
+func (*GbpSubnetDetails) GetMessageName() string { return "gbp_subnet_details" }
+func (*GbpSubnetDetails) GetCrcString() string { return "4ed84156" }
+func (*GbpSubnetDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpSubnetDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Subnet.RdID
+ size += 4 // m.Subnet.SwIfIndex
+ size += 2 // m.Subnet.Sclass
+ size += 4 // m.Subnet.Type
+ size += 4 // m.Subnet.Prefix.Address.Af
+ size += 1 * 16 // m.Subnet.Prefix.Address.Un
+ size += 1 // m.Subnet.Prefix.Len
+ return size
+}
+func (m *GbpSubnetDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Subnet.RdID)
+ buf.EncodeUint32(uint32(m.Subnet.SwIfIndex))
+ buf.EncodeUint16(m.Subnet.Sclass)
+ buf.EncodeUint32(uint32(m.Subnet.Type))
+ buf.EncodeUint32(uint32(m.Subnet.Prefix.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Subnet.RdID = buf.DecodeUint32()
+ m.Subnet.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Subnet.Sclass = buf.DecodeUint16()
+ m.Subnet.Type = GbpSubnetType(buf.DecodeUint32())
+ m.Subnet.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Subnet.Prefix.Len = buf.DecodeUint8()
+ return nil
+}
+
+// GbpSubnetDump defines message 'gbp_subnet_dump'.
+type GbpSubnetDump struct{}
+
+func (m *GbpSubnetDump) Reset() { *m = GbpSubnetDump{} }
+func (*GbpSubnetDump) GetMessageName() string { return "gbp_subnet_dump" }
+func (*GbpSubnetDump) GetCrcString() string { return "51077d14" }
+func (*GbpSubnetDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpSubnetDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GbpSubnetDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GbpSubnetDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GbpVxlanTunnelAdd defines message 'gbp_vxlan_tunnel_add'.
+type GbpVxlanTunnelAdd struct {
+ Tunnel GbpVxlanTunnel `binapi:"gbp_vxlan_tunnel,name=tunnel" json:"tunnel,omitempty"`
+}
+
+func (m *GbpVxlanTunnelAdd) Reset() { *m = GbpVxlanTunnelAdd{} }
+func (*GbpVxlanTunnelAdd) GetMessageName() string { return "gbp_vxlan_tunnel_add" }
+func (*GbpVxlanTunnelAdd) GetCrcString() string { return "3e070b35" }
+func (*GbpVxlanTunnelAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpVxlanTunnelAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Tunnel.Vni
+ size += 4 // m.Tunnel.Mode
+ size += 4 // m.Tunnel.BdRdID
+ size += 1 * 4 // m.Tunnel.Src
+ return size
+}
+func (m *GbpVxlanTunnelAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Tunnel.Vni)
+ buf.EncodeUint32(uint32(m.Tunnel.Mode))
+ buf.EncodeUint32(m.Tunnel.BdRdID)
+ buf.EncodeBytes(m.Tunnel.Src[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *GbpVxlanTunnelAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Tunnel.Vni = buf.DecodeUint32()
+ m.Tunnel.Mode = GbpVxlanTunnelMode(buf.DecodeUint32())
+ m.Tunnel.BdRdID = buf.DecodeUint32()
+ copy(m.Tunnel.Src[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// GbpVxlanTunnelAddReply defines message 'gbp_vxlan_tunnel_add_reply'.
+type GbpVxlanTunnelAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *GbpVxlanTunnelAddReply) Reset() { *m = GbpVxlanTunnelAddReply{} }
+func (*GbpVxlanTunnelAddReply) GetMessageName() string { return "gbp_vxlan_tunnel_add_reply" }
+func (*GbpVxlanTunnelAddReply) GetCrcString() string { return "5383d31f" }
+func (*GbpVxlanTunnelAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpVxlanTunnelAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *GbpVxlanTunnelAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// GbpVxlanTunnelDel defines message 'gbp_vxlan_tunnel_del'.
+type GbpVxlanTunnelDel struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *GbpVxlanTunnelDel) Reset() { *m = GbpVxlanTunnelDel{} }
+func (*GbpVxlanTunnelDel) GetMessageName() string { return "gbp_vxlan_tunnel_del" }
+func (*GbpVxlanTunnelDel) GetCrcString() string { return "8d1f2fe9" }
+func (*GbpVxlanTunnelDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpVxlanTunnelDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ return size
+}
+func (m *GbpVxlanTunnelDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *GbpVxlanTunnelDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// GbpVxlanTunnelDelReply defines message 'gbp_vxlan_tunnel_del_reply'.
+type GbpVxlanTunnelDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GbpVxlanTunnelDelReply) Reset() { *m = GbpVxlanTunnelDelReply{} }
+func (*GbpVxlanTunnelDelReply) GetMessageName() string { return "gbp_vxlan_tunnel_del_reply" }
+func (*GbpVxlanTunnelDelReply) GetCrcString() string { return "e8d4e804" }
+func (*GbpVxlanTunnelDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpVxlanTunnelDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GbpVxlanTunnelDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GbpVxlanTunnelDetails defines message 'gbp_vxlan_tunnel_details'.
+type GbpVxlanTunnelDetails struct {
+ Tunnel GbpVxlanTunnel `binapi:"gbp_vxlan_tunnel,name=tunnel" json:"tunnel,omitempty"`
+}
+
+func (m *GbpVxlanTunnelDetails) Reset() { *m = GbpVxlanTunnelDetails{} }
+func (*GbpVxlanTunnelDetails) GetMessageName() string { return "gbp_vxlan_tunnel_details" }
+func (*GbpVxlanTunnelDetails) GetCrcString() string { return "65c6c818" }
+func (*GbpVxlanTunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GbpVxlanTunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Tunnel.Vni
+ size += 4 // m.Tunnel.Mode
+ size += 4 // m.Tunnel.BdRdID
+ size += 1 * 4 // m.Tunnel.Src
+ return size
+}
+func (m *GbpVxlanTunnelDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Tunnel.Vni)
+ buf.EncodeUint32(uint32(m.Tunnel.Mode))
+ buf.EncodeUint32(m.Tunnel.BdRdID)
+ buf.EncodeBytes(m.Tunnel.Src[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *GbpVxlanTunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Tunnel.Vni = buf.DecodeUint32()
+ m.Tunnel.Mode = GbpVxlanTunnelMode(buf.DecodeUint32())
+ m.Tunnel.BdRdID = buf.DecodeUint32()
+ copy(m.Tunnel.Src[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// GbpVxlanTunnelDump defines message 'gbp_vxlan_tunnel_dump'.
+type GbpVxlanTunnelDump struct{}
+
+func (m *GbpVxlanTunnelDump) Reset() { *m = GbpVxlanTunnelDump{} }
+func (*GbpVxlanTunnelDump) GetMessageName() string { return "gbp_vxlan_tunnel_dump" }
+func (*GbpVxlanTunnelDump) GetCrcString() string { return "51077d14" }
+func (*GbpVxlanTunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GbpVxlanTunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GbpVxlanTunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GbpVxlanTunnelDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_gbp_binapi_init() }
+func file_gbp_binapi_init() {
+ api.RegisterMessage((*GbpBridgeDomainAdd)(nil), "gbp_bridge_domain_add_8454bfdf")
+ api.RegisterMessage((*GbpBridgeDomainAddReply)(nil), "gbp_bridge_domain_add_reply_e8d4e804")
+ api.RegisterMessage((*GbpBridgeDomainDel)(nil), "gbp_bridge_domain_del_c25fdce6")
+ api.RegisterMessage((*GbpBridgeDomainDelReply)(nil), "gbp_bridge_domain_del_reply_e8d4e804")
+ api.RegisterMessage((*GbpBridgeDomainDetails)(nil), "gbp_bridge_domain_details_2acd15f9")
+ api.RegisterMessage((*GbpBridgeDomainDump)(nil), "gbp_bridge_domain_dump_51077d14")
+ api.RegisterMessage((*GbpBridgeDomainDumpReply)(nil), "gbp_bridge_domain_dump_reply_e8d4e804")
+ api.RegisterMessage((*GbpContractAddDel)(nil), "gbp_contract_add_del_553e275b")
+ api.RegisterMessage((*GbpContractAddDelReply)(nil), "gbp_contract_add_del_reply_1992deab")
+ api.RegisterMessage((*GbpContractDetails)(nil), "gbp_contract_details_2a18db6e")
+ api.RegisterMessage((*GbpContractDump)(nil), "gbp_contract_dump_51077d14")
+ api.RegisterMessage((*GbpEndpointAdd)(nil), "gbp_endpoint_add_9ce16d5a")
+ api.RegisterMessage((*GbpEndpointAddReply)(nil), "gbp_endpoint_add_reply_1dd3ff3e")
+ api.RegisterMessage((*GbpEndpointDel)(nil), "gbp_endpoint_del_b93cd566")
+ api.RegisterMessage((*GbpEndpointDelReply)(nil), "gbp_endpoint_del_reply_e8d4e804")
+ api.RegisterMessage((*GbpEndpointDetails)(nil), "gbp_endpoint_details_08aecb60")
+ api.RegisterMessage((*GbpEndpointDump)(nil), "gbp_endpoint_dump_51077d14")
+ api.RegisterMessage((*GbpEndpointGroupAdd)(nil), "gbp_endpoint_group_add_8e0f4054")
+ api.RegisterMessage((*GbpEndpointGroupAddReply)(nil), "gbp_endpoint_group_add_reply_e8d4e804")
+ api.RegisterMessage((*GbpEndpointGroupDel)(nil), "gbp_endpoint_group_del_3436b8b7")
+ api.RegisterMessage((*GbpEndpointGroupDelReply)(nil), "gbp_endpoint_group_del_reply_e8d4e804")
+ api.RegisterMessage((*GbpEndpointGroupDetails)(nil), "gbp_endpoint_group_details_8f38292c")
+ api.RegisterMessage((*GbpEndpointGroupDump)(nil), "gbp_endpoint_group_dump_51077d14")
+ api.RegisterMessage((*GbpExtItfAddDel)(nil), "gbp_ext_itf_add_del_12ed5700")
+ api.RegisterMessage((*GbpExtItfAddDelReply)(nil), "gbp_ext_itf_add_del_reply_e8d4e804")
+ api.RegisterMessage((*GbpExtItfDetails)(nil), "gbp_ext_itf_details_408a45c0")
+ api.RegisterMessage((*GbpExtItfDump)(nil), "gbp_ext_itf_dump_51077d14")
+ api.RegisterMessage((*GbpRecircAddDel)(nil), "gbp_recirc_add_del_718c69c3")
+ api.RegisterMessage((*GbpRecircAddDelReply)(nil), "gbp_recirc_add_del_reply_e8d4e804")
+ api.RegisterMessage((*GbpRecircDetails)(nil), "gbp_recirc_details_66ecc42e")
+ api.RegisterMessage((*GbpRecircDump)(nil), "gbp_recirc_dump_51077d14")
+ api.RegisterMessage((*GbpRouteDomainAdd)(nil), "gbp_route_domain_add_2d0afe38")
+ api.RegisterMessage((*GbpRouteDomainAddReply)(nil), "gbp_route_domain_add_reply_e8d4e804")
+ api.RegisterMessage((*GbpRouteDomainDel)(nil), "gbp_route_domain_del_bee4edcd")
+ api.RegisterMessage((*GbpRouteDomainDelReply)(nil), "gbp_route_domain_del_reply_e8d4e804")
+ api.RegisterMessage((*GbpRouteDomainDetails)(nil), "gbp_route_domain_details_8ab11375")
+ api.RegisterMessage((*GbpRouteDomainDump)(nil), "gbp_route_domain_dump_51077d14")
+ api.RegisterMessage((*GbpRouteDomainDumpReply)(nil), "gbp_route_domain_dump_reply_e8d4e804")
+ api.RegisterMessage((*GbpSubnetAddDel)(nil), "gbp_subnet_add_del_888aca35")
+ api.RegisterMessage((*GbpSubnetAddDelReply)(nil), "gbp_subnet_add_del_reply_e8d4e804")
+ api.RegisterMessage((*GbpSubnetDetails)(nil), "gbp_subnet_details_4ed84156")
+ api.RegisterMessage((*GbpSubnetDump)(nil), "gbp_subnet_dump_51077d14")
+ api.RegisterMessage((*GbpVxlanTunnelAdd)(nil), "gbp_vxlan_tunnel_add_3e070b35")
+ api.RegisterMessage((*GbpVxlanTunnelAddReply)(nil), "gbp_vxlan_tunnel_add_reply_5383d31f")
+ api.RegisterMessage((*GbpVxlanTunnelDel)(nil), "gbp_vxlan_tunnel_del_8d1f2fe9")
+ api.RegisterMessage((*GbpVxlanTunnelDelReply)(nil), "gbp_vxlan_tunnel_del_reply_e8d4e804")
+ api.RegisterMessage((*GbpVxlanTunnelDetails)(nil), "gbp_vxlan_tunnel_details_65c6c818")
+ api.RegisterMessage((*GbpVxlanTunnelDump)(nil), "gbp_vxlan_tunnel_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*GbpBridgeDomainAdd)(nil),
+ (*GbpBridgeDomainAddReply)(nil),
+ (*GbpBridgeDomainDel)(nil),
+ (*GbpBridgeDomainDelReply)(nil),
+ (*GbpBridgeDomainDetails)(nil),
+ (*GbpBridgeDomainDump)(nil),
+ (*GbpBridgeDomainDumpReply)(nil),
+ (*GbpContractAddDel)(nil),
+ (*GbpContractAddDelReply)(nil),
+ (*GbpContractDetails)(nil),
+ (*GbpContractDump)(nil),
+ (*GbpEndpointAdd)(nil),
+ (*GbpEndpointAddReply)(nil),
+ (*GbpEndpointDel)(nil),
+ (*GbpEndpointDelReply)(nil),
+ (*GbpEndpointDetails)(nil),
+ (*GbpEndpointDump)(nil),
+ (*GbpEndpointGroupAdd)(nil),
+ (*GbpEndpointGroupAddReply)(nil),
+ (*GbpEndpointGroupDel)(nil),
+ (*GbpEndpointGroupDelReply)(nil),
+ (*GbpEndpointGroupDetails)(nil),
+ (*GbpEndpointGroupDump)(nil),
+ (*GbpExtItfAddDel)(nil),
+ (*GbpExtItfAddDelReply)(nil),
+ (*GbpExtItfDetails)(nil),
+ (*GbpExtItfDump)(nil),
+ (*GbpRecircAddDel)(nil),
+ (*GbpRecircAddDelReply)(nil),
+ (*GbpRecircDetails)(nil),
+ (*GbpRecircDump)(nil),
+ (*GbpRouteDomainAdd)(nil),
+ (*GbpRouteDomainAddReply)(nil),
+ (*GbpRouteDomainDel)(nil),
+ (*GbpRouteDomainDelReply)(nil),
+ (*GbpRouteDomainDetails)(nil),
+ (*GbpRouteDomainDump)(nil),
+ (*GbpRouteDomainDumpReply)(nil),
+ (*GbpSubnetAddDel)(nil),
+ (*GbpSubnetAddDelReply)(nil),
+ (*GbpSubnetDetails)(nil),
+ (*GbpSubnetDump)(nil),
+ (*GbpVxlanTunnelAdd)(nil),
+ (*GbpVxlanTunnelAddReply)(nil),
+ (*GbpVxlanTunnelDel)(nil),
+ (*GbpVxlanTunnelDelReply)(nil),
+ (*GbpVxlanTunnelDetails)(nil),
+ (*GbpVxlanTunnelDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/gbp/gbp_rpc.ba.go b/internal/testbinapi/binapi2001/gbp/gbp_rpc.ba.go
new file mode 100644
index 0000000..bad1f79
--- /dev/null
+++ b/internal/testbinapi/binapi2001/gbp/gbp_rpc.ba.go
@@ -0,0 +1,523 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package gbp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service gbp.
+type RPCService interface {
+ GbpBridgeDomainAdd(ctx context.Context, in *GbpBridgeDomainAdd) (*GbpBridgeDomainAddReply, error)
+ GbpBridgeDomainDel(ctx context.Context, in *GbpBridgeDomainDel) (*GbpBridgeDomainDelReply, error)
+ GbpBridgeDomainDump(ctx context.Context, in *GbpBridgeDomainDump) (RPCService_GbpBridgeDomainDumpClient, error)
+ GbpContractAddDel(ctx context.Context, in *GbpContractAddDel) (*GbpContractAddDelReply, error)
+ GbpContractDump(ctx context.Context, in *GbpContractDump) (RPCService_GbpContractDumpClient, error)
+ GbpEndpointAdd(ctx context.Context, in *GbpEndpointAdd) (*GbpEndpointAddReply, error)
+ GbpEndpointDel(ctx context.Context, in *GbpEndpointDel) (*GbpEndpointDelReply, error)
+ GbpEndpointDump(ctx context.Context, in *GbpEndpointDump) (RPCService_GbpEndpointDumpClient, error)
+ GbpEndpointGroupAdd(ctx context.Context, in *GbpEndpointGroupAdd) (*GbpEndpointGroupAddReply, error)
+ GbpEndpointGroupDel(ctx context.Context, in *GbpEndpointGroupDel) (*GbpEndpointGroupDelReply, error)
+ GbpEndpointGroupDump(ctx context.Context, in *GbpEndpointGroupDump) (RPCService_GbpEndpointGroupDumpClient, error)
+ GbpExtItfAddDel(ctx context.Context, in *GbpExtItfAddDel) (*GbpExtItfAddDelReply, error)
+ GbpExtItfDump(ctx context.Context, in *GbpExtItfDump) (RPCService_GbpExtItfDumpClient, error)
+ GbpRecircAddDel(ctx context.Context, in *GbpRecircAddDel) (*GbpRecircAddDelReply, error)
+ GbpRecircDump(ctx context.Context, in *GbpRecircDump) (RPCService_GbpRecircDumpClient, error)
+ GbpRouteDomainAdd(ctx context.Context, in *GbpRouteDomainAdd) (*GbpRouteDomainAddReply, error)
+ GbpRouteDomainDel(ctx context.Context, in *GbpRouteDomainDel) (*GbpRouteDomainDelReply, error)
+ GbpRouteDomainDump(ctx context.Context, in *GbpRouteDomainDump) (RPCService_GbpRouteDomainDumpClient, error)
+ GbpSubnetAddDel(ctx context.Context, in *GbpSubnetAddDel) (*GbpSubnetAddDelReply, error)
+ GbpSubnetDump(ctx context.Context, in *GbpSubnetDump) (RPCService_GbpSubnetDumpClient, error)
+ GbpVxlanTunnelAdd(ctx context.Context, in *GbpVxlanTunnelAdd) (*GbpVxlanTunnelAddReply, error)
+ GbpVxlanTunnelDel(ctx context.Context, in *GbpVxlanTunnelDel) (*GbpVxlanTunnelDelReply, error)
+ GbpVxlanTunnelDump(ctx context.Context, in *GbpVxlanTunnelDump) (RPCService_GbpVxlanTunnelDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) GbpBridgeDomainAdd(ctx context.Context, in *GbpBridgeDomainAdd) (*GbpBridgeDomainAddReply, error) {
+ out := new(GbpBridgeDomainAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpBridgeDomainDel(ctx context.Context, in *GbpBridgeDomainDel) (*GbpBridgeDomainDelReply, error) {
+ out := new(GbpBridgeDomainDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpBridgeDomainDump(ctx context.Context, in *GbpBridgeDomainDump) (RPCService_GbpBridgeDomainDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GbpBridgeDomainDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GbpBridgeDomainDumpClient interface {
+ Recv() (*GbpBridgeDomainDetails, error)
+ api.Stream
+}
+
+type serviceClient_GbpBridgeDomainDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GbpBridgeDomainDumpClient) Recv() (*GbpBridgeDomainDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GbpBridgeDomainDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) GbpContractAddDel(ctx context.Context, in *GbpContractAddDel) (*GbpContractAddDelReply, error) {
+ out := new(GbpContractAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpContractDump(ctx context.Context, in *GbpContractDump) (RPCService_GbpContractDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GbpContractDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GbpContractDumpClient interface {
+ Recv() (*GbpContractDetails, error)
+ api.Stream
+}
+
+type serviceClient_GbpContractDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GbpContractDumpClient) Recv() (*GbpContractDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GbpContractDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) GbpEndpointAdd(ctx context.Context, in *GbpEndpointAdd) (*GbpEndpointAddReply, error) {
+ out := new(GbpEndpointAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpEndpointDel(ctx context.Context, in *GbpEndpointDel) (*GbpEndpointDelReply, error) {
+ out := new(GbpEndpointDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpEndpointDump(ctx context.Context, in *GbpEndpointDump) (RPCService_GbpEndpointDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GbpEndpointDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GbpEndpointDumpClient interface {
+ Recv() (*GbpEndpointDetails, error)
+ api.Stream
+}
+
+type serviceClient_GbpEndpointDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GbpEndpointDumpClient) Recv() (*GbpEndpointDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GbpEndpointDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) GbpEndpointGroupAdd(ctx context.Context, in *GbpEndpointGroupAdd) (*GbpEndpointGroupAddReply, error) {
+ out := new(GbpEndpointGroupAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpEndpointGroupDel(ctx context.Context, in *GbpEndpointGroupDel) (*GbpEndpointGroupDelReply, error) {
+ out := new(GbpEndpointGroupDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpEndpointGroupDump(ctx context.Context, in *GbpEndpointGroupDump) (RPCService_GbpEndpointGroupDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GbpEndpointGroupDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GbpEndpointGroupDumpClient interface {
+ Recv() (*GbpEndpointGroupDetails, error)
+ api.Stream
+}
+
+type serviceClient_GbpEndpointGroupDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GbpEndpointGroupDumpClient) Recv() (*GbpEndpointGroupDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GbpEndpointGroupDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) GbpExtItfAddDel(ctx context.Context, in *GbpExtItfAddDel) (*GbpExtItfAddDelReply, error) {
+ out := new(GbpExtItfAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpExtItfDump(ctx context.Context, in *GbpExtItfDump) (RPCService_GbpExtItfDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GbpExtItfDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GbpExtItfDumpClient interface {
+ Recv() (*GbpExtItfDetails, error)
+ api.Stream
+}
+
+type serviceClient_GbpExtItfDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GbpExtItfDumpClient) Recv() (*GbpExtItfDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GbpExtItfDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) GbpRecircAddDel(ctx context.Context, in *GbpRecircAddDel) (*GbpRecircAddDelReply, error) {
+ out := new(GbpRecircAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpRecircDump(ctx context.Context, in *GbpRecircDump) (RPCService_GbpRecircDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GbpRecircDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GbpRecircDumpClient interface {
+ Recv() (*GbpRecircDetails, error)
+ api.Stream
+}
+
+type serviceClient_GbpRecircDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GbpRecircDumpClient) Recv() (*GbpRecircDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GbpRecircDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) GbpRouteDomainAdd(ctx context.Context, in *GbpRouteDomainAdd) (*GbpRouteDomainAddReply, error) {
+ out := new(GbpRouteDomainAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpRouteDomainDel(ctx context.Context, in *GbpRouteDomainDel) (*GbpRouteDomainDelReply, error) {
+ out := new(GbpRouteDomainDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpRouteDomainDump(ctx context.Context, in *GbpRouteDomainDump) (RPCService_GbpRouteDomainDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GbpRouteDomainDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GbpRouteDomainDumpClient interface {
+ Recv() (*GbpRouteDomainDetails, error)
+ api.Stream
+}
+
+type serviceClient_GbpRouteDomainDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GbpRouteDomainDumpClient) Recv() (*GbpRouteDomainDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GbpRouteDomainDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) GbpSubnetAddDel(ctx context.Context, in *GbpSubnetAddDel) (*GbpSubnetAddDelReply, error) {
+ out := new(GbpSubnetAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpSubnetDump(ctx context.Context, in *GbpSubnetDump) (RPCService_GbpSubnetDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GbpSubnetDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GbpSubnetDumpClient interface {
+ Recv() (*GbpSubnetDetails, error)
+ api.Stream
+}
+
+type serviceClient_GbpSubnetDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GbpSubnetDumpClient) Recv() (*GbpSubnetDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GbpSubnetDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) GbpVxlanTunnelAdd(ctx context.Context, in *GbpVxlanTunnelAdd) (*GbpVxlanTunnelAddReply, error) {
+ out := new(GbpVxlanTunnelAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpVxlanTunnelDel(ctx context.Context, in *GbpVxlanTunnelDel) (*GbpVxlanTunnelDelReply, error) {
+ out := new(GbpVxlanTunnelDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GbpVxlanTunnelDump(ctx context.Context, in *GbpVxlanTunnelDump) (RPCService_GbpVxlanTunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GbpVxlanTunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GbpVxlanTunnelDumpClient interface {
+ Recv() (*GbpVxlanTunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_GbpVxlanTunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GbpVxlanTunnelDumpClient) Recv() (*GbpVxlanTunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GbpVxlanTunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/gen.go b/internal/testbinapi/binapi2001/gen.go
new file mode 100644
index 0000000..1a348e3
--- /dev/null
+++ b/internal/testbinapi/binapi2001/gen.go
@@ -0,0 +1,17 @@
+// 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 binapi2001
+
+//go:generate env VPP_VERSION=20.01 binapi-generator -input-dir=.vppapi -output-dir=.
diff --git a/internal/testbinapi/binapi2001/geneve/geneve.ba.go b/internal/testbinapi/binapi2001/geneve/geneve.ba.go
new file mode 100644
index 0000000..e79def2
--- /dev/null
+++ b/internal/testbinapi/binapi2001/geneve/geneve.ba.go
@@ -0,0 +1,1174 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/geneve.api.json
+
+// Package geneve contains generated bindings for API file geneve.api.
+//
+// Contents:
+// 7 aliases
+// 10 enums
+// 6 structs
+// 1 union
+// 6 messages
+//
+package geneve
+
+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 = "geneve"
+ APIVersion = "2.0.0"
+ VersionCrc = 0x46ee8ab6
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// GeneveAddDelTunnel defines message 'geneve_add_del_tunnel'.
+type GeneveAddDelTunnel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ LocalAddress Address `binapi:"address,name=local_address" json:"local_address,omitempty"`
+ RemoteAddress Address `binapi:"address,name=remote_address" json:"remote_address,omitempty"`
+ McastSwIfIndex InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
+ EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
+ DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *GeneveAddDelTunnel) Reset() { *m = GeneveAddDelTunnel{} }
+func (*GeneveAddDelTunnel) GetMessageName() string { return "geneve_add_del_tunnel" }
+func (*GeneveAddDelTunnel) GetCrcString() string { return "976693b5" }
+func (*GeneveAddDelTunnel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GeneveAddDelTunnel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.LocalAddress.Af
+ size += 1 * 16 // m.LocalAddress.Un
+ size += 4 // m.RemoteAddress.Af
+ size += 1 * 16 // m.RemoteAddress.Un
+ size += 4 // m.McastSwIfIndex
+ size += 4 // m.EncapVrfID
+ size += 4 // m.DecapNextIndex
+ size += 4 // m.Vni
+ return size
+}
+func (m *GeneveAddDelTunnel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.LocalAddress.Af))
+ buf.EncodeBytes(m.LocalAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.RemoteAddress.Af))
+ buf.EncodeBytes(m.RemoteAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.McastSwIfIndex))
+ buf.EncodeUint32(m.EncapVrfID)
+ buf.EncodeUint32(m.DecapNextIndex)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *GeneveAddDelTunnel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.LocalAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LocalAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.RemoteAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.RemoteAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.McastSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.EncapVrfID = buf.DecodeUint32()
+ m.DecapNextIndex = buf.DecodeUint32()
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// GeneveAddDelTunnelReply defines message 'geneve_add_del_tunnel_reply'.
+type GeneveAddDelTunnelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *GeneveAddDelTunnelReply) Reset() { *m = GeneveAddDelTunnelReply{} }
+func (*GeneveAddDelTunnelReply) GetMessageName() string { return "geneve_add_del_tunnel_reply" }
+func (*GeneveAddDelTunnelReply) GetCrcString() string { return "5383d31f" }
+func (*GeneveAddDelTunnelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GeneveAddDelTunnelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *GeneveAddDelTunnelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// GeneveTunnelDetails defines message 'geneve_tunnel_details'.
+type GeneveTunnelDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SrcAddress Address `binapi:"address,name=src_address" json:"src_address,omitempty"`
+ DstAddress Address `binapi:"address,name=dst_address" json:"dst_address,omitempty"`
+ McastSwIfIndex InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
+ EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
+ DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *GeneveTunnelDetails) Reset() { *m = GeneveTunnelDetails{} }
+func (*GeneveTunnelDetails) GetMessageName() string { return "geneve_tunnel_details" }
+func (*GeneveTunnelDetails) GetCrcString() string { return "e27e2748" }
+func (*GeneveTunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GeneveTunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.SrcAddress.Af
+ size += 1 * 16 // m.SrcAddress.Un
+ size += 4 // m.DstAddress.Af
+ size += 1 * 16 // m.DstAddress.Un
+ size += 4 // m.McastSwIfIndex
+ size += 4 // m.EncapVrfID
+ size += 4 // m.DecapNextIndex
+ size += 4 // m.Vni
+ return size
+}
+func (m *GeneveTunnelDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.SrcAddress.Af))
+ buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.DstAddress.Af))
+ buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.McastSwIfIndex))
+ buf.EncodeUint32(m.EncapVrfID)
+ buf.EncodeUint32(m.DecapNextIndex)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *GeneveTunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.SrcAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DstAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.McastSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.EncapVrfID = buf.DecodeUint32()
+ m.DecapNextIndex = buf.DecodeUint32()
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// GeneveTunnelDump defines message 'geneve_tunnel_dump'.
+type GeneveTunnelDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *GeneveTunnelDump) Reset() { *m = GeneveTunnelDump{} }
+func (*GeneveTunnelDump) GetMessageName() string { return "geneve_tunnel_dump" }
+func (*GeneveTunnelDump) GetCrcString() string { return "f9e6675e" }
+func (*GeneveTunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GeneveTunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *GeneveTunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *GeneveTunnelDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// SwInterfaceSetGeneveBypass defines message 'sw_interface_set_geneve_bypass'.
+type SwInterfaceSetGeneveBypass struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetGeneveBypass) Reset() { *m = SwInterfaceSetGeneveBypass{} }
+func (*SwInterfaceSetGeneveBypass) GetMessageName() string { return "sw_interface_set_geneve_bypass" }
+func (*SwInterfaceSetGeneveBypass) GetCrcString() string { return "65247409" }
+func (*SwInterfaceSetGeneveBypass) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetGeneveBypass) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetGeneveBypass) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetGeneveBypass) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// SwInterfaceSetGeneveBypassReply defines message 'sw_interface_set_geneve_bypass_reply'.
+type SwInterfaceSetGeneveBypassReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetGeneveBypassReply) Reset() { *m = SwInterfaceSetGeneveBypassReply{} }
+func (*SwInterfaceSetGeneveBypassReply) GetMessageName() string {
+ return "sw_interface_set_geneve_bypass_reply"
+}
+func (*SwInterfaceSetGeneveBypassReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetGeneveBypassReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetGeneveBypassReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetGeneveBypassReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_geneve_binapi_init() }
+func file_geneve_binapi_init() {
+ api.RegisterMessage((*GeneveAddDelTunnel)(nil), "geneve_add_del_tunnel_976693b5")
+ api.RegisterMessage((*GeneveAddDelTunnelReply)(nil), "geneve_add_del_tunnel_reply_5383d31f")
+ api.RegisterMessage((*GeneveTunnelDetails)(nil), "geneve_tunnel_details_e27e2748")
+ api.RegisterMessage((*GeneveTunnelDump)(nil), "geneve_tunnel_dump_f9e6675e")
+ api.RegisterMessage((*SwInterfaceSetGeneveBypass)(nil), "sw_interface_set_geneve_bypass_65247409")
+ api.RegisterMessage((*SwInterfaceSetGeneveBypassReply)(nil), "sw_interface_set_geneve_bypass_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*GeneveAddDelTunnel)(nil),
+ (*GeneveAddDelTunnelReply)(nil),
+ (*GeneveTunnelDetails)(nil),
+ (*GeneveTunnelDump)(nil),
+ (*SwInterfaceSetGeneveBypass)(nil),
+ (*SwInterfaceSetGeneveBypassReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/geneve/geneve_rpc.ba.go b/internal/testbinapi/binapi2001/geneve/geneve_rpc.ba.go
new file mode 100644
index 0000000..fe78712
--- /dev/null
+++ b/internal/testbinapi/binapi2001/geneve/geneve_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package geneve
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service geneve.
+type RPCService interface {
+ GeneveAddDelTunnel(ctx context.Context, in *GeneveAddDelTunnel) (*GeneveAddDelTunnelReply, error)
+ GeneveTunnelDump(ctx context.Context, in *GeneveTunnelDump) (RPCService_GeneveTunnelDumpClient, error)
+ SwInterfaceSetGeneveBypass(ctx context.Context, in *SwInterfaceSetGeneveBypass) (*SwInterfaceSetGeneveBypassReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) GeneveAddDelTunnel(ctx context.Context, in *GeneveAddDelTunnel) (*GeneveAddDelTunnelReply, error) {
+ out := new(GeneveAddDelTunnelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GeneveTunnelDump(ctx context.Context, in *GeneveTunnelDump) (RPCService_GeneveTunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GeneveTunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GeneveTunnelDumpClient interface {
+ Recv() (*GeneveTunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_GeneveTunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GeneveTunnelDumpClient) Recv() (*GeneveTunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GeneveTunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) SwInterfaceSetGeneveBypass(ctx context.Context, in *SwInterfaceSetGeneveBypass) (*SwInterfaceSetGeneveBypassReply, error) {
+ out := new(SwInterfaceSetGeneveBypassReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/gre/gre.ba.go b/internal/testbinapi/binapi2001/gre/gre.ba.go
new file mode 100644
index 0000000..78d3720
--- /dev/null
+++ b/internal/testbinapi/binapi2001/gre/gre.ba.go
@@ -0,0 +1,1131 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/gre.api.json
+
+// Package gre contains generated bindings for API file gre.api.
+//
+// Contents:
+// 6 aliases
+// 12 enums
+// 7 structs
+// 1 union
+// 4 messages
+//
+package gre
+
+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 = "gre"
+ APIVersion = "2.0.1"
+ VersionCrc = 0xb7663194
+)
+
+// 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)) + ")"
+}
+
+// GreTunnelMode defines enum 'gre_tunnel_mode'.
+type GreTunnelMode uint8
+
+const (
+ GRE_API_TUNNEL_MODE_P2P GreTunnelMode = 1
+ GRE_API_TUNNEL_MODE_MP GreTunnelMode = 2
+)
+
+var (
+ GreTunnelMode_name = map[uint8]string{
+ 1: "GRE_API_TUNNEL_MODE_P2P",
+ 2: "GRE_API_TUNNEL_MODE_MP",
+ }
+ GreTunnelMode_value = map[string]uint8{
+ "GRE_API_TUNNEL_MODE_P2P": 1,
+ "GRE_API_TUNNEL_MODE_MP": 2,
+ }
+)
+
+func (x GreTunnelMode) String() string {
+ s, ok := GreTunnelMode_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "GreTunnelMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// GreTunnelType defines enum 'gre_tunnel_type'.
+type GreTunnelType uint8
+
+const (
+ GRE_API_TUNNEL_TYPE_L3 GreTunnelType = 0
+ GRE_API_TUNNEL_TYPE_TEB GreTunnelType = 1
+ GRE_API_TUNNEL_TYPE_ERSPAN GreTunnelType = 2
+)
+
+var (
+ GreTunnelType_name = map[uint8]string{
+ 0: "GRE_API_TUNNEL_TYPE_L3",
+ 1: "GRE_API_TUNNEL_TYPE_TEB",
+ 2: "GRE_API_TUNNEL_TYPE_ERSPAN",
+ }
+ GreTunnelType_value = map[string]uint8{
+ "GRE_API_TUNNEL_TYPE_L3": 0,
+ "GRE_API_TUNNEL_TYPE_TEB": 1,
+ "GRE_API_TUNNEL_TYPE_ERSPAN": 2,
+ }
+)
+
+func (x GreTunnelType) String() string {
+ s, ok := GreTunnelType_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "GreTunnelType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// GreTunnel defines type 'gre_tunnel'.
+type GreTunnel struct {
+ Type GreTunnelType `binapi:"gre_tunnel_type,name=type" json:"type,omitempty"`
+ Mode GreTunnelMode `binapi:"gre_tunnel_mode,name=mode" json:"mode,omitempty"`
+ SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
+ Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
+ OuterTableID uint32 `binapi:"u32,name=outer_table_id" json:"outer_table_id,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Src Address `binapi:"address,name=src" json:"src,omitempty"`
+ Dst Address `binapi:"address,name=dst" json:"dst,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// GreTunnelAddDel defines message 'gre_tunnel_add_del'.
+type GreTunnelAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Tunnel GreTunnel `binapi:"gre_tunnel,name=tunnel" json:"tunnel,omitempty"`
+}
+
+func (m *GreTunnelAddDel) Reset() { *m = GreTunnelAddDel{} }
+func (*GreTunnelAddDel) GetMessageName() string { return "gre_tunnel_add_del" }
+func (*GreTunnelAddDel) GetCrcString() string { return "f9c4059d" }
+func (*GreTunnelAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GreTunnelAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Tunnel.Type
+ size += 1 // m.Tunnel.Mode
+ size += 2 // m.Tunnel.SessionID
+ size += 4 // m.Tunnel.Instance
+ size += 4 // m.Tunnel.OuterTableID
+ size += 4 // m.Tunnel.SwIfIndex
+ size += 4 // m.Tunnel.Src.Af
+ size += 1 * 16 // m.Tunnel.Src.Un
+ size += 4 // m.Tunnel.Dst.Af
+ size += 1 * 16 // m.Tunnel.Dst.Un
+ return size
+}
+func (m *GreTunnelAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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.EncodeUint16(m.Tunnel.SessionID)
+ buf.EncodeUint32(m.Tunnel.Instance)
+ buf.EncodeUint32(m.Tunnel.OuterTableID)
+ buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Tunnel.Src.Af))
+ buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.Dst.Af))
+ buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *GreTunnelAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Tunnel.Type = GreTunnelType(buf.DecodeUint8())
+ m.Tunnel.Mode = GreTunnelMode(buf.DecodeUint8())
+ m.Tunnel.SessionID = buf.DecodeUint16()
+ m.Tunnel.Instance = buf.DecodeUint32()
+ m.Tunnel.OuterTableID = buf.DecodeUint32()
+ m.Tunnel.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tunnel.Src.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.Dst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// GreTunnelAddDelReply defines message 'gre_tunnel_add_del_reply'.
+type GreTunnelAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *GreTunnelAddDelReply) Reset() { *m = GreTunnelAddDelReply{} }
+func (*GreTunnelAddDelReply) GetMessageName() string { return "gre_tunnel_add_del_reply" }
+func (*GreTunnelAddDelReply) GetCrcString() string { return "5383d31f" }
+func (*GreTunnelAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GreTunnelAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *GreTunnelAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// GreTunnelDetails defines message 'gre_tunnel_details'.
+type GreTunnelDetails struct {
+ Tunnel GreTunnel `binapi:"gre_tunnel,name=tunnel" json:"tunnel,omitempty"`
+}
+
+func (m *GreTunnelDetails) Reset() { *m = GreTunnelDetails{} }
+func (*GreTunnelDetails) GetMessageName() string { return "gre_tunnel_details" }
+func (*GreTunnelDetails) GetCrcString() string { return "066f8369" }
+func (*GreTunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GreTunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Tunnel.Type
+ size += 1 // m.Tunnel.Mode
+ size += 2 // m.Tunnel.SessionID
+ size += 4 // m.Tunnel.Instance
+ size += 4 // m.Tunnel.OuterTableID
+ size += 4 // m.Tunnel.SwIfIndex
+ size += 4 // m.Tunnel.Src.Af
+ size += 1 * 16 // m.Tunnel.Src.Un
+ size += 4 // m.Tunnel.Dst.Af
+ size += 1 * 16 // m.Tunnel.Dst.Un
+ return size
+}
+func (m *GreTunnelDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.Tunnel.Type))
+ buf.EncodeUint8(uint8(m.Tunnel.Mode))
+ buf.EncodeUint16(m.Tunnel.SessionID)
+ buf.EncodeUint32(m.Tunnel.Instance)
+ buf.EncodeUint32(m.Tunnel.OuterTableID)
+ buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Tunnel.Src.Af))
+ buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.Dst.Af))
+ buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *GreTunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Tunnel.Type = GreTunnelType(buf.DecodeUint8())
+ m.Tunnel.Mode = GreTunnelMode(buf.DecodeUint8())
+ m.Tunnel.SessionID = buf.DecodeUint16()
+ m.Tunnel.Instance = buf.DecodeUint32()
+ m.Tunnel.OuterTableID = buf.DecodeUint32()
+ m.Tunnel.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tunnel.Src.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.Dst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// GreTunnelDump defines message 'gre_tunnel_dump'.
+type GreTunnelDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *GreTunnelDump) Reset() { *m = GreTunnelDump{} }
+func (*GreTunnelDump) GetMessageName() string { return "gre_tunnel_dump" }
+func (*GreTunnelDump) GetCrcString() string { return "f9e6675e" }
+func (*GreTunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GreTunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *GreTunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *GreTunnelDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+func init() { file_gre_binapi_init() }
+func file_gre_binapi_init() {
+ api.RegisterMessage((*GreTunnelAddDel)(nil), "gre_tunnel_add_del_f9c4059d")
+ api.RegisterMessage((*GreTunnelAddDelReply)(nil), "gre_tunnel_add_del_reply_5383d31f")
+ api.RegisterMessage((*GreTunnelDetails)(nil), "gre_tunnel_details_066f8369")
+ api.RegisterMessage((*GreTunnelDump)(nil), "gre_tunnel_dump_f9e6675e")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*GreTunnelAddDel)(nil),
+ (*GreTunnelAddDelReply)(nil),
+ (*GreTunnelDetails)(nil),
+ (*GreTunnelDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/gre/gre_rpc.ba.go b/internal/testbinapi/binapi2001/gre/gre_rpc.ba.go
new file mode 100644
index 0000000..8ea9820
--- /dev/null
+++ b/internal/testbinapi/binapi2001/gre/gre_rpc.ba.go
@@ -0,0 +1,73 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package gre
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service gre.
+type RPCService interface {
+ GreTunnelAddDel(ctx context.Context, in *GreTunnelAddDel) (*GreTunnelAddDelReply, error)
+ GreTunnelDump(ctx context.Context, in *GreTunnelDump) (RPCService_GreTunnelDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) GreTunnelAddDel(ctx context.Context, in *GreTunnelAddDel) (*GreTunnelAddDelReply, error) {
+ out := new(GreTunnelAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GreTunnelDump(ctx context.Context, in *GreTunnelDump) (RPCService_GreTunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GreTunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GreTunnelDumpClient interface {
+ Recv() (*GreTunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_GreTunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GreTunnelDumpClient) Recv() (*GreTunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GreTunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/gso/gso.ba.go b/internal/testbinapi/binapi2001/gso/gso.ba.go
new file mode 100644
index 0000000..374191b
--- /dev/null
+++ b/internal/testbinapi/binapi2001/gso/gso.ba.go
@@ -0,0 +1,372 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/gso.api.json
+
+// Package gso contains generated bindings for API file gso.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 2 messages
+//
+package gso
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "gso"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xecb22d44
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// FeatureGsoEnableDisable defines message 'feature_gso_enable_disable'.
+type FeatureGsoEnableDisable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+}
+
+func (m *FeatureGsoEnableDisable) Reset() { *m = FeatureGsoEnableDisable{} }
+func (*FeatureGsoEnableDisable) GetMessageName() string { return "feature_gso_enable_disable" }
+func (*FeatureGsoEnableDisable) GetCrcString() string { return "5501adee" }
+func (*FeatureGsoEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *FeatureGsoEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.EnableDisable
+ return size
+}
+func (m *FeatureGsoEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.EnableDisable)
+ return buf.Bytes(), nil
+}
+func (m *FeatureGsoEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.EnableDisable = buf.DecodeBool()
+ return nil
+}
+
+// FeatureGsoEnableDisableReply defines message 'feature_gso_enable_disable_reply'.
+type FeatureGsoEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *FeatureGsoEnableDisableReply) Reset() { *m = FeatureGsoEnableDisableReply{} }
+func (*FeatureGsoEnableDisableReply) GetMessageName() string {
+ return "feature_gso_enable_disable_reply"
+}
+func (*FeatureGsoEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*FeatureGsoEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *FeatureGsoEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *FeatureGsoEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_gso_binapi_init() }
+func file_gso_binapi_init() {
+ api.RegisterMessage((*FeatureGsoEnableDisable)(nil), "feature_gso_enable_disable_5501adee")
+ api.RegisterMessage((*FeatureGsoEnableDisableReply)(nil), "feature_gso_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*FeatureGsoEnableDisable)(nil),
+ (*FeatureGsoEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/gso/gso_rpc.ba.go b/internal/testbinapi/binapi2001/gso/gso_rpc.ba.go
new file mode 100644
index 0000000..d955acc
--- /dev/null
+++ b/internal/testbinapi/binapi2001/gso/gso_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package gso
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service gso.
+type RPCService interface {
+ FeatureGsoEnableDisable(ctx context.Context, in *FeatureGsoEnableDisable) (*FeatureGsoEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) FeatureGsoEnableDisable(ctx context.Context, in *FeatureGsoEnableDisable) (*FeatureGsoEnableDisableReply, error) {
+ out := new(FeatureGsoEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/gtpu/gtpu.ba.go b/internal/testbinapi/binapi2001/gtpu/gtpu.ba.go
new file mode 100644
index 0000000..dd4b8c8
--- /dev/null
+++ b/internal/testbinapi/binapi2001/gtpu/gtpu.ba.go
@@ -0,0 +1,1144 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/gtpu.api.json
+
+// Package gtpu contains generated bindings for API file gtpu.api.
+//
+// Contents:
+// 6 aliases
+// 10 enums
+// 6 structs
+// 1 union
+// 6 messages
+//
+package gtpu
+
+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 = "gtpu"
+ APIVersion = "2.0.0"
+ VersionCrc = 0x6305cc01
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// GtpuAddDelTunnel defines message 'gtpu_add_del_tunnel'.
+type GtpuAddDelTunnel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ SrcAddress Address `binapi:"address,name=src_address" json:"src_address,omitempty"`
+ DstAddress Address `binapi:"address,name=dst_address" json:"dst_address,omitempty"`
+ McastSwIfIndex InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
+ EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
+ DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"`
+ Teid uint32 `binapi:"u32,name=teid" json:"teid,omitempty"`
+}
+
+func (m *GtpuAddDelTunnel) Reset() { *m = GtpuAddDelTunnel{} }
+func (*GtpuAddDelTunnel) GetMessageName() string { return "gtpu_add_del_tunnel" }
+func (*GtpuAddDelTunnel) GetCrcString() string { return "9a26a51c" }
+func (*GtpuAddDelTunnel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GtpuAddDelTunnel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.SrcAddress.Af
+ size += 1 * 16 // m.SrcAddress.Un
+ size += 4 // m.DstAddress.Af
+ size += 1 * 16 // m.DstAddress.Un
+ size += 4 // m.McastSwIfIndex
+ size += 4 // m.EncapVrfID
+ size += 4 // m.DecapNextIndex
+ size += 4 // m.Teid
+ return size
+}
+func (m *GtpuAddDelTunnel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.SrcAddress.Af))
+ buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.DstAddress.Af))
+ buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.McastSwIfIndex))
+ buf.EncodeUint32(m.EncapVrfID)
+ buf.EncodeUint32(m.DecapNextIndex)
+ buf.EncodeUint32(m.Teid)
+ return buf.Bytes(), nil
+}
+func (m *GtpuAddDelTunnel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SrcAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DstAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.McastSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.EncapVrfID = buf.DecodeUint32()
+ m.DecapNextIndex = buf.DecodeUint32()
+ m.Teid = buf.DecodeUint32()
+ return nil
+}
+
+// GtpuAddDelTunnelReply defines message 'gtpu_add_del_tunnel_reply'.
+type GtpuAddDelTunnelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *GtpuAddDelTunnelReply) Reset() { *m = GtpuAddDelTunnelReply{} }
+func (*GtpuAddDelTunnelReply) GetMessageName() string { return "gtpu_add_del_tunnel_reply" }
+func (*GtpuAddDelTunnelReply) GetCrcString() string { return "5383d31f" }
+func (*GtpuAddDelTunnelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GtpuAddDelTunnelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *GtpuAddDelTunnelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// GtpuTunnelDetails defines message 'gtpu_tunnel_details'.
+type GtpuTunnelDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SrcAddress Address `binapi:"address,name=src_address" json:"src_address,omitempty"`
+ DstAddress Address `binapi:"address,name=dst_address" json:"dst_address,omitempty"`
+ McastSwIfIndex InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
+ EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
+ DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"`
+ Teid uint32 `binapi:"u32,name=teid" json:"teid,omitempty"`
+}
+
+func (m *GtpuTunnelDetails) Reset() { *m = GtpuTunnelDetails{} }
+func (*GtpuTunnelDetails) GetMessageName() string { return "gtpu_tunnel_details" }
+func (*GtpuTunnelDetails) GetCrcString() string { return "a4d81a09" }
+func (*GtpuTunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GtpuTunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.SrcAddress.Af
+ size += 1 * 16 // m.SrcAddress.Un
+ size += 4 // m.DstAddress.Af
+ size += 1 * 16 // m.DstAddress.Un
+ size += 4 // m.McastSwIfIndex
+ size += 4 // m.EncapVrfID
+ size += 4 // m.DecapNextIndex
+ size += 4 // m.Teid
+ return size
+}
+func (m *GtpuTunnelDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.SrcAddress.Af))
+ buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.DstAddress.Af))
+ buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.McastSwIfIndex))
+ buf.EncodeUint32(m.EncapVrfID)
+ buf.EncodeUint32(m.DecapNextIndex)
+ buf.EncodeUint32(m.Teid)
+ return buf.Bytes(), nil
+}
+func (m *GtpuTunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.SrcAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DstAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.McastSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.EncapVrfID = buf.DecodeUint32()
+ m.DecapNextIndex = buf.DecodeUint32()
+ m.Teid = buf.DecodeUint32()
+ return nil
+}
+
+// GtpuTunnelDump defines message 'gtpu_tunnel_dump'.
+type GtpuTunnelDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *GtpuTunnelDump) Reset() { *m = GtpuTunnelDump{} }
+func (*GtpuTunnelDump) GetMessageName() string { return "gtpu_tunnel_dump" }
+func (*GtpuTunnelDump) GetCrcString() string { return "f9e6675e" }
+func (*GtpuTunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GtpuTunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *GtpuTunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *GtpuTunnelDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// SwInterfaceSetGtpuBypass defines message 'sw_interface_set_gtpu_bypass'.
+type SwInterfaceSetGtpuBypass struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetGtpuBypass) Reset() { *m = SwInterfaceSetGtpuBypass{} }
+func (*SwInterfaceSetGtpuBypass) GetMessageName() string { return "sw_interface_set_gtpu_bypass" }
+func (*SwInterfaceSetGtpuBypass) GetCrcString() string { return "65247409" }
+func (*SwInterfaceSetGtpuBypass) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetGtpuBypass) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetGtpuBypass) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetGtpuBypass) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// SwInterfaceSetGtpuBypassReply defines message 'sw_interface_set_gtpu_bypass_reply'.
+type SwInterfaceSetGtpuBypassReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetGtpuBypassReply) Reset() { *m = SwInterfaceSetGtpuBypassReply{} }
+func (*SwInterfaceSetGtpuBypassReply) GetMessageName() string {
+ return "sw_interface_set_gtpu_bypass_reply"
+}
+func (*SwInterfaceSetGtpuBypassReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetGtpuBypassReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetGtpuBypassReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetGtpuBypassReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_gtpu_binapi_init() }
+func file_gtpu_binapi_init() {
+ api.RegisterMessage((*GtpuAddDelTunnel)(nil), "gtpu_add_del_tunnel_9a26a51c")
+ api.RegisterMessage((*GtpuAddDelTunnelReply)(nil), "gtpu_add_del_tunnel_reply_5383d31f")
+ api.RegisterMessage((*GtpuTunnelDetails)(nil), "gtpu_tunnel_details_a4d81a09")
+ api.RegisterMessage((*GtpuTunnelDump)(nil), "gtpu_tunnel_dump_f9e6675e")
+ api.RegisterMessage((*SwInterfaceSetGtpuBypass)(nil), "sw_interface_set_gtpu_bypass_65247409")
+ api.RegisterMessage((*SwInterfaceSetGtpuBypassReply)(nil), "sw_interface_set_gtpu_bypass_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*GtpuAddDelTunnel)(nil),
+ (*GtpuAddDelTunnelReply)(nil),
+ (*GtpuTunnelDetails)(nil),
+ (*GtpuTunnelDump)(nil),
+ (*SwInterfaceSetGtpuBypass)(nil),
+ (*SwInterfaceSetGtpuBypassReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/gtpu/gtpu_rpc.ba.go b/internal/testbinapi/binapi2001/gtpu/gtpu_rpc.ba.go
new file mode 100644
index 0000000..6cc1d23
--- /dev/null
+++ b/internal/testbinapi/binapi2001/gtpu/gtpu_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package gtpu
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service gtpu.
+type RPCService interface {
+ GtpuAddDelTunnel(ctx context.Context, in *GtpuAddDelTunnel) (*GtpuAddDelTunnelReply, error)
+ GtpuTunnelDump(ctx context.Context, in *GtpuTunnelDump) (RPCService_GtpuTunnelDumpClient, error)
+ SwInterfaceSetGtpuBypass(ctx context.Context, in *SwInterfaceSetGtpuBypass) (*SwInterfaceSetGtpuBypassReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) GtpuAddDelTunnel(ctx context.Context, in *GtpuAddDelTunnel) (*GtpuAddDelTunnelReply, error) {
+ out := new(GtpuAddDelTunnelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GtpuTunnelDump(ctx context.Context, in *GtpuTunnelDump) (RPCService_GtpuTunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GtpuTunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GtpuTunnelDumpClient interface {
+ Recv() (*GtpuTunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_GtpuTunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GtpuTunnelDumpClient) Recv() (*GtpuTunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GtpuTunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) SwInterfaceSetGtpuBypass(ctx context.Context, in *SwInterfaceSetGtpuBypass) (*SwInterfaceSetGtpuBypassReply, error) {
+ out := new(SwInterfaceSetGtpuBypassReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/http_static/http_static.ba.go b/internal/testbinapi/binapi2001/http_static/http_static.ba.go
new file mode 100644
index 0000000..b302380
--- /dev/null
+++ b/internal/testbinapi/binapi2001/http_static/http_static.ba.go
@@ -0,0 +1,129 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/http_static.api.json
+
+// Package http_static contains generated bindings for API file http_static.api.
+//
+// Contents:
+// 2 messages
+//
+package http_static
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "http_static"
+ APIVersion = "2.1.0"
+ VersionCrc = 0xd29e72e9
+)
+
+// HTTPStaticEnable defines message 'http_static_enable'.
+type HTTPStaticEnable struct {
+ FifoSize uint32 `binapi:"u32,name=fifo_size" json:"fifo_size,omitempty"`
+ CacheSizeLimit uint32 `binapi:"u32,name=cache_size_limit" json:"cache_size_limit,omitempty"`
+ PreallocFifos uint32 `binapi:"u32,name=prealloc_fifos" json:"prealloc_fifos,omitempty"`
+ PrivateSegmentSize uint32 `binapi:"u32,name=private_segment_size" json:"private_segment_size,omitempty"`
+ WwwRoot string `binapi:"string[256],name=www_root" json:"www_root,omitempty"`
+ URI string `binapi:"string[256],name=uri" json:"uri,omitempty"`
+}
+
+func (m *HTTPStaticEnable) Reset() { *m = HTTPStaticEnable{} }
+func (*HTTPStaticEnable) GetMessageName() string { return "http_static_enable" }
+func (*HTTPStaticEnable) GetCrcString() string { return "075f8292" }
+func (*HTTPStaticEnable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *HTTPStaticEnable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.FifoSize
+ size += 4 // m.CacheSizeLimit
+ size += 4 // m.PreallocFifos
+ size += 4 // m.PrivateSegmentSize
+ size += 256 // m.WwwRoot
+ size += 256 // m.URI
+ return size
+}
+func (m *HTTPStaticEnable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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
+}
+func (m *HTTPStaticEnable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.FifoSize = buf.DecodeUint32()
+ m.CacheSizeLimit = buf.DecodeUint32()
+ m.PreallocFifos = buf.DecodeUint32()
+ m.PrivateSegmentSize = buf.DecodeUint32()
+ m.WwwRoot = buf.DecodeString(256)
+ m.URI = buf.DecodeString(256)
+ return nil
+}
+
+// HTTPStaticEnableReply defines message 'http_static_enable_reply'.
+type HTTPStaticEnableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *HTTPStaticEnableReply) Reset() { *m = HTTPStaticEnableReply{} }
+func (*HTTPStaticEnableReply) GetMessageName() string { return "http_static_enable_reply" }
+func (*HTTPStaticEnableReply) GetCrcString() string { return "e8d4e804" }
+func (*HTTPStaticEnableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *HTTPStaticEnableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *HTTPStaticEnableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_http_static_binapi_init() }
+func file_http_static_binapi_init() {
+ api.RegisterMessage((*HTTPStaticEnable)(nil), "http_static_enable_075f8292")
+ api.RegisterMessage((*HTTPStaticEnableReply)(nil), "http_static_enable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*HTTPStaticEnable)(nil),
+ (*HTTPStaticEnableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/http_static/http_static_rpc.ba.go b/internal/testbinapi/binapi2001/http_static/http_static_rpc.ba.go
new file mode 100644
index 0000000..415313d
--- /dev/null
+++ b/internal/testbinapi/binapi2001/http_static/http_static_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package http_static
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service http_static.
+type RPCService interface {
+ HTTPStaticEnable(ctx context.Context, in *HTTPStaticEnable) (*HTTPStaticEnableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) HTTPStaticEnable(ctx context.Context, in *HTTPStaticEnable) (*HTTPStaticEnableReply, error) {
+ out := new(HTTPStaticEnableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/igmp/igmp.ba.go b/internal/testbinapi/binapi2001/igmp/igmp.ba.go
new file mode 100644
index 0000000..5482411
--- /dev/null
+++ b/internal/testbinapi/binapi2001/igmp/igmp.ba.go
@@ -0,0 +1,1686 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/igmp.api.json
+
+// Package igmp contains generated bindings for API file igmp.api.
+//
+// Contents:
+// 6 aliases
+// 12 enums
+// 8 structs
+// 1 union
+// 19 messages
+//
+package igmp
+
+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 = "igmp"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xfd1fef7b
+)
+
+// 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)) + ")"
+}
+
+// FilterMode defines enum 'filter_mode'.
+type FilterMode uint32
+
+const (
+ EXCLUDE FilterMode = 0
+ INCLUDE FilterMode = 1
+)
+
+var (
+ FilterMode_name = map[uint32]string{
+ 0: "EXCLUDE",
+ 1: "INCLUDE",
+ }
+ FilterMode_value = map[string]uint32{
+ "EXCLUDE": 0,
+ "INCLUDE": 1,
+ }
+)
+
+func (x FilterMode) String() string {
+ s, ok := FilterMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FilterMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// GroupPrefixType defines enum 'group_prefix_type'.
+type GroupPrefixType uint32
+
+const (
+ ASM GroupPrefixType = 0
+ SSM GroupPrefixType = 1
+)
+
+var (
+ GroupPrefixType_name = map[uint32]string{
+ 0: "ASM",
+ 1: "SSM",
+ }
+ GroupPrefixType_value = map[string]uint32{
+ "ASM": 0,
+ "SSM": 1,
+ }
+)
+
+func (x GroupPrefixType) String() string {
+ s, ok := GroupPrefixType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "GroupPrefixType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// GroupPrefix defines type 'group_prefix'.
+type GroupPrefix struct {
+ Type GroupPrefixType `binapi:"group_prefix_type,name=type" json:"type,omitempty"`
+ Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
+}
+
+// IgmpGroup defines type 'igmp_group'.
+type IgmpGroup struct {
+ Filter FilterMode `binapi:"filter_mode,name=filter" json:"filter,omitempty"`
+ NSrcs uint8 `binapi:"u8,name=n_srcs" json:"-"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Gaddr IP4Address `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"`
+ Saddrs []IP4Address `binapi:"ip4_address[n_srcs],name=saddrs" json:"saddrs,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// IgmpClearInterface defines message 'igmp_clear_interface'.
+type IgmpClearInterface struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IgmpClearInterface) Reset() { *m = IgmpClearInterface{} }
+func (*IgmpClearInterface) GetMessageName() string { return "igmp_clear_interface" }
+func (*IgmpClearInterface) GetCrcString() string { return "f9e6675e" }
+func (*IgmpClearInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IgmpClearInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IgmpClearInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IgmpClearInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// IgmpClearInterfaceReply defines message 'igmp_clear_interface_reply'.
+type IgmpClearInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IgmpClearInterfaceReply) Reset() { *m = IgmpClearInterfaceReply{} }
+func (*IgmpClearInterfaceReply) GetMessageName() string { return "igmp_clear_interface_reply" }
+func (*IgmpClearInterfaceReply) GetCrcString() string { return "e8d4e804" }
+func (*IgmpClearInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IgmpClearInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IgmpClearInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IgmpDetails defines message 'igmp_details'.
+type IgmpDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Saddr IP4Address `binapi:"ip4_address,name=saddr" json:"saddr,omitempty"`
+ Gaddr IP4Address `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"`
+}
+
+func (m *IgmpDetails) Reset() { *m = IgmpDetails{} }
+func (*IgmpDetails) GetMessageName() string { return "igmp_details" }
+func (*IgmpDetails) GetCrcString() string { return "52f12a89" }
+func (*IgmpDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IgmpDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 * 4 // m.Saddr
+ size += 1 * 4 // m.Gaddr
+ return size
+}
+func (m *IgmpDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBytes(m.Saddr[:], 4)
+ buf.EncodeBytes(m.Gaddr[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *IgmpDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.Saddr[:], buf.DecodeBytes(4))
+ copy(m.Gaddr[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// IgmpDump defines message 'igmp_dump'.
+type IgmpDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IgmpDump) Reset() { *m = IgmpDump{} }
+func (*IgmpDump) GetMessageName() string { return "igmp_dump" }
+func (*IgmpDump) GetCrcString() string { return "f9e6675e" }
+func (*IgmpDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IgmpDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IgmpDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IgmpDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// IgmpEnableDisable defines message 'igmp_enable_disable'.
+type IgmpEnableDisable struct {
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+ Mode uint8 `binapi:"u8,name=mode" json:"mode,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IgmpEnableDisable) Reset() { *m = IgmpEnableDisable{} }
+func (*IgmpEnableDisable) GetMessageName() string { return "igmp_enable_disable" }
+func (*IgmpEnableDisable) GetCrcString() string { return "b1edfb96" }
+func (*IgmpEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IgmpEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ size += 1 // m.Mode
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IgmpEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ buf.EncodeUint8(m.Mode)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IgmpEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ m.Mode = buf.DecodeUint8()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// IgmpEnableDisableReply defines message 'igmp_enable_disable_reply'.
+type IgmpEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IgmpEnableDisableReply) Reset() { *m = IgmpEnableDisableReply{} }
+func (*IgmpEnableDisableReply) GetMessageName() string { return "igmp_enable_disable_reply" }
+func (*IgmpEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*IgmpEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IgmpEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IgmpEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IgmpEvent defines message 'igmp_event'.
+type IgmpEvent struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Filter FilterMode `binapi:"filter_mode,name=filter" json:"filter,omitempty"`
+ Saddr IP4Address `binapi:"ip4_address,name=saddr" json:"saddr,omitempty"`
+ Gaddr IP4Address `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"`
+}
+
+func (m *IgmpEvent) Reset() { *m = IgmpEvent{} }
+func (*IgmpEvent) GetMessageName() string { return "igmp_event" }
+func (*IgmpEvent) GetCrcString() string { return "d7696eaf" }
+func (*IgmpEvent) GetMessageType() api.MessageType {
+ return api.OtherMessage
+}
+
+func (m *IgmpEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Filter
+ size += 1 * 4 // m.Saddr
+ size += 1 * 4 // m.Gaddr
+ return size
+}
+func (m *IgmpEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Filter))
+ buf.EncodeBytes(m.Saddr[:], 4)
+ buf.EncodeBytes(m.Gaddr[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *IgmpEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Filter = FilterMode(buf.DecodeUint32())
+ copy(m.Saddr[:], buf.DecodeBytes(4))
+ copy(m.Gaddr[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// IgmpGroupPrefixDetails defines message 'igmp_group_prefix_details'.
+type IgmpGroupPrefixDetails struct {
+ Gp GroupPrefix `binapi:"group_prefix,name=gp" json:"gp,omitempty"`
+}
+
+func (m *IgmpGroupPrefixDetails) Reset() { *m = IgmpGroupPrefixDetails{} }
+func (*IgmpGroupPrefixDetails) GetMessageName() string { return "igmp_group_prefix_details" }
+func (*IgmpGroupPrefixDetails) GetCrcString() string { return "c3b3c526" }
+func (*IgmpGroupPrefixDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IgmpGroupPrefixDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Gp.Type
+ size += 4 // m.Gp.Prefix.Address.Af
+ size += 1 * 16 // m.Gp.Prefix.Address.Un
+ size += 1 // m.Gp.Prefix.Len
+ return size
+}
+func (m *IgmpGroupPrefixDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Gp.Type))
+ buf.EncodeUint32(uint32(m.Gp.Prefix.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Gp.Type = GroupPrefixType(buf.DecodeUint32())
+ m.Gp.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Gp.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Gp.Prefix.Len = buf.DecodeUint8()
+ return nil
+}
+
+// IgmpGroupPrefixDump defines message 'igmp_group_prefix_dump'.
+type IgmpGroupPrefixDump struct{}
+
+func (m *IgmpGroupPrefixDump) Reset() { *m = IgmpGroupPrefixDump{} }
+func (*IgmpGroupPrefixDump) GetMessageName() string { return "igmp_group_prefix_dump" }
+func (*IgmpGroupPrefixDump) GetCrcString() string { return "51077d14" }
+func (*IgmpGroupPrefixDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IgmpGroupPrefixDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *IgmpGroupPrefixDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *IgmpGroupPrefixDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// IgmpGroupPrefixSet defines message 'igmp_group_prefix_set'.
+type IgmpGroupPrefixSet struct {
+ Gp GroupPrefix `binapi:"group_prefix,name=gp" json:"gp,omitempty"`
+}
+
+func (m *IgmpGroupPrefixSet) Reset() { *m = IgmpGroupPrefixSet{} }
+func (*IgmpGroupPrefixSet) GetMessageName() string { return "igmp_group_prefix_set" }
+func (*IgmpGroupPrefixSet) GetCrcString() string { return "d4f20ac5" }
+func (*IgmpGroupPrefixSet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IgmpGroupPrefixSet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Gp.Type
+ size += 4 // m.Gp.Prefix.Address.Af
+ size += 1 * 16 // m.Gp.Prefix.Address.Un
+ size += 1 // m.Gp.Prefix.Len
+ return size
+}
+func (m *IgmpGroupPrefixSet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Gp.Type))
+ buf.EncodeUint32(uint32(m.Gp.Prefix.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Gp.Type = GroupPrefixType(buf.DecodeUint32())
+ m.Gp.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Gp.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Gp.Prefix.Len = buf.DecodeUint8()
+ return nil
+}
+
+// IgmpGroupPrefixSetReply defines message 'igmp_group_prefix_set_reply'.
+type IgmpGroupPrefixSetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IgmpGroupPrefixSetReply) Reset() { *m = IgmpGroupPrefixSetReply{} }
+func (*IgmpGroupPrefixSetReply) GetMessageName() string { return "igmp_group_prefix_set_reply" }
+func (*IgmpGroupPrefixSetReply) GetCrcString() string { return "e8d4e804" }
+func (*IgmpGroupPrefixSetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IgmpGroupPrefixSetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IgmpGroupPrefixSetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IgmpListen defines message 'igmp_listen'.
+type IgmpListen struct {
+ Group IgmpGroup `binapi:"igmp_group,name=group" json:"group,omitempty"`
+}
+
+func (m *IgmpListen) Reset() { *m = IgmpListen{} }
+func (*IgmpListen) GetMessageName() string { return "igmp_listen" }
+func (*IgmpListen) GetCrcString() string { return "3f93a51a" }
+func (*IgmpListen) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IgmpListen) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Group.Filter
+ size += 1 // m.Group.NSrcs
+ size += 4 // m.Group.SwIfIndex
+ size += 1 * 4 // m.Group.Gaddr
+ for j2 := 0; j2 < len(m.Group.Saddrs); j2++ {
+ var s2 IP4Address
+ _ = s2
+ if j2 < len(m.Group.Saddrs) {
+ s2 = m.Group.Saddrs[j2]
+ }
+ size += 1 * 4 // s2
+ }
+ return size
+}
+func (m *IgmpListen) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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 IP4Address // Saddrs
+ if j1 < len(m.Group.Saddrs) {
+ v1 = m.Group.Saddrs[j1]
+ }
+ buf.EncodeBytes(v1[:], 4)
+ }
+ return buf.Bytes(), nil
+}
+func (m *IgmpListen) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Group.Filter = FilterMode(buf.DecodeUint32())
+ m.Group.NSrcs = buf.DecodeUint8()
+ m.Group.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.Group.Gaddr[:], buf.DecodeBytes(4))
+ m.Group.Saddrs = make([]IP4Address, m.Group.NSrcs)
+ for j1 := 0; j1 < len(m.Group.Saddrs); j1++ {
+ copy(m.Group.Saddrs[j1][:], buf.DecodeBytes(4))
+ }
+ return nil
+}
+
+// IgmpListenReply defines message 'igmp_listen_reply'.
+type IgmpListenReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IgmpListenReply) Reset() { *m = IgmpListenReply{} }
+func (*IgmpListenReply) GetMessageName() string { return "igmp_listen_reply" }
+func (*IgmpListenReply) GetCrcString() string { return "e8d4e804" }
+func (*IgmpListenReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IgmpListenReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IgmpListenReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IgmpProxyDeviceAddDel defines message 'igmp_proxy_device_add_del'.
+type IgmpProxyDeviceAddDel struct {
+ Add uint8 `binapi:"u8,name=add" json:"add,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IgmpProxyDeviceAddDel) Reset() { *m = IgmpProxyDeviceAddDel{} }
+func (*IgmpProxyDeviceAddDel) GetMessageName() string { return "igmp_proxy_device_add_del" }
+func (*IgmpProxyDeviceAddDel) GetCrcString() string { return "0b9be9ce" }
+func (*IgmpProxyDeviceAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IgmpProxyDeviceAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Add
+ size += 4 // m.VrfID
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IgmpProxyDeviceAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Add)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IgmpProxyDeviceAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Add = buf.DecodeUint8()
+ m.VrfID = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// IgmpProxyDeviceAddDelInterface defines message 'igmp_proxy_device_add_del_interface'.
+type IgmpProxyDeviceAddDelInterface struct {
+ Add bool `binapi:"bool,name=add" json:"add,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IgmpProxyDeviceAddDelInterface) Reset() { *m = IgmpProxyDeviceAddDelInterface{} }
+func (*IgmpProxyDeviceAddDelInterface) GetMessageName() string {
+ return "igmp_proxy_device_add_del_interface"
+}
+func (*IgmpProxyDeviceAddDelInterface) GetCrcString() string { return "1a9ec24a" }
+func (*IgmpProxyDeviceAddDelInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IgmpProxyDeviceAddDelInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Add
+ size += 4 // m.VrfID
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IgmpProxyDeviceAddDelInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Add)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IgmpProxyDeviceAddDelInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Add = buf.DecodeBool()
+ m.VrfID = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// IgmpProxyDeviceAddDelInterfaceReply defines message 'igmp_proxy_device_add_del_interface_reply'.
+type IgmpProxyDeviceAddDelInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IgmpProxyDeviceAddDelInterfaceReply) Reset() { *m = IgmpProxyDeviceAddDelInterfaceReply{} }
+func (*IgmpProxyDeviceAddDelInterfaceReply) GetMessageName() string {
+ return "igmp_proxy_device_add_del_interface_reply"
+}
+func (*IgmpProxyDeviceAddDelInterfaceReply) GetCrcString() string { return "e8d4e804" }
+func (*IgmpProxyDeviceAddDelInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IgmpProxyDeviceAddDelInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IgmpProxyDeviceAddDelInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IgmpProxyDeviceAddDelReply defines message 'igmp_proxy_device_add_del_reply'.
+type IgmpProxyDeviceAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IgmpProxyDeviceAddDelReply) Reset() { *m = IgmpProxyDeviceAddDelReply{} }
+func (*IgmpProxyDeviceAddDelReply) GetMessageName() string { return "igmp_proxy_device_add_del_reply" }
+func (*IgmpProxyDeviceAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*IgmpProxyDeviceAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IgmpProxyDeviceAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IgmpProxyDeviceAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// WantIgmpEvents defines message 'want_igmp_events'.
+type WantIgmpEvents struct {
+ Enable uint32 `binapi:"u32,name=enable" json:"enable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *WantIgmpEvents) Reset() { *m = WantIgmpEvents{} }
+func (*WantIgmpEvents) GetMessageName() string { return "want_igmp_events" }
+func (*WantIgmpEvents) GetCrcString() string { return "cfaccc1f" }
+func (*WantIgmpEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantIgmpEvents) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Enable
+ size += 4 // m.PID
+ return size
+}
+func (m *WantIgmpEvents) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Enable)
+ buf.EncodeUint32(m.PID)
+ return buf.Bytes(), nil
+}
+func (m *WantIgmpEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeUint32()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// WantIgmpEventsReply defines message 'want_igmp_events_reply'.
+type WantIgmpEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantIgmpEventsReply) Reset() { *m = WantIgmpEventsReply{} }
+func (*WantIgmpEventsReply) GetMessageName() string { return "want_igmp_events_reply" }
+func (*WantIgmpEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantIgmpEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantIgmpEventsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantIgmpEventsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_igmp_binapi_init() }
+func file_igmp_binapi_init() {
+ api.RegisterMessage((*IgmpClearInterface)(nil), "igmp_clear_interface_f9e6675e")
+ api.RegisterMessage((*IgmpClearInterfaceReply)(nil), "igmp_clear_interface_reply_e8d4e804")
+ api.RegisterMessage((*IgmpDetails)(nil), "igmp_details_52f12a89")
+ api.RegisterMessage((*IgmpDump)(nil), "igmp_dump_f9e6675e")
+ api.RegisterMessage((*IgmpEnableDisable)(nil), "igmp_enable_disable_b1edfb96")
+ api.RegisterMessage((*IgmpEnableDisableReply)(nil), "igmp_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*IgmpEvent)(nil), "igmp_event_d7696eaf")
+ api.RegisterMessage((*IgmpGroupPrefixDetails)(nil), "igmp_group_prefix_details_c3b3c526")
+ api.RegisterMessage((*IgmpGroupPrefixDump)(nil), "igmp_group_prefix_dump_51077d14")
+ api.RegisterMessage((*IgmpGroupPrefixSet)(nil), "igmp_group_prefix_set_d4f20ac5")
+ api.RegisterMessage((*IgmpGroupPrefixSetReply)(nil), "igmp_group_prefix_set_reply_e8d4e804")
+ api.RegisterMessage((*IgmpListen)(nil), "igmp_listen_3f93a51a")
+ api.RegisterMessage((*IgmpListenReply)(nil), "igmp_listen_reply_e8d4e804")
+ api.RegisterMessage((*IgmpProxyDeviceAddDel)(nil), "igmp_proxy_device_add_del_0b9be9ce")
+ api.RegisterMessage((*IgmpProxyDeviceAddDelInterface)(nil), "igmp_proxy_device_add_del_interface_1a9ec24a")
+ api.RegisterMessage((*IgmpProxyDeviceAddDelInterfaceReply)(nil), "igmp_proxy_device_add_del_interface_reply_e8d4e804")
+ api.RegisterMessage((*IgmpProxyDeviceAddDelReply)(nil), "igmp_proxy_device_add_del_reply_e8d4e804")
+ api.RegisterMessage((*WantIgmpEvents)(nil), "want_igmp_events_cfaccc1f")
+ api.RegisterMessage((*WantIgmpEventsReply)(nil), "want_igmp_events_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*IgmpClearInterface)(nil),
+ (*IgmpClearInterfaceReply)(nil),
+ (*IgmpDetails)(nil),
+ (*IgmpDump)(nil),
+ (*IgmpEnableDisable)(nil),
+ (*IgmpEnableDisableReply)(nil),
+ (*IgmpEvent)(nil),
+ (*IgmpGroupPrefixDetails)(nil),
+ (*IgmpGroupPrefixDump)(nil),
+ (*IgmpGroupPrefixSet)(nil),
+ (*IgmpGroupPrefixSetReply)(nil),
+ (*IgmpListen)(nil),
+ (*IgmpListenReply)(nil),
+ (*IgmpProxyDeviceAddDel)(nil),
+ (*IgmpProxyDeviceAddDelInterface)(nil),
+ (*IgmpProxyDeviceAddDelInterfaceReply)(nil),
+ (*IgmpProxyDeviceAddDelReply)(nil),
+ (*WantIgmpEvents)(nil),
+ (*WantIgmpEventsReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/igmp/igmp_rpc.ba.go b/internal/testbinapi/binapi2001/igmp/igmp_rpc.ba.go
new file mode 100644
index 0000000..7258577
--- /dev/null
+++ b/internal/testbinapi/binapi2001/igmp/igmp_rpc.ba.go
@@ -0,0 +1,173 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package igmp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service igmp.
+type RPCService interface {
+ IgmpClearInterface(ctx context.Context, in *IgmpClearInterface) (*IgmpClearInterfaceReply, error)
+ IgmpDump(ctx context.Context, in *IgmpDump) (RPCService_IgmpDumpClient, error)
+ IgmpEnableDisable(ctx context.Context, in *IgmpEnableDisable) (*IgmpEnableDisableReply, error)
+ IgmpGroupPrefixDump(ctx context.Context, in *IgmpGroupPrefixDump) (RPCService_IgmpGroupPrefixDumpClient, error)
+ IgmpGroupPrefixSet(ctx context.Context, in *IgmpGroupPrefixSet) (*IgmpGroupPrefixSetReply, error)
+ IgmpListen(ctx context.Context, in *IgmpListen) (*IgmpListenReply, error)
+ IgmpProxyDeviceAddDel(ctx context.Context, in *IgmpProxyDeviceAddDel) (*IgmpProxyDeviceAddDelReply, error)
+ IgmpProxyDeviceAddDelInterface(ctx context.Context, in *IgmpProxyDeviceAddDelInterface) (*IgmpProxyDeviceAddDelInterfaceReply, error)
+ WantIgmpEvents(ctx context.Context, in *WantIgmpEvents) (*WantIgmpEventsReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) IgmpClearInterface(ctx context.Context, in *IgmpClearInterface) (*IgmpClearInterfaceReply, error) {
+ out := new(IgmpClearInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IgmpDump(ctx context.Context, in *IgmpDump) (RPCService_IgmpDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IgmpDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IgmpDumpClient interface {
+ Recv() (*IgmpDetails, error)
+ api.Stream
+}
+
+type serviceClient_IgmpDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IgmpDumpClient) Recv() (*IgmpDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IgmpDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IgmpEnableDisable(ctx context.Context, in *IgmpEnableDisable) (*IgmpEnableDisableReply, error) {
+ out := new(IgmpEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IgmpGroupPrefixDump(ctx context.Context, in *IgmpGroupPrefixDump) (RPCService_IgmpGroupPrefixDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IgmpGroupPrefixDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IgmpGroupPrefixDumpClient interface {
+ Recv() (*IgmpGroupPrefixDetails, error)
+ api.Stream
+}
+
+type serviceClient_IgmpGroupPrefixDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IgmpGroupPrefixDumpClient) Recv() (*IgmpGroupPrefixDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IgmpGroupPrefixDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IgmpGroupPrefixSet(ctx context.Context, in *IgmpGroupPrefixSet) (*IgmpGroupPrefixSetReply, error) {
+ out := new(IgmpGroupPrefixSetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IgmpListen(ctx context.Context, in *IgmpListen) (*IgmpListenReply, error) {
+ out := new(IgmpListenReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IgmpProxyDeviceAddDel(ctx context.Context, in *IgmpProxyDeviceAddDel) (*IgmpProxyDeviceAddDelReply, error) {
+ out := new(IgmpProxyDeviceAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IgmpProxyDeviceAddDelInterface(ctx context.Context, in *IgmpProxyDeviceAddDelInterface) (*IgmpProxyDeviceAddDelInterfaceReply, error) {
+ out := new(IgmpProxyDeviceAddDelInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) WantIgmpEvents(ctx context.Context, in *WantIgmpEvents) (*WantIgmpEventsReply, error) {
+ out := new(WantIgmpEventsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ikev2/ikev2.ba.go b/internal/testbinapi/binapi2001/ikev2/ikev2.ba.go
new file mode 100644
index 0000000..f7ad3c8
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ikev2/ikev2.ba.go
@@ -0,0 +1,1961 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/ikev2.api.json
+
+// Package ikev2 contains generated bindings for API file ikev2.api.
+//
+// Contents:
+// 6 aliases
+// 10 enums
+// 6 structs
+// 1 union
+// 28 messages
+//
+package ikev2
+
+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 = "ikev2"
+ APIVersion = "1.0.1"
+ VersionCrc = 0x4eab5d22
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// Ikev2InitiateDelChildSa defines message 'ikev2_initiate_del_child_sa'.
+type Ikev2InitiateDelChildSa struct {
+ Ispi uint32 `binapi:"u32,name=ispi" json:"ispi,omitempty"`
+}
+
+func (m *Ikev2InitiateDelChildSa) Reset() { *m = Ikev2InitiateDelChildSa{} }
+func (*Ikev2InitiateDelChildSa) GetMessageName() string { return "ikev2_initiate_del_child_sa" }
+func (*Ikev2InitiateDelChildSa) GetCrcString() string { return "7f004d2e" }
+func (*Ikev2InitiateDelChildSa) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2InitiateDelChildSa) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Ispi
+ return size
+}
+func (m *Ikev2InitiateDelChildSa) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Ispi)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2InitiateDelChildSa) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Ispi = buf.DecodeUint32()
+ return nil
+}
+
+// Ikev2InitiateDelChildSaReply defines message 'ikev2_initiate_del_child_sa_reply'.
+type Ikev2InitiateDelChildSaReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2InitiateDelChildSaReply) Reset() { *m = Ikev2InitiateDelChildSaReply{} }
+func (*Ikev2InitiateDelChildSaReply) GetMessageName() string {
+ return "ikev2_initiate_del_child_sa_reply"
+}
+func (*Ikev2InitiateDelChildSaReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2InitiateDelChildSaReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2InitiateDelChildSaReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2InitiateDelChildSaReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2InitiateDelIkeSa defines message 'ikev2_initiate_del_ike_sa'.
+type Ikev2InitiateDelIkeSa struct {
+ Ispi uint64 `binapi:"u64,name=ispi" json:"ispi,omitempty"`
+}
+
+func (m *Ikev2InitiateDelIkeSa) Reset() { *m = Ikev2InitiateDelIkeSa{} }
+func (*Ikev2InitiateDelIkeSa) GetMessageName() string { return "ikev2_initiate_del_ike_sa" }
+func (*Ikev2InitiateDelIkeSa) GetCrcString() string { return "8d125bdd" }
+func (*Ikev2InitiateDelIkeSa) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2InitiateDelIkeSa) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 8 // m.Ispi
+ return size
+}
+func (m *Ikev2InitiateDelIkeSa) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint64(m.Ispi)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2InitiateDelIkeSa) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Ispi = buf.DecodeUint64()
+ return nil
+}
+
+// Ikev2InitiateDelIkeSaReply defines message 'ikev2_initiate_del_ike_sa_reply'.
+type Ikev2InitiateDelIkeSaReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2InitiateDelIkeSaReply) Reset() { *m = Ikev2InitiateDelIkeSaReply{} }
+func (*Ikev2InitiateDelIkeSaReply) GetMessageName() string { return "ikev2_initiate_del_ike_sa_reply" }
+func (*Ikev2InitiateDelIkeSaReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2InitiateDelIkeSaReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2InitiateDelIkeSaReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2InitiateDelIkeSaReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2InitiateRekeyChildSa defines message 'ikev2_initiate_rekey_child_sa'.
+type Ikev2InitiateRekeyChildSa struct {
+ Ispi uint32 `binapi:"u32,name=ispi" json:"ispi,omitempty"`
+}
+
+func (m *Ikev2InitiateRekeyChildSa) Reset() { *m = Ikev2InitiateRekeyChildSa{} }
+func (*Ikev2InitiateRekeyChildSa) GetMessageName() string { return "ikev2_initiate_rekey_child_sa" }
+func (*Ikev2InitiateRekeyChildSa) GetCrcString() string { return "7f004d2e" }
+func (*Ikev2InitiateRekeyChildSa) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2InitiateRekeyChildSa) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Ispi
+ return size
+}
+func (m *Ikev2InitiateRekeyChildSa) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Ispi)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2InitiateRekeyChildSa) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Ispi = buf.DecodeUint32()
+ return nil
+}
+
+// Ikev2InitiateRekeyChildSaReply defines message 'ikev2_initiate_rekey_child_sa_reply'.
+type Ikev2InitiateRekeyChildSaReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2InitiateRekeyChildSaReply) Reset() { *m = Ikev2InitiateRekeyChildSaReply{} }
+func (*Ikev2InitiateRekeyChildSaReply) GetMessageName() string {
+ return "ikev2_initiate_rekey_child_sa_reply"
+}
+func (*Ikev2InitiateRekeyChildSaReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2InitiateRekeyChildSaReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2InitiateRekeyChildSaReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2InitiateRekeyChildSaReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2InitiateSaInit defines message 'ikev2_initiate_sa_init'.
+type Ikev2InitiateSaInit struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+}
+
+func (m *Ikev2InitiateSaInit) Reset() { *m = Ikev2InitiateSaInit{} }
+func (*Ikev2InitiateSaInit) GetMessageName() string { return "ikev2_initiate_sa_init" }
+func (*Ikev2InitiateSaInit) GetCrcString() string { return "ebf79a66" }
+func (*Ikev2InitiateSaInit) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2InitiateSaInit) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ return size
+}
+func (m *Ikev2InitiateSaInit) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2InitiateSaInit) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ return nil
+}
+
+// Ikev2InitiateSaInitReply defines message 'ikev2_initiate_sa_init_reply'.
+type Ikev2InitiateSaInitReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2InitiateSaInitReply) Reset() { *m = Ikev2InitiateSaInitReply{} }
+func (*Ikev2InitiateSaInitReply) GetMessageName() string { return "ikev2_initiate_sa_init_reply" }
+func (*Ikev2InitiateSaInitReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2InitiateSaInitReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2InitiateSaInitReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2InitiateSaInitReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2PluginGetVersion defines message 'ikev2_plugin_get_version'.
+type Ikev2PluginGetVersion struct{}
+
+func (m *Ikev2PluginGetVersion) Reset() { *m = Ikev2PluginGetVersion{} }
+func (*Ikev2PluginGetVersion) GetMessageName() string { return "ikev2_plugin_get_version" }
+func (*Ikev2PluginGetVersion) GetCrcString() string { return "51077d14" }
+func (*Ikev2PluginGetVersion) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2PluginGetVersion) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Ikev2PluginGetVersion) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2PluginGetVersion) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Ikev2PluginGetVersionReply defines message 'ikev2_plugin_get_version_reply'.
+type Ikev2PluginGetVersionReply struct {
+ Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
+ Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
+}
+
+func (m *Ikev2PluginGetVersionReply) Reset() { *m = Ikev2PluginGetVersionReply{} }
+func (*Ikev2PluginGetVersionReply) GetMessageName() string { return "ikev2_plugin_get_version_reply" }
+func (*Ikev2PluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
+func (*Ikev2PluginGetVersionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2PluginGetVersionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Major
+ size += 4 // m.Minor
+ return size
+}
+func (m *Ikev2PluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Major)
+ buf.EncodeUint32(m.Minor)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2PluginGetVersionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Major = buf.DecodeUint32()
+ m.Minor = buf.DecodeUint32()
+ return nil
+}
+
+// Ikev2ProfileAddDel defines message 'ikev2_profile_add_del'.
+type Ikev2ProfileAddDel struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *Ikev2ProfileAddDel) Reset() { *m = Ikev2ProfileAddDel{} }
+func (*Ikev2ProfileAddDel) GetMessageName() string { return "ikev2_profile_add_del" }
+func (*Ikev2ProfileAddDel) GetCrcString() string { return "2c925b55" }
+func (*Ikev2ProfileAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2ProfileAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *Ikev2ProfileAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2ProfileAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// Ikev2ProfileAddDelReply defines message 'ikev2_profile_add_del_reply'.
+type Ikev2ProfileAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2ProfileAddDelReply) Reset() { *m = Ikev2ProfileAddDelReply{} }
+func (*Ikev2ProfileAddDelReply) GetMessageName() string { return "ikev2_profile_add_del_reply" }
+func (*Ikev2ProfileAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2ProfileAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2ProfileAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2ProfileAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2ProfileSetAuth defines message 'ikev2_profile_set_auth'.
+type Ikev2ProfileSetAuth struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ AuthMethod uint8 `binapi:"u8,name=auth_method" json:"auth_method,omitempty"`
+ IsHex bool `binapi:"bool,name=is_hex" json:"is_hex,omitempty"`
+ DataLen uint32 `binapi:"u32,name=data_len" json:"-"`
+ Data []byte `binapi:"u8[data_len],name=data" json:"data,omitempty"`
+}
+
+func (m *Ikev2ProfileSetAuth) Reset() { *m = Ikev2ProfileSetAuth{} }
+func (*Ikev2ProfileSetAuth) GetMessageName() string { return "ikev2_profile_set_auth" }
+func (*Ikev2ProfileSetAuth) GetCrcString() string { return "642c97cd" }
+func (*Ikev2ProfileSetAuth) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2ProfileSetAuth) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ size += 1 // m.AuthMethod
+ size += 1 // m.IsHex
+ size += 4 // m.DataLen
+ size += 1 * len(m.Data) // m.Data
+ return size
+}
+func (m *Ikev2ProfileSetAuth) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ buf.EncodeUint8(m.AuthMethod)
+ buf.EncodeBool(m.IsHex)
+ buf.EncodeUint32(uint32(len(m.Data)))
+ buf.EncodeBytes(m.Data, 0)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2ProfileSetAuth) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ m.AuthMethod = buf.DecodeUint8()
+ m.IsHex = buf.DecodeBool()
+ m.DataLen = buf.DecodeUint32()
+ m.Data = make([]byte, m.DataLen)
+ copy(m.Data, buf.DecodeBytes(len(m.Data)))
+ return nil
+}
+
+// Ikev2ProfileSetAuthReply defines message 'ikev2_profile_set_auth_reply'.
+type Ikev2ProfileSetAuthReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2ProfileSetAuthReply) Reset() { *m = Ikev2ProfileSetAuthReply{} }
+func (*Ikev2ProfileSetAuthReply) GetMessageName() string { return "ikev2_profile_set_auth_reply" }
+func (*Ikev2ProfileSetAuthReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2ProfileSetAuthReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2ProfileSetAuthReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2ProfileSetAuthReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2ProfileSetID defines message 'ikev2_profile_set_id'.
+type Ikev2ProfileSetID struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ IsLocal bool `binapi:"bool,name=is_local" json:"is_local,omitempty"`
+ IDType uint8 `binapi:"u8,name=id_type" json:"id_type,omitempty"`
+ DataLen uint32 `binapi:"u32,name=data_len" json:"-"`
+ Data []byte `binapi:"u8[data_len],name=data" json:"data,omitempty"`
+}
+
+func (m *Ikev2ProfileSetID) Reset() { *m = Ikev2ProfileSetID{} }
+func (*Ikev2ProfileSetID) GetMessageName() string { return "ikev2_profile_set_id" }
+func (*Ikev2ProfileSetID) GetCrcString() string { return "4d7e2418" }
+func (*Ikev2ProfileSetID) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2ProfileSetID) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ size += 1 // m.IsLocal
+ size += 1 // m.IDType
+ size += 4 // m.DataLen
+ size += 1 * len(m.Data) // m.Data
+ return size
+}
+func (m *Ikev2ProfileSetID) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ buf.EncodeBool(m.IsLocal)
+ buf.EncodeUint8(m.IDType)
+ buf.EncodeUint32(uint32(len(m.Data)))
+ buf.EncodeBytes(m.Data, 0)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2ProfileSetID) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ m.IsLocal = buf.DecodeBool()
+ m.IDType = buf.DecodeUint8()
+ m.DataLen = buf.DecodeUint32()
+ m.Data = make([]byte, m.DataLen)
+ copy(m.Data, buf.DecodeBytes(len(m.Data)))
+ return nil
+}
+
+// Ikev2ProfileSetIDReply defines message 'ikev2_profile_set_id_reply'.
+type Ikev2ProfileSetIDReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2ProfileSetIDReply) Reset() { *m = Ikev2ProfileSetIDReply{} }
+func (*Ikev2ProfileSetIDReply) GetMessageName() string { return "ikev2_profile_set_id_reply" }
+func (*Ikev2ProfileSetIDReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2ProfileSetIDReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2ProfileSetIDReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2ProfileSetIDReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2ProfileSetTs defines message 'ikev2_profile_set_ts'.
+type Ikev2ProfileSetTs struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ IsLocal bool `binapi:"bool,name=is_local" json:"is_local,omitempty"`
+ Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
+ StartPort uint16 `binapi:"u16,name=start_port" json:"start_port,omitempty"`
+ EndPort uint16 `binapi:"u16,name=end_port" json:"end_port,omitempty"`
+ StartAddr uint32 `binapi:"u32,name=start_addr" json:"start_addr,omitempty"`
+ EndAddr uint32 `binapi:"u32,name=end_addr" json:"end_addr,omitempty"`
+}
+
+func (m *Ikev2ProfileSetTs) Reset() { *m = Ikev2ProfileSetTs{} }
+func (*Ikev2ProfileSetTs) GetMessageName() string { return "ikev2_profile_set_ts" }
+func (*Ikev2ProfileSetTs) GetCrcString() string { return "64d55c16" }
+func (*Ikev2ProfileSetTs) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2ProfileSetTs) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ size += 1 // m.IsLocal
+ size += 1 // m.Proto
+ size += 2 // m.StartPort
+ size += 2 // m.EndPort
+ size += 4 // m.StartAddr
+ size += 4 // m.EndAddr
+ return size
+}
+func (m *Ikev2ProfileSetTs) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ buf.EncodeBool(m.IsLocal)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ m.IsLocal = buf.DecodeBool()
+ m.Proto = buf.DecodeUint8()
+ m.StartPort = buf.DecodeUint16()
+ m.EndPort = buf.DecodeUint16()
+ m.StartAddr = buf.DecodeUint32()
+ m.EndAddr = buf.DecodeUint32()
+ return nil
+}
+
+// Ikev2ProfileSetTsReply defines message 'ikev2_profile_set_ts_reply'.
+type Ikev2ProfileSetTsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2ProfileSetTsReply) Reset() { *m = Ikev2ProfileSetTsReply{} }
+func (*Ikev2ProfileSetTsReply) GetMessageName() string { return "ikev2_profile_set_ts_reply" }
+func (*Ikev2ProfileSetTsReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2ProfileSetTsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2ProfileSetTsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2ProfileSetTsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2SetEspTransforms defines message 'ikev2_set_esp_transforms'.
+type Ikev2SetEspTransforms struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ CryptoAlg uint32 `binapi:"u32,name=crypto_alg" json:"crypto_alg,omitempty"`
+ CryptoKeySize uint32 `binapi:"u32,name=crypto_key_size" json:"crypto_key_size,omitempty"`
+ IntegAlg uint32 `binapi:"u32,name=integ_alg" json:"integ_alg,omitempty"`
+ DhGroup uint32 `binapi:"u32,name=dh_group" json:"dh_group,omitempty"`
+}
+
+func (m *Ikev2SetEspTransforms) Reset() { *m = Ikev2SetEspTransforms{} }
+func (*Ikev2SetEspTransforms) GetMessageName() string { return "ikev2_set_esp_transforms" }
+func (*Ikev2SetEspTransforms) GetCrcString() string { return "936a1a37" }
+func (*Ikev2SetEspTransforms) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2SetEspTransforms) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ size += 4 // m.CryptoAlg
+ size += 4 // m.CryptoKeySize
+ size += 4 // m.IntegAlg
+ size += 4 // m.DhGroup
+ return size
+}
+func (m *Ikev2SetEspTransforms) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ m.CryptoAlg = buf.DecodeUint32()
+ m.CryptoKeySize = buf.DecodeUint32()
+ m.IntegAlg = buf.DecodeUint32()
+ m.DhGroup = buf.DecodeUint32()
+ return nil
+}
+
+// Ikev2SetEspTransformsReply defines message 'ikev2_set_esp_transforms_reply'.
+type Ikev2SetEspTransformsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2SetEspTransformsReply) Reset() { *m = Ikev2SetEspTransformsReply{} }
+func (*Ikev2SetEspTransformsReply) GetMessageName() string { return "ikev2_set_esp_transforms_reply" }
+func (*Ikev2SetEspTransformsReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2SetEspTransformsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2SetEspTransformsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2SetEspTransformsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2SetIkeTransforms defines message 'ikev2_set_ike_transforms'.
+type Ikev2SetIkeTransforms struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ CryptoAlg uint32 `binapi:"u32,name=crypto_alg" json:"crypto_alg,omitempty"`
+ CryptoKeySize uint32 `binapi:"u32,name=crypto_key_size" json:"crypto_key_size,omitempty"`
+ IntegAlg uint32 `binapi:"u32,name=integ_alg" json:"integ_alg,omitempty"`
+ DhGroup uint32 `binapi:"u32,name=dh_group" json:"dh_group,omitempty"`
+}
+
+func (m *Ikev2SetIkeTransforms) Reset() { *m = Ikev2SetIkeTransforms{} }
+func (*Ikev2SetIkeTransforms) GetMessageName() string { return "ikev2_set_ike_transforms" }
+func (*Ikev2SetIkeTransforms) GetCrcString() string { return "936a1a37" }
+func (*Ikev2SetIkeTransforms) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2SetIkeTransforms) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ size += 4 // m.CryptoAlg
+ size += 4 // m.CryptoKeySize
+ size += 4 // m.IntegAlg
+ size += 4 // m.DhGroup
+ return size
+}
+func (m *Ikev2SetIkeTransforms) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ m.CryptoAlg = buf.DecodeUint32()
+ m.CryptoKeySize = buf.DecodeUint32()
+ m.IntegAlg = buf.DecodeUint32()
+ m.DhGroup = buf.DecodeUint32()
+ return nil
+}
+
+// Ikev2SetIkeTransformsReply defines message 'ikev2_set_ike_transforms_reply'.
+type Ikev2SetIkeTransformsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2SetIkeTransformsReply) Reset() { *m = Ikev2SetIkeTransformsReply{} }
+func (*Ikev2SetIkeTransformsReply) GetMessageName() string { return "ikev2_set_ike_transforms_reply" }
+func (*Ikev2SetIkeTransformsReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2SetIkeTransformsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2SetIkeTransformsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2SetIkeTransformsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2SetLocalKey defines message 'ikev2_set_local_key'.
+type Ikev2SetLocalKey struct {
+ KeyFile []byte `binapi:"u8[256],name=key_file" json:"key_file,omitempty"`
+}
+
+func (m *Ikev2SetLocalKey) Reset() { *m = Ikev2SetLocalKey{} }
+func (*Ikev2SetLocalKey) GetMessageName() string { return "ikev2_set_local_key" }
+func (*Ikev2SetLocalKey) GetCrcString() string { return "e4996cd5" }
+func (*Ikev2SetLocalKey) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2SetLocalKey) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 256 // m.KeyFile
+ return size
+}
+func (m *Ikev2SetLocalKey) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.KeyFile, 256)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2SetLocalKey) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.KeyFile = make([]byte, 256)
+ copy(m.KeyFile, buf.DecodeBytes(len(m.KeyFile)))
+ return nil
+}
+
+// Ikev2SetLocalKeyReply defines message 'ikev2_set_local_key_reply'.
+type Ikev2SetLocalKeyReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2SetLocalKeyReply) Reset() { *m = Ikev2SetLocalKeyReply{} }
+func (*Ikev2SetLocalKeyReply) GetMessageName() string { return "ikev2_set_local_key_reply" }
+func (*Ikev2SetLocalKeyReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2SetLocalKeyReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2SetLocalKeyReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2SetLocalKeyReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2SetResponder defines message 'ikev2_set_responder'.
+type Ikev2SetResponder struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+}
+
+func (m *Ikev2SetResponder) Reset() { *m = Ikev2SetResponder{} }
+func (*Ikev2SetResponder) GetMessageName() string { return "ikev2_set_responder" }
+func (*Ikev2SetResponder) GetCrcString() string { return "f0d3dc80" }
+func (*Ikev2SetResponder) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2SetResponder) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ size += 4 // m.SwIfIndex
+ size += 1 * 4 // m.Address
+ return size
+}
+func (m *Ikev2SetResponder) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBytes(m.Address[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *Ikev2SetResponder) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.Address[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// Ikev2SetResponderReply defines message 'ikev2_set_responder_reply'.
+type Ikev2SetResponderReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2SetResponderReply) Reset() { *m = Ikev2SetResponderReply{} }
+func (*Ikev2SetResponderReply) GetMessageName() string { return "ikev2_set_responder_reply" }
+func (*Ikev2SetResponderReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2SetResponderReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2SetResponderReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2SetResponderReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Ikev2SetSaLifetime defines message 'ikev2_set_sa_lifetime'.
+type Ikev2SetSaLifetime struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ Lifetime uint64 `binapi:"u64,name=lifetime" json:"lifetime,omitempty"`
+ LifetimeJitter uint32 `binapi:"u32,name=lifetime_jitter" json:"lifetime_jitter,omitempty"`
+ Handover uint32 `binapi:"u32,name=handover" json:"handover,omitempty"`
+ LifetimeMaxdata uint64 `binapi:"u64,name=lifetime_maxdata" json:"lifetime_maxdata,omitempty"`
+}
+
+func (m *Ikev2SetSaLifetime) Reset() { *m = Ikev2SetSaLifetime{} }
+func (*Ikev2SetSaLifetime) GetMessageName() string { return "ikev2_set_sa_lifetime" }
+func (*Ikev2SetSaLifetime) GetCrcString() string { return "7039feaa" }
+func (*Ikev2SetSaLifetime) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ikev2SetSaLifetime) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ size += 8 // m.Lifetime
+ size += 4 // m.LifetimeJitter
+ size += 4 // m.Handover
+ size += 8 // m.LifetimeMaxdata
+ return size
+}
+func (m *Ikev2SetSaLifetime) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ m.Lifetime = buf.DecodeUint64()
+ m.LifetimeJitter = buf.DecodeUint32()
+ m.Handover = buf.DecodeUint32()
+ m.LifetimeMaxdata = buf.DecodeUint64()
+ return nil
+}
+
+// Ikev2SetSaLifetimeReply defines message 'ikev2_set_sa_lifetime_reply'.
+type Ikev2SetSaLifetimeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ikev2SetSaLifetimeReply) Reset() { *m = Ikev2SetSaLifetimeReply{} }
+func (*Ikev2SetSaLifetimeReply) GetMessageName() string { return "ikev2_set_sa_lifetime_reply" }
+func (*Ikev2SetSaLifetimeReply) GetCrcString() string { return "e8d4e804" }
+func (*Ikev2SetSaLifetimeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ikev2SetSaLifetimeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ikev2SetSaLifetimeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_ikev2_binapi_init() }
+func file_ikev2_binapi_init() {
+ api.RegisterMessage((*Ikev2InitiateDelChildSa)(nil), "ikev2_initiate_del_child_sa_7f004d2e")
+ api.RegisterMessage((*Ikev2InitiateDelChildSaReply)(nil), "ikev2_initiate_del_child_sa_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2InitiateDelIkeSa)(nil), "ikev2_initiate_del_ike_sa_8d125bdd")
+ api.RegisterMessage((*Ikev2InitiateDelIkeSaReply)(nil), "ikev2_initiate_del_ike_sa_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2InitiateRekeyChildSa)(nil), "ikev2_initiate_rekey_child_sa_7f004d2e")
+ api.RegisterMessage((*Ikev2InitiateRekeyChildSaReply)(nil), "ikev2_initiate_rekey_child_sa_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2InitiateSaInit)(nil), "ikev2_initiate_sa_init_ebf79a66")
+ api.RegisterMessage((*Ikev2InitiateSaInitReply)(nil), "ikev2_initiate_sa_init_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2PluginGetVersion)(nil), "ikev2_plugin_get_version_51077d14")
+ api.RegisterMessage((*Ikev2PluginGetVersionReply)(nil), "ikev2_plugin_get_version_reply_9b32cf86")
+ api.RegisterMessage((*Ikev2ProfileAddDel)(nil), "ikev2_profile_add_del_2c925b55")
+ api.RegisterMessage((*Ikev2ProfileAddDelReply)(nil), "ikev2_profile_add_del_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2ProfileSetAuth)(nil), "ikev2_profile_set_auth_642c97cd")
+ api.RegisterMessage((*Ikev2ProfileSetAuthReply)(nil), "ikev2_profile_set_auth_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2ProfileSetID)(nil), "ikev2_profile_set_id_4d7e2418")
+ api.RegisterMessage((*Ikev2ProfileSetIDReply)(nil), "ikev2_profile_set_id_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2ProfileSetTs)(nil), "ikev2_profile_set_ts_64d55c16")
+ api.RegisterMessage((*Ikev2ProfileSetTsReply)(nil), "ikev2_profile_set_ts_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2SetEspTransforms)(nil), "ikev2_set_esp_transforms_936a1a37")
+ api.RegisterMessage((*Ikev2SetEspTransformsReply)(nil), "ikev2_set_esp_transforms_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2SetIkeTransforms)(nil), "ikev2_set_ike_transforms_936a1a37")
+ api.RegisterMessage((*Ikev2SetIkeTransformsReply)(nil), "ikev2_set_ike_transforms_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2SetLocalKey)(nil), "ikev2_set_local_key_e4996cd5")
+ api.RegisterMessage((*Ikev2SetLocalKeyReply)(nil), "ikev2_set_local_key_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2SetResponder)(nil), "ikev2_set_responder_f0d3dc80")
+ api.RegisterMessage((*Ikev2SetResponderReply)(nil), "ikev2_set_responder_reply_e8d4e804")
+ api.RegisterMessage((*Ikev2SetSaLifetime)(nil), "ikev2_set_sa_lifetime_7039feaa")
+ api.RegisterMessage((*Ikev2SetSaLifetimeReply)(nil), "ikev2_set_sa_lifetime_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*Ikev2InitiateDelChildSa)(nil),
+ (*Ikev2InitiateDelChildSaReply)(nil),
+ (*Ikev2InitiateDelIkeSa)(nil),
+ (*Ikev2InitiateDelIkeSaReply)(nil),
+ (*Ikev2InitiateRekeyChildSa)(nil),
+ (*Ikev2InitiateRekeyChildSaReply)(nil),
+ (*Ikev2InitiateSaInit)(nil),
+ (*Ikev2InitiateSaInitReply)(nil),
+ (*Ikev2PluginGetVersion)(nil),
+ (*Ikev2PluginGetVersionReply)(nil),
+ (*Ikev2ProfileAddDel)(nil),
+ (*Ikev2ProfileAddDelReply)(nil),
+ (*Ikev2ProfileSetAuth)(nil),
+ (*Ikev2ProfileSetAuthReply)(nil),
+ (*Ikev2ProfileSetID)(nil),
+ (*Ikev2ProfileSetIDReply)(nil),
+ (*Ikev2ProfileSetTs)(nil),
+ (*Ikev2ProfileSetTsReply)(nil),
+ (*Ikev2SetEspTransforms)(nil),
+ (*Ikev2SetEspTransformsReply)(nil),
+ (*Ikev2SetIkeTransforms)(nil),
+ (*Ikev2SetIkeTransformsReply)(nil),
+ (*Ikev2SetLocalKey)(nil),
+ (*Ikev2SetLocalKeyReply)(nil),
+ (*Ikev2SetResponder)(nil),
+ (*Ikev2SetResponderReply)(nil),
+ (*Ikev2SetSaLifetime)(nil),
+ (*Ikev2SetSaLifetimeReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ikev2/ikev2_rpc.ba.go b/internal/testbinapi/binapi2001/ikev2/ikev2_rpc.ba.go
new file mode 100644
index 0000000..5cac5d4
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ikev2/ikev2_rpc.ba.go
@@ -0,0 +1,160 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ikev2
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service ikev2.
+type RPCService interface {
+ Ikev2InitiateDelChildSa(ctx context.Context, in *Ikev2InitiateDelChildSa) (*Ikev2InitiateDelChildSaReply, error)
+ Ikev2InitiateDelIkeSa(ctx context.Context, in *Ikev2InitiateDelIkeSa) (*Ikev2InitiateDelIkeSaReply, error)
+ Ikev2InitiateRekeyChildSa(ctx context.Context, in *Ikev2InitiateRekeyChildSa) (*Ikev2InitiateRekeyChildSaReply, error)
+ Ikev2InitiateSaInit(ctx context.Context, in *Ikev2InitiateSaInit) (*Ikev2InitiateSaInitReply, error)
+ Ikev2PluginGetVersion(ctx context.Context, in *Ikev2PluginGetVersion) (*Ikev2PluginGetVersionReply, error)
+ Ikev2ProfileAddDel(ctx context.Context, in *Ikev2ProfileAddDel) (*Ikev2ProfileAddDelReply, error)
+ Ikev2ProfileSetAuth(ctx context.Context, in *Ikev2ProfileSetAuth) (*Ikev2ProfileSetAuthReply, error)
+ Ikev2ProfileSetID(ctx context.Context, in *Ikev2ProfileSetID) (*Ikev2ProfileSetIDReply, error)
+ Ikev2ProfileSetTs(ctx context.Context, in *Ikev2ProfileSetTs) (*Ikev2ProfileSetTsReply, error)
+ Ikev2SetEspTransforms(ctx context.Context, in *Ikev2SetEspTransforms) (*Ikev2SetEspTransformsReply, error)
+ Ikev2SetIkeTransforms(ctx context.Context, in *Ikev2SetIkeTransforms) (*Ikev2SetIkeTransformsReply, error)
+ Ikev2SetLocalKey(ctx context.Context, in *Ikev2SetLocalKey) (*Ikev2SetLocalKeyReply, error)
+ Ikev2SetResponder(ctx context.Context, in *Ikev2SetResponder) (*Ikev2SetResponderReply, error)
+ Ikev2SetSaLifetime(ctx context.Context, in *Ikev2SetSaLifetime) (*Ikev2SetSaLifetimeReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) Ikev2InitiateDelChildSa(ctx context.Context, in *Ikev2InitiateDelChildSa) (*Ikev2InitiateDelChildSaReply, error) {
+ out := new(Ikev2InitiateDelChildSaReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2InitiateDelIkeSa(ctx context.Context, in *Ikev2InitiateDelIkeSa) (*Ikev2InitiateDelIkeSaReply, error) {
+ out := new(Ikev2InitiateDelIkeSaReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2InitiateRekeyChildSa(ctx context.Context, in *Ikev2InitiateRekeyChildSa) (*Ikev2InitiateRekeyChildSaReply, error) {
+ out := new(Ikev2InitiateRekeyChildSaReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2InitiateSaInit(ctx context.Context, in *Ikev2InitiateSaInit) (*Ikev2InitiateSaInitReply, error) {
+ out := new(Ikev2InitiateSaInitReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2PluginGetVersion(ctx context.Context, in *Ikev2PluginGetVersion) (*Ikev2PluginGetVersionReply, error) {
+ out := new(Ikev2PluginGetVersionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2ProfileAddDel(ctx context.Context, in *Ikev2ProfileAddDel) (*Ikev2ProfileAddDelReply, error) {
+ out := new(Ikev2ProfileAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2ProfileSetAuth(ctx context.Context, in *Ikev2ProfileSetAuth) (*Ikev2ProfileSetAuthReply, error) {
+ out := new(Ikev2ProfileSetAuthReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2ProfileSetID(ctx context.Context, in *Ikev2ProfileSetID) (*Ikev2ProfileSetIDReply, error) {
+ out := new(Ikev2ProfileSetIDReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2ProfileSetTs(ctx context.Context, in *Ikev2ProfileSetTs) (*Ikev2ProfileSetTsReply, error) {
+ out := new(Ikev2ProfileSetTsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2SetEspTransforms(ctx context.Context, in *Ikev2SetEspTransforms) (*Ikev2SetEspTransformsReply, error) {
+ out := new(Ikev2SetEspTransformsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2SetIkeTransforms(ctx context.Context, in *Ikev2SetIkeTransforms) (*Ikev2SetIkeTransformsReply, error) {
+ out := new(Ikev2SetIkeTransformsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2SetLocalKey(ctx context.Context, in *Ikev2SetLocalKey) (*Ikev2SetLocalKeyReply, error) {
+ out := new(Ikev2SetLocalKeyReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2SetResponder(ctx context.Context, in *Ikev2SetResponder) (*Ikev2SetResponderReply, error) {
+ out := new(Ikev2SetResponderReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ikev2SetSaLifetime(ctx context.Context, in *Ikev2SetSaLifetime) (*Ikev2SetSaLifetimeReply, error) {
+ out := new(Ikev2SetSaLifetimeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/interface/interface.ba.go b/internal/testbinapi/binapi2001/interface/interface.ba.go
new file mode 100644
index 0000000..94a33b8
--- /dev/null
+++ b/internal/testbinapi/binapi2001/interface/interface.ba.go
@@ -0,0 +1,3083 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/interface.api.json
+
+// Package interfaces contains generated bindings for API file interface.api.
+//
+// Contents:
+// 7 aliases
+// 10 enums
+// 6 structs
+// 1 union
+// 53 messages
+//
+package interfaces
+
+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 = "interface"
+ APIVersion = "3.2.2"
+ VersionCrc = 0xfebc3ffa
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// CollectDetailedInterfaceStats defines message 'collect_detailed_interface_stats'.
+type CollectDetailedInterfaceStats struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+}
+
+func (m *CollectDetailedInterfaceStats) Reset() { *m = CollectDetailedInterfaceStats{} }
+func (*CollectDetailedInterfaceStats) GetMessageName() string {
+ return "collect_detailed_interface_stats"
+}
+func (*CollectDetailedInterfaceStats) GetCrcString() string { return "5501adee" }
+func (*CollectDetailedInterfaceStats) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CollectDetailedInterfaceStats) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.EnableDisable
+ return size
+}
+func (m *CollectDetailedInterfaceStats) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.EnableDisable)
+ return buf.Bytes(), nil
+}
+func (m *CollectDetailedInterfaceStats) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.EnableDisable = buf.DecodeBool()
+ return nil
+}
+
+// CollectDetailedInterfaceStatsReply defines message 'collect_detailed_interface_stats_reply'.
+type CollectDetailedInterfaceStatsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *CollectDetailedInterfaceStatsReply) Reset() { *m = CollectDetailedInterfaceStatsReply{} }
+func (*CollectDetailedInterfaceStatsReply) GetMessageName() string {
+ return "collect_detailed_interface_stats_reply"
+}
+func (*CollectDetailedInterfaceStatsReply) GetCrcString() string { return "e8d4e804" }
+func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CollectDetailedInterfaceStatsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *CollectDetailedInterfaceStatsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// CreateLoopback defines message 'create_loopback'.
+type CreateLoopback struct {
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+}
+
+func (m *CreateLoopback) Reset() { *m = CreateLoopback{} }
+func (*CreateLoopback) GetMessageName() string { return "create_loopback" }
+func (*CreateLoopback) GetCrcString() string { return "42bb5d22" }
+func (*CreateLoopback) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CreateLoopback) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 6 // m.MacAddress
+ return size
+}
+func (m *CreateLoopback) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.MacAddress[:], 6)
+ return buf.Bytes(), nil
+}
+func (m *CreateLoopback) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// CreateLoopbackInstance defines message 'create_loopback_instance'.
+type CreateLoopbackInstance struct {
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ IsSpecified bool `binapi:"bool,name=is_specified" json:"is_specified,omitempty"`
+ UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
+}
+
+func (m *CreateLoopbackInstance) Reset() { *m = CreateLoopbackInstance{} }
+func (*CreateLoopbackInstance) GetMessageName() string { return "create_loopback_instance" }
+func (*CreateLoopbackInstance) GetCrcString() string { return "d36a3ee2" }
+func (*CreateLoopbackInstance) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CreateLoopbackInstance) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 6 // m.MacAddress
+ size += 1 // m.IsSpecified
+ size += 4 // m.UserInstance
+ return size
+}
+func (m *CreateLoopbackInstance) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.MacAddress[:], 6)
+ buf.EncodeBool(m.IsSpecified)
+ buf.EncodeUint32(m.UserInstance)
+ return buf.Bytes(), nil
+}
+func (m *CreateLoopbackInstance) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ m.IsSpecified = buf.DecodeBool()
+ m.UserInstance = buf.DecodeUint32()
+ return nil
+}
+
+// CreateLoopbackInstanceReply defines message 'create_loopback_instance_reply'.
+type CreateLoopbackInstanceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *CreateLoopbackInstanceReply) Reset() { *m = CreateLoopbackInstanceReply{} }
+func (*CreateLoopbackInstanceReply) GetMessageName() string { return "create_loopback_instance_reply" }
+func (*CreateLoopbackInstanceReply) GetCrcString() string { return "5383d31f" }
+func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CreateLoopbackInstanceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *CreateLoopbackInstanceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// CreateLoopbackReply defines message 'create_loopback_reply'.
+type CreateLoopbackReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *CreateLoopbackReply) Reset() { *m = CreateLoopbackReply{} }
+func (*CreateLoopbackReply) GetMessageName() string { return "create_loopback_reply" }
+func (*CreateLoopbackReply) GetCrcString() string { return "5383d31f" }
+func (*CreateLoopbackReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CreateLoopbackReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *CreateLoopbackReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// CreateSubif defines message 'create_subif'.
+type CreateSubif struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SubID uint32 `binapi:"u32,name=sub_id" json:"sub_id,omitempty"`
+ SubIfFlags SubIfFlags `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"`
+ OuterVlanID uint16 `binapi:"u16,name=outer_vlan_id" json:"outer_vlan_id,omitempty"`
+ InnerVlanID uint16 `binapi:"u16,name=inner_vlan_id" json:"inner_vlan_id,omitempty"`
+}
+
+func (m *CreateSubif) Reset() { *m = CreateSubif{} }
+func (*CreateSubif) GetMessageName() string { return "create_subif" }
+func (*CreateSubif) GetCrcString() string { return "cb371063" }
+func (*CreateSubif) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CreateSubif) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.SubID
+ size += 4 // m.SubIfFlags
+ size += 2 // m.OuterVlanID
+ size += 2 // m.InnerVlanID
+ return size
+}
+func (m *CreateSubif) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.SubID)
+ buf.EncodeUint32(uint32(m.SubIfFlags))
+ buf.EncodeUint16(m.OuterVlanID)
+ buf.EncodeUint16(m.InnerVlanID)
+ return buf.Bytes(), nil
+}
+func (m *CreateSubif) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.SubID = buf.DecodeUint32()
+ m.SubIfFlags = SubIfFlags(buf.DecodeUint32())
+ m.OuterVlanID = buf.DecodeUint16()
+ m.InnerVlanID = buf.DecodeUint16()
+ return nil
+}
+
+// CreateSubifReply defines message 'create_subif_reply'.
+type CreateSubifReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *CreateSubifReply) Reset() { *m = CreateSubifReply{} }
+func (*CreateSubifReply) GetMessageName() string { return "create_subif_reply" }
+func (*CreateSubifReply) GetCrcString() string { return "5383d31f" }
+func (*CreateSubifReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CreateSubifReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *CreateSubifReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// CreateVlanSubif defines message 'create_vlan_subif'.
+type CreateVlanSubif struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ VlanID uint32 `binapi:"u32,name=vlan_id" json:"vlan_id,omitempty"`
+}
+
+func (m *CreateVlanSubif) Reset() { *m = CreateVlanSubif{} }
+func (*CreateVlanSubif) GetMessageName() string { return "create_vlan_subif" }
+func (*CreateVlanSubif) GetCrcString() string { return "af34ac8b" }
+func (*CreateVlanSubif) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CreateVlanSubif) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.VlanID
+ return size
+}
+func (m *CreateVlanSubif) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.VlanID)
+ return buf.Bytes(), nil
+}
+func (m *CreateVlanSubif) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.VlanID = buf.DecodeUint32()
+ return nil
+}
+
+// CreateVlanSubifReply defines message 'create_vlan_subif_reply'.
+type CreateVlanSubifReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *CreateVlanSubifReply) Reset() { *m = CreateVlanSubifReply{} }
+func (*CreateVlanSubifReply) GetMessageName() string { return "create_vlan_subif_reply" }
+func (*CreateVlanSubifReply) GetCrcString() string { return "5383d31f" }
+func (*CreateVlanSubifReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CreateVlanSubifReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *CreateVlanSubifReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// DeleteLoopback defines message 'delete_loopback'.
+type DeleteLoopback struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *DeleteLoopback) Reset() { *m = DeleteLoopback{} }
+func (*DeleteLoopback) GetMessageName() string { return "delete_loopback" }
+func (*DeleteLoopback) GetCrcString() string { return "f9e6675e" }
+func (*DeleteLoopback) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DeleteLoopback) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *DeleteLoopback) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *DeleteLoopback) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// DeleteLoopbackReply defines message 'delete_loopback_reply'.
+type DeleteLoopbackReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DeleteLoopbackReply) Reset() { *m = DeleteLoopbackReply{} }
+func (*DeleteLoopbackReply) GetMessageName() string { return "delete_loopback_reply" }
+func (*DeleteLoopbackReply) GetCrcString() string { return "e8d4e804" }
+func (*DeleteLoopbackReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DeleteLoopbackReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DeleteLoopbackReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DeleteSubif defines message 'delete_subif'.
+type DeleteSubif struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *DeleteSubif) Reset() { *m = DeleteSubif{} }
+func (*DeleteSubif) GetMessageName() string { return "delete_subif" }
+func (*DeleteSubif) GetCrcString() string { return "f9e6675e" }
+func (*DeleteSubif) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DeleteSubif) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *DeleteSubif) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *DeleteSubif) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// DeleteSubifReply defines message 'delete_subif_reply'.
+type DeleteSubifReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DeleteSubifReply) Reset() { *m = DeleteSubifReply{} }
+func (*DeleteSubifReply) GetMessageName() string { return "delete_subif_reply" }
+func (*DeleteSubifReply) GetCrcString() string { return "e8d4e804" }
+func (*DeleteSubifReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DeleteSubifReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DeleteSubifReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// HwInterfaceSetMtu defines message 'hw_interface_set_mtu'.
+type HwInterfaceSetMtu struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Mtu uint16 `binapi:"u16,name=mtu" json:"mtu,omitempty"`
+}
+
+func (m *HwInterfaceSetMtu) Reset() { *m = HwInterfaceSetMtu{} }
+func (*HwInterfaceSetMtu) GetMessageName() string { return "hw_interface_set_mtu" }
+func (*HwInterfaceSetMtu) GetCrcString() string { return "e6746899" }
+func (*HwInterfaceSetMtu) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *HwInterfaceSetMtu) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 2 // m.Mtu
+ return size
+}
+func (m *HwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint16(m.Mtu)
+ return buf.Bytes(), nil
+}
+func (m *HwInterfaceSetMtu) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Mtu = buf.DecodeUint16()
+ return nil
+}
+
+// HwInterfaceSetMtuReply defines message 'hw_interface_set_mtu_reply'.
+type HwInterfaceSetMtuReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *HwInterfaceSetMtuReply) Reset() { *m = HwInterfaceSetMtuReply{} }
+func (*HwInterfaceSetMtuReply) GetMessageName() string { return "hw_interface_set_mtu_reply" }
+func (*HwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" }
+func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *HwInterfaceSetMtuReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *HwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// InterfaceNameRenumber defines message 'interface_name_renumber'.
+type InterfaceNameRenumber struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ NewShowDevInstance uint32 `binapi:"u32,name=new_show_dev_instance" json:"new_show_dev_instance,omitempty"`
+}
+
+func (m *InterfaceNameRenumber) Reset() { *m = InterfaceNameRenumber{} }
+func (*InterfaceNameRenumber) GetMessageName() string { return "interface_name_renumber" }
+func (*InterfaceNameRenumber) GetCrcString() string { return "2b8858b8" }
+func (*InterfaceNameRenumber) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *InterfaceNameRenumber) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.NewShowDevInstance
+ return size
+}
+func (m *InterfaceNameRenumber) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.NewShowDevInstance)
+ return buf.Bytes(), nil
+}
+func (m *InterfaceNameRenumber) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.NewShowDevInstance = buf.DecodeUint32()
+ return nil
+}
+
+// InterfaceNameRenumberReply defines message 'interface_name_renumber_reply'.
+type InterfaceNameRenumberReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *InterfaceNameRenumberReply) Reset() { *m = InterfaceNameRenumberReply{} }
+func (*InterfaceNameRenumberReply) GetMessageName() string { return "interface_name_renumber_reply" }
+func (*InterfaceNameRenumberReply) GetCrcString() string { return "e8d4e804" }
+func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *InterfaceNameRenumberReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *InterfaceNameRenumberReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceAddDelAddress defines message 'sw_interface_add_del_address'.
+type SwInterfaceAddDelAddress struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ DelAll bool `binapi:"bool,name=del_all" json:"del_all,omitempty"`
+ Prefix AddressWithPrefix `binapi:"address_with_prefix,name=prefix" json:"prefix,omitempty"`
+}
+
+func (m *SwInterfaceAddDelAddress) Reset() { *m = SwInterfaceAddDelAddress{} }
+func (*SwInterfaceAddDelAddress) GetMessageName() string { return "sw_interface_add_del_address" }
+func (*SwInterfaceAddDelAddress) GetCrcString() string { return "5803d5c4" }
+func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceAddDelAddress) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsAdd
+ size += 1 // m.DelAll
+ size += 4 // m.Prefix.Address.Af
+ size += 1 * 16 // m.Prefix.Address.Un
+ size += 1 // m.Prefix.Len
+ return size
+}
+func (m *SwInterfaceAddDelAddress) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.DelAll)
+ buf.EncodeUint32(uint32(m.Prefix.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsAdd = buf.DecodeBool()
+ m.DelAll = buf.DecodeBool()
+ m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceAddDelAddressReply defines message 'sw_interface_add_del_address_reply'.
+type SwInterfaceAddDelAddressReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceAddDelAddressReply) Reset() { *m = SwInterfaceAddDelAddressReply{} }
+func (*SwInterfaceAddDelAddressReply) GetMessageName() string {
+ return "sw_interface_add_del_address_reply"
+}
+func (*SwInterfaceAddDelAddressReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceAddDelAddressReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceAddDelAddressReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceAddDelMacAddress defines message 'sw_interface_add_del_mac_address'.
+type SwInterfaceAddDelMacAddress struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Addr MacAddress `binapi:"mac_address,name=addr" json:"addr,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *SwInterfaceAddDelMacAddress) Reset() { *m = SwInterfaceAddDelMacAddress{} }
+func (*SwInterfaceAddDelMacAddress) GetMessageName() string {
+ return "sw_interface_add_del_mac_address"
+}
+func (*SwInterfaceAddDelMacAddress) GetCrcString() string { return "638bb9f4" }
+func (*SwInterfaceAddDelMacAddress) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceAddDelMacAddress) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 * 6 // m.Addr
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *SwInterfaceAddDelMacAddress) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeBytes(m.Addr[:], 6)
+ buf.EncodeUint8(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceAddDelMacAddress) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ copy(m.Addr[:], buf.DecodeBytes(6))
+ m.IsAdd = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceAddDelMacAddressReply defines message 'sw_interface_add_del_mac_address_reply'.
+type SwInterfaceAddDelMacAddressReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceAddDelMacAddressReply) Reset() { *m = SwInterfaceAddDelMacAddressReply{} }
+func (*SwInterfaceAddDelMacAddressReply) GetMessageName() string {
+ return "sw_interface_add_del_mac_address_reply"
+}
+func (*SwInterfaceAddDelMacAddressReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceAddDelMacAddressReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceAddDelMacAddressReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceAddDelMacAddressReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceClearStats defines message 'sw_interface_clear_stats'.
+type SwInterfaceClearStats struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *SwInterfaceClearStats) Reset() { *m = SwInterfaceClearStats{} }
+func (*SwInterfaceClearStats) GetMessageName() string { return "sw_interface_clear_stats" }
+func (*SwInterfaceClearStats) GetCrcString() string { return "f9e6675e" }
+func (*SwInterfaceClearStats) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceClearStats) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *SwInterfaceClearStats) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceClearStats) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// SwInterfaceClearStatsReply defines message 'sw_interface_clear_stats_reply'.
+type SwInterfaceClearStatsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceClearStatsReply) Reset() { *m = SwInterfaceClearStatsReply{} }
+func (*SwInterfaceClearStatsReply) GetMessageName() string { return "sw_interface_clear_stats_reply" }
+func (*SwInterfaceClearStatsReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceClearStatsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceClearStatsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceDetails defines message 'sw_interface_details'.
+type SwInterfaceDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SupSwIfIndex uint32 `binapi:"u32,name=sup_sw_if_index" json:"sup_sw_if_index,omitempty"`
+ L2Address MacAddress `binapi:"mac_address,name=l2_address" json:"l2_address,omitempty"`
+ Flags IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
+ Type IfType `binapi:"if_type,name=type" json:"type,omitempty"`
+ LinkDuplex LinkDuplex `binapi:"link_duplex,name=link_duplex" json:"link_duplex,omitempty"`
+ LinkSpeed uint32 `binapi:"u32,name=link_speed" json:"link_speed,omitempty"`
+ LinkMtu uint16 `binapi:"u16,name=link_mtu" json:"link_mtu,omitempty"`
+ Mtu []uint32 `binapi:"u32[4],name=mtu" json:"mtu,omitempty"`
+ SubID uint32 `binapi:"u32,name=sub_id" json:"sub_id,omitempty"`
+ SubNumberOfTags uint8 `binapi:"u8,name=sub_number_of_tags" json:"sub_number_of_tags,omitempty"`
+ SubOuterVlanID uint16 `binapi:"u16,name=sub_outer_vlan_id" json:"sub_outer_vlan_id,omitempty"`
+ SubInnerVlanID uint16 `binapi:"u16,name=sub_inner_vlan_id" json:"sub_inner_vlan_id,omitempty"`
+ SubIfFlags SubIfFlags `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"`
+ VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"`
+ VtrPushDot1q uint32 `binapi:"u32,name=vtr_push_dot1q" json:"vtr_push_dot1q,omitempty"`
+ VtrTag1 uint32 `binapi:"u32,name=vtr_tag1" json:"vtr_tag1,omitempty"`
+ VtrTag2 uint32 `binapi:"u32,name=vtr_tag2" json:"vtr_tag2,omitempty"`
+ OuterTag uint16 `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"`
+ BDmac MacAddress `binapi:"mac_address,name=b_dmac" json:"b_dmac,omitempty"`
+ BSmac MacAddress `binapi:"mac_address,name=b_smac" json:"b_smac,omitempty"`
+ BVlanid uint16 `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"`
+ ISid uint32 `binapi:"u32,name=i_sid" json:"i_sid,omitempty"`
+ InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
+ InterfaceDevType string `binapi:"string[64],name=interface_dev_type" json:"interface_dev_type,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *SwInterfaceDetails) Reset() { *m = SwInterfaceDetails{} }
+func (*SwInterfaceDetails) GetMessageName() string { return "sw_interface_details" }
+func (*SwInterfaceDetails) GetCrcString() string { return "17b69fa2" }
+func (*SwInterfaceDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.SupSwIfIndex
+ size += 1 * 6 // m.L2Address
+ size += 4 // m.Flags
+ size += 4 // m.Type
+ size += 4 // m.LinkDuplex
+ size += 4 // m.LinkSpeed
+ size += 2 // m.LinkMtu
+ size += 4 * 4 // m.Mtu
+ size += 4 // m.SubID
+ size += 1 // m.SubNumberOfTags
+ size += 2 // m.SubOuterVlanID
+ size += 2 // m.SubInnerVlanID
+ size += 4 // m.SubIfFlags
+ size += 4 // m.VtrOp
+ size += 4 // m.VtrPushDot1q
+ size += 4 // m.VtrTag1
+ size += 4 // m.VtrTag2
+ size += 2 // m.OuterTag
+ size += 1 * 6 // m.BDmac
+ size += 1 * 6 // m.BSmac
+ size += 2 // m.BVlanid
+ size += 4 // m.ISid
+ size += 64 // m.InterfaceName
+ size += 64 // m.InterfaceDevType
+ size += 64 // m.Tag
+ return size
+}
+func (m *SwInterfaceDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ 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(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(x)
+ }
+ buf.EncodeUint32(m.SubID)
+ buf.EncodeUint8(m.SubNumberOfTags)
+ buf.EncodeUint16(m.SubOuterVlanID)
+ buf.EncodeUint16(m.SubInnerVlanID)
+ buf.EncodeUint32(uint32(m.SubIfFlags))
+ 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(m.BVlanid)
+ buf.EncodeUint32(m.ISid)
+ buf.EncodeString(m.InterfaceName, 64)
+ buf.EncodeString(m.InterfaceDevType, 64)
+ buf.EncodeString(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.SupSwIfIndex = buf.DecodeUint32()
+ copy(m.L2Address[:], buf.DecodeBytes(6))
+ m.Flags = IfStatusFlags(buf.DecodeUint32())
+ m.Type = IfType(buf.DecodeUint32())
+ m.LinkDuplex = LinkDuplex(buf.DecodeUint32())
+ m.LinkSpeed = buf.DecodeUint32()
+ m.LinkMtu = buf.DecodeUint16()
+ m.Mtu = make([]uint32, 4)
+ for i := 0; i < len(m.Mtu); i++ {
+ m.Mtu[i] = buf.DecodeUint32()
+ }
+ m.SubID = buf.DecodeUint32()
+ m.SubNumberOfTags = buf.DecodeUint8()
+ m.SubOuterVlanID = buf.DecodeUint16()
+ m.SubInnerVlanID = buf.DecodeUint16()
+ m.SubIfFlags = SubIfFlags(buf.DecodeUint32())
+ m.VtrOp = buf.DecodeUint32()
+ m.VtrPushDot1q = buf.DecodeUint32()
+ m.VtrTag1 = buf.DecodeUint32()
+ m.VtrTag2 = buf.DecodeUint32()
+ m.OuterTag = buf.DecodeUint16()
+ copy(m.BDmac[:], buf.DecodeBytes(6))
+ copy(m.BSmac[:], buf.DecodeBytes(6))
+ m.BVlanid = buf.DecodeUint16()
+ m.ISid = buf.DecodeUint32()
+ m.InterfaceName = buf.DecodeString(64)
+ m.InterfaceDevType = buf.DecodeString(64)
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// SwInterfaceDump defines message 'sw_interface_dump'.
+type SwInterfaceDump struct {
+ SwIfIndex 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"`
+}
+
+func (m *SwInterfaceDump) Reset() { *m = SwInterfaceDump{} }
+func (*SwInterfaceDump) GetMessageName() string { return "sw_interface_dump" }
+func (*SwInterfaceDump) GetCrcString() string { return "aa610c27" }
+func (*SwInterfaceDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.NameFilterValid)
+ buf.EncodeString(m.NameFilter, 0)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.NameFilterValid = buf.DecodeBool()
+ m.NameFilter = buf.DecodeString(0)
+ return nil
+}
+
+// SwInterfaceEvent defines message 'sw_interface_event'.
+type SwInterfaceEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Flags IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
+ Deleted bool `binapi:"bool,name=deleted" json:"deleted,omitempty"`
+}
+
+func (m *SwInterfaceEvent) Reset() { *m = SwInterfaceEvent{} }
+func (*SwInterfaceEvent) GetMessageName() string { return "sw_interface_event" }
+func (*SwInterfaceEvent) GetCrcString() string { return "f709f78d" }
+func (*SwInterfaceEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *SwInterfaceEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Flags
+ size += 1 // m.Deleted
+ return size
+}
+func (m *SwInterfaceEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PID)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Flags))
+ buf.EncodeBool(m.Deleted)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Flags = IfStatusFlags(buf.DecodeUint32())
+ m.Deleted = buf.DecodeBool()
+ return nil
+}
+
+// SwInterfaceGetMacAddress defines message 'sw_interface_get_mac_address'.
+type SwInterfaceGetMacAddress struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *SwInterfaceGetMacAddress) Reset() { *m = SwInterfaceGetMacAddress{} }
+func (*SwInterfaceGetMacAddress) GetMessageName() string { return "sw_interface_get_mac_address" }
+func (*SwInterfaceGetMacAddress) GetCrcString() string { return "f9e6675e" }
+func (*SwInterfaceGetMacAddress) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceGetMacAddress) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *SwInterfaceGetMacAddress) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceGetMacAddress) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// SwInterfaceGetMacAddressReply defines message 'sw_interface_get_mac_address_reply'.
+type SwInterfaceGetMacAddressReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+}
+
+func (m *SwInterfaceGetMacAddressReply) Reset() { *m = SwInterfaceGetMacAddressReply{} }
+func (*SwInterfaceGetMacAddressReply) GetMessageName() string {
+ return "sw_interface_get_mac_address_reply"
+}
+func (*SwInterfaceGetMacAddressReply) GetCrcString() string { return "40ef2c08" }
+func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceGetMacAddressReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 6 // m.MacAddress
+ return size
+}
+func (m *SwInterfaceGetMacAddressReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// SwInterfaceGetTable defines message 'sw_interface_get_table'.
+type SwInterfaceGetTable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+}
+
+func (m *SwInterfaceGetTable) Reset() { *m = SwInterfaceGetTable{} }
+func (*SwInterfaceGetTable) GetMessageName() string { return "sw_interface_get_table" }
+func (*SwInterfaceGetTable) GetCrcString() string { return "2d033de4" }
+func (*SwInterfaceGetTable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceGetTable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
+ return size
+}
+func (m *SwInterfaceGetTable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceGetTable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
+ return nil
+}
+
+// SwInterfaceGetTableReply defines message 'sw_interface_get_table_reply'.
+type SwInterfaceGetTableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+}
+
+func (m *SwInterfaceGetTableReply) Reset() { *m = SwInterfaceGetTableReply{} }
+func (*SwInterfaceGetTableReply) GetMessageName() string { return "sw_interface_get_table_reply" }
+func (*SwInterfaceGetTableReply) GetCrcString() string { return "a6eb0109" }
+func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceGetTableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.VrfID
+ return size
+}
+func (m *SwInterfaceGetTableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.VrfID = buf.DecodeUint32()
+ return nil
+}
+
+// SwInterfaceRxPlacementDetails defines message 'sw_interface_rx_placement_details'.
+type SwInterfaceRxPlacementDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
+ WorkerID uint32 `binapi:"u32,name=worker_id" json:"worker_id,omitempty"`
+ Mode RxMode `binapi:"rx_mode,name=mode" json:"mode,omitempty"`
+}
+
+func (m *SwInterfaceRxPlacementDetails) Reset() { *m = SwInterfaceRxPlacementDetails{} }
+func (*SwInterfaceRxPlacementDetails) GetMessageName() string {
+ return "sw_interface_rx_placement_details"
+}
+func (*SwInterfaceRxPlacementDetails) GetCrcString() string { return "f6d7d024" }
+func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceRxPlacementDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.QueueID
+ size += 4 // m.WorkerID
+ size += 4 // m.Mode
+ return size
+}
+func (m *SwInterfaceRxPlacementDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.QueueID)
+ buf.EncodeUint32(m.WorkerID)
+ buf.EncodeUint32(uint32(m.Mode))
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceRxPlacementDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.QueueID = buf.DecodeUint32()
+ m.WorkerID = buf.DecodeUint32()
+ m.Mode = RxMode(buf.DecodeUint32())
+ return nil
+}
+
+// SwInterfaceRxPlacementDump defines message 'sw_interface_rx_placement_dump'.
+type SwInterfaceRxPlacementDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *SwInterfaceRxPlacementDump) Reset() { *m = SwInterfaceRxPlacementDump{} }
+func (*SwInterfaceRxPlacementDump) GetMessageName() string { return "sw_interface_rx_placement_dump" }
+func (*SwInterfaceRxPlacementDump) GetCrcString() string { return "f9e6675e" }
+func (*SwInterfaceRxPlacementDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceRxPlacementDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *SwInterfaceRxPlacementDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceRxPlacementDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// SwInterfaceSetFlags defines message 'sw_interface_set_flags'.
+type SwInterfaceSetFlags struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Flags IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
+}
+
+func (m *SwInterfaceSetFlags) Reset() { *m = SwInterfaceSetFlags{} }
+func (*SwInterfaceSetFlags) GetMessageName() string { return "sw_interface_set_flags" }
+func (*SwInterfaceSetFlags) GetCrcString() string { return "6a2b491a" }
+func (*SwInterfaceSetFlags) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetFlags) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Flags
+ return size
+}
+func (m *SwInterfaceSetFlags) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Flags))
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetFlags) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Flags = IfStatusFlags(buf.DecodeUint32())
+ return nil
+}
+
+// SwInterfaceSetFlagsReply defines message 'sw_interface_set_flags_reply'.
+type SwInterfaceSetFlagsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetFlagsReply) Reset() { *m = SwInterfaceSetFlagsReply{} }
+func (*SwInterfaceSetFlagsReply) GetMessageName() string { return "sw_interface_set_flags_reply" }
+func (*SwInterfaceSetFlagsReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetFlagsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetFlagsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetIPDirectedBroadcast defines message 'sw_interface_set_ip_directed_broadcast'.
+type SwInterfaceSetIPDirectedBroadcast struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetIPDirectedBroadcast) Reset() { *m = SwInterfaceSetIPDirectedBroadcast{} }
+func (*SwInterfaceSetIPDirectedBroadcast) GetMessageName() string {
+ return "sw_interface_set_ip_directed_broadcast"
+}
+func (*SwInterfaceSetIPDirectedBroadcast) GetCrcString() string { return "ae6cfcfb" }
+func (*SwInterfaceSetIPDirectedBroadcast) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetIPDirectedBroadcast) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetIPDirectedBroadcast) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetIPDirectedBroadcast) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// SwInterfaceSetIPDirectedBroadcastReply defines message 'sw_interface_set_ip_directed_broadcast_reply'.
+type SwInterfaceSetIPDirectedBroadcastReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetIPDirectedBroadcastReply) Reset() {
+ *m = SwInterfaceSetIPDirectedBroadcastReply{}
+}
+func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageName() string {
+ return "sw_interface_set_ip_directed_broadcast_reply"
+}
+func (*SwInterfaceSetIPDirectedBroadcastReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetIPDirectedBroadcastReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetIPDirectedBroadcastReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetMacAddress defines message 'sw_interface_set_mac_address'.
+type SwInterfaceSetMacAddress struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+}
+
+func (m *SwInterfaceSetMacAddress) Reset() { *m = SwInterfaceSetMacAddress{} }
+func (*SwInterfaceSetMacAddress) GetMessageName() string { return "sw_interface_set_mac_address" }
+func (*SwInterfaceSetMacAddress) GetCrcString() string { return "6aca746a" }
+func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetMacAddress) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 * 6 // m.MacAddress
+ return size
+}
+func (m *SwInterfaceSetMacAddress) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBytes(m.MacAddress[:], 6)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetMacAddress) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// SwInterfaceSetMacAddressReply defines message 'sw_interface_set_mac_address_reply'.
+type SwInterfaceSetMacAddressReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetMacAddressReply) Reset() { *m = SwInterfaceSetMacAddressReply{} }
+func (*SwInterfaceSetMacAddressReply) GetMessageName() string {
+ return "sw_interface_set_mac_address_reply"
+}
+func (*SwInterfaceSetMacAddressReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetMacAddressReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetMacAddressReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetMtu defines message 'sw_interface_set_mtu'.
+type SwInterfaceSetMtu struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Mtu []uint32 `binapi:"u32[4],name=mtu" json:"mtu,omitempty"`
+}
+
+func (m *SwInterfaceSetMtu) Reset() { *m = SwInterfaceSetMtu{} }
+func (*SwInterfaceSetMtu) GetMessageName() string { return "sw_interface_set_mtu" }
+func (*SwInterfaceSetMtu) GetCrcString() string { return "5cbe85e5" }
+func (*SwInterfaceSetMtu) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetMtu) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 * 4 // m.Mtu
+ return size
+}
+func (m *SwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetMtu) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Mtu = make([]uint32, 4)
+ for i := 0; i < len(m.Mtu); i++ {
+ m.Mtu[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// SwInterfaceSetMtuReply defines message 'sw_interface_set_mtu_reply'.
+type SwInterfaceSetMtuReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetMtuReply) Reset() { *m = SwInterfaceSetMtuReply{} }
+func (*SwInterfaceSetMtuReply) GetMessageName() string { return "sw_interface_set_mtu_reply" }
+func (*SwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetMtuReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetRxMode defines message 'sw_interface_set_rx_mode'.
+type SwInterfaceSetRxMode struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ QueueIDValid bool `binapi:"bool,name=queue_id_valid" json:"queue_id_valid,omitempty"`
+ QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
+ Mode RxMode `binapi:"rx_mode,name=mode" json:"mode,omitempty"`
+}
+
+func (m *SwInterfaceSetRxMode) Reset() { *m = SwInterfaceSetRxMode{} }
+func (*SwInterfaceSetRxMode) GetMessageName() string { return "sw_interface_set_rx_mode" }
+func (*SwInterfaceSetRxMode) GetCrcString() string { return "780f5cee" }
+func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetRxMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.QueueIDValid
+ size += 4 // m.QueueID
+ size += 4 // m.Mode
+ return size
+}
+func (m *SwInterfaceSetRxMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.QueueIDValid)
+ buf.EncodeUint32(m.QueueID)
+ buf.EncodeUint32(uint32(m.Mode))
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetRxMode) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.QueueIDValid = buf.DecodeBool()
+ m.QueueID = buf.DecodeUint32()
+ m.Mode = RxMode(buf.DecodeUint32())
+ return nil
+}
+
+// SwInterfaceSetRxModeReply defines message 'sw_interface_set_rx_mode_reply'.
+type SwInterfaceSetRxModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetRxModeReply) Reset() { *m = SwInterfaceSetRxModeReply{} }
+func (*SwInterfaceSetRxModeReply) GetMessageName() string { return "sw_interface_set_rx_mode_reply" }
+func (*SwInterfaceSetRxModeReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetRxModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetRxModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetRxPlacement defines message 'sw_interface_set_rx_placement'.
+type SwInterfaceSetRxPlacement struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
+ WorkerID uint32 `binapi:"u32,name=worker_id" json:"worker_id,omitempty"`
+ IsMain bool `binapi:"bool,name=is_main" json:"is_main,omitempty"`
+}
+
+func (m *SwInterfaceSetRxPlacement) Reset() { *m = SwInterfaceSetRxPlacement{} }
+func (*SwInterfaceSetRxPlacement) GetMessageName() string { return "sw_interface_set_rx_placement" }
+func (*SwInterfaceSetRxPlacement) GetCrcString() string { return "db65f3c9" }
+func (*SwInterfaceSetRxPlacement) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetRxPlacement) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.QueueID
+ size += 4 // m.WorkerID
+ size += 1 // m.IsMain
+ return size
+}
+func (m *SwInterfaceSetRxPlacement) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.QueueID)
+ buf.EncodeUint32(m.WorkerID)
+ buf.EncodeBool(m.IsMain)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetRxPlacement) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.QueueID = buf.DecodeUint32()
+ m.WorkerID = buf.DecodeUint32()
+ m.IsMain = buf.DecodeBool()
+ return nil
+}
+
+// SwInterfaceSetRxPlacementReply defines message 'sw_interface_set_rx_placement_reply'.
+type SwInterfaceSetRxPlacementReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetRxPlacementReply) Reset() { *m = SwInterfaceSetRxPlacementReply{} }
+func (*SwInterfaceSetRxPlacementReply) GetMessageName() string {
+ return "sw_interface_set_rx_placement_reply"
+}
+func (*SwInterfaceSetRxPlacementReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetRxPlacementReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetRxPlacementReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetTable defines message 'sw_interface_set_table'.
+type SwInterfaceSetTable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+}
+
+func (m *SwInterfaceSetTable) Reset() { *m = SwInterfaceSetTable{} }
+func (*SwInterfaceSetTable) GetMessageName() string { return "sw_interface_set_table" }
+func (*SwInterfaceSetTable) GetCrcString() string { return "df42a577" }
+func (*SwInterfaceSetTable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetTable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
+ size += 4 // m.VrfID
+ return size
+}
+func (m *SwInterfaceSetTable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ buf.EncodeUint32(m.VrfID)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetTable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
+ m.VrfID = buf.DecodeUint32()
+ return nil
+}
+
+// SwInterfaceSetTableReply defines message 'sw_interface_set_table_reply'.
+type SwInterfaceSetTableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetTableReply) Reset() { *m = SwInterfaceSetTableReply{} }
+func (*SwInterfaceSetTableReply) GetMessageName() string { return "sw_interface_set_table_reply" }
+func (*SwInterfaceSetTableReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetTableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetTableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetUnnumbered defines message 'sw_interface_set_unnumbered'.
+type SwInterfaceSetUnnumbered struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ UnnumberedSwIfIndex InterfaceIndex `binapi:"interface_index,name=unnumbered_sw_if_index" json:"unnumbered_sw_if_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *SwInterfaceSetUnnumbered) Reset() { *m = SwInterfaceSetUnnumbered{} }
+func (*SwInterfaceSetUnnumbered) GetMessageName() string { return "sw_interface_set_unnumbered" }
+func (*SwInterfaceSetUnnumbered) GetCrcString() string { return "938ef33b" }
+func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetUnnumbered) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.UnnumberedSwIfIndex
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *SwInterfaceSetUnnumbered) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.UnnumberedSwIfIndex))
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetUnnumbered) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.UnnumberedSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// SwInterfaceSetUnnumberedReply defines message 'sw_interface_set_unnumbered_reply'.
+type SwInterfaceSetUnnumberedReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetUnnumberedReply) Reset() { *m = SwInterfaceSetUnnumberedReply{} }
+func (*SwInterfaceSetUnnumberedReply) GetMessageName() string {
+ return "sw_interface_set_unnumbered_reply"
+}
+func (*SwInterfaceSetUnnumberedReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetUnnumberedReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetUnnumberedReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceTagAddDel defines message 'sw_interface_tag_add_del'.
+type SwInterfaceTagAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *SwInterfaceTagAddDel) Reset() { *m = SwInterfaceTagAddDel{} }
+func (*SwInterfaceTagAddDel) GetMessageName() string { return "sw_interface_tag_add_del" }
+func (*SwInterfaceTagAddDel) GetCrcString() string { return "426f8bc1" }
+func (*SwInterfaceTagAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceTagAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.SwIfIndex
+ size += 64 // m.Tag
+ return size
+}
+func (m *SwInterfaceTagAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeString(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceTagAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// SwInterfaceTagAddDelReply defines message 'sw_interface_tag_add_del_reply'.
+type SwInterfaceTagAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceTagAddDelReply) Reset() { *m = SwInterfaceTagAddDelReply{} }
+func (*SwInterfaceTagAddDelReply) GetMessageName() string { return "sw_interface_tag_add_del_reply" }
+func (*SwInterfaceTagAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceTagAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceTagAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// WantInterfaceEvents defines message 'want_interface_events'.
+type WantInterfaceEvents struct {
+ EnableDisable uint32 `binapi:"u32,name=enable_disable" json:"enable_disable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *WantInterfaceEvents) Reset() { *m = WantInterfaceEvents{} }
+func (*WantInterfaceEvents) GetMessageName() string { return "want_interface_events" }
+func (*WantInterfaceEvents) GetCrcString() string { return "476f5a08" }
+func (*WantInterfaceEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantInterfaceEvents) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.EnableDisable
+ size += 4 // m.PID
+ return size
+}
+func (m *WantInterfaceEvents) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.EnableDisable)
+ buf.EncodeUint32(m.PID)
+ return buf.Bytes(), nil
+}
+func (m *WantInterfaceEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeUint32()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// WantInterfaceEventsReply defines message 'want_interface_events_reply'.
+type WantInterfaceEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantInterfaceEventsReply) Reset() { *m = WantInterfaceEventsReply{} }
+func (*WantInterfaceEventsReply) GetMessageName() string { return "want_interface_events_reply" }
+func (*WantInterfaceEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantInterfaceEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantInterfaceEventsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantInterfaceEventsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_interfaces_binapi_init() }
+func file_interfaces_binapi_init() {
+ api.RegisterMessage((*CollectDetailedInterfaceStats)(nil), "collect_detailed_interface_stats_5501adee")
+ api.RegisterMessage((*CollectDetailedInterfaceStatsReply)(nil), "collect_detailed_interface_stats_reply_e8d4e804")
+ api.RegisterMessage((*CreateLoopback)(nil), "create_loopback_42bb5d22")
+ api.RegisterMessage((*CreateLoopbackInstance)(nil), "create_loopback_instance_d36a3ee2")
+ api.RegisterMessage((*CreateLoopbackInstanceReply)(nil), "create_loopback_instance_reply_5383d31f")
+ api.RegisterMessage((*CreateLoopbackReply)(nil), "create_loopback_reply_5383d31f")
+ api.RegisterMessage((*CreateSubif)(nil), "create_subif_cb371063")
+ api.RegisterMessage((*CreateSubifReply)(nil), "create_subif_reply_5383d31f")
+ api.RegisterMessage((*CreateVlanSubif)(nil), "create_vlan_subif_af34ac8b")
+ api.RegisterMessage((*CreateVlanSubifReply)(nil), "create_vlan_subif_reply_5383d31f")
+ api.RegisterMessage((*DeleteLoopback)(nil), "delete_loopback_f9e6675e")
+ api.RegisterMessage((*DeleteLoopbackReply)(nil), "delete_loopback_reply_e8d4e804")
+ api.RegisterMessage((*DeleteSubif)(nil), "delete_subif_f9e6675e")
+ api.RegisterMessage((*DeleteSubifReply)(nil), "delete_subif_reply_e8d4e804")
+ api.RegisterMessage((*HwInterfaceSetMtu)(nil), "hw_interface_set_mtu_e6746899")
+ api.RegisterMessage((*HwInterfaceSetMtuReply)(nil), "hw_interface_set_mtu_reply_e8d4e804")
+ api.RegisterMessage((*InterfaceNameRenumber)(nil), "interface_name_renumber_2b8858b8")
+ api.RegisterMessage((*InterfaceNameRenumberReply)(nil), "interface_name_renumber_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceAddDelAddress)(nil), "sw_interface_add_del_address_5803d5c4")
+ api.RegisterMessage((*SwInterfaceAddDelAddressReply)(nil), "sw_interface_add_del_address_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceAddDelMacAddress)(nil), "sw_interface_add_del_mac_address_638bb9f4")
+ api.RegisterMessage((*SwInterfaceAddDelMacAddressReply)(nil), "sw_interface_add_del_mac_address_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceClearStats)(nil), "sw_interface_clear_stats_f9e6675e")
+ api.RegisterMessage((*SwInterfaceClearStatsReply)(nil), "sw_interface_clear_stats_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceDetails)(nil), "sw_interface_details_17b69fa2")
+ api.RegisterMessage((*SwInterfaceDump)(nil), "sw_interface_dump_aa610c27")
+ api.RegisterMessage((*SwInterfaceEvent)(nil), "sw_interface_event_f709f78d")
+ api.RegisterMessage((*SwInterfaceGetMacAddress)(nil), "sw_interface_get_mac_address_f9e6675e")
+ api.RegisterMessage((*SwInterfaceGetMacAddressReply)(nil), "sw_interface_get_mac_address_reply_40ef2c08")
+ api.RegisterMessage((*SwInterfaceGetTable)(nil), "sw_interface_get_table_2d033de4")
+ api.RegisterMessage((*SwInterfaceGetTableReply)(nil), "sw_interface_get_table_reply_a6eb0109")
+ api.RegisterMessage((*SwInterfaceRxPlacementDetails)(nil), "sw_interface_rx_placement_details_f6d7d024")
+ api.RegisterMessage((*SwInterfaceRxPlacementDump)(nil), "sw_interface_rx_placement_dump_f9e6675e")
+ api.RegisterMessage((*SwInterfaceSetFlags)(nil), "sw_interface_set_flags_6a2b491a")
+ api.RegisterMessage((*SwInterfaceSetFlagsReply)(nil), "sw_interface_set_flags_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcast)(nil), "sw_interface_set_ip_directed_broadcast_ae6cfcfb")
+ api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcastReply)(nil), "sw_interface_set_ip_directed_broadcast_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetMacAddress)(nil), "sw_interface_set_mac_address_6aca746a")
+ api.RegisterMessage((*SwInterfaceSetMacAddressReply)(nil), "sw_interface_set_mac_address_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetMtu)(nil), "sw_interface_set_mtu_5cbe85e5")
+ api.RegisterMessage((*SwInterfaceSetMtuReply)(nil), "sw_interface_set_mtu_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetRxMode)(nil), "sw_interface_set_rx_mode_780f5cee")
+ api.RegisterMessage((*SwInterfaceSetRxModeReply)(nil), "sw_interface_set_rx_mode_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetRxPlacement)(nil), "sw_interface_set_rx_placement_db65f3c9")
+ api.RegisterMessage((*SwInterfaceSetRxPlacementReply)(nil), "sw_interface_set_rx_placement_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetTable)(nil), "sw_interface_set_table_df42a577")
+ api.RegisterMessage((*SwInterfaceSetTableReply)(nil), "sw_interface_set_table_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetUnnumbered)(nil), "sw_interface_set_unnumbered_938ef33b")
+ api.RegisterMessage((*SwInterfaceSetUnnumberedReply)(nil), "sw_interface_set_unnumbered_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceTagAddDel)(nil), "sw_interface_tag_add_del_426f8bc1")
+ api.RegisterMessage((*SwInterfaceTagAddDelReply)(nil), "sw_interface_tag_add_del_reply_e8d4e804")
+ api.RegisterMessage((*WantInterfaceEvents)(nil), "want_interface_events_476f5a08")
+ api.RegisterMessage((*WantInterfaceEventsReply)(nil), "want_interface_events_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*CollectDetailedInterfaceStats)(nil),
+ (*CollectDetailedInterfaceStatsReply)(nil),
+ (*CreateLoopback)(nil),
+ (*CreateLoopbackInstance)(nil),
+ (*CreateLoopbackInstanceReply)(nil),
+ (*CreateLoopbackReply)(nil),
+ (*CreateSubif)(nil),
+ (*CreateSubifReply)(nil),
+ (*CreateVlanSubif)(nil),
+ (*CreateVlanSubifReply)(nil),
+ (*DeleteLoopback)(nil),
+ (*DeleteLoopbackReply)(nil),
+ (*DeleteSubif)(nil),
+ (*DeleteSubifReply)(nil),
+ (*HwInterfaceSetMtu)(nil),
+ (*HwInterfaceSetMtuReply)(nil),
+ (*InterfaceNameRenumber)(nil),
+ (*InterfaceNameRenumberReply)(nil),
+ (*SwInterfaceAddDelAddress)(nil),
+ (*SwInterfaceAddDelAddressReply)(nil),
+ (*SwInterfaceAddDelMacAddress)(nil),
+ (*SwInterfaceAddDelMacAddressReply)(nil),
+ (*SwInterfaceClearStats)(nil),
+ (*SwInterfaceClearStatsReply)(nil),
+ (*SwInterfaceDetails)(nil),
+ (*SwInterfaceDump)(nil),
+ (*SwInterfaceEvent)(nil),
+ (*SwInterfaceGetMacAddress)(nil),
+ (*SwInterfaceGetMacAddressReply)(nil),
+ (*SwInterfaceGetTable)(nil),
+ (*SwInterfaceGetTableReply)(nil),
+ (*SwInterfaceRxPlacementDetails)(nil),
+ (*SwInterfaceRxPlacementDump)(nil),
+ (*SwInterfaceSetFlags)(nil),
+ (*SwInterfaceSetFlagsReply)(nil),
+ (*SwInterfaceSetIPDirectedBroadcast)(nil),
+ (*SwInterfaceSetIPDirectedBroadcastReply)(nil),
+ (*SwInterfaceSetMacAddress)(nil),
+ (*SwInterfaceSetMacAddressReply)(nil),
+ (*SwInterfaceSetMtu)(nil),
+ (*SwInterfaceSetMtuReply)(nil),
+ (*SwInterfaceSetRxMode)(nil),
+ (*SwInterfaceSetRxModeReply)(nil),
+ (*SwInterfaceSetRxPlacement)(nil),
+ (*SwInterfaceSetRxPlacementReply)(nil),
+ (*SwInterfaceSetTable)(nil),
+ (*SwInterfaceSetTableReply)(nil),
+ (*SwInterfaceSetUnnumbered)(nil),
+ (*SwInterfaceSetUnnumberedReply)(nil),
+ (*SwInterfaceTagAddDel)(nil),
+ (*SwInterfaceTagAddDelReply)(nil),
+ (*WantInterfaceEvents)(nil),
+ (*WantInterfaceEventsReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/interfaces/interfaces_rpc.ba.go b/internal/testbinapi/binapi2001/interface/interface_rpc.ba.go
index e30aed9..f12e6eb 100644
--- a/internal/testbinapi/binapi2001/interfaces/interfaces_rpc.ba.go
+++ b/internal/testbinapi/binapi2001/interface/interface_rpc.ba.go
@@ -4,15 +4,14 @@ package interfaces
import (
"context"
- "io"
-
+ "fmt"
api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
)
-// RPCService represents RPC service API for interface module.
+// RPCService defines RPC service interface.
type RPCService interface {
- DumpSwInterface(ctx context.Context, in *SwInterfaceDump) (RPCService_DumpSwInterfaceClient, error)
- DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_DumpSwInterfaceRxPlacementClient, error)
CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error)
CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error)
CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error)
@@ -25,8 +24,10 @@ type RPCService interface {
SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error)
SwInterfaceAddDelMacAddress(ctx context.Context, in *SwInterfaceAddDelMacAddress) (*SwInterfaceAddDelMacAddressReply, error)
SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error)
+ SwInterfaceDump(ctx context.Context, in *SwInterfaceDump) (RPCService_SwInterfaceDumpClient, error)
SwInterfaceGetMacAddress(ctx context.Context, in *SwInterfaceGetMacAddress) (*SwInterfaceGetMacAddressReply, error)
SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error)
+ SwInterfaceRxPlacementDump(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_SwInterfaceRxPlacementDumpClient, error)
SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error)
SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error)
SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error)
@@ -40,68 +41,16 @@ type RPCService interface {
}
type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpSwInterface(ctx context.Context, in *SwInterfaceDump) (RPCService_DumpSwInterfaceClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSwInterfaceClient{stream}
- return x, nil
-}
-
-type RPCService_DumpSwInterfaceClient interface {
- Recv() (*SwInterfaceDetails, error)
-}
-
-type serviceClient_DumpSwInterfaceClient struct {
- api.MultiRequestCtx
+ conn api.Connection
}
-func (c *serviceClient_DumpSwInterfaceClient) Recv() (*SwInterfaceDetails, error) {
- m := new(SwInterfaceDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_DumpSwInterfaceRxPlacementClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSwInterfaceRxPlacementClient{stream}
- return x, nil
-}
-
-type RPCService_DumpSwInterfaceRxPlacementClient interface {
- Recv() (*SwInterfaceRxPlacementDetails, error)
-}
-
-type serviceClient_DumpSwInterfaceRxPlacementClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpSwInterfaceRxPlacementClient) Recv() (*SwInterfaceRxPlacementDetails, error) {
- m := new(SwInterfaceRxPlacementDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
}
func (c *serviceClient) CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error) {
out := new(CollectDetailedInterfaceStatsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -110,7 +59,7 @@ func (c *serviceClient) CollectDetailedInterfaceStats(ctx context.Context, in *C
func (c *serviceClient) CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error) {
out := new(CreateLoopbackReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -119,7 +68,7 @@ func (c *serviceClient) CreateLoopback(ctx context.Context, in *CreateLoopback)
func (c *serviceClient) CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error) {
out := new(CreateLoopbackInstanceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -128,7 +77,7 @@ func (c *serviceClient) CreateLoopbackInstance(ctx context.Context, in *CreateLo
func (c *serviceClient) CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubifReply, error) {
out := new(CreateSubifReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -137,7 +86,7 @@ func (c *serviceClient) CreateSubif(ctx context.Context, in *CreateSubif) (*Crea
func (c *serviceClient) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*CreateVlanSubifReply, error) {
out := new(CreateVlanSubifReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -146,7 +95,7 @@ func (c *serviceClient) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif
func (c *serviceClient) DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*DeleteLoopbackReply, error) {
out := new(DeleteLoopbackReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -155,7 +104,7 @@ func (c *serviceClient) DeleteLoopback(ctx context.Context, in *DeleteLoopback)
func (c *serviceClient) DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubifReply, error) {
out := new(DeleteSubifReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -164,7 +113,7 @@ func (c *serviceClient) DeleteSubif(ctx context.Context, in *DeleteSubif) (*Dele
func (c *serviceClient) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error) {
out := new(HwInterfaceSetMtuReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -173,7 +122,7 @@ func (c *serviceClient) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSe
func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error) {
out := new(InterfaceNameRenumberReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -182,7 +131,7 @@ func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *Interface
func (c *serviceClient) SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error) {
out := new(SwInterfaceAddDelAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -191,7 +140,7 @@ func (c *serviceClient) SwInterfaceAddDelAddress(ctx context.Context, in *SwInte
func (c *serviceClient) SwInterfaceAddDelMacAddress(ctx context.Context, in *SwInterfaceAddDelMacAddress) (*SwInterfaceAddDelMacAddressReply, error) {
out := new(SwInterfaceAddDelMacAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -200,16 +149,55 @@ func (c *serviceClient) SwInterfaceAddDelMacAddress(ctx context.Context, in *SwI
func (c *serviceClient) SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error) {
out := new(SwInterfaceClearStatsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
+func (c *serviceClient) SwInterfaceDump(ctx context.Context, in *SwInterfaceDump) (RPCService_SwInterfaceDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwInterfaceDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwInterfaceDumpClient interface {
+ Recv() (*SwInterfaceDetails, error)
+ api.Stream
+}
+
+type serviceClient_SwInterfaceDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwInterfaceDumpClient) Recv() (*SwInterfaceDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwInterfaceDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
func (c *serviceClient) SwInterfaceGetMacAddress(ctx context.Context, in *SwInterfaceGetMacAddress) (*SwInterfaceGetMacAddressReply, error) {
out := new(SwInterfaceGetMacAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -218,16 +206,55 @@ func (c *serviceClient) SwInterfaceGetMacAddress(ctx context.Context, in *SwInte
func (c *serviceClient) SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error) {
out := new(SwInterfaceGetTableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
+func (c *serviceClient) SwInterfaceRxPlacementDump(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_SwInterfaceRxPlacementDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwInterfaceRxPlacementDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwInterfaceRxPlacementDumpClient interface {
+ Recv() (*SwInterfaceRxPlacementDetails, error)
+ api.Stream
+}
+
+type serviceClient_SwInterfaceRxPlacementDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwInterfaceRxPlacementDumpClient) Recv() (*SwInterfaceRxPlacementDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwInterfaceRxPlacementDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
func (c *serviceClient) SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error) {
out := new(SwInterfaceSetFlagsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -236,7 +263,7 @@ func (c *serviceClient) SwInterfaceSetFlags(ctx context.Context, in *SwInterface
func (c *serviceClient) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error) {
out := new(SwInterfaceSetIPDirectedBroadcastReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -245,7 +272,7 @@ func (c *serviceClient) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, i
func (c *serviceClient) SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error) {
out := new(SwInterfaceSetMacAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -254,7 +281,7 @@ func (c *serviceClient) SwInterfaceSetMacAddress(ctx context.Context, in *SwInte
func (c *serviceClient) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error) {
out := new(SwInterfaceSetMtuReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -263,7 +290,7 @@ func (c *serviceClient) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSe
func (c *serviceClient) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error) {
out := new(SwInterfaceSetRxModeReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -272,7 +299,7 @@ func (c *serviceClient) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfac
func (c *serviceClient) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error) {
out := new(SwInterfaceSetRxPlacementReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -281,7 +308,7 @@ func (c *serviceClient) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInt
func (c *serviceClient) SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error) {
out := new(SwInterfaceSetTableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -290,7 +317,7 @@ func (c *serviceClient) SwInterfaceSetTable(ctx context.Context, in *SwInterface
func (c *serviceClient) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error) {
out := new(SwInterfaceSetUnnumberedReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -299,7 +326,7 @@ func (c *serviceClient) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInte
func (c *serviceClient) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error) {
out := new(SwInterfaceTagAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -308,14 +335,9 @@ func (c *serviceClient) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfac
func (c *serviceClient) WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error) {
out := new(WantInterfaceEventsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/internal/testbinapi/binapi2001/interface_types/interface_types.ba.go b/internal/testbinapi/binapi2001/interface_types/interface_types.ba.go
new file mode 100644
index 0000000..c4ba91d
--- /dev/null
+++ b/internal/testbinapi/binapi2001/interface_types/interface_types.ba.go
@@ -0,0 +1,278 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/interface_types.api.json
+
+// Package interface_types contains generated bindings for API file interface_types.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+//
+package interface_types
+
+import (
+ api "git.fd.io/govpp.git/api"
+ "strconv"
+)
+
+// 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
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
diff --git a/internal/testbinapi/binapi2001/interfaces/interfaces.ba.go b/internal/testbinapi/binapi2001/interfaces/interfaces.ba.go
deleted file mode 100644
index 0c6ff3e..0000000
--- a/internal/testbinapi/binapi2001/interfaces/interfaces.ba.go
+++ /dev/null
@@ -1,3961 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.01-45~g7a071e370~b63
-// source: /usr/share/vpp/api/core/interface.api.json
-
-/*
-Package interfaces contains generated code for VPP binary API defined by interface.api (version 3.2.2).
-
-It consists of:
- 7 aliases
- 10 enums
- 53 messages
- 6 types
- 1 union
-*/
-package interfaces
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "math"
- "strconv"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-)
-
-// 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 // please upgrade the GoVPP api package
-
-const (
- // ModuleName is the name of this module.
- ModuleName = "interface"
- // APIVersion is the API version of this module.
- APIVersion = "3.2.2"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0xfebc3ffa
-)
-
-// AddressFamily represents VPP binary API 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)) + ")"
-}
-
-// IfStatusFlags represents VPP binary API enum 'if_status_flags'.
-type IfStatusFlags uint32
-
-const (
- IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
- IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
-)
-
-var (
- IfStatusFlags_name = map[uint32]string{
- 1: "IF_STATUS_API_FLAG_ADMIN_UP",
- 2: "IF_STATUS_API_FLAG_LINK_UP",
- }
- IfStatusFlags_value = map[string]uint32{
- "IF_STATUS_API_FLAG_ADMIN_UP": 1,
- "IF_STATUS_API_FLAG_LINK_UP": 2,
- }
-)
-
-func (x IfStatusFlags) String() string {
- s, ok := IfStatusFlags_name[uint32(x)]
- if ok {
- return s
- }
- return "IfStatusFlags(" + strconv.Itoa(int(x)) + ")"
-}
-
-// IfType represents VPP binary API enum 'if_type'.
-type IfType uint32
-
-const (
- IF_API_TYPE_HARDWARE IfType = 1
- IF_API_TYPE_SUB IfType = 2
- IF_API_TYPE_P2P IfType = 3
- IF_API_TYPE_PIPE IfType = 4
-)
-
-var (
- IfType_name = map[uint32]string{
- 1: "IF_API_TYPE_HARDWARE",
- 2: "IF_API_TYPE_SUB",
- 3: "IF_API_TYPE_P2P",
- 4: "IF_API_TYPE_PIPE",
- }
- IfType_value = map[string]uint32{
- "IF_API_TYPE_HARDWARE": 1,
- "IF_API_TYPE_SUB": 2,
- "IF_API_TYPE_P2P": 3,
- "IF_API_TYPE_PIPE": 4,
- }
-)
-
-func (x IfType) String() string {
- s, ok := IfType_name[uint32(x)]
- if ok {
- return s
- }
- return "IfType(" + strconv.Itoa(int(x)) + ")"
-}
-
-// IPDscp represents VPP binary API enum 'ip_dscp'.
-type IPDscp uint8
-
-const (
- IP_API_DSCP_CS0 IPDscp = 0
- IP_API_DSCP_CS1 IPDscp = 8
- IP_API_DSCP_AF11 IPDscp = 10
- IP_API_DSCP_AF12 IPDscp = 12
- IP_API_DSCP_AF13 IPDscp = 14
- IP_API_DSCP_CS2 IPDscp = 16
- IP_API_DSCP_AF21 IPDscp = 18
- IP_API_DSCP_AF22 IPDscp = 20
- IP_API_DSCP_AF23 IPDscp = 22
- IP_API_DSCP_CS3 IPDscp = 24
- IP_API_DSCP_AF31 IPDscp = 26
- IP_API_DSCP_AF32 IPDscp = 28
- IP_API_DSCP_AF33 IPDscp = 30
- IP_API_DSCP_CS4 IPDscp = 32
- IP_API_DSCP_AF41 IPDscp = 34
- IP_API_DSCP_AF42 IPDscp = 36
- IP_API_DSCP_AF43 IPDscp = 38
- IP_API_DSCP_CS5 IPDscp = 40
- IP_API_DSCP_EF IPDscp = 46
- IP_API_DSCP_CS6 IPDscp = 48
- IP_API_DSCP_CS7 IPDscp = 50
-)
-
-var (
- IPDscp_name = map[uint8]string{
- 0: "IP_API_DSCP_CS0",
- 8: "IP_API_DSCP_CS1",
- 10: "IP_API_DSCP_AF11",
- 12: "IP_API_DSCP_AF12",
- 14: "IP_API_DSCP_AF13",
- 16: "IP_API_DSCP_CS2",
- 18: "IP_API_DSCP_AF21",
- 20: "IP_API_DSCP_AF22",
- 22: "IP_API_DSCP_AF23",
- 24: "IP_API_DSCP_CS3",
- 26: "IP_API_DSCP_AF31",
- 28: "IP_API_DSCP_AF32",
- 30: "IP_API_DSCP_AF33",
- 32: "IP_API_DSCP_CS4",
- 34: "IP_API_DSCP_AF41",
- 36: "IP_API_DSCP_AF42",
- 38: "IP_API_DSCP_AF43",
- 40: "IP_API_DSCP_CS5",
- 46: "IP_API_DSCP_EF",
- 48: "IP_API_DSCP_CS6",
- 50: "IP_API_DSCP_CS7",
- }
- IPDscp_value = map[string]uint8{
- "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,
- }
-)
-
-func (x IPDscp) String() string {
- s, ok := IPDscp_name[uint8(x)]
- if ok {
- return s
- }
- return "IPDscp(" + strconv.Itoa(int(x)) + ")"
-}
-
-// IPEcn represents VPP binary API enum 'ip_ecn'.
-type IPEcn uint8
-
-const (
- IP_API_ECN_NONE IPEcn = 0
- IP_API_ECN_ECT0 IPEcn = 1
- IP_API_ECN_ECT1 IPEcn = 2
- IP_API_ECN_CE IPEcn = 3
-)
-
-var (
- IPEcn_name = map[uint8]string{
- 0: "IP_API_ECN_NONE",
- 1: "IP_API_ECN_ECT0",
- 2: "IP_API_ECN_ECT1",
- 3: "IP_API_ECN_CE",
- }
- IPEcn_value = map[string]uint8{
- "IP_API_ECN_NONE": 0,
- "IP_API_ECN_ECT0": 1,
- "IP_API_ECN_ECT1": 2,
- "IP_API_ECN_CE": 3,
- }
-)
-
-func (x IPEcn) String() string {
- s, ok := IPEcn_name[uint8(x)]
- if ok {
- return s
- }
- return "IPEcn(" + strconv.Itoa(int(x)) + ")"
-}
-
-// IPProto represents VPP binary API enum 'ip_proto'.
-type IPProto uint32
-
-const (
- IP_API_PROTO_HOPOPT IPProto = 0
- IP_API_PROTO_ICMP IPProto = 1
- IP_API_PROTO_IGMP IPProto = 2
- IP_API_PROTO_TCP IPProto = 6
- IP_API_PROTO_UDP IPProto = 17
- IP_API_PROTO_GRE IPProto = 47
- IP_API_PROTO_AH IPProto = 50
- IP_API_PROTO_ESP IPProto = 51
- IP_API_PROTO_EIGRP IPProto = 88
- IP_API_PROTO_OSPF IPProto = 89
- IP_API_PROTO_SCTP IPProto = 132
- IP_API_PROTO_RESERVED IPProto = 255
-)
-
-var (
- IPProto_name = map[uint32]string{
- 0: "IP_API_PROTO_HOPOPT",
- 1: "IP_API_PROTO_ICMP",
- 2: "IP_API_PROTO_IGMP",
- 6: "IP_API_PROTO_TCP",
- 17: "IP_API_PROTO_UDP",
- 47: "IP_API_PROTO_GRE",
- 50: "IP_API_PROTO_AH",
- 51: "IP_API_PROTO_ESP",
- 88: "IP_API_PROTO_EIGRP",
- 89: "IP_API_PROTO_OSPF",
- 132: "IP_API_PROTO_SCTP",
- 255: "IP_API_PROTO_RESERVED",
- }
- IPProto_value = map[string]uint32{
- "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,
- }
-)
-
-func (x IPProto) String() string {
- s, ok := IPProto_name[uint32(x)]
- if ok {
- return s
- }
- return "IPProto(" + strconv.Itoa(int(x)) + ")"
-}
-
-// LinkDuplex represents VPP binary API enum 'link_duplex'.
-type LinkDuplex uint32
-
-const (
- LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
- LINK_DUPLEX_API_HALF LinkDuplex = 1
- LINK_DUPLEX_API_FULL LinkDuplex = 2
-)
-
-var (
- LinkDuplex_name = map[uint32]string{
- 0: "LINK_DUPLEX_API_UNKNOWN",
- 1: "LINK_DUPLEX_API_HALF",
- 2: "LINK_DUPLEX_API_FULL",
- }
- LinkDuplex_value = map[string]uint32{
- "LINK_DUPLEX_API_UNKNOWN": 0,
- "LINK_DUPLEX_API_HALF": 1,
- "LINK_DUPLEX_API_FULL": 2,
- }
-)
-
-func (x LinkDuplex) String() string {
- s, ok := LinkDuplex_name[uint32(x)]
- if ok {
- return s
- }
- return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
-}
-
-// MtuProto represents VPP binary API enum 'mtu_proto'.
-type MtuProto uint32
-
-const (
- MTU_PROTO_API_L3 MtuProto = 1
- MTU_PROTO_API_IP4 MtuProto = 2
- MTU_PROTO_API_IP6 MtuProto = 3
- MTU_PROTO_API_MPLS MtuProto = 4
- MTU_PROTO_API_N MtuProto = 5
-)
-
-var (
- MtuProto_name = map[uint32]string{
- 1: "MTU_PROTO_API_L3",
- 2: "MTU_PROTO_API_IP4",
- 3: "MTU_PROTO_API_IP6",
- 4: "MTU_PROTO_API_MPLS",
- 5: "MTU_PROTO_API_N",
- }
- MtuProto_value = map[string]uint32{
- "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,
- }
-)
-
-func (x MtuProto) String() string {
- s, ok := MtuProto_name[uint32(x)]
- if ok {
- return s
- }
- return "MtuProto(" + strconv.Itoa(int(x)) + ")"
-}
-
-// RxMode represents VPP binary API enum 'rx_mode'.
-type RxMode uint32
-
-const (
- RX_MODE_API_UNKNOWN RxMode = 0
- RX_MODE_API_POLLING RxMode = 1
- RX_MODE_API_INTERRUPT RxMode = 2
- RX_MODE_API_ADAPTIVE RxMode = 3
- RX_MODE_API_DEFAULT RxMode = 4
-)
-
-var (
- RxMode_name = map[uint32]string{
- 0: "RX_MODE_API_UNKNOWN",
- 1: "RX_MODE_API_POLLING",
- 2: "RX_MODE_API_INTERRUPT",
- 3: "RX_MODE_API_ADAPTIVE",
- 4: "RX_MODE_API_DEFAULT",
- }
- RxMode_value = map[string]uint32{
- "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,
- }
-)
-
-func (x RxMode) String() string {
- s, ok := RxMode_name[uint32(x)]
- if ok {
- return s
- }
- return "RxMode(" + strconv.Itoa(int(x)) + ")"
-}
-
-// SubIfFlags represents VPP binary API enum 'sub_if_flags'.
-type SubIfFlags uint32
-
-const (
- SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
- SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
- SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
- SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
- SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
- SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
- SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
- SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
- SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
- SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
-)
-
-var (
- SubIfFlags_name = map[uint32]string{
- 1: "SUB_IF_API_FLAG_NO_TAGS",
- 2: "SUB_IF_API_FLAG_ONE_TAG",
- 4: "SUB_IF_API_FLAG_TWO_TAGS",
- 8: "SUB_IF_API_FLAG_DOT1AD",
- 16: "SUB_IF_API_FLAG_EXACT_MATCH",
- 32: "SUB_IF_API_FLAG_DEFAULT",
- 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
- 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
- 254: "SUB_IF_API_FLAG_MASK_VNET",
- 256: "SUB_IF_API_FLAG_DOT1AH",
- }
- SubIfFlags_value = map[string]uint32{
- "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,
- }
-)
-
-func (x SubIfFlags) String() string {
- s, ok := SubIfFlags_name[uint32(x)]
- if ok {
- return s
- }
- return "SubIfFlags(" + strconv.Itoa(int(x)) + ")"
-}
-
-// AddressWithPrefix represents VPP binary API alias 'address_with_prefix'.
-type AddressWithPrefix Prefix
-
-// InterfaceIndex represents VPP binary API alias 'interface_index'.
-type InterfaceIndex uint32
-
-// IP4Address represents VPP binary API alias 'ip4_address'.
-type IP4Address [4]uint8
-
-// IP4AddressWithPrefix represents VPP binary API alias 'ip4_address_with_prefix'.
-type IP4AddressWithPrefix IP4Prefix
-
-// IP6Address represents VPP binary API alias 'ip6_address'.
-type IP6Address [16]uint8
-
-// IP6AddressWithPrefix represents VPP binary API alias 'ip6_address_with_prefix'.
-type IP6AddressWithPrefix IP6Prefix
-
-// MacAddress represents VPP binary API alias 'mac_address'.
-type MacAddress [6]uint8
-
-// Address represents VPP binary API type 'address'.
-type Address struct {
- Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
- Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
-}
-
-func (*Address) GetTypeName() string { return "address" }
-
-// IP4Prefix represents VPP binary API type 'ip4_prefix'.
-type IP4Prefix struct {
- Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
- Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
-}
-
-func (*IP4Prefix) GetTypeName() string { return "ip4_prefix" }
-
-// IP6Prefix represents VPP binary API type 'ip6_prefix'.
-type IP6Prefix struct {
- Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
- Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
-}
-
-func (*IP6Prefix) GetTypeName() string { return "ip6_prefix" }
-
-// Mprefix represents VPP binary API type 'mprefix'.
-type Mprefix struct {
- Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
- GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
- GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
- SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
-}
-
-func (*Mprefix) GetTypeName() string { return "mprefix" }
-
-// Prefix represents VPP binary API type 'prefix'.
-type Prefix struct {
- Address Address `binapi:"address,name=address" json:"address,omitempty"`
- Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
-}
-
-func (*Prefix) GetTypeName() string { return "prefix" }
-
-// PrefixMatcher represents VPP binary API type 'prefix_matcher'.
-type PrefixMatcher struct {
- Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
- Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
-}
-
-func (*PrefixMatcher) GetTypeName() string { return "prefix_matcher" }
-
-// AddressUnion represents VPP binary API union 'address_union'.
-type AddressUnion struct {
- XXX_UnionData [16]byte
-}
-
-func (*AddressUnion) GetTypeName() string { return "address_union" }
-
-func AddressUnionIP4(a IP4Address) (u AddressUnion) {
- u.SetIP4(a)
- return
-}
-func (u *AddressUnion) SetIP4(a IP4Address) {
- var b = new(bytes.Buffer)
- if err := struc.Pack(b, &a); err != nil {
- return
- }
- copy(u.XXX_UnionData[:], b.Bytes())
-}
-func (u *AddressUnion) GetIP4() (a IP4Address) {
- var b = bytes.NewReader(u.XXX_UnionData[:])
- struc.Unpack(b, &a)
- return
-}
-
-func AddressUnionIP6(a IP6Address) (u AddressUnion) {
- u.SetIP6(a)
- return
-}
-func (u *AddressUnion) SetIP6(a IP6Address) {
- var b = new(bytes.Buffer)
- if err := struc.Pack(b, &a); err != nil {
- return
- }
- copy(u.XXX_UnionData[:], b.Bytes())
-}
-func (u *AddressUnion) GetIP6() (a IP6Address) {
- var b = bytes.NewReader(u.XXX_UnionData[:])
- struc.Unpack(b, &a)
- return
-}
-
-// CollectDetailedInterfaceStats represents VPP binary API message 'collect_detailed_interface_stats'.
-type CollectDetailedInterfaceStats struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
-}
-
-func (m *CollectDetailedInterfaceStats) Reset() { *m = CollectDetailedInterfaceStats{} }
-func (*CollectDetailedInterfaceStats) GetMessageName() string {
- return "collect_detailed_interface_stats"
-}
-func (*CollectDetailedInterfaceStats) GetCrcString() string { return "5501adee" }
-func (*CollectDetailedInterfaceStats) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CollectDetailedInterfaceStats) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.EnableDisable
- size += 1
- return size
-}
-func (m *CollectDetailedInterfaceStats) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.EnableDisable
- if m.EnableDisable {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *CollectDetailedInterfaceStats) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.EnableDisable
- m.EnableDisable = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// CollectDetailedInterfaceStatsReply represents VPP binary API message 'collect_detailed_interface_stats_reply'.
-type CollectDetailedInterfaceStatsReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *CollectDetailedInterfaceStatsReply) Reset() { *m = CollectDetailedInterfaceStatsReply{} }
-func (*CollectDetailedInterfaceStatsReply) GetMessageName() string {
- return "collect_detailed_interface_stats_reply"
-}
-func (*CollectDetailedInterfaceStatsReply) GetCrcString() string { return "e8d4e804" }
-func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CollectDetailedInterfaceStatsReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *CollectDetailedInterfaceStatsReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *CollectDetailedInterfaceStatsReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateLoopback represents VPP binary API message 'create_loopback'.
-type CreateLoopback struct {
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
-}
-
-func (m *CreateLoopback) Reset() { *m = CreateLoopback{} }
-func (*CreateLoopback) GetMessageName() string { return "create_loopback" }
-func (*CreateLoopback) GetCrcString() string { return "42bb5d22" }
-func (*CreateLoopback) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CreateLoopback) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.MacAddress
- size += 6
- return size
-}
-func (m *CreateLoopback) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *CreateLoopback) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// CreateLoopbackInstance represents VPP binary API message 'create_loopback_instance'.
-type CreateLoopbackInstance struct {
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
- IsSpecified bool `binapi:"bool,name=is_specified" json:"is_specified,omitempty"`
- UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
-}
-
-func (m *CreateLoopbackInstance) Reset() { *m = CreateLoopbackInstance{} }
-func (*CreateLoopbackInstance) GetMessageName() string { return "create_loopback_instance" }
-func (*CreateLoopbackInstance) GetCrcString() string { return "d36a3ee2" }
-func (*CreateLoopbackInstance) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CreateLoopbackInstance) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.MacAddress
- size += 6
- // field[1] m.IsSpecified
- size += 1
- // field[1] m.UserInstance
- size += 4
- return size
-}
-func (m *CreateLoopbackInstance) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.IsSpecified
- if m.IsSpecified {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.UserInstance
- o.PutUint32(buf[pos:pos+4], uint32(m.UserInstance))
- pos += 4
- return buf, nil
-}
-func (m *CreateLoopbackInstance) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.IsSpecified
- m.IsSpecified = tmp[pos] != 0
- pos += 1
- // field[1] m.UserInstance
- m.UserInstance = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateLoopbackInstanceReply represents VPP binary API message 'create_loopback_instance_reply'.
-type CreateLoopbackInstanceReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *CreateLoopbackInstanceReply) Reset() { *m = CreateLoopbackInstanceReply{} }
-func (*CreateLoopbackInstanceReply) GetMessageName() string { return "create_loopback_instance_reply" }
-func (*CreateLoopbackInstanceReply) GetCrcString() string { return "5383d31f" }
-func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CreateLoopbackInstanceReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *CreateLoopbackInstanceReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *CreateLoopbackInstanceReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateLoopbackReply represents VPP binary API message 'create_loopback_reply'.
-type CreateLoopbackReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *CreateLoopbackReply) Reset() { *m = CreateLoopbackReply{} }
-func (*CreateLoopbackReply) GetMessageName() string { return "create_loopback_reply" }
-func (*CreateLoopbackReply) GetCrcString() string { return "5383d31f" }
-func (*CreateLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CreateLoopbackReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *CreateLoopbackReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *CreateLoopbackReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateSubif represents VPP binary API message 'create_subif'.
-type CreateSubif struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- SubID uint32 `binapi:"u32,name=sub_id" json:"sub_id,omitempty"`
- SubIfFlags SubIfFlags `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"`
- OuterVlanID uint16 `binapi:"u16,name=outer_vlan_id" json:"outer_vlan_id,omitempty"`
- InnerVlanID uint16 `binapi:"u16,name=inner_vlan_id" json:"inner_vlan_id,omitempty"`
-}
-
-func (m *CreateSubif) Reset() { *m = CreateSubif{} }
-func (*CreateSubif) GetMessageName() string { return "create_subif" }
-func (*CreateSubif) GetCrcString() string { return "cb371063" }
-func (*CreateSubif) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CreateSubif) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.SubID
- size += 4
- // field[1] m.SubIfFlags
- size += 4
- // field[1] m.OuterVlanID
- size += 2
- // field[1] m.InnerVlanID
- size += 2
- return size
-}
-func (m *CreateSubif) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.SubID
- o.PutUint32(buf[pos:pos+4], uint32(m.SubID))
- pos += 4
- // field[1] m.SubIfFlags
- o.PutUint32(buf[pos:pos+4], uint32(m.SubIfFlags))
- pos += 4
- // field[1] m.OuterVlanID
- o.PutUint16(buf[pos:pos+2], uint16(m.OuterVlanID))
- pos += 2
- // field[1] m.InnerVlanID
- o.PutUint16(buf[pos:pos+2], uint16(m.InnerVlanID))
- pos += 2
- return buf, nil
-}
-func (m *CreateSubif) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SubID
- m.SubID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SubIfFlags
- m.SubIfFlags = SubIfFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.OuterVlanID
- m.OuterVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.InnerVlanID
- m.InnerVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- return nil
-}
-
-// CreateSubifReply represents VPP binary API message 'create_subif_reply'.
-type CreateSubifReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *CreateSubifReply) Reset() { *m = CreateSubifReply{} }
-func (*CreateSubifReply) GetMessageName() string { return "create_subif_reply" }
-func (*CreateSubifReply) GetCrcString() string { return "5383d31f" }
-func (*CreateSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CreateSubifReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *CreateSubifReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *CreateSubifReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateVlanSubif represents VPP binary API message 'create_vlan_subif'.
-type CreateVlanSubif struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- VlanID uint32 `binapi:"u32,name=vlan_id" json:"vlan_id,omitempty"`
-}
-
-func (m *CreateVlanSubif) Reset() { *m = CreateVlanSubif{} }
-func (*CreateVlanSubif) GetMessageName() string { return "create_vlan_subif" }
-func (*CreateVlanSubif) GetCrcString() string { return "af34ac8b" }
-func (*CreateVlanSubif) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CreateVlanSubif) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.VlanID
- size += 4
- return size
-}
-func (m *CreateVlanSubif) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.VlanID
- o.PutUint32(buf[pos:pos+4], uint32(m.VlanID))
- pos += 4
- return buf, nil
-}
-func (m *CreateVlanSubif) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VlanID
- m.VlanID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateVlanSubifReply represents VPP binary API message 'create_vlan_subif_reply'.
-type CreateVlanSubifReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *CreateVlanSubifReply) Reset() { *m = CreateVlanSubifReply{} }
-func (*CreateVlanSubifReply) GetMessageName() string { return "create_vlan_subif_reply" }
-func (*CreateVlanSubifReply) GetCrcString() string { return "5383d31f" }
-func (*CreateVlanSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CreateVlanSubifReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *CreateVlanSubifReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *CreateVlanSubifReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// DeleteLoopback represents VPP binary API message 'delete_loopback'.
-type DeleteLoopback struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *DeleteLoopback) Reset() { *m = DeleteLoopback{} }
-func (*DeleteLoopback) GetMessageName() string { return "delete_loopback" }
-func (*DeleteLoopback) GetCrcString() string { return "f9e6675e" }
-func (*DeleteLoopback) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *DeleteLoopback) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *DeleteLoopback) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *DeleteLoopback) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// DeleteLoopbackReply represents VPP binary API message 'delete_loopback_reply'.
-type DeleteLoopbackReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *DeleteLoopbackReply) Reset() { *m = DeleteLoopbackReply{} }
-func (*DeleteLoopbackReply) GetMessageName() string { return "delete_loopback_reply" }
-func (*DeleteLoopbackReply) GetCrcString() string { return "e8d4e804" }
-func (*DeleteLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *DeleteLoopbackReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *DeleteLoopbackReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *DeleteLoopbackReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// DeleteSubif represents VPP binary API message 'delete_subif'.
-type DeleteSubif struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *DeleteSubif) Reset() { *m = DeleteSubif{} }
-func (*DeleteSubif) GetMessageName() string { return "delete_subif" }
-func (*DeleteSubif) GetCrcString() string { return "f9e6675e" }
-func (*DeleteSubif) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *DeleteSubif) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *DeleteSubif) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *DeleteSubif) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// DeleteSubifReply represents VPP binary API message 'delete_subif_reply'.
-type DeleteSubifReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *DeleteSubifReply) Reset() { *m = DeleteSubifReply{} }
-func (*DeleteSubifReply) GetMessageName() string { return "delete_subif_reply" }
-func (*DeleteSubifReply) GetCrcString() string { return "e8d4e804" }
-func (*DeleteSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *DeleteSubifReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *DeleteSubifReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *DeleteSubifReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// HwInterfaceSetMtu represents VPP binary API message 'hw_interface_set_mtu'.
-type HwInterfaceSetMtu struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Mtu uint16 `binapi:"u16,name=mtu" json:"mtu,omitempty"`
-}
-
-func (m *HwInterfaceSetMtu) Reset() { *m = HwInterfaceSetMtu{} }
-func (*HwInterfaceSetMtu) GetMessageName() string { return "hw_interface_set_mtu" }
-func (*HwInterfaceSetMtu) GetCrcString() string { return "e6746899" }
-func (*HwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *HwInterfaceSetMtu) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Mtu
- size += 2
- return size
-}
-func (m *HwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Mtu
- o.PutUint16(buf[pos:pos+2], uint16(m.Mtu))
- pos += 2
- return buf, nil
-}
-func (m *HwInterfaceSetMtu) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mtu
- m.Mtu = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- return nil
-}
-
-// HwInterfaceSetMtuReply represents VPP binary API message 'hw_interface_set_mtu_reply'.
-type HwInterfaceSetMtuReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *HwInterfaceSetMtuReply) Reset() { *m = HwInterfaceSetMtuReply{} }
-func (*HwInterfaceSetMtuReply) GetMessageName() string { return "hw_interface_set_mtu_reply" }
-func (*HwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" }
-func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *HwInterfaceSetMtuReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *HwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *HwInterfaceSetMtuReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// InterfaceNameRenumber represents VPP binary API message 'interface_name_renumber'.
-type InterfaceNameRenumber struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- NewShowDevInstance uint32 `binapi:"u32,name=new_show_dev_instance" json:"new_show_dev_instance,omitempty"`
-}
-
-func (m *InterfaceNameRenumber) Reset() { *m = InterfaceNameRenumber{} }
-func (*InterfaceNameRenumber) GetMessageName() string { return "interface_name_renumber" }
-func (*InterfaceNameRenumber) GetCrcString() string { return "2b8858b8" }
-func (*InterfaceNameRenumber) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *InterfaceNameRenumber) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.NewShowDevInstance
- size += 4
- return size
-}
-func (m *InterfaceNameRenumber) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.NewShowDevInstance
- o.PutUint32(buf[pos:pos+4], uint32(m.NewShowDevInstance))
- pos += 4
- return buf, nil
-}
-func (m *InterfaceNameRenumber) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NewShowDevInstance
- m.NewShowDevInstance = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// InterfaceNameRenumberReply represents VPP binary API message 'interface_name_renumber_reply'.
-type InterfaceNameRenumberReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *InterfaceNameRenumberReply) Reset() { *m = InterfaceNameRenumberReply{} }
-func (*InterfaceNameRenumberReply) GetMessageName() string { return "interface_name_renumber_reply" }
-func (*InterfaceNameRenumberReply) GetCrcString() string { return "e8d4e804" }
-func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *InterfaceNameRenumberReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *InterfaceNameRenumberReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *InterfaceNameRenumberReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceAddDelAddress represents VPP binary API message 'sw_interface_add_del_address'.
-type SwInterfaceAddDelAddress struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
- DelAll bool `binapi:"bool,name=del_all" json:"del_all,omitempty"`
- Prefix AddressWithPrefix `binapi:"address_with_prefix,name=prefix" json:"prefix,omitempty"`
-}
-
-func (m *SwInterfaceAddDelAddress) Reset() { *m = SwInterfaceAddDelAddress{} }
-func (*SwInterfaceAddDelAddress) GetMessageName() string { return "sw_interface_add_del_address" }
-func (*SwInterfaceAddDelAddress) GetCrcString() string { return "5803d5c4" }
-func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceAddDelAddress) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsAdd
- size += 1
- // field[1] m.DelAll
- size += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 4
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
- return size
-}
-func (m *SwInterfaceAddDelAddress) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.DelAll
- if m.DelAll {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Prefix.Address.Af))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[2] m.Prefix.Len
- buf[pos] = uint8(m.Prefix.Len)
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceAddDelAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.DelAll
- m.DelAll = tmp[pos] != 0
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Prefix.Len
- m.Prefix.Len = uint8(tmp[pos])
- pos += 1
- return nil
-}
-
-// SwInterfaceAddDelAddressReply represents VPP binary API message 'sw_interface_add_del_address_reply'.
-type SwInterfaceAddDelAddressReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceAddDelAddressReply) Reset() { *m = SwInterfaceAddDelAddressReply{} }
-func (*SwInterfaceAddDelAddressReply) GetMessageName() string {
- return "sw_interface_add_del_address_reply"
-}
-func (*SwInterfaceAddDelAddressReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceAddDelAddressReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceAddDelAddressReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceAddDelAddressReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceAddDelMacAddress represents VPP binary API message 'sw_interface_add_del_mac_address'.
-type SwInterfaceAddDelMacAddress struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Addr MacAddress `binapi:"mac_address,name=addr" json:"addr,omitempty"`
- IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
-}
-
-func (m *SwInterfaceAddDelMacAddress) Reset() { *m = SwInterfaceAddDelMacAddress{} }
-func (*SwInterfaceAddDelMacAddress) GetMessageName() string {
- return "sw_interface_add_del_mac_address"
-}
-func (*SwInterfaceAddDelMacAddress) GetCrcString() string { return "638bb9f4" }
-func (*SwInterfaceAddDelMacAddress) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceAddDelMacAddress) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Addr
- size += 6
- // field[1] m.IsAdd
- size += 1
- return size
-}
-func (m *SwInterfaceAddDelMacAddress) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Addr
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.Addr) {
- x = uint8(m.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.IsAdd
- buf[pos] = uint8(m.IsAdd)
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceAddDelMacAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Addr
- for i := 0; i < len(m.Addr); i++ {
- m.Addr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.IsAdd
- m.IsAdd = uint8(tmp[pos])
- pos += 1
- return nil
-}
-
-// SwInterfaceAddDelMacAddressReply represents VPP binary API message 'sw_interface_add_del_mac_address_reply'.
-type SwInterfaceAddDelMacAddressReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceAddDelMacAddressReply) Reset() { *m = SwInterfaceAddDelMacAddressReply{} }
-func (*SwInterfaceAddDelMacAddressReply) GetMessageName() string {
- return "sw_interface_add_del_mac_address_reply"
-}
-func (*SwInterfaceAddDelMacAddressReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceAddDelMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceAddDelMacAddressReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceAddDelMacAddressReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceAddDelMacAddressReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceClearStats represents VPP binary API message 'sw_interface_clear_stats'.
-type SwInterfaceClearStats struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *SwInterfaceClearStats) Reset() { *m = SwInterfaceClearStats{} }
-func (*SwInterfaceClearStats) GetMessageName() string { return "sw_interface_clear_stats" }
-func (*SwInterfaceClearStats) GetCrcString() string { return "f9e6675e" }
-func (*SwInterfaceClearStats) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceClearStats) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *SwInterfaceClearStats) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceClearStats) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceClearStatsReply represents VPP binary API message 'sw_interface_clear_stats_reply'.
-type SwInterfaceClearStatsReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceClearStatsReply) Reset() { *m = SwInterfaceClearStatsReply{} }
-func (*SwInterfaceClearStatsReply) GetMessageName() string { return "sw_interface_clear_stats_reply" }
-func (*SwInterfaceClearStatsReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceClearStatsReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceClearStatsReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceClearStatsReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceDetails represents VPP binary API message 'sw_interface_details'.
-type SwInterfaceDetails struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- SupSwIfIndex uint32 `binapi:"u32,name=sup_sw_if_index" json:"sup_sw_if_index,omitempty"`
- L2Address MacAddress `binapi:"mac_address,name=l2_address" json:"l2_address,omitempty"`
- Flags IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
- Type IfType `binapi:"if_type,name=type" json:"type,omitempty"`
- LinkDuplex LinkDuplex `binapi:"link_duplex,name=link_duplex" json:"link_duplex,omitempty"`
- LinkSpeed uint32 `binapi:"u32,name=link_speed" json:"link_speed,omitempty"`
- LinkMtu uint16 `binapi:"u16,name=link_mtu" json:"link_mtu,omitempty"`
- Mtu []uint32 `binapi:"u32[4],name=mtu" json:"mtu,omitempty" struc:"[4]uint32"`
- SubID uint32 `binapi:"u32,name=sub_id" json:"sub_id,omitempty"`
- SubNumberOfTags uint8 `binapi:"u8,name=sub_number_of_tags" json:"sub_number_of_tags,omitempty"`
- SubOuterVlanID uint16 `binapi:"u16,name=sub_outer_vlan_id" json:"sub_outer_vlan_id,omitempty"`
- SubInnerVlanID uint16 `binapi:"u16,name=sub_inner_vlan_id" json:"sub_inner_vlan_id,omitempty"`
- SubIfFlags SubIfFlags `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"`
- VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"`
- VtrPushDot1q uint32 `binapi:"u32,name=vtr_push_dot1q" json:"vtr_push_dot1q,omitempty"`
- VtrTag1 uint32 `binapi:"u32,name=vtr_tag1" json:"vtr_tag1,omitempty"`
- VtrTag2 uint32 `binapi:"u32,name=vtr_tag2" json:"vtr_tag2,omitempty"`
- OuterTag uint16 `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"`
- BDmac MacAddress `binapi:"mac_address,name=b_dmac" json:"b_dmac,omitempty"`
- BSmac MacAddress `binapi:"mac_address,name=b_smac" json:"b_smac,omitempty"`
- BVlanid uint16 `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"`
- ISid uint32 `binapi:"u32,name=i_sid" json:"i_sid,omitempty"`
- InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty" struc:"[64]byte"`
- InterfaceDevType string `binapi:"string[64],name=interface_dev_type" json:"interface_dev_type,omitempty" struc:"[64]byte"`
- Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
-}
-
-func (m *SwInterfaceDetails) Reset() { *m = SwInterfaceDetails{} }
-func (*SwInterfaceDetails) GetMessageName() string { return "sw_interface_details" }
-func (*SwInterfaceDetails) GetCrcString() string { return "17b69fa2" }
-func (*SwInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.SupSwIfIndex
- size += 4
- // field[1] m.L2Address
- size += 6
- // field[1] m.Flags
- size += 4
- // field[1] m.Type
- size += 4
- // field[1] m.LinkDuplex
- size += 4
- // field[1] m.LinkSpeed
- size += 4
- // field[1] m.LinkMtu
- size += 2
- // field[1] m.Mtu
- size += 16
- // field[1] m.SubID
- size += 4
- // field[1] m.SubNumberOfTags
- size += 1
- // field[1] m.SubOuterVlanID
- size += 2
- // field[1] m.SubInnerVlanID
- size += 2
- // field[1] m.SubIfFlags
- size += 4
- // field[1] m.VtrOp
- size += 4
- // field[1] m.VtrPushDot1q
- size += 4
- // field[1] m.VtrTag1
- size += 4
- // field[1] m.VtrTag2
- size += 4
- // field[1] m.OuterTag
- size += 2
- // field[1] m.BDmac
- size += 6
- // field[1] m.BSmac
- size += 6
- // field[1] m.BVlanid
- size += 2
- // field[1] m.ISid
- size += 4
- // field[1] m.InterfaceName
- size += 64
- // field[1] m.InterfaceDevType
- size += 64
- // field[1] m.Tag
- size += 64
- return size
-}
-func (m *SwInterfaceDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.SupSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SupSwIfIndex))
- pos += 4
- // field[1] m.L2Address
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.L2Address) {
- x = uint8(m.L2Address[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Flags
- o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
- pos += 4
- // field[1] m.Type
- o.PutUint32(buf[pos:pos+4], uint32(m.Type))
- pos += 4
- // field[1] m.LinkDuplex
- o.PutUint32(buf[pos:pos+4], uint32(m.LinkDuplex))
- pos += 4
- // field[1] m.LinkSpeed
- o.PutUint32(buf[pos:pos+4], uint32(m.LinkSpeed))
- pos += 4
- // field[1] m.LinkMtu
- o.PutUint16(buf[pos:pos+2], uint16(m.LinkMtu))
- pos += 2
- // field[1] m.Mtu
- for i := 0; i < 4; i++ {
- var x uint32
- if i < len(m.Mtu) {
- x = uint32(m.Mtu[i])
- }
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- // field[1] m.SubID
- o.PutUint32(buf[pos:pos+4], uint32(m.SubID))
- pos += 4
- // field[1] m.SubNumberOfTags
- buf[pos] = uint8(m.SubNumberOfTags)
- pos += 1
- // field[1] m.SubOuterVlanID
- o.PutUint16(buf[pos:pos+2], uint16(m.SubOuterVlanID))
- pos += 2
- // field[1] m.SubInnerVlanID
- o.PutUint16(buf[pos:pos+2], uint16(m.SubInnerVlanID))
- pos += 2
- // field[1] m.SubIfFlags
- o.PutUint32(buf[pos:pos+4], uint32(m.SubIfFlags))
- pos += 4
- // field[1] m.VtrOp
- o.PutUint32(buf[pos:pos+4], uint32(m.VtrOp))
- pos += 4
- // field[1] m.VtrPushDot1q
- o.PutUint32(buf[pos:pos+4], uint32(m.VtrPushDot1q))
- pos += 4
- // field[1] m.VtrTag1
- o.PutUint32(buf[pos:pos+4], uint32(m.VtrTag1))
- pos += 4
- // field[1] m.VtrTag2
- o.PutUint32(buf[pos:pos+4], uint32(m.VtrTag2))
- pos += 4
- // field[1] m.OuterTag
- o.PutUint16(buf[pos:pos+2], uint16(m.OuterTag))
- pos += 2
- // field[1] m.BDmac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.BDmac) {
- x = uint8(m.BDmac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.BSmac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.BSmac) {
- x = uint8(m.BSmac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.BVlanid
- o.PutUint16(buf[pos:pos+2], uint16(m.BVlanid))
- pos += 2
- // field[1] m.ISid
- o.PutUint32(buf[pos:pos+4], uint32(m.ISid))
- pos += 4
- // field[1] m.InterfaceName
- copy(buf[pos:pos+64], m.InterfaceName)
- pos += 64
- // field[1] m.InterfaceDevType
- copy(buf[pos:pos+64], m.InterfaceDevType)
- pos += 64
- // field[1] m.Tag
- copy(buf[pos:pos+64], m.Tag)
- pos += 64
- return buf, nil
-}
-func (m *SwInterfaceDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SupSwIfIndex
- m.SupSwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.L2Address
- for i := 0; i < len(m.L2Address); i++ {
- m.L2Address[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Flags
- m.Flags = IfStatusFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Type
- m.Type = IfType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.LinkDuplex
- m.LinkDuplex = LinkDuplex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.LinkSpeed
- m.LinkSpeed = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.LinkMtu
- m.LinkMtu = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.Mtu
- m.Mtu = make([]uint32, 4)
- for i := 0; i < len(m.Mtu); i++ {
- m.Mtu[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- }
- // field[1] m.SubID
- m.SubID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SubNumberOfTags
- m.SubNumberOfTags = uint8(tmp[pos])
- pos += 1
- // field[1] m.SubOuterVlanID
- m.SubOuterVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.SubInnerVlanID
- m.SubInnerVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.SubIfFlags
- m.SubIfFlags = SubIfFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VtrOp
- m.VtrOp = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VtrPushDot1q
- m.VtrPushDot1q = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VtrTag1
- m.VtrTag1 = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VtrTag2
- m.VtrTag2 = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.OuterTag
- m.OuterTag = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.BDmac
- for i := 0; i < len(m.BDmac); i++ {
- m.BDmac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.BSmac
- for i := 0; i < len(m.BSmac); i++ {
- m.BSmac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.BVlanid
- m.BVlanid = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.ISid
- m.ISid = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.InterfaceName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.InterfaceName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.InterfaceDevType
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.InterfaceDevType = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.Tag
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Tag = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// SwInterfaceDump represents VPP binary API message 'sw_interface_dump'.
-type SwInterfaceDump struct {
- SwIfIndex 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"`
- XXX_NameFilterLen uint32 `struc:"sizeof=NameFilter"`
- NameFilter string `json:"name_filter,omitempty"`
-}
-
-func (m *SwInterfaceDump) Reset() { *m = SwInterfaceDump{} }
-func (*SwInterfaceDump) GetMessageName() string { return "sw_interface_dump" }
-func (*SwInterfaceDump) GetCrcString() string { return "aa610c27" }
-func (*SwInterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.NameFilterValid
- size += 1
- // field[1] m.NameFilter
- size += 4 + len(m.NameFilter)
- return size
-}
-func (m *SwInterfaceDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.NameFilterValid
- if m.NameFilterValid {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.NameFilter
- o.PutUint32(buf[pos:pos+4], uint32(len(m.NameFilter)))
- pos += 4
- copy(buf[pos:pos+len(m.NameFilter)], m.NameFilter[:])
- pos += len(m.NameFilter)
- return buf, nil
-}
-func (m *SwInterfaceDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NameFilterValid
- m.NameFilterValid = tmp[pos] != 0
- pos += 1
- // field[1] m.NameFilter
- {
- siz := o.Uint32(tmp[pos : pos+4])
- pos += 4
- m.NameFilter = codec.DecodeString(tmp[pos : pos+int(siz)])
- pos += len(m.NameFilter)
- }
- return nil
-}
-
-// SwInterfaceEvent represents VPP binary API message 'sw_interface_event'.
-type SwInterfaceEvent struct {
- PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Flags IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
- Deleted bool `binapi:"bool,name=deleted" json:"deleted,omitempty"`
-}
-
-func (m *SwInterfaceEvent) Reset() { *m = SwInterfaceEvent{} }
-func (*SwInterfaceEvent) GetMessageName() string { return "sw_interface_event" }
-func (*SwInterfaceEvent) GetCrcString() string { return "f709f78d" }
-func (*SwInterfaceEvent) GetMessageType() api.MessageType { return api.EventMessage }
-
-func (m *SwInterfaceEvent) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.PID
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Flags
- size += 4
- // field[1] m.Deleted
- size += 1
- return size
-}
-func (m *SwInterfaceEvent) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.PID
- o.PutUint32(buf[pos:pos+4], uint32(m.PID))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Flags
- o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
- pos += 4
- // field[1] m.Deleted
- if m.Deleted {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceEvent) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.PID
- m.PID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Flags
- m.Flags = IfStatusFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Deleted
- m.Deleted = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceGetMacAddress represents VPP binary API message 'sw_interface_get_mac_address'.
-type SwInterfaceGetMacAddress struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *SwInterfaceGetMacAddress) Reset() { *m = SwInterfaceGetMacAddress{} }
-func (*SwInterfaceGetMacAddress) GetMessageName() string { return "sw_interface_get_mac_address" }
-func (*SwInterfaceGetMacAddress) GetCrcString() string { return "f9e6675e" }
-func (*SwInterfaceGetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceGetMacAddress) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *SwInterfaceGetMacAddress) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceGetMacAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceGetMacAddressReply represents VPP binary API message 'sw_interface_get_mac_address_reply'.
-type SwInterfaceGetMacAddressReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
-}
-
-func (m *SwInterfaceGetMacAddressReply) Reset() { *m = SwInterfaceGetMacAddressReply{} }
-func (*SwInterfaceGetMacAddressReply) GetMessageName() string {
- return "sw_interface_get_mac_address_reply"
-}
-func (*SwInterfaceGetMacAddressReply) GetCrcString() string { return "40ef2c08" }
-func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceGetMacAddressReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.MacAddress
- size += 6
- return size
-}
-func (m *SwInterfaceGetMacAddressReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SwInterfaceGetMacAddressReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// SwInterfaceGetTable represents VPP binary API message 'sw_interface_get_table'.
-type SwInterfaceGetTable struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
-}
-
-func (m *SwInterfaceGetTable) Reset() { *m = SwInterfaceGetTable{} }
-func (*SwInterfaceGetTable) GetMessageName() string { return "sw_interface_get_table" }
-func (*SwInterfaceGetTable) GetCrcString() string { return "2d033de4" }
-func (*SwInterfaceGetTable) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceGetTable) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
- return size
-}
-func (m *SwInterfaceGetTable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceGetTable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceGetTableReply represents VPP binary API message 'sw_interface_get_table_reply'.
-type SwInterfaceGetTableReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
-}
-
-func (m *SwInterfaceGetTableReply) Reset() { *m = SwInterfaceGetTableReply{} }
-func (*SwInterfaceGetTableReply) GetMessageName() string { return "sw_interface_get_table_reply" }
-func (*SwInterfaceGetTableReply) GetCrcString() string { return "a6eb0109" }
-func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceGetTableReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.VrfID
- size += 4
- return size
-}
-func (m *SwInterfaceGetTableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.VrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.VrfID))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceGetTableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VrfID
- m.VrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceRxPlacementDetails represents VPP binary API message 'sw_interface_rx_placement_details'.
-type SwInterfaceRxPlacementDetails struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
- WorkerID uint32 `binapi:"u32,name=worker_id" json:"worker_id,omitempty"`
- Mode RxMode `binapi:"rx_mode,name=mode" json:"mode,omitempty"`
-}
-
-func (m *SwInterfaceRxPlacementDetails) Reset() { *m = SwInterfaceRxPlacementDetails{} }
-func (*SwInterfaceRxPlacementDetails) GetMessageName() string {
- return "sw_interface_rx_placement_details"
-}
-func (*SwInterfaceRxPlacementDetails) GetCrcString() string { return "f6d7d024" }
-func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceRxPlacementDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.QueueID
- size += 4
- // field[1] m.WorkerID
- size += 4
- // field[1] m.Mode
- size += 4
- return size
-}
-func (m *SwInterfaceRxPlacementDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.QueueID
- o.PutUint32(buf[pos:pos+4], uint32(m.QueueID))
- pos += 4
- // field[1] m.WorkerID
- o.PutUint32(buf[pos:pos+4], uint32(m.WorkerID))
- pos += 4
- // field[1] m.Mode
- o.PutUint32(buf[pos:pos+4], uint32(m.Mode))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceRxPlacementDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.QueueID
- m.QueueID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.WorkerID
- m.WorkerID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mode
- m.Mode = RxMode(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceRxPlacementDump represents VPP binary API message 'sw_interface_rx_placement_dump'.
-type SwInterfaceRxPlacementDump struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *SwInterfaceRxPlacementDump) Reset() { *m = SwInterfaceRxPlacementDump{} }
-func (*SwInterfaceRxPlacementDump) GetMessageName() string { return "sw_interface_rx_placement_dump" }
-func (*SwInterfaceRxPlacementDump) GetCrcString() string { return "f9e6675e" }
-func (*SwInterfaceRxPlacementDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceRxPlacementDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *SwInterfaceRxPlacementDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceRxPlacementDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetFlags represents VPP binary API message 'sw_interface_set_flags'.
-type SwInterfaceSetFlags struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Flags IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
-}
-
-func (m *SwInterfaceSetFlags) Reset() { *m = SwInterfaceSetFlags{} }
-func (*SwInterfaceSetFlags) GetMessageName() string { return "sw_interface_set_flags" }
-func (*SwInterfaceSetFlags) GetCrcString() string { return "6a2b491a" }
-func (*SwInterfaceSetFlags) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetFlags) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Flags
- size += 4
- return size
-}
-func (m *SwInterfaceSetFlags) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Flags
- o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetFlags) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Flags
- m.Flags = IfStatusFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetFlagsReply represents VPP binary API message 'sw_interface_set_flags_reply'.
-type SwInterfaceSetFlagsReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetFlagsReply) Reset() { *m = SwInterfaceSetFlagsReply{} }
-func (*SwInterfaceSetFlagsReply) GetMessageName() string { return "sw_interface_set_flags_reply" }
-func (*SwInterfaceSetFlagsReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetFlagsReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetFlagsReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetFlagsReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetIPDirectedBroadcast represents VPP binary API message 'sw_interface_set_ip_directed_broadcast'.
-type SwInterfaceSetIPDirectedBroadcast struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
-}
-
-func (m *SwInterfaceSetIPDirectedBroadcast) Reset() { *m = SwInterfaceSetIPDirectedBroadcast{} }
-func (*SwInterfaceSetIPDirectedBroadcast) GetMessageName() string {
- return "sw_interface_set_ip_directed_broadcast"
-}
-func (*SwInterfaceSetIPDirectedBroadcast) GetCrcString() string { return "ae6cfcfb" }
-func (*SwInterfaceSetIPDirectedBroadcast) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetIPDirectedBroadcast) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Enable
- size += 1
- return size
-}
-func (m *SwInterfaceSetIPDirectedBroadcast) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Enable
- if m.Enable {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceSetIPDirectedBroadcast) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Enable
- m.Enable = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceSetIPDirectedBroadcastReply represents VPP binary API message 'sw_interface_set_ip_directed_broadcast_reply'.
-type SwInterfaceSetIPDirectedBroadcastReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetIPDirectedBroadcastReply) Reset() {
- *m = SwInterfaceSetIPDirectedBroadcastReply{}
-}
-func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageName() string {
- return "sw_interface_set_ip_directed_broadcast_reply"
-}
-func (*SwInterfaceSetIPDirectedBroadcastReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType {
- return api.ReplyMessage
-}
-
-func (m *SwInterfaceSetIPDirectedBroadcastReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetIPDirectedBroadcastReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetIPDirectedBroadcastReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetMacAddress represents VPP binary API message 'sw_interface_set_mac_address'.
-type SwInterfaceSetMacAddress struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
-}
-
-func (m *SwInterfaceSetMacAddress) Reset() { *m = SwInterfaceSetMacAddress{} }
-func (*SwInterfaceSetMacAddress) GetMessageName() string { return "sw_interface_set_mac_address" }
-func (*SwInterfaceSetMacAddress) GetCrcString() string { return "6aca746a" }
-func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetMacAddress) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.MacAddress
- size += 6
- return size
-}
-func (m *SwInterfaceSetMacAddress) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SwInterfaceSetMacAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// SwInterfaceSetMacAddressReply represents VPP binary API message 'sw_interface_set_mac_address_reply'.
-type SwInterfaceSetMacAddressReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetMacAddressReply) Reset() { *m = SwInterfaceSetMacAddressReply{} }
-func (*SwInterfaceSetMacAddressReply) GetMessageName() string {
- return "sw_interface_set_mac_address_reply"
-}
-func (*SwInterfaceSetMacAddressReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetMacAddressReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetMacAddressReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetMacAddressReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetMtu represents VPP binary API message 'sw_interface_set_mtu'.
-type SwInterfaceSetMtu struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Mtu []uint32 `binapi:"u32[4],name=mtu" json:"mtu,omitempty" struc:"[4]uint32"`
-}
-
-func (m *SwInterfaceSetMtu) Reset() { *m = SwInterfaceSetMtu{} }
-func (*SwInterfaceSetMtu) GetMessageName() string { return "sw_interface_set_mtu" }
-func (*SwInterfaceSetMtu) GetCrcString() string { return "5cbe85e5" }
-func (*SwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetMtu) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Mtu
- size += 16
- return size
-}
-func (m *SwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Mtu
- for i := 0; i < 4; i++ {
- var x uint32
- if i < len(m.Mtu) {
- x = uint32(m.Mtu[i])
- }
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *SwInterfaceSetMtu) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mtu
- m.Mtu = make([]uint32, 4)
- for i := 0; i < len(m.Mtu); i++ {
- m.Mtu[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- }
- return nil
-}
-
-// SwInterfaceSetMtuReply represents VPP binary API message 'sw_interface_set_mtu_reply'.
-type SwInterfaceSetMtuReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetMtuReply) Reset() { *m = SwInterfaceSetMtuReply{} }
-func (*SwInterfaceSetMtuReply) GetMessageName() string { return "sw_interface_set_mtu_reply" }
-func (*SwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetMtuReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetMtuReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetRxMode represents VPP binary API message 'sw_interface_set_rx_mode'.
-type SwInterfaceSetRxMode struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- QueueIDValid bool `binapi:"bool,name=queue_id_valid" json:"queue_id_valid,omitempty"`
- QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
- Mode RxMode `binapi:"rx_mode,name=mode" json:"mode,omitempty"`
-}
-
-func (m *SwInterfaceSetRxMode) Reset() { *m = SwInterfaceSetRxMode{} }
-func (*SwInterfaceSetRxMode) GetMessageName() string { return "sw_interface_set_rx_mode" }
-func (*SwInterfaceSetRxMode) GetCrcString() string { return "780f5cee" }
-func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetRxMode) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.QueueIDValid
- size += 1
- // field[1] m.QueueID
- size += 4
- // field[1] m.Mode
- size += 4
- return size
-}
-func (m *SwInterfaceSetRxMode) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.QueueIDValid
- if m.QueueIDValid {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.QueueID
- o.PutUint32(buf[pos:pos+4], uint32(m.QueueID))
- pos += 4
- // field[1] m.Mode
- o.PutUint32(buf[pos:pos+4], uint32(m.Mode))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetRxMode) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.QueueIDValid
- m.QueueIDValid = tmp[pos] != 0
- pos += 1
- // field[1] m.QueueID
- m.QueueID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mode
- m.Mode = RxMode(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetRxModeReply represents VPP binary API message 'sw_interface_set_rx_mode_reply'.
-type SwInterfaceSetRxModeReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetRxModeReply) Reset() { *m = SwInterfaceSetRxModeReply{} }
-func (*SwInterfaceSetRxModeReply) GetMessageName() string { return "sw_interface_set_rx_mode_reply" }
-func (*SwInterfaceSetRxModeReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetRxModeReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetRxModeReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetRxModeReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetRxPlacement represents VPP binary API message 'sw_interface_set_rx_placement'.
-type SwInterfaceSetRxPlacement struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
- WorkerID uint32 `binapi:"u32,name=worker_id" json:"worker_id,omitempty"`
- IsMain bool `binapi:"bool,name=is_main" json:"is_main,omitempty"`
-}
-
-func (m *SwInterfaceSetRxPlacement) Reset() { *m = SwInterfaceSetRxPlacement{} }
-func (*SwInterfaceSetRxPlacement) GetMessageName() string { return "sw_interface_set_rx_placement" }
-func (*SwInterfaceSetRxPlacement) GetCrcString() string { return "db65f3c9" }
-func (*SwInterfaceSetRxPlacement) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetRxPlacement) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.QueueID
- size += 4
- // field[1] m.WorkerID
- size += 4
- // field[1] m.IsMain
- size += 1
- return size
-}
-func (m *SwInterfaceSetRxPlacement) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.QueueID
- o.PutUint32(buf[pos:pos+4], uint32(m.QueueID))
- pos += 4
- // field[1] m.WorkerID
- o.PutUint32(buf[pos:pos+4], uint32(m.WorkerID))
- pos += 4
- // field[1] m.IsMain
- if m.IsMain {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceSetRxPlacement) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.QueueID
- m.QueueID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.WorkerID
- m.WorkerID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsMain
- m.IsMain = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceSetRxPlacementReply represents VPP binary API message 'sw_interface_set_rx_placement_reply'.
-type SwInterfaceSetRxPlacementReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetRxPlacementReply) Reset() { *m = SwInterfaceSetRxPlacementReply{} }
-func (*SwInterfaceSetRxPlacementReply) GetMessageName() string {
- return "sw_interface_set_rx_placement_reply"
-}
-func (*SwInterfaceSetRxPlacementReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetRxPlacementReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetRxPlacementReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetRxPlacementReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetTable represents VPP binary API message 'sw_interface_set_table'.
-type SwInterfaceSetTable struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
- VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
-}
-
-func (m *SwInterfaceSetTable) Reset() { *m = SwInterfaceSetTable{} }
-func (*SwInterfaceSetTable) GetMessageName() string { return "sw_interface_set_table" }
-func (*SwInterfaceSetTable) GetCrcString() string { return "df42a577" }
-func (*SwInterfaceSetTable) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetTable) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
- // field[1] m.VrfID
- size += 4
- return size
-}
-func (m *SwInterfaceSetTable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.VrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.VrfID))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetTable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
- // field[1] m.VrfID
- m.VrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetTableReply represents VPP binary API message 'sw_interface_set_table_reply'.
-type SwInterfaceSetTableReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetTableReply) Reset() { *m = SwInterfaceSetTableReply{} }
-func (*SwInterfaceSetTableReply) GetMessageName() string { return "sw_interface_set_table_reply" }
-func (*SwInterfaceSetTableReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetTableReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetTableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetTableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetUnnumbered represents VPP binary API message 'sw_interface_set_unnumbered'.
-type SwInterfaceSetUnnumbered struct {
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- UnnumberedSwIfIndex InterfaceIndex `binapi:"interface_index,name=unnumbered_sw_if_index" json:"unnumbered_sw_if_index,omitempty"`
- IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
-}
-
-func (m *SwInterfaceSetUnnumbered) Reset() { *m = SwInterfaceSetUnnumbered{} }
-func (*SwInterfaceSetUnnumbered) GetMessageName() string { return "sw_interface_set_unnumbered" }
-func (*SwInterfaceSetUnnumbered) GetCrcString() string { return "938ef33b" }
-func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetUnnumbered) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.UnnumberedSwIfIndex
- size += 4
- // field[1] m.IsAdd
- size += 1
- return size
-}
-func (m *SwInterfaceSetUnnumbered) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.UnnumberedSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.UnnumberedSwIfIndex))
- pos += 4
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceSetUnnumbered) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.UnnumberedSwIfIndex
- m.UnnumberedSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceSetUnnumberedReply represents VPP binary API message 'sw_interface_set_unnumbered_reply'.
-type SwInterfaceSetUnnumberedReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetUnnumberedReply) Reset() { *m = SwInterfaceSetUnnumberedReply{} }
-func (*SwInterfaceSetUnnumberedReply) GetMessageName() string {
- return "sw_interface_set_unnumbered_reply"
-}
-func (*SwInterfaceSetUnnumberedReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetUnnumberedReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetUnnumberedReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetUnnumberedReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceTagAddDel represents VPP binary API message 'sw_interface_tag_add_del'.
-type SwInterfaceTagAddDel struct {
- IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
- SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
-}
-
-func (m *SwInterfaceTagAddDel) Reset() { *m = SwInterfaceTagAddDel{} }
-func (*SwInterfaceTagAddDel) GetMessageName() string { return "sw_interface_tag_add_del" }
-func (*SwInterfaceTagAddDel) GetCrcString() string { return "426f8bc1" }
-func (*SwInterfaceTagAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceTagAddDel) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Tag
- size += 64
- return size
-}
-func (m *SwInterfaceTagAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Tag
- copy(buf[pos:pos+64], m.Tag)
- pos += 64
- return buf, nil
-}
-func (m *SwInterfaceTagAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Tag = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// SwInterfaceTagAddDelReply represents VPP binary API message 'sw_interface_tag_add_del_reply'.
-type SwInterfaceTagAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceTagAddDelReply) Reset() { *m = SwInterfaceTagAddDelReply{} }
-func (*SwInterfaceTagAddDelReply) GetMessageName() string { return "sw_interface_tag_add_del_reply" }
-func (*SwInterfaceTagAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceTagAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceTagAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceTagAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// WantInterfaceEvents represents VPP binary API message 'want_interface_events'.
-type WantInterfaceEvents struct {
- EnableDisable uint32 `binapi:"u32,name=enable_disable" json:"enable_disable,omitempty"`
- PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
-}
-
-func (m *WantInterfaceEvents) Reset() { *m = WantInterfaceEvents{} }
-func (*WantInterfaceEvents) GetMessageName() string { return "want_interface_events" }
-func (*WantInterfaceEvents) GetCrcString() string { return "476f5a08" }
-func (*WantInterfaceEvents) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *WantInterfaceEvents) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.EnableDisable
- size += 4
- // field[1] m.PID
- size += 4
- return size
-}
-func (m *WantInterfaceEvents) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.EnableDisable
- o.PutUint32(buf[pos:pos+4], uint32(m.EnableDisable))
- pos += 4
- // field[1] m.PID
- o.PutUint32(buf[pos:pos+4], uint32(m.PID))
- pos += 4
- return buf, nil
-}
-func (m *WantInterfaceEvents) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.EnableDisable
- m.EnableDisable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.PID
- m.PID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// WantInterfaceEventsReply represents VPP binary API message 'want_interface_events_reply'.
-type WantInterfaceEventsReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *WantInterfaceEventsReply) Reset() { *m = WantInterfaceEventsReply{} }
-func (*WantInterfaceEventsReply) GetMessageName() string { return "want_interface_events_reply" }
-func (*WantInterfaceEventsReply) GetCrcString() string { return "e8d4e804" }
-func (*WantInterfaceEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *WantInterfaceEventsReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *WantInterfaceEventsReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
- if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *WantInterfaceEventsReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-func init() { file_interfaces_binapi_init() }
-func file_interfaces_binapi_init() {
- api.RegisterMessage((*CollectDetailedInterfaceStats)(nil), "interface.CollectDetailedInterfaceStats")
- api.RegisterMessage((*CollectDetailedInterfaceStatsReply)(nil), "interface.CollectDetailedInterfaceStatsReply")
- api.RegisterMessage((*CreateLoopback)(nil), "interface.CreateLoopback")
- api.RegisterMessage((*CreateLoopbackInstance)(nil), "interface.CreateLoopbackInstance")
- api.RegisterMessage((*CreateLoopbackInstanceReply)(nil), "interface.CreateLoopbackInstanceReply")
- api.RegisterMessage((*CreateLoopbackReply)(nil), "interface.CreateLoopbackReply")
- api.RegisterMessage((*CreateSubif)(nil), "interface.CreateSubif")
- api.RegisterMessage((*CreateSubifReply)(nil), "interface.CreateSubifReply")
- api.RegisterMessage((*CreateVlanSubif)(nil), "interface.CreateVlanSubif")
- api.RegisterMessage((*CreateVlanSubifReply)(nil), "interface.CreateVlanSubifReply")
- api.RegisterMessage((*DeleteLoopback)(nil), "interface.DeleteLoopback")
- api.RegisterMessage((*DeleteLoopbackReply)(nil), "interface.DeleteLoopbackReply")
- api.RegisterMessage((*DeleteSubif)(nil), "interface.DeleteSubif")
- api.RegisterMessage((*DeleteSubifReply)(nil), "interface.DeleteSubifReply")
- api.RegisterMessage((*HwInterfaceSetMtu)(nil), "interface.HwInterfaceSetMtu")
- api.RegisterMessage((*HwInterfaceSetMtuReply)(nil), "interface.HwInterfaceSetMtuReply")
- api.RegisterMessage((*InterfaceNameRenumber)(nil), "interface.InterfaceNameRenumber")
- api.RegisterMessage((*InterfaceNameRenumberReply)(nil), "interface.InterfaceNameRenumberReply")
- api.RegisterMessage((*SwInterfaceAddDelAddress)(nil), "interface.SwInterfaceAddDelAddress")
- api.RegisterMessage((*SwInterfaceAddDelAddressReply)(nil), "interface.SwInterfaceAddDelAddressReply")
- api.RegisterMessage((*SwInterfaceAddDelMacAddress)(nil), "interface.SwInterfaceAddDelMacAddress")
- api.RegisterMessage((*SwInterfaceAddDelMacAddressReply)(nil), "interface.SwInterfaceAddDelMacAddressReply")
- api.RegisterMessage((*SwInterfaceClearStats)(nil), "interface.SwInterfaceClearStats")
- api.RegisterMessage((*SwInterfaceClearStatsReply)(nil), "interface.SwInterfaceClearStatsReply")
- api.RegisterMessage((*SwInterfaceDetails)(nil), "interface.SwInterfaceDetails")
- api.RegisterMessage((*SwInterfaceDump)(nil), "interface.SwInterfaceDump")
- api.RegisterMessage((*SwInterfaceEvent)(nil), "interface.SwInterfaceEvent")
- api.RegisterMessage((*SwInterfaceGetMacAddress)(nil), "interface.SwInterfaceGetMacAddress")
- api.RegisterMessage((*SwInterfaceGetMacAddressReply)(nil), "interface.SwInterfaceGetMacAddressReply")
- api.RegisterMessage((*SwInterfaceGetTable)(nil), "interface.SwInterfaceGetTable")
- api.RegisterMessage((*SwInterfaceGetTableReply)(nil), "interface.SwInterfaceGetTableReply")
- api.RegisterMessage((*SwInterfaceRxPlacementDetails)(nil), "interface.SwInterfaceRxPlacementDetails")
- api.RegisterMessage((*SwInterfaceRxPlacementDump)(nil), "interface.SwInterfaceRxPlacementDump")
- api.RegisterMessage((*SwInterfaceSetFlags)(nil), "interface.SwInterfaceSetFlags")
- api.RegisterMessage((*SwInterfaceSetFlagsReply)(nil), "interface.SwInterfaceSetFlagsReply")
- api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcast)(nil), "interface.SwInterfaceSetIPDirectedBroadcast")
- api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcastReply)(nil), "interface.SwInterfaceSetIPDirectedBroadcastReply")
- api.RegisterMessage((*SwInterfaceSetMacAddress)(nil), "interface.SwInterfaceSetMacAddress")
- api.RegisterMessage((*SwInterfaceSetMacAddressReply)(nil), "interface.SwInterfaceSetMacAddressReply")
- api.RegisterMessage((*SwInterfaceSetMtu)(nil), "interface.SwInterfaceSetMtu")
- api.RegisterMessage((*SwInterfaceSetMtuReply)(nil), "interface.SwInterfaceSetMtuReply")
- api.RegisterMessage((*SwInterfaceSetRxMode)(nil), "interface.SwInterfaceSetRxMode")
- api.RegisterMessage((*SwInterfaceSetRxModeReply)(nil), "interface.SwInterfaceSetRxModeReply")
- api.RegisterMessage((*SwInterfaceSetRxPlacement)(nil), "interface.SwInterfaceSetRxPlacement")
- api.RegisterMessage((*SwInterfaceSetRxPlacementReply)(nil), "interface.SwInterfaceSetRxPlacementReply")
- api.RegisterMessage((*SwInterfaceSetTable)(nil), "interface.SwInterfaceSetTable")
- api.RegisterMessage((*SwInterfaceSetTableReply)(nil), "interface.SwInterfaceSetTableReply")
- api.RegisterMessage((*SwInterfaceSetUnnumbered)(nil), "interface.SwInterfaceSetUnnumbered")
- api.RegisterMessage((*SwInterfaceSetUnnumberedReply)(nil), "interface.SwInterfaceSetUnnumberedReply")
- api.RegisterMessage((*SwInterfaceTagAddDel)(nil), "interface.SwInterfaceTagAddDel")
- api.RegisterMessage((*SwInterfaceTagAddDelReply)(nil), "interface.SwInterfaceTagAddDelReply")
- api.RegisterMessage((*WantInterfaceEvents)(nil), "interface.WantInterfaceEvents")
- api.RegisterMessage((*WantInterfaceEventsReply)(nil), "interface.WantInterfaceEventsReply")
-}
-
-// Messages returns list of all messages in this module.
-func AllMessages() []api.Message {
- return []api.Message{
- (*CollectDetailedInterfaceStats)(nil),
- (*CollectDetailedInterfaceStatsReply)(nil),
- (*CreateLoopback)(nil),
- (*CreateLoopbackInstance)(nil),
- (*CreateLoopbackInstanceReply)(nil),
- (*CreateLoopbackReply)(nil),
- (*CreateSubif)(nil),
- (*CreateSubifReply)(nil),
- (*CreateVlanSubif)(nil),
- (*CreateVlanSubifReply)(nil),
- (*DeleteLoopback)(nil),
- (*DeleteLoopbackReply)(nil),
- (*DeleteSubif)(nil),
- (*DeleteSubifReply)(nil),
- (*HwInterfaceSetMtu)(nil),
- (*HwInterfaceSetMtuReply)(nil),
- (*InterfaceNameRenumber)(nil),
- (*InterfaceNameRenumberReply)(nil),
- (*SwInterfaceAddDelAddress)(nil),
- (*SwInterfaceAddDelAddressReply)(nil),
- (*SwInterfaceAddDelMacAddress)(nil),
- (*SwInterfaceAddDelMacAddressReply)(nil),
- (*SwInterfaceClearStats)(nil),
- (*SwInterfaceClearStatsReply)(nil),
- (*SwInterfaceDetails)(nil),
- (*SwInterfaceDump)(nil),
- (*SwInterfaceEvent)(nil),
- (*SwInterfaceGetMacAddress)(nil),
- (*SwInterfaceGetMacAddressReply)(nil),
- (*SwInterfaceGetTable)(nil),
- (*SwInterfaceGetTableReply)(nil),
- (*SwInterfaceRxPlacementDetails)(nil),
- (*SwInterfaceRxPlacementDump)(nil),
- (*SwInterfaceSetFlags)(nil),
- (*SwInterfaceSetFlagsReply)(nil),
- (*SwInterfaceSetIPDirectedBroadcast)(nil),
- (*SwInterfaceSetIPDirectedBroadcastReply)(nil),
- (*SwInterfaceSetMacAddress)(nil),
- (*SwInterfaceSetMacAddressReply)(nil),
- (*SwInterfaceSetMtu)(nil),
- (*SwInterfaceSetMtuReply)(nil),
- (*SwInterfaceSetRxMode)(nil),
- (*SwInterfaceSetRxModeReply)(nil),
- (*SwInterfaceSetRxPlacement)(nil),
- (*SwInterfaceSetRxPlacementReply)(nil),
- (*SwInterfaceSetTable)(nil),
- (*SwInterfaceSetTableReply)(nil),
- (*SwInterfaceSetUnnumbered)(nil),
- (*SwInterfaceSetUnnumberedReply)(nil),
- (*SwInterfaceTagAddDel)(nil),
- (*SwInterfaceTagAddDelReply)(nil),
- (*WantInterfaceEvents)(nil),
- (*WantInterfaceEventsReply)(nil),
- }
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
diff --git a/internal/testbinapi/binapi2001/ioam_cache/ioam_cache.ba.go b/internal/testbinapi/binapi2001/ioam_cache/ioam_cache.ba.go
new file mode 100644
index 0000000..4a453c7
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ioam_cache/ioam_cache.ba.go
@@ -0,0 +1,111 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/ioam_cache.api.json
+
+// Package ioam_cache contains generated bindings for API file ioam_cache.api.
+//
+// Contents:
+// 2 messages
+//
+package ioam_cache
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "ioam_cache"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xd0a0cf20
+)
+
+// IoamCacheIP6EnableDisable defines message 'ioam_cache_ip6_enable_disable'.
+type IoamCacheIP6EnableDisable struct {
+ IsDisable bool `binapi:"bool,name=is_disable" json:"is_disable,omitempty"`
+}
+
+func (m *IoamCacheIP6EnableDisable) Reset() { *m = IoamCacheIP6EnableDisable{} }
+func (*IoamCacheIP6EnableDisable) GetMessageName() string { return "ioam_cache_ip6_enable_disable" }
+func (*IoamCacheIP6EnableDisable) GetCrcString() string { return "47705c03" }
+func (*IoamCacheIP6EnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IoamCacheIP6EnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsDisable
+ return size
+}
+func (m *IoamCacheIP6EnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsDisable)
+ return buf.Bytes(), nil
+}
+func (m *IoamCacheIP6EnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsDisable = buf.DecodeBool()
+ return nil
+}
+
+// IoamCacheIP6EnableDisableReply defines message 'ioam_cache_ip6_enable_disable_reply'.
+type IoamCacheIP6EnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IoamCacheIP6EnableDisableReply) Reset() { *m = IoamCacheIP6EnableDisableReply{} }
+func (*IoamCacheIP6EnableDisableReply) GetMessageName() string {
+ return "ioam_cache_ip6_enable_disable_reply"
+}
+func (*IoamCacheIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*IoamCacheIP6EnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IoamCacheIP6EnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IoamCacheIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_ioam_cache_binapi_init() }
+func file_ioam_cache_binapi_init() {
+ api.RegisterMessage((*IoamCacheIP6EnableDisable)(nil), "ioam_cache_ip6_enable_disable_47705c03")
+ api.RegisterMessage((*IoamCacheIP6EnableDisableReply)(nil), "ioam_cache_ip6_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*IoamCacheIP6EnableDisable)(nil),
+ (*IoamCacheIP6EnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ioam_cache/ioam_cache_rpc.ba.go b/internal/testbinapi/binapi2001/ioam_cache/ioam_cache_rpc.ba.go
new file mode 100644
index 0000000..33a721f
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ioam_cache/ioam_cache_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ioam_cache
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service ioam_cache.
+type RPCService interface {
+ IoamCacheIP6EnableDisable(ctx context.Context, in *IoamCacheIP6EnableDisable) (*IoamCacheIP6EnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) IoamCacheIP6EnableDisable(ctx context.Context, in *IoamCacheIP6EnableDisable) (*IoamCacheIP6EnableDisableReply, error) {
+ out := new(IoamCacheIP6EnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ioam_export/ioam_export.ba.go b/internal/testbinapi/binapi2001/ioam_export/ioam_export.ba.go
new file mode 100644
index 0000000..5a1fef6
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ioam_export/ioam_export.ba.go
@@ -0,0 +1,686 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/ioam_export.api.json
+
+// Package ioam_export contains generated bindings for API file ioam_export.api.
+//
+// Contents:
+// 5 aliases
+// 4 enums
+// 6 structs
+// 1 union
+// 2 messages
+//
+package ioam_export
+
+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 = "ioam_export"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xc6fdb83f
+)
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// IoamExportIP6EnableDisable defines message 'ioam_export_ip6_enable_disable'.
+type IoamExportIP6EnableDisable struct {
+ IsDisable bool `binapi:"bool,name=is_disable" json:"is_disable,omitempty"`
+ CollectorAddress IP4Address `binapi:"ip4_address,name=collector_address" json:"collector_address,omitempty"`
+ SrcAddress IP4Address `binapi:"ip4_address,name=src_address" json:"src_address,omitempty"`
+}
+
+func (m *IoamExportIP6EnableDisable) Reset() { *m = IoamExportIP6EnableDisable{} }
+func (*IoamExportIP6EnableDisable) GetMessageName() string { return "ioam_export_ip6_enable_disable" }
+func (*IoamExportIP6EnableDisable) GetCrcString() string { return "e4d4ebfa" }
+func (*IoamExportIP6EnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IoamExportIP6EnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsDisable
+ size += 1 * 4 // m.CollectorAddress
+ size += 1 * 4 // m.SrcAddress
+ return size
+}
+func (m *IoamExportIP6EnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsDisable)
+ buf.EncodeBytes(m.CollectorAddress[:], 4)
+ buf.EncodeBytes(m.SrcAddress[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *IoamExportIP6EnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsDisable = buf.DecodeBool()
+ copy(m.CollectorAddress[:], buf.DecodeBytes(4))
+ copy(m.SrcAddress[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// IoamExportIP6EnableDisableReply defines message 'ioam_export_ip6_enable_disable_reply'.
+type IoamExportIP6EnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IoamExportIP6EnableDisableReply) Reset() { *m = IoamExportIP6EnableDisableReply{} }
+func (*IoamExportIP6EnableDisableReply) GetMessageName() string {
+ return "ioam_export_ip6_enable_disable_reply"
+}
+func (*IoamExportIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*IoamExportIP6EnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IoamExportIP6EnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IoamExportIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_ioam_export_binapi_init() }
+func file_ioam_export_binapi_init() {
+ api.RegisterMessage((*IoamExportIP6EnableDisable)(nil), "ioam_export_ip6_enable_disable_e4d4ebfa")
+ api.RegisterMessage((*IoamExportIP6EnableDisableReply)(nil), "ioam_export_ip6_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*IoamExportIP6EnableDisable)(nil),
+ (*IoamExportIP6EnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ioam_export/ioam_export_rpc.ba.go b/internal/testbinapi/binapi2001/ioam_export/ioam_export_rpc.ba.go
new file mode 100644
index 0000000..584a563
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ioam_export/ioam_export_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ioam_export
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service ioam_export.
+type RPCService interface {
+ IoamExportIP6EnableDisable(ctx context.Context, in *IoamExportIP6EnableDisable) (*IoamExportIP6EnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) IoamExportIP6EnableDisable(ctx context.Context, in *IoamExportIP6EnableDisable) (*IoamExportIP6EnableDisableReply, error) {
+ out := new(IoamExportIP6EnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go b/internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go
new file mode 100644
index 0000000..cac19f6
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go
@@ -0,0 +1,1086 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/ioam_vxlan_gpe.api.json
+
+// Package ioam_vxlan_gpe contains generated bindings for API file ioam_vxlan_gpe.api.
+//
+// Contents:
+// 5 aliases
+// 4 enums
+// 6 structs
+// 1 union
+// 12 messages
+//
+package ioam_vxlan_gpe
+
+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 = "ioam_vxlan_gpe"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xf80eb923
+)
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// VxlanGpeIoamDisable defines message 'vxlan_gpe_ioam_disable'.
+type VxlanGpeIoamDisable struct {
+ ID uint16 `binapi:"u16,name=id" json:"id,omitempty"`
+}
+
+func (m *VxlanGpeIoamDisable) Reset() { *m = VxlanGpeIoamDisable{} }
+func (*VxlanGpeIoamDisable) GetMessageName() string { return "vxlan_gpe_ioam_disable" }
+func (*VxlanGpeIoamDisable) GetCrcString() string { return "6b16a45e" }
+func (*VxlanGpeIoamDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGpeIoamDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.ID
+ return size
+}
+func (m *VxlanGpeIoamDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.ID)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeIoamDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint16()
+ return nil
+}
+
+// VxlanGpeIoamDisableReply defines message 'vxlan_gpe_ioam_disable_reply'.
+type VxlanGpeIoamDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *VxlanGpeIoamDisableReply) Reset() { *m = VxlanGpeIoamDisableReply{} }
+func (*VxlanGpeIoamDisableReply) GetMessageName() string { return "vxlan_gpe_ioam_disable_reply" }
+func (*VxlanGpeIoamDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*VxlanGpeIoamDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGpeIoamDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *VxlanGpeIoamDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// VxlanGpeIoamEnable defines message 'vxlan_gpe_ioam_enable'.
+type VxlanGpeIoamEnable struct {
+ ID uint16 `binapi:"u16,name=id" json:"id,omitempty"`
+ TracePpc uint8 `binapi:"u8,name=trace_ppc" json:"trace_ppc,omitempty"`
+ PowEnable bool `binapi:"bool,name=pow_enable" json:"pow_enable,omitempty"`
+ TraceEnable bool `binapi:"bool,name=trace_enable" json:"trace_enable,omitempty"`
+}
+
+func (m *VxlanGpeIoamEnable) Reset() { *m = VxlanGpeIoamEnable{} }
+func (*VxlanGpeIoamEnable) GetMessageName() string { return "vxlan_gpe_ioam_enable" }
+func (*VxlanGpeIoamEnable) GetCrcString() string { return "2481bef7" }
+func (*VxlanGpeIoamEnable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGpeIoamEnable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.ID
+ size += 1 // m.TracePpc
+ size += 1 // m.PowEnable
+ size += 1 // m.TraceEnable
+ return size
+}
+func (m *VxlanGpeIoamEnable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.ID)
+ buf.EncodeUint8(m.TracePpc)
+ buf.EncodeBool(m.PowEnable)
+ buf.EncodeBool(m.TraceEnable)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeIoamEnable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint16()
+ m.TracePpc = buf.DecodeUint8()
+ m.PowEnable = buf.DecodeBool()
+ m.TraceEnable = buf.DecodeBool()
+ return nil
+}
+
+// VxlanGpeIoamEnableReply defines message 'vxlan_gpe_ioam_enable_reply'.
+type VxlanGpeIoamEnableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *VxlanGpeIoamEnableReply) Reset() { *m = VxlanGpeIoamEnableReply{} }
+func (*VxlanGpeIoamEnableReply) GetMessageName() string { return "vxlan_gpe_ioam_enable_reply" }
+func (*VxlanGpeIoamEnableReply) GetCrcString() string { return "e8d4e804" }
+func (*VxlanGpeIoamEnableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGpeIoamEnableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *VxlanGpeIoamEnableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// VxlanGpeIoamTransitDisable defines message 'vxlan_gpe_ioam_transit_disable'.
+type VxlanGpeIoamTransitDisable struct {
+ OuterFibIndex uint32 `binapi:"u32,name=outer_fib_index" json:"outer_fib_index,omitempty"`
+ DstAddr Address `binapi:"address,name=dst_addr" json:"dst_addr,omitempty"`
+}
+
+func (m *VxlanGpeIoamTransitDisable) Reset() { *m = VxlanGpeIoamTransitDisable{} }
+func (*VxlanGpeIoamTransitDisable) GetMessageName() string { return "vxlan_gpe_ioam_transit_disable" }
+func (*VxlanGpeIoamTransitDisable) GetCrcString() string { return "553f5b7b" }
+func (*VxlanGpeIoamTransitDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGpeIoamTransitDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.OuterFibIndex
+ size += 4 // m.DstAddr.Af
+ size += 1 * 16 // m.DstAddr.Un
+ return size
+}
+func (m *VxlanGpeIoamTransitDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.OuterFibIndex)
+ buf.EncodeUint32(uint32(m.DstAddr.Af))
+ buf.EncodeBytes(m.DstAddr.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeIoamTransitDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.OuterFibIndex = buf.DecodeUint32()
+ m.DstAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.DstAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// VxlanGpeIoamTransitDisableReply defines message 'vxlan_gpe_ioam_transit_disable_reply'.
+type VxlanGpeIoamTransitDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *VxlanGpeIoamTransitDisableReply) Reset() { *m = VxlanGpeIoamTransitDisableReply{} }
+func (*VxlanGpeIoamTransitDisableReply) GetMessageName() string {
+ return "vxlan_gpe_ioam_transit_disable_reply"
+}
+func (*VxlanGpeIoamTransitDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*VxlanGpeIoamTransitDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGpeIoamTransitDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *VxlanGpeIoamTransitDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// VxlanGpeIoamTransitEnable defines message 'vxlan_gpe_ioam_transit_enable'.
+type VxlanGpeIoamTransitEnable struct {
+ OuterFibIndex uint32 `binapi:"u32,name=outer_fib_index" json:"outer_fib_index,omitempty"`
+ DstAddr Address `binapi:"address,name=dst_addr" json:"dst_addr,omitempty"`
+}
+
+func (m *VxlanGpeIoamTransitEnable) Reset() { *m = VxlanGpeIoamTransitEnable{} }
+func (*VxlanGpeIoamTransitEnable) GetMessageName() string { return "vxlan_gpe_ioam_transit_enable" }
+func (*VxlanGpeIoamTransitEnable) GetCrcString() string { return "553f5b7b" }
+func (*VxlanGpeIoamTransitEnable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGpeIoamTransitEnable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.OuterFibIndex
+ size += 4 // m.DstAddr.Af
+ size += 1 * 16 // m.DstAddr.Un
+ return size
+}
+func (m *VxlanGpeIoamTransitEnable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.OuterFibIndex)
+ buf.EncodeUint32(uint32(m.DstAddr.Af))
+ buf.EncodeBytes(m.DstAddr.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeIoamTransitEnable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.OuterFibIndex = buf.DecodeUint32()
+ m.DstAddr.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.DstAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// VxlanGpeIoamTransitEnableReply defines message 'vxlan_gpe_ioam_transit_enable_reply'.
+type VxlanGpeIoamTransitEnableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *VxlanGpeIoamTransitEnableReply) Reset() { *m = VxlanGpeIoamTransitEnableReply{} }
+func (*VxlanGpeIoamTransitEnableReply) GetMessageName() string {
+ return "vxlan_gpe_ioam_transit_enable_reply"
+}
+func (*VxlanGpeIoamTransitEnableReply) GetCrcString() string { return "e8d4e804" }
+func (*VxlanGpeIoamTransitEnableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGpeIoamTransitEnableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *VxlanGpeIoamTransitEnableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// VxlanGpeIoamVniDisable defines message 'vxlan_gpe_ioam_vni_disable'.
+type VxlanGpeIoamVniDisable struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ Local Address `binapi:"address,name=local" json:"local,omitempty"`
+ Remote Address `binapi:"address,name=remote" json:"remote,omitempty"`
+}
+
+func (m *VxlanGpeIoamVniDisable) Reset() { *m = VxlanGpeIoamVniDisable{} }
+func (*VxlanGpeIoamVniDisable) GetMessageName() string { return "vxlan_gpe_ioam_vni_disable" }
+func (*VxlanGpeIoamVniDisable) GetCrcString() string { return "997161fb" }
+func (*VxlanGpeIoamVniDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGpeIoamVniDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ size += 4 // m.Local.Af
+ size += 1 * 16 // m.Local.Un
+ size += 4 // m.Remote.Af
+ size += 1 * 16 // m.Remote.Un
+ return size
+}
+func (m *VxlanGpeIoamVniDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint32(uint32(m.Local.Af))
+ buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Remote.Af))
+ buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeIoamVniDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ m.Local.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Local.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Remote.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Remote.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// VxlanGpeIoamVniDisableReply defines message 'vxlan_gpe_ioam_vni_disable_reply'.
+type VxlanGpeIoamVniDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *VxlanGpeIoamVniDisableReply) Reset() { *m = VxlanGpeIoamVniDisableReply{} }
+func (*VxlanGpeIoamVniDisableReply) GetMessageName() string {
+ return "vxlan_gpe_ioam_vni_disable_reply"
+}
+func (*VxlanGpeIoamVniDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*VxlanGpeIoamVniDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGpeIoamVniDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *VxlanGpeIoamVniDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// VxlanGpeIoamVniEnable defines message 'vxlan_gpe_ioam_vni_enable'.
+type VxlanGpeIoamVniEnable struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ Local Address `binapi:"address,name=local" json:"local,omitempty"`
+ Remote Address `binapi:"address,name=remote" json:"remote,omitempty"`
+}
+
+func (m *VxlanGpeIoamVniEnable) Reset() { *m = VxlanGpeIoamVniEnable{} }
+func (*VxlanGpeIoamVniEnable) GetMessageName() string { return "vxlan_gpe_ioam_vni_enable" }
+func (*VxlanGpeIoamVniEnable) GetCrcString() string { return "997161fb" }
+func (*VxlanGpeIoamVniEnable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGpeIoamVniEnable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ size += 4 // m.Local.Af
+ size += 1 * 16 // m.Local.Un
+ size += 4 // m.Remote.Af
+ size += 1 * 16 // m.Remote.Un
+ return size
+}
+func (m *VxlanGpeIoamVniEnable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint32(uint32(m.Local.Af))
+ buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Remote.Af))
+ buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeIoamVniEnable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ m.Local.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Local.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Remote.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Remote.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// VxlanGpeIoamVniEnableReply defines message 'vxlan_gpe_ioam_vni_enable_reply'.
+type VxlanGpeIoamVniEnableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *VxlanGpeIoamVniEnableReply) Reset() { *m = VxlanGpeIoamVniEnableReply{} }
+func (*VxlanGpeIoamVniEnableReply) GetMessageName() string { return "vxlan_gpe_ioam_vni_enable_reply" }
+func (*VxlanGpeIoamVniEnableReply) GetCrcString() string { return "e8d4e804" }
+func (*VxlanGpeIoamVniEnableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGpeIoamVniEnableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *VxlanGpeIoamVniEnableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_ioam_vxlan_gpe_binapi_init() }
+func file_ioam_vxlan_gpe_binapi_init() {
+ api.RegisterMessage((*VxlanGpeIoamDisable)(nil), "vxlan_gpe_ioam_disable_6b16a45e")
+ api.RegisterMessage((*VxlanGpeIoamDisableReply)(nil), "vxlan_gpe_ioam_disable_reply_e8d4e804")
+ api.RegisterMessage((*VxlanGpeIoamEnable)(nil), "vxlan_gpe_ioam_enable_2481bef7")
+ api.RegisterMessage((*VxlanGpeIoamEnableReply)(nil), "vxlan_gpe_ioam_enable_reply_e8d4e804")
+ api.RegisterMessage((*VxlanGpeIoamTransitDisable)(nil), "vxlan_gpe_ioam_transit_disable_553f5b7b")
+ api.RegisterMessage((*VxlanGpeIoamTransitDisableReply)(nil), "vxlan_gpe_ioam_transit_disable_reply_e8d4e804")
+ api.RegisterMessage((*VxlanGpeIoamTransitEnable)(nil), "vxlan_gpe_ioam_transit_enable_553f5b7b")
+ api.RegisterMessage((*VxlanGpeIoamTransitEnableReply)(nil), "vxlan_gpe_ioam_transit_enable_reply_e8d4e804")
+ api.RegisterMessage((*VxlanGpeIoamVniDisable)(nil), "vxlan_gpe_ioam_vni_disable_997161fb")
+ api.RegisterMessage((*VxlanGpeIoamVniDisableReply)(nil), "vxlan_gpe_ioam_vni_disable_reply_e8d4e804")
+ api.RegisterMessage((*VxlanGpeIoamVniEnable)(nil), "vxlan_gpe_ioam_vni_enable_997161fb")
+ api.RegisterMessage((*VxlanGpeIoamVniEnableReply)(nil), "vxlan_gpe_ioam_vni_enable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*VxlanGpeIoamDisable)(nil),
+ (*VxlanGpeIoamDisableReply)(nil),
+ (*VxlanGpeIoamEnable)(nil),
+ (*VxlanGpeIoamEnableReply)(nil),
+ (*VxlanGpeIoamTransitDisable)(nil),
+ (*VxlanGpeIoamTransitDisableReply)(nil),
+ (*VxlanGpeIoamTransitEnable)(nil),
+ (*VxlanGpeIoamTransitEnableReply)(nil),
+ (*VxlanGpeIoamVniDisable)(nil),
+ (*VxlanGpeIoamVniDisableReply)(nil),
+ (*VxlanGpeIoamVniEnable)(nil),
+ (*VxlanGpeIoamVniEnableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe_rpc.ba.go b/internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe_rpc.ba.go
new file mode 100644
index 0000000..e06b33a
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ioam_vxlan_gpe/ioam_vxlan_gpe_rpc.ba.go
@@ -0,0 +1,80 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ioam_vxlan_gpe
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service ioam_vxlan_gpe.
+type RPCService interface {
+ VxlanGpeIoamDisable(ctx context.Context, in *VxlanGpeIoamDisable) (*VxlanGpeIoamDisableReply, error)
+ VxlanGpeIoamEnable(ctx context.Context, in *VxlanGpeIoamEnable) (*VxlanGpeIoamEnableReply, error)
+ VxlanGpeIoamTransitDisable(ctx context.Context, in *VxlanGpeIoamTransitDisable) (*VxlanGpeIoamTransitDisableReply, error)
+ VxlanGpeIoamTransitEnable(ctx context.Context, in *VxlanGpeIoamTransitEnable) (*VxlanGpeIoamTransitEnableReply, error)
+ VxlanGpeIoamVniDisable(ctx context.Context, in *VxlanGpeIoamVniDisable) (*VxlanGpeIoamVniDisableReply, error)
+ VxlanGpeIoamVniEnable(ctx context.Context, in *VxlanGpeIoamVniEnable) (*VxlanGpeIoamVniEnableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) VxlanGpeIoamDisable(ctx context.Context, in *VxlanGpeIoamDisable) (*VxlanGpeIoamDisableReply, error) {
+ out := new(VxlanGpeIoamDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanGpeIoamEnable(ctx context.Context, in *VxlanGpeIoamEnable) (*VxlanGpeIoamEnableReply, error) {
+ out := new(VxlanGpeIoamEnableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanGpeIoamTransitDisable(ctx context.Context, in *VxlanGpeIoamTransitDisable) (*VxlanGpeIoamTransitDisableReply, error) {
+ out := new(VxlanGpeIoamTransitDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanGpeIoamTransitEnable(ctx context.Context, in *VxlanGpeIoamTransitEnable) (*VxlanGpeIoamTransitEnableReply, error) {
+ out := new(VxlanGpeIoamTransitEnableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanGpeIoamVniDisable(ctx context.Context, in *VxlanGpeIoamVniDisable) (*VxlanGpeIoamVniDisableReply, error) {
+ out := new(VxlanGpeIoamVniDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanGpeIoamVniEnable(ctx context.Context, in *VxlanGpeIoamVniEnable) (*VxlanGpeIoamVniEnableReply, error) {
+ out := new(VxlanGpeIoamVniEnableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ip/ip.ba.go b/internal/testbinapi/binapi2001/ip/ip.ba.go
index ca717ca..1b0b6b2 100644
--- a/internal/testbinapi/binapi2001/ip/ip.ba.go
+++ b/internal/testbinapi/binapi2001/ip/ip.ba.go
@@ -1,50 +1,42 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.4.0-dev
-// VPP: 20.01-45~g7a071e370~b63
-// source: /usr/share/vpp/api/core/ip.api.json
-
-/*
-Package ip contains generated code for VPP binary API defined by ip.api (version 3.0.1).
-
-It consists of:
- 7 aliases
- 15 enums
- 60 messages
- 14 types
- 1 union
-*/
+// VPP: 20.01
+// source: .vppapi/core/ip.api.json
+
+// Package ip contains generated bindings for API file ip.api.
+//
+// Contents:
+// 7 aliases
+// 15 enums
+// 14 structs
+// 1 union
+// 60 messages
+//
package ip
import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "math"
- "strconv"
-
+ "fmt"
api "git.fd.io/govpp.git/api"
codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
+ "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 // please upgrade the GoVPP api package
+const _ = api.GoVppAPIPackageIsVersion2
const (
- // ModuleName is the name of this module.
- ModuleName = "ip"
- // APIVersion is the API version of this module.
+ APIFile = "ip"
APIVersion = "3.0.1"
- // VersionCrc is the CRC of this module.
VersionCrc = 0xfc3fea46
)
-// AddressFamily represents VPP binary API enum 'address_family'.
+// AddressFamily defines enum 'address_family'.
type AddressFamily uint32
const (
@@ -71,7 +63,7 @@ func (x AddressFamily) String() string {
return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
}
-// FibPathFlags represents VPP binary API enum 'fib_path_flags'.
+// FibPathFlags defines enum 'fib_path_flags'.
type FibPathFlags uint32
const (
@@ -101,10 +93,29 @@ func (x FibPathFlags) String() string {
if ok {
return s
}
- return "FibPathFlags(" + strconv.Itoa(int(x)) + ")"
+ 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<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// FibPathNhProto represents VPP binary API enum 'fib_path_nh_proto'.
+// FibPathNhProto defines enum 'fib_path_nh_proto'.
type FibPathNhProto uint32
const (
@@ -140,7 +151,7 @@ func (x FibPathNhProto) String() string {
return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
}
-// FibPathType represents VPP binary API enum 'fib_path_type'.
+// FibPathType defines enum 'fib_path_type'.
type FibPathType uint32
const (
@@ -194,7 +205,7 @@ func (x FibPathType) String() string {
return "FibPathType(" + strconv.Itoa(int(x)) + ")"
}
-// IfStatusFlags represents VPP binary API enum 'if_status_flags'.
+// IfStatusFlags defines enum 'if_status_flags'.
type IfStatusFlags uint32
const (
@@ -218,10 +229,29 @@ func (x IfStatusFlags) String() string {
if ok {
return s
}
- return "IfStatusFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// IfType represents VPP binary API enum 'if_type'.
+// IfType defines enum 'if_type'.
type IfType uint32
const (
@@ -254,7 +284,7 @@ func (x IfType) String() string {
return "IfType(" + strconv.Itoa(int(x)) + ")"
}
-// IPDscp represents VPP binary API enum 'ip_dscp'.
+// IPDscp defines enum 'ip_dscp'.
type IPDscp uint8
const (
@@ -338,7 +368,7 @@ func (x IPDscp) String() string {
return "IPDscp(" + strconv.Itoa(int(x)) + ")"
}
-// IPEcn represents VPP binary API enum 'ip_ecn'.
+// IPEcn defines enum 'ip_ecn'.
type IPEcn uint8
const (
@@ -371,7 +401,7 @@ func (x IPEcn) String() string {
return "IPEcn(" + strconv.Itoa(int(x)) + ")"
}
-// IPProto represents VPP binary API enum 'ip_proto'.
+// IPProto defines enum 'ip_proto'.
type IPProto uint32
const (
@@ -428,7 +458,7 @@ func (x IPProto) String() string {
return "IPProto(" + strconv.Itoa(int(x)) + ")"
}
-// IPReassType represents VPP binary API enum 'ip_reass_type'.
+// IPReassType defines enum 'ip_reass_type'.
type IPReassType uint32
const (
@@ -455,7 +485,7 @@ func (x IPReassType) String() string {
return "IPReassType(" + strconv.Itoa(int(x)) + ")"
}
-// LinkDuplex represents VPP binary API enum 'link_duplex'.
+// LinkDuplex defines enum 'link_duplex'.
type LinkDuplex uint32
const (
@@ -485,7 +515,7 @@ func (x LinkDuplex) String() string {
return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
}
-// MfibItfFlags represents VPP binary API enum 'mfib_itf_flags'.
+// MfibItfFlags defines enum 'mfib_itf_flags'.
type MfibItfFlags uint32
const (
@@ -521,10 +551,29 @@ func (x MfibItfFlags) String() string {
if ok {
return s
}
- return "MfibItfFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := MfibItfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "MfibItfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// MtuProto represents VPP binary API enum 'mtu_proto'.
+// MtuProto defines enum 'mtu_proto'.
type MtuProto uint32
const (
@@ -560,7 +609,7 @@ func (x MtuProto) String() string {
return "MtuProto(" + strconv.Itoa(int(x)) + ")"
}
-// RxMode represents VPP binary API enum 'rx_mode'.
+// RxMode defines enum 'rx_mode'.
type RxMode uint32
const (
@@ -596,7 +645,7 @@ func (x RxMode) String() string {
return "RxMode(" + strconv.Itoa(int(x)) + ")"
}
-// SubIfFlags represents VPP binary API enum 'sub_if_flags'.
+// SubIfFlags defines enum 'sub_if_flags'.
type SubIfFlags uint32
const (
@@ -644,39 +693,204 @@ func (x SubIfFlags) String() string {
if ok {
return s
}
- return "SubIfFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// AddressWithPrefix represents VPP binary API alias 'address_with_prefix'.
+// AddressWithPrefix defines alias 'address_with_prefix'.
type AddressWithPrefix Prefix
-// InterfaceIndex represents VPP binary API alias 'interface_index'.
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
type InterfaceIndex uint32
-// IP4Address represents VPP binary API alias 'ip4_address'.
+// IP4Address defines alias 'ip4_address'.
type IP4Address [4]uint8
-// IP4AddressWithPrefix represents VPP binary API alias 'ip4_address_with_prefix'.
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
type IP4AddressWithPrefix IP4Prefix
-// IP6Address represents VPP binary API alias 'ip6_address'.
+// IP6Address defines alias 'ip6_address'.
type IP6Address [16]uint8
-// IP6AddressWithPrefix represents VPP binary API alias 'ip6_address_with_prefix'.
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
type IP6AddressWithPrefix IP6Prefix
-// MacAddress represents VPP binary API alias 'mac_address'.
+// MacAddress defines alias 'mac_address'.
type MacAddress [6]uint8
-// Address represents VPP binary API type 'address'.
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
type Address struct {
Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
}
-func (*Address) GetTypeName() string { return "address" }
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
-// FibMplsLabel represents VPP binary API type 'fib_mpls_label'.
+// FibMplsLabel defines type 'fib_mpls_label'.
type FibMplsLabel struct {
IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
@@ -684,9 +898,7 @@ type FibMplsLabel struct {
Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
}
-func (*FibMplsLabel) GetTypeName() string { return "fib_mpls_label" }
-
-// FibPath represents VPP binary API type 'fib_path'.
+// FibPath defines type 'fib_path'.
type FibPath struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
@@ -698,12 +910,10 @@ type FibPath struct {
Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
- LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty" struc:"[16]FibMplsLabel"`
+ LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
}
-func (*FibPath) GetTypeName() string { return "fib_path" }
-
-// FibPathNh represents VPP binary API type 'fib_path_nh'.
+// FibPathNh defines type 'fib_path_nh'.
type FibPathNh struct {
Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
@@ -711,65 +921,147 @@ type FibPathNh struct {
ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
}
-func (*FibPathNh) GetTypeName() string { return "fib_path_nh" }
-
-// IP4Prefix represents VPP binary API type 'ip4_prefix'.
+// IP4Prefix defines type 'ip4_prefix'.
type IP4Prefix struct {
Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
}
-func (*IP4Prefix) GetTypeName() string { return "ip4_prefix" }
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
-// IP6Prefix represents VPP binary API type 'ip6_prefix'.
+// IP6Prefix defines type 'ip6_prefix'.
type IP6Prefix struct {
Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
}
-func (*IP6Prefix) GetTypeName() string { return "ip6_prefix" }
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
-// IPMroute represents VPP binary API type 'ip_mroute'.
+// IPMroute defines type 'ip_mroute'.
type IPMroute struct {
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
EntryFlags uint32 `binapi:"u32,name=entry_flags" json:"entry_flags,omitempty"`
RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
Prefix Mprefix `binapi:"mprefix,name=prefix" json:"prefix,omitempty"`
- NPaths uint8 `binapi:"u8,name=n_paths" json:"n_paths,omitempty" struc:"sizeof=Paths"`
+ NPaths uint8 `binapi:"u8,name=n_paths" json:"-"`
Paths []MfibPath `binapi:"mfib_path[n_paths],name=paths" json:"paths,omitempty"`
}
-func (*IPMroute) GetTypeName() string { return "ip_mroute" }
-
-// IPRoute represents VPP binary API type 'ip_route'.
+// IPRoute defines type 'ip_route'.
type IPRoute struct {
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
- NPaths uint8 `binapi:"u8,name=n_paths" json:"n_paths,omitempty" struc:"sizeof=Paths"`
+ NPaths uint8 `binapi:"u8,name=n_paths" json:"-"`
Paths []FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
}
-func (*IPRoute) GetTypeName() string { return "ip_route" }
-
-// IPTable represents VPP binary API type 'ip_table'.
+// IPTable defines type 'ip_table'.
type IPTable struct {
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
- Name string `binapi:"string[64],name=name" json:"name,omitempty" struc:"[64]byte"`
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
}
-func (*IPTable) GetTypeName() string { return "ip_table" }
-
-// MfibPath represents VPP binary API type 'mfib_path'.
+// MfibPath defines type 'mfib_path'.
type MfibPath struct {
ItfFlags MfibItfFlags `binapi:"mfib_itf_flags,name=itf_flags" json:"itf_flags,omitempty"`
Path FibPath `binapi:"fib_path,name=path" json:"path,omitempty"`
}
-func (*MfibPath) GetTypeName() string { return "mfib_path" }
-
-// Mprefix represents VPP binary API type 'mprefix'.
+// Mprefix defines type 'mprefix'.
type Mprefix struct {
Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
@@ -777,54 +1069,96 @@ type Mprefix struct {
SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
}
-func (*Mprefix) GetTypeName() string { return "mprefix" }
-
-// Prefix represents VPP binary API type 'prefix'.
+// Prefix defines type 'prefix'.
type Prefix struct {
Address Address `binapi:"address,name=address" json:"address,omitempty"`
Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
}
-func (*Prefix) GetTypeName() string { return "prefix" }
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
-// PrefixMatcher represents VPP binary API type 'prefix_matcher'.
+// PrefixMatcher defines type 'prefix_matcher'.
type PrefixMatcher struct {
Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
}
-func (*PrefixMatcher) GetTypeName() string { return "prefix_matcher" }
-
-// PuntRedirect represents VPP binary API type 'punt_redirect'.
+// PuntRedirect defines type 'punt_redirect'.
type PuntRedirect struct {
RxSwIfIndex InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
TxSwIfIndex InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
Nh Address `binapi:"address,name=nh" json:"nh,omitempty"`
}
-func (*PuntRedirect) GetTypeName() string { return "punt_redirect" }
-
-// AddressUnion represents VPP binary API union 'address_union'.
+// AddressUnion defines union 'address_union'.
type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
XXX_UnionData [16]byte
}
-func (*AddressUnion) GetTypeName() string { return "address_union" }
-
func AddressUnionIP4(a IP4Address) (u AddressUnion) {
u.SetIP4(a)
return
}
func (u *AddressUnion) SetIP4(a IP4Address) {
- var b = new(bytes.Buffer)
- if err := struc.Pack(b, &a); err != nil {
- return
- }
- copy(u.XXX_UnionData[:], b.Bytes())
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
}
func (u *AddressUnion) GetIP4() (a IP4Address) {
- var b = bytes.NewReader(u.XXX_UnionData[:])
- struc.Unpack(b, &a)
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
return
}
@@ -833,111 +1167,82 @@ func AddressUnionIP6(a IP6Address) (u AddressUnion) {
return
}
func (u *AddressUnion) SetIP6(a IP6Address) {
- var b = new(bytes.Buffer)
- if err := struc.Pack(b, &a); err != nil {
- return
- }
- copy(u.XXX_UnionData[:], b.Bytes())
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
}
func (u *AddressUnion) GetIP6() (a IP6Address) {
- var b = bytes.NewReader(u.XXX_UnionData[:])
- struc.Unpack(b, &a)
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
return
}
-// IoamDisable represents VPP binary API message 'ioam_disable'.
+// IoamDisable defines message 'ioam_disable'.
type IoamDisable struct {
ID uint16 `binapi:"u16,name=id" json:"id,omitempty"`
}
-func (m *IoamDisable) Reset() { *m = IoamDisable{} }
-func (*IoamDisable) GetMessageName() string { return "ioam_disable" }
-func (*IoamDisable) GetCrcString() string { return "6b16a45e" }
-func (*IoamDisable) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IoamDisable) Reset() { *m = IoamDisable{} }
+func (*IoamDisable) GetMessageName() string { return "ioam_disable" }
+func (*IoamDisable) GetCrcString() string { return "6b16a45e" }
+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
- // field[1] m.ID
- size += 2
+ size += 2 // m.ID
return size
}
func (m *IoamDisable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ID
- o.PutUint16(buf[pos:pos+2], uint16(m.ID))
- pos += 2
- return buf, nil
-}
-func (m *IoamDisable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ID
- m.ID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.ID)
+ return buf.Bytes(), nil
+}
+func (m *IoamDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint16()
return nil
}
-// IoamDisableReply represents VPP binary API message 'ioam_disable_reply'.
+// IoamDisableReply defines message 'ioam_disable_reply'.
type IoamDisableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IoamDisableReply) Reset() { *m = IoamDisableReply{} }
-func (*IoamDisableReply) GetMessageName() string { return "ioam_disable_reply" }
-func (*IoamDisableReply) GetCrcString() string { return "e8d4e804" }
-func (*IoamDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IoamDisableReply) Reset() { *m = IoamDisableReply{} }
+func (*IoamDisableReply) GetMessageName() string { return "ioam_disable_reply" }
+func (*IoamDisableReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IoamDisableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IoamDisableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IoamEnable represents VPP binary API message 'ioam_enable'.
+// IoamEnable defines message 'ioam_enable'.
type IoamEnable struct {
ID uint16 `binapi:"u16,name=id" json:"id,omitempty"`
Seqno bool `binapi:"bool,name=seqno" json:"seqno,omitempty"`
@@ -947,364 +1252,210 @@ type IoamEnable struct {
NodeID uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"`
}
-func (m *IoamEnable) Reset() { *m = IoamEnable{} }
-func (*IoamEnable) GetMessageName() string { return "ioam_enable" }
-func (*IoamEnable) GetCrcString() string { return "51ccd868" }
-func (*IoamEnable) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IoamEnable) Reset() { *m = IoamEnable{} }
+func (*IoamEnable) GetMessageName() string { return "ioam_enable" }
+func (*IoamEnable) GetCrcString() string { return "51ccd868" }
+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
- // field[1] m.ID
- size += 2
- // field[1] m.Seqno
- size += 1
- // field[1] m.Analyse
- size += 1
- // field[1] m.PotEnable
- size += 1
- // field[1] m.TraceEnable
- size += 1
- // field[1] m.NodeID
- size += 4
+ size += 2 // m.ID
+ size += 1 // m.Seqno
+ size += 1 // m.Analyse
+ size += 1 // m.PotEnable
+ size += 1 // m.TraceEnable
+ size += 4 // m.NodeID
return size
}
func (m *IoamEnable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ID
- o.PutUint16(buf[pos:pos+2], uint16(m.ID))
- pos += 2
- // field[1] m.Seqno
- if m.Seqno {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Analyse
- if m.Analyse {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.PotEnable
- if m.PotEnable {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.TraceEnable
- if m.TraceEnable {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.NodeID
- o.PutUint32(buf[pos:pos+4], uint32(m.NodeID))
- pos += 4
- return buf, nil
-}
-func (m *IoamEnable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ID
- m.ID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.Seqno
- m.Seqno = tmp[pos] != 0
- pos += 1
- // field[1] m.Analyse
- m.Analyse = tmp[pos] != 0
- pos += 1
- // field[1] m.PotEnable
- m.PotEnable = tmp[pos] != 0
- pos += 1
- // field[1] m.TraceEnable
- m.TraceEnable = tmp[pos] != 0
- pos += 1
- // field[1] m.NodeID
- m.NodeID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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(m.NodeID)
+ return buf.Bytes(), nil
+}
+func (m *IoamEnable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint16()
+ m.Seqno = buf.DecodeBool()
+ m.Analyse = buf.DecodeBool()
+ m.PotEnable = buf.DecodeBool()
+ m.TraceEnable = buf.DecodeBool()
+ m.NodeID = buf.DecodeUint32()
return nil
}
-// IoamEnableReply represents VPP binary API message 'ioam_enable_reply'.
+// IoamEnableReply defines message 'ioam_enable_reply'.
type IoamEnableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IoamEnableReply) Reset() { *m = IoamEnableReply{} }
-func (*IoamEnableReply) GetMessageName() string { return "ioam_enable_reply" }
-func (*IoamEnableReply) GetCrcString() string { return "e8d4e804" }
-func (*IoamEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IoamEnableReply) Reset() { *m = IoamEnableReply{} }
+func (*IoamEnableReply) GetMessageName() string { return "ioam_enable_reply" }
+func (*IoamEnableReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IoamEnableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IoamEnableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPAddressDetails represents VPP binary API message 'ip_address_details'.
+// IPAddressDetails defines message 'ip_address_details'.
type IPAddressDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
Prefix AddressWithPrefix `binapi:"address_with_prefix,name=prefix" json:"prefix,omitempty"`
}
-func (m *IPAddressDetails) Reset() { *m = IPAddressDetails{} }
-func (*IPAddressDetails) GetMessageName() string { return "ip_address_details" }
-func (*IPAddressDetails) GetCrcString() string { return "b1199745" }
-func (*IPAddressDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPAddressDetails) Reset() { *m = IPAddressDetails{} }
+func (*IPAddressDetails) GetMessageName() string { return "ip_address_details" }
+func (*IPAddressDetails) GetCrcString() string { return "b1199745" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 4
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Prefix.Address.Af
+ size += 1 * 16 // m.Prefix.Address.Un
+ size += 1 // m.Prefix.Len
return size
}
func (m *IPAddressDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Prefix.Address.Af))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[2] m.Prefix.Len
- buf[pos] = uint8(m.Prefix.Len)
- pos += 1
- return buf, nil
-}
-func (m *IPAddressDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Prefix.Len
- m.Prefix.Len = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Prefix.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
return nil
}
-// IPAddressDump represents VPP binary API message 'ip_address_dump'.
+// IPAddressDump defines message 'ip_address_dump'.
type IPAddressDump struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
}
-func (m *IPAddressDump) Reset() { *m = IPAddressDump{} }
-func (*IPAddressDump) GetMessageName() string { return "ip_address_dump" }
-func (*IPAddressDump) GetCrcString() string { return "2d033de4" }
-func (*IPAddressDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPAddressDump) Reset() { *m = IPAddressDump{} }
+func (*IPAddressDump) GetMessageName() string { return "ip_address_dump" }
+func (*IPAddressDump) GetCrcString() string { return "2d033de4" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
return size
}
func (m *IPAddressDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPAddressDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *IPAddressDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
return nil
}
-// IPContainerProxyAddDel represents VPP binary API message 'ip_container_proxy_add_del'.
+// IPContainerProxyAddDel defines message 'ip_container_proxy_add_del'.
type IPContainerProxyAddDel struct {
Pfx Prefix `binapi:"prefix,name=pfx" json:"pfx,omitempty"`
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
}
-func (m *IPContainerProxyAddDel) Reset() { *m = IPContainerProxyAddDel{} }
-func (*IPContainerProxyAddDel) GetMessageName() string { return "ip_container_proxy_add_del" }
-func (*IPContainerProxyAddDel) GetCrcString() string { return "91189f40" }
-func (*IPContainerProxyAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPContainerProxyAddDel) Reset() { *m = IPContainerProxyAddDel{} }
+func (*IPContainerProxyAddDel) GetMessageName() string { return "ip_container_proxy_add_del" }
+func (*IPContainerProxyAddDel) GetCrcString() string { return "91189f40" }
+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
- // field[1] m.Pfx
- // field[2] m.Pfx.Address
- // field[3] m.Pfx.Address.Af
- size += 4
- // field[3] m.Pfx.Address.Un
- size += 16
- // field[2] m.Pfx.Len
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsAdd
- size += 1
+ size += 4 // m.Pfx.Address.Af
+ size += 1 * 16 // m.Pfx.Address.Un
+ size += 1 // m.Pfx.Len
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsAdd
return size
}
func (m *IPContainerProxyAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Pfx
- // field[2] m.Pfx.Address
- // field[3] m.Pfx.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Pfx.Address.Af))
- pos += 4
- // field[3] m.Pfx.Address.Un
- copy(buf[pos:pos+16], m.Pfx.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[2] m.Pfx.Len
- buf[pos] = uint8(m.Pfx.Len)
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPContainerProxyAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Pfx
- // field[2] m.Pfx.Address
- // field[3] m.Pfx.Address.Af
- m.Pfx.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Pfx.Address.Un
- copy(m.Pfx.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Pfx.Len
- m.Pfx.Len = uint8(tmp[pos])
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Pfx.Address.Af))
+ 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
+}
+func (m *IPContainerProxyAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Pfx.Len = buf.DecodeUint8()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsAdd = buf.DecodeBool()
return nil
}
-// IPContainerProxyAddDelReply represents VPP binary API message 'ip_container_proxy_add_del_reply'.
+// IPContainerProxyAddDelReply defines message 'ip_container_proxy_add_del_reply'.
type IPContainerProxyAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -1313,1487 +1464,815 @@ func (m *IPContainerProxyAddDelReply) Reset() { *m = IPContainerProxyAddDelReply
func (*IPContainerProxyAddDelReply) GetMessageName() string {
return "ip_container_proxy_add_del_reply"
}
-func (*IPContainerProxyAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*IPContainerProxyAddDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPContainerProxyAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPContainerProxyAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPContainerProxyDetails represents VPP binary API message 'ip_container_proxy_details'.
+// IPContainerProxyDetails defines message 'ip_container_proxy_details'.
type IPContainerProxyDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
}
-func (m *IPContainerProxyDetails) Reset() { *m = IPContainerProxyDetails{} }
-func (*IPContainerProxyDetails) GetMessageName() string { return "ip_container_proxy_details" }
-func (*IPContainerProxyDetails) GetCrcString() string { return "0ee460e8" }
-func (*IPContainerProxyDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPContainerProxyDetails) Reset() { *m = IPContainerProxyDetails{} }
+func (*IPContainerProxyDetails) GetMessageName() string { return "ip_container_proxy_details" }
+func (*IPContainerProxyDetails) GetCrcString() string { return "0ee460e8" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 4
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Prefix.Address.Af
+ size += 1 * 16 // m.Prefix.Address.Un
+ size += 1 // m.Prefix.Len
return size
}
func (m *IPContainerProxyDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Prefix.Address.Af))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[2] m.Prefix.Len
- buf[pos] = uint8(m.Prefix.Len)
- pos += 1
- return buf, nil
-}
-func (m *IPContainerProxyDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Prefix.Len
- m.Prefix.Len = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Prefix.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
return nil
}
-// IPContainerProxyDump represents VPP binary API message 'ip_container_proxy_dump'.
+// IPContainerProxyDump defines message 'ip_container_proxy_dump'.
type IPContainerProxyDump struct{}
-func (m *IPContainerProxyDump) Reset() { *m = IPContainerProxyDump{} }
-func (*IPContainerProxyDump) GetMessageName() string { return "ip_container_proxy_dump" }
-func (*IPContainerProxyDump) GetCrcString() string { return "51077d14" }
-func (*IPContainerProxyDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPContainerProxyDump) Reset() { *m = IPContainerProxyDump{} }
+func (*IPContainerProxyDump) GetMessageName() string { return "ip_container_proxy_dump" }
+func (*IPContainerProxyDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *IPContainerProxyDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *IPContainerProxyDump) Unmarshal(b []byte) error {
return nil
}
-// IPDetails represents VPP binary API message 'ip_details'.
+// IPDetails defines message 'ip_details'.
type IPDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
}
-func (m *IPDetails) Reset() { *m = IPDetails{} }
-func (*IPDetails) GetMessageName() string { return "ip_details" }
-func (*IPDetails) GetCrcString() string { return "eb152d07" }
-func (*IPDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPDetails) Reset() { *m = IPDetails{} }
+func (*IPDetails) GetMessageName() string { return "ip_details" }
+func (*IPDetails) GetCrcString() string { return "eb152d07" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
return size
}
func (m *IPDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *IPDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
return nil
}
-// IPDump represents VPP binary API message 'ip_dump'.
+// IPDump defines message 'ip_dump'.
type IPDump struct {
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
}
-func (m *IPDump) Reset() { *m = IPDump{} }
-func (*IPDump) GetMessageName() string { return "ip_dump" }
-func (*IPDump) GetCrcString() string { return "98d231ca" }
-func (*IPDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPDump) Reset() { *m = IPDump{} }
+func (*IPDump) GetMessageName() string { return "ip_dump" }
+func (*IPDump) GetCrcString() string { return "98d231ca" }
+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
- // field[1] m.IsIPv6
- size += 1
+ size += 1 // m.IsIPv6
return size
}
func (m *IPDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *IPDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeBool()
return nil
}
-// IPMrouteAddDel represents VPP binary API message 'ip_mroute_add_del'.
+// IPMrouteAddDel defines message 'ip_mroute_add_del'.
type IPMrouteAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
IsMultipath bool `binapi:"bool,name=is_multipath" json:"is_multipath,omitempty"`
Route IPMroute `binapi:"ip_mroute,name=route" json:"route,omitempty"`
}
-func (m *IPMrouteAddDel) Reset() { *m = IPMrouteAddDel{} }
-func (*IPMrouteAddDel) GetMessageName() string { return "ip_mroute_add_del" }
-func (*IPMrouteAddDel) GetCrcString() string { return "f6627d17" }
-func (*IPMrouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPMrouteAddDel) Reset() { *m = IPMrouteAddDel{} }
+func (*IPMrouteAddDel) GetMessageName() string { return "ip_mroute_add_del" }
+func (*IPMrouteAddDel) GetCrcString() string { return "f6627d17" }
+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
- // field[1] m.IsAdd
- size += 1
- // field[1] m.IsMultipath
- size += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- size += 4
- // field[2] m.Route.EntryFlags
- size += 4
- // field[2] m.Route.RpfID
- size += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- size += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- size += 2
- // field[3] m.Route.Prefix.GrpAddress
- size += 16
- // field[3] m.Route.Prefix.SrcAddress
- size += 16
- // field[2] m.Route.NPaths
- size += 1
- // field[2] m.Route.Paths
+ size += 1 // m.IsAdd
+ size += 1 // m.IsMultipath
+ size += 4 // m.Route.TableID
+ size += 4 // m.Route.EntryFlags
+ size += 4 // m.Route.RpfID
+ size += 4 // m.Route.Prefix.Af
+ size += 2 // m.Route.Prefix.GrpAddressLength
+ size += 1 * 16 // m.Route.Prefix.GrpAddress
+ size += 1 * 16 // m.Route.Prefix.SrcAddress
+ size += 1 // m.Route.NPaths
for j2 := 0; j2 < len(m.Route.Paths); j2++ {
var s2 MfibPath
_ = s2
if j2 < len(m.Route.Paths) {
s2 = m.Route.Paths[j2]
}
- // field[3] s2.ItfFlags
- size += 4
- // field[3] s2.Path
- // field[4] s2.Path.SwIfIndex
- size += 4
- // field[4] s2.Path.TableID
- size += 4
- // field[4] s2.Path.RpfID
- size += 4
- // field[4] s2.Path.Weight
- size += 1
- // field[4] s2.Path.Preference
- size += 1
- // field[4] s2.Path.Type
- size += 4
- // field[4] s2.Path.Flags
- size += 4
- // field[4] s2.Path.Proto
- size += 4
- // field[4] s2.Path.Nh
- // field[5] s2.Path.Nh.Address
- size += 16
- // field[5] s2.Path.Nh.ViaLabel
- size += 4
- // field[5] s2.Path.Nh.ObjID
- size += 4
- // field[5] s2.Path.Nh.ClassifyTableIndex
- size += 4
- // field[4] s2.Path.NLabels
- size += 1
- // field[4] s2.Path.LabelStack
+ size += 4 // s2.ItfFlags
+ size += 4 // s2.Path.SwIfIndex
+ size += 4 // s2.Path.TableID
+ size += 4 // s2.Path.RpfID
+ size += 1 // s2.Path.Weight
+ size += 1 // s2.Path.Preference
+ size += 4 // s2.Path.Type
+ size += 4 // s2.Path.Flags
+ size += 4 // s2.Path.Proto
+ size += 1 * 16 // s2.Path.Nh.Address
+ size += 4 // s2.Path.Nh.ViaLabel
+ size += 4 // s2.Path.Nh.ObjID
+ size += 4 // s2.Path.Nh.ClassifyTableIndex
+ size += 1 // s2.Path.NLabels
for j4 := 0; j4 < 16; j4++ {
- var s4 FibMplsLabel
- _ = s4
- if j4 < len(s2.Path.LabelStack) {
- s4 = s2.Path.LabelStack[j4]
- }
- // field[5] s4.IsUniform
- size += 1
- // field[5] s4.Label
- size += 4
- // field[5] s4.TTL
- size += 1
- // field[5] s4.Exp
- size += 1
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.IsMultipath
- if m.IsMultipath {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.TableID))
- pos += 4
- // field[2] m.Route.EntryFlags
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.EntryFlags))
- pos += 4
- // field[2] m.Route.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.RpfID))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.Prefix.Af))
- pos += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- o.PutUint16(buf[pos:pos+2], uint16(m.Route.Prefix.GrpAddressLength))
- pos += 2
- // field[3] m.Route.Prefix.GrpAddress
- copy(buf[pos:pos+16], m.Route.Prefix.GrpAddress.XXX_UnionData[:])
- pos += 16
- // field[3] m.Route.Prefix.SrcAddress
- copy(buf[pos:pos+16], m.Route.Prefix.SrcAddress.XXX_UnionData[:])
- pos += 16
- // field[2] m.Route.NPaths
- buf[pos] = uint8(len(m.Route.Paths))
- pos += 1
- // field[2] m.Route.Paths
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var v2 MfibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.IsMultipath)
+ buf.EncodeUint32(m.Route.TableID)
+ buf.EncodeUint32(m.Route.EntryFlags)
+ buf.EncodeUint32(m.Route.RpfID)
+ buf.EncodeUint32(uint32(m.Route.Prefix.Af))
+ 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 MfibPath // Paths
+ if j1 < len(m.Route.Paths) {
+ v1 = m.Route.Paths[j1]
}
- // field[3] v2.ItfFlags
- o.PutUint32(buf[pos:pos+4], uint32(v2.ItfFlags))
- pos += 4
- // field[3] v2.Path
- // field[4] v2.Path.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.SwIfIndex))
- pos += 4
- // field[4] v2.Path.TableID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.TableID))
- pos += 4
- // field[4] v2.Path.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.RpfID))
- pos += 4
- // field[4] v2.Path.Weight
- buf[pos] = uint8(v2.Path.Weight)
- pos += 1
- // field[4] v2.Path.Preference
- buf[pos] = uint8(v2.Path.Preference)
- pos += 1
- // field[4] v2.Path.Type
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Type))
- pos += 4
- // field[4] v2.Path.Flags
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Flags))
- pos += 4
- // field[4] v2.Path.Proto
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Proto))
- pos += 4
- // field[4] v2.Path.Nh
- // field[5] v2.Path.Nh.Address
- copy(buf[pos:pos+16], v2.Path.Nh.Address.XXX_UnionData[:])
- pos += 16
- // field[5] v2.Path.Nh.ViaLabel
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ViaLabel))
- pos += 4
- // field[5] v2.Path.Nh.ObjID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ObjID))
- pos += 4
- // field[5] v2.Path.Nh.ClassifyTableIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ClassifyTableIndex))
- pos += 4
- // field[4] v2.Path.NLabels
- buf[pos] = uint8(v2.Path.NLabels)
- pos += 1
- // field[4] v2.Path.LabelStack
- for j4 := 0; j4 < 16; j4++ {
- var v4 FibMplsLabel
- if j4 < len(v2.Path.LabelStack) {
- v4 = v2.Path.LabelStack[j4]
- }
- // field[5] v4.IsUniform
- buf[pos] = uint8(v4.IsUniform)
- pos += 1
- // field[5] v4.Label
- o.PutUint32(buf[pos:pos+4], uint32(v4.Label))
- pos += 4
- // field[5] v4.TTL
- buf[pos] = uint8(v4.TTL)
- pos += 1
- // field[5] v4.Exp
- buf[pos] = uint8(v4.Exp)
- pos += 1
+ buf.EncodeUint32(uint32(v1.ItfFlags))
+ 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[:], 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++ {
+ 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, nil
-}
-func (m *IPMrouteAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.IsMultipath
- m.IsMultipath = tmp[pos] != 0
- pos += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- m.Route.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.EntryFlags
- m.Route.EntryFlags = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.RpfID
- m.Route.RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- m.Route.Prefix.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- m.Route.Prefix.GrpAddressLength = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[3] m.Route.Prefix.GrpAddress
- copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.Route.Prefix.SrcAddress
- copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Route.NPaths
- m.Route.NPaths = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.Paths
- m.Route.Paths = make([]MfibPath, int(m.Route.NPaths))
- for j2 := 0; j2 < int(m.Route.NPaths); j2++ {
- // field[3] m.Route.Paths[j2].ItfFlags
- m.Route.Paths[j2].ItfFlags = MfibItfFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Path
- // field[4] m.Route.Paths[j2].Path.SwIfIndex
- m.Route.Paths[j2].Path.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.TableID
- m.Route.Paths[j2].Path.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.RpfID
- m.Route.Paths[j2].Path.RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Weight
- m.Route.Paths[j2].Path.Weight = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.Preference
- m.Route.Paths[j2].Path.Preference = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.Type
- m.Route.Paths[j2].Path.Type = FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Flags
- m.Route.Paths[j2].Path.Flags = FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Proto
- m.Route.Paths[j2].Path.Proto = FibPathNhProto(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Nh
- // field[5] m.Route.Paths[j2].Path.Nh.Address
- copy(m.Route.Paths[j2].Path.Nh.Address.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[5] m.Route.Paths[j2].Path.Nh.ViaLabel
- m.Route.Paths[j2].Path.Nh.ViaLabel = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.Nh.ObjID
- m.Route.Paths[j2].Path.Nh.ObjID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.Nh.ClassifyTableIndex
- m.Route.Paths[j2].Path.Nh.ClassifyTableIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.NLabels
- m.Route.Paths[j2].Path.NLabels = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.LabelStack
- for j4 := 0; j4 < 16; j4++ {
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].IsUniform
- m.Route.Paths[j2].Path.LabelStack[j4].IsUniform = uint8(tmp[pos])
- pos += 1
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].Label
- m.Route.Paths[j2].Path.LabelStack[j4].Label = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].TTL
- m.Route.Paths[j2].Path.LabelStack[j4].TTL = uint8(tmp[pos])
- pos += 1
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].Exp
- m.Route.Paths[j2].Path.LabelStack[j4].Exp = uint8(tmp[pos])
- pos += 1
+ return buf.Bytes(), nil
+}
+func (m *IPMrouteAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.IsMultipath = buf.DecodeBool()
+ m.Route.TableID = buf.DecodeUint32()
+ m.Route.EntryFlags = buf.DecodeUint32()
+ m.Route.RpfID = buf.DecodeUint32()
+ m.Route.Prefix.Af = AddressFamily(buf.DecodeUint32())
+ m.Route.Prefix.GrpAddressLength = buf.DecodeUint16()
+ 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([]MfibPath, m.Route.NPaths)
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ m.Route.Paths[j1].ItfFlags = MfibItfFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.TableID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.RpfID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Weight = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.Preference = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.Type = FibPathType(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.Flags = FibPathFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Route.Paths[j1].Path.Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Paths[j1].Path.Nh.ViaLabel = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Nh.ObjID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.NLabels = buf.DecodeUint8()
+ for j3 := 0; j3 < 16; j3++ {
+ m.Route.Paths[j1].Path.LabelStack[j3].IsUniform = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.LabelStack[j3].Label = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.LabelStack[j3].TTL = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.LabelStack[j3].Exp = buf.DecodeUint8()
}
}
return nil
}
-// IPMrouteAddDelReply represents VPP binary API message 'ip_mroute_add_del_reply'.
+// IPMrouteAddDelReply defines message 'ip_mroute_add_del_reply'.
type IPMrouteAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
}
-func (m *IPMrouteAddDelReply) Reset() { *m = IPMrouteAddDelReply{} }
-func (*IPMrouteAddDelReply) GetMessageName() string { return "ip_mroute_add_del_reply" }
-func (*IPMrouteAddDelReply) GetCrcString() string { return "1992deab" }
-func (*IPMrouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPMrouteAddDelReply) Reset() { *m = IPMrouteAddDelReply{} }
+func (*IPMrouteAddDelReply) GetMessageName() string { return "ip_mroute_add_del_reply" }
+func (*IPMrouteAddDelReply) GetCrcString() string { return "1992deab" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.StatsIndex
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.StatsIndex
return size
}
func (m *IPMrouteAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.StatsIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.StatsIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPMrouteAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.StatsIndex
- m.StatsIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.StatsIndex = buf.DecodeUint32()
return nil
}
-// IPMrouteDetails represents VPP binary API message 'ip_mroute_details'.
+// IPMrouteDetails defines message 'ip_mroute_details'.
type IPMrouteDetails struct {
Route IPMroute `binapi:"ip_mroute,name=route" json:"route,omitempty"`
}
-func (m *IPMrouteDetails) Reset() { *m = IPMrouteDetails{} }
-func (*IPMrouteDetails) GetMessageName() string { return "ip_mroute_details" }
-func (*IPMrouteDetails) GetCrcString() string { return "c1cb4b44" }
-func (*IPMrouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPMrouteDetails) Reset() { *m = IPMrouteDetails{} }
+func (*IPMrouteDetails) GetMessageName() string { return "ip_mroute_details" }
+func (*IPMrouteDetails) GetCrcString() string { return "c1cb4b44" }
+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
- // field[1] m.Route
- // field[2] m.Route.TableID
- size += 4
- // field[2] m.Route.EntryFlags
- size += 4
- // field[2] m.Route.RpfID
- size += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- size += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- size += 2
- // field[3] m.Route.Prefix.GrpAddress
- size += 16
- // field[3] m.Route.Prefix.SrcAddress
- size += 16
- // field[2] m.Route.NPaths
- size += 1
- // field[2] m.Route.Paths
+ size += 4 // m.Route.TableID
+ size += 4 // m.Route.EntryFlags
+ size += 4 // m.Route.RpfID
+ size += 4 // m.Route.Prefix.Af
+ size += 2 // m.Route.Prefix.GrpAddressLength
+ size += 1 * 16 // m.Route.Prefix.GrpAddress
+ size += 1 * 16 // m.Route.Prefix.SrcAddress
+ size += 1 // m.Route.NPaths
for j2 := 0; j2 < len(m.Route.Paths); j2++ {
var s2 MfibPath
_ = s2
if j2 < len(m.Route.Paths) {
s2 = m.Route.Paths[j2]
}
- // field[3] s2.ItfFlags
- size += 4
- // field[3] s2.Path
- // field[4] s2.Path.SwIfIndex
- size += 4
- // field[4] s2.Path.TableID
- size += 4
- // field[4] s2.Path.RpfID
- size += 4
- // field[4] s2.Path.Weight
- size += 1
- // field[4] s2.Path.Preference
- size += 1
- // field[4] s2.Path.Type
- size += 4
- // field[4] s2.Path.Flags
- size += 4
- // field[4] s2.Path.Proto
- size += 4
- // field[4] s2.Path.Nh
- // field[5] s2.Path.Nh.Address
- size += 16
- // field[5] s2.Path.Nh.ViaLabel
- size += 4
- // field[5] s2.Path.Nh.ObjID
- size += 4
- // field[5] s2.Path.Nh.ClassifyTableIndex
- size += 4
- // field[4] s2.Path.NLabels
- size += 1
- // field[4] s2.Path.LabelStack
+ size += 4 // s2.ItfFlags
+ size += 4 // s2.Path.SwIfIndex
+ size += 4 // s2.Path.TableID
+ size += 4 // s2.Path.RpfID
+ size += 1 // s2.Path.Weight
+ size += 1 // s2.Path.Preference
+ size += 4 // s2.Path.Type
+ size += 4 // s2.Path.Flags
+ size += 4 // s2.Path.Proto
+ size += 1 * 16 // s2.Path.Nh.Address
+ size += 4 // s2.Path.Nh.ViaLabel
+ size += 4 // s2.Path.Nh.ObjID
+ size += 4 // s2.Path.Nh.ClassifyTableIndex
+ size += 1 // s2.Path.NLabels
for j4 := 0; j4 < 16; j4++ {
- var s4 FibMplsLabel
- _ = s4
- if j4 < len(s2.Path.LabelStack) {
- s4 = s2.Path.LabelStack[j4]
- }
- // field[5] s4.IsUniform
- size += 1
- // field[5] s4.Label
- size += 4
- // field[5] s4.TTL
- size += 1
- // field[5] s4.Exp
- size += 1
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Route
- // field[2] m.Route.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.TableID))
- pos += 4
- // field[2] m.Route.EntryFlags
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.EntryFlags))
- pos += 4
- // field[2] m.Route.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.RpfID))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.Prefix.Af))
- pos += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- o.PutUint16(buf[pos:pos+2], uint16(m.Route.Prefix.GrpAddressLength))
- pos += 2
- // field[3] m.Route.Prefix.GrpAddress
- copy(buf[pos:pos+16], m.Route.Prefix.GrpAddress.XXX_UnionData[:])
- pos += 16
- // field[3] m.Route.Prefix.SrcAddress
- copy(buf[pos:pos+16], m.Route.Prefix.SrcAddress.XXX_UnionData[:])
- pos += 16
- // field[2] m.Route.NPaths
- buf[pos] = uint8(len(m.Route.Paths))
- pos += 1
- // field[2] m.Route.Paths
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var v2 MfibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Route.TableID)
+ buf.EncodeUint32(m.Route.EntryFlags)
+ buf.EncodeUint32(m.Route.RpfID)
+ buf.EncodeUint32(uint32(m.Route.Prefix.Af))
+ 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 MfibPath // Paths
+ if j1 < len(m.Route.Paths) {
+ v1 = m.Route.Paths[j1]
}
- // field[3] v2.ItfFlags
- o.PutUint32(buf[pos:pos+4], uint32(v2.ItfFlags))
- pos += 4
- // field[3] v2.Path
- // field[4] v2.Path.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.SwIfIndex))
- pos += 4
- // field[4] v2.Path.TableID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.TableID))
- pos += 4
- // field[4] v2.Path.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.RpfID))
- pos += 4
- // field[4] v2.Path.Weight
- buf[pos] = uint8(v2.Path.Weight)
- pos += 1
- // field[4] v2.Path.Preference
- buf[pos] = uint8(v2.Path.Preference)
- pos += 1
- // field[4] v2.Path.Type
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Type))
- pos += 4
- // field[4] v2.Path.Flags
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Flags))
- pos += 4
- // field[4] v2.Path.Proto
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Proto))
- pos += 4
- // field[4] v2.Path.Nh
- // field[5] v2.Path.Nh.Address
- copy(buf[pos:pos+16], v2.Path.Nh.Address.XXX_UnionData[:])
- pos += 16
- // field[5] v2.Path.Nh.ViaLabel
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ViaLabel))
- pos += 4
- // field[5] v2.Path.Nh.ObjID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ObjID))
- pos += 4
- // field[5] v2.Path.Nh.ClassifyTableIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ClassifyTableIndex))
- pos += 4
- // field[4] v2.Path.NLabels
- buf[pos] = uint8(v2.Path.NLabels)
- pos += 1
- // field[4] v2.Path.LabelStack
- for j4 := 0; j4 < 16; j4++ {
- var v4 FibMplsLabel
- if j4 < len(v2.Path.LabelStack) {
- v4 = v2.Path.LabelStack[j4]
- }
- // field[5] v4.IsUniform
- buf[pos] = uint8(v4.IsUniform)
- pos += 1
- // field[5] v4.Label
- o.PutUint32(buf[pos:pos+4], uint32(v4.Label))
- pos += 4
- // field[5] v4.TTL
- buf[pos] = uint8(v4.TTL)
- pos += 1
- // field[5] v4.Exp
- buf[pos] = uint8(v4.Exp)
- pos += 1
+ buf.EncodeUint32(uint32(v1.ItfFlags))
+ 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[:], 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++ {
+ 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, nil
-}
-func (m *IPMrouteDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Route
- // field[2] m.Route.TableID
- m.Route.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.EntryFlags
- m.Route.EntryFlags = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.RpfID
- m.Route.RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- m.Route.Prefix.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- m.Route.Prefix.GrpAddressLength = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[3] m.Route.Prefix.GrpAddress
- copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.Route.Prefix.SrcAddress
- copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Route.NPaths
- m.Route.NPaths = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.Paths
- m.Route.Paths = make([]MfibPath, int(m.Route.NPaths))
- for j2 := 0; j2 < int(m.Route.NPaths); j2++ {
- // field[3] m.Route.Paths[j2].ItfFlags
- m.Route.Paths[j2].ItfFlags = MfibItfFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Path
- // field[4] m.Route.Paths[j2].Path.SwIfIndex
- m.Route.Paths[j2].Path.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.TableID
- m.Route.Paths[j2].Path.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.RpfID
- m.Route.Paths[j2].Path.RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Weight
- m.Route.Paths[j2].Path.Weight = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.Preference
- m.Route.Paths[j2].Path.Preference = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.Type
- m.Route.Paths[j2].Path.Type = FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Flags
- m.Route.Paths[j2].Path.Flags = FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Proto
- m.Route.Paths[j2].Path.Proto = FibPathNhProto(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Nh
- // field[5] m.Route.Paths[j2].Path.Nh.Address
- copy(m.Route.Paths[j2].Path.Nh.Address.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[5] m.Route.Paths[j2].Path.Nh.ViaLabel
- m.Route.Paths[j2].Path.Nh.ViaLabel = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.Nh.ObjID
- m.Route.Paths[j2].Path.Nh.ObjID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.Nh.ClassifyTableIndex
- m.Route.Paths[j2].Path.Nh.ClassifyTableIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.NLabels
- m.Route.Paths[j2].Path.NLabels = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.LabelStack
- for j4 := 0; j4 < 16; j4++ {
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].IsUniform
- m.Route.Paths[j2].Path.LabelStack[j4].IsUniform = uint8(tmp[pos])
- pos += 1
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].Label
- m.Route.Paths[j2].Path.LabelStack[j4].Label = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].TTL
- m.Route.Paths[j2].Path.LabelStack[j4].TTL = uint8(tmp[pos])
- pos += 1
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].Exp
- m.Route.Paths[j2].Path.LabelStack[j4].Exp = uint8(tmp[pos])
- pos += 1
+ return buf.Bytes(), nil
+}
+func (m *IPMrouteDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Route.TableID = buf.DecodeUint32()
+ m.Route.EntryFlags = buf.DecodeUint32()
+ m.Route.RpfID = buf.DecodeUint32()
+ m.Route.Prefix.Af = AddressFamily(buf.DecodeUint32())
+ m.Route.Prefix.GrpAddressLength = buf.DecodeUint16()
+ 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([]MfibPath, m.Route.NPaths)
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ m.Route.Paths[j1].ItfFlags = MfibItfFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.TableID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.RpfID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Weight = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.Preference = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.Type = FibPathType(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.Flags = FibPathFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Route.Paths[j1].Path.Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Paths[j1].Path.Nh.ViaLabel = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Nh.ObjID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.NLabels = buf.DecodeUint8()
+ for j3 := 0; j3 < 16; j3++ {
+ m.Route.Paths[j1].Path.LabelStack[j3].IsUniform = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.LabelStack[j3].Label = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.LabelStack[j3].TTL = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.LabelStack[j3].Exp = buf.DecodeUint8()
}
}
return nil
}
-// IPMrouteDump represents VPP binary API message 'ip_mroute_dump'.
+// IPMrouteDump defines message 'ip_mroute_dump'.
type IPMrouteDump struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPMrouteDump) Reset() { *m = IPMrouteDump{} }
-func (*IPMrouteDump) GetMessageName() string { return "ip_mroute_dump" }
-func (*IPMrouteDump) GetCrcString() string { return "b9d2e09e" }
-func (*IPMrouteDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPMrouteDump) Reset() { *m = IPMrouteDump{} }
+func (*IPMrouteDump) GetMessageName() string { return "ip_mroute_dump" }
+func (*IPMrouteDump) GetCrcString() string { return "b9d2e09e" }
+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
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPMrouteDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPMrouteDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPMtableDetails represents VPP binary API message 'ip_mtable_details'.
+// IPMtableDetails defines message 'ip_mtable_details'.
type IPMtableDetails struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPMtableDetails) Reset() { *m = IPMtableDetails{} }
-func (*IPMtableDetails) GetMessageName() string { return "ip_mtable_details" }
-func (*IPMtableDetails) GetCrcString() string { return "b9d2e09e" }
-func (*IPMtableDetails) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPMtableDetails) Reset() { *m = IPMtableDetails{} }
+func (*IPMtableDetails) GetMessageName() string { return "ip_mtable_details" }
+func (*IPMtableDetails) GetCrcString() string { return "b9d2e09e" }
+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
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPMtableDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPMtableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPMtableDump represents VPP binary API message 'ip_mtable_dump'.
+// IPMtableDump defines message 'ip_mtable_dump'.
type IPMtableDump struct{}
-func (m *IPMtableDump) Reset() { *m = IPMtableDump{} }
-func (*IPMtableDump) GetMessageName() string { return "ip_mtable_dump" }
-func (*IPMtableDump) GetCrcString() string { return "51077d14" }
-func (*IPMtableDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPMtableDump) Reset() { *m = IPMtableDump{} }
+func (*IPMtableDump) GetMessageName() string { return "ip_mtable_dump" }
+func (*IPMtableDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *IPMtableDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *IPMtableDump) Unmarshal(b []byte) error {
return nil
}
-// IPPuntPolice represents VPP binary API message 'ip_punt_police'.
+// IPPuntPolice defines message 'ip_punt_police'.
type IPPuntPolice struct {
PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
}
-func (m *IPPuntPolice) Reset() { *m = IPPuntPolice{} }
-func (*IPPuntPolice) GetMessageName() string { return "ip_punt_police" }
-func (*IPPuntPolice) GetCrcString() string { return "db867cea" }
-func (*IPPuntPolice) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPPuntPolice) Reset() { *m = IPPuntPolice{} }
+func (*IPPuntPolice) GetMessageName() string { return "ip_punt_police" }
+func (*IPPuntPolice) GetCrcString() string { return "db867cea" }
+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
- // field[1] m.PolicerIndex
- size += 4
- // field[1] m.IsAdd
- size += 1
- // field[1] m.IsIP6
- size += 1
+ size += 4 // m.PolicerIndex
+ size += 1 // m.IsAdd
+ size += 1 // m.IsIP6
return size
}
func (m *IPPuntPolice) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.PolicerIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.PolicerIndex))
- pos += 4
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.IsIP6
- if m.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPPuntPolice) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.PolicerIndex
- m.PolicerIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.IsIP6
- m.IsIP6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PolicerIndex)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.IsIP6)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntPolice) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PolicerIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ m.IsIP6 = buf.DecodeBool()
return nil
}
-// IPPuntPoliceReply represents VPP binary API message 'ip_punt_police_reply'.
+// IPPuntPoliceReply defines message 'ip_punt_police_reply'.
type IPPuntPoliceReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPPuntPoliceReply) Reset() { *m = IPPuntPoliceReply{} }
-func (*IPPuntPoliceReply) GetMessageName() string { return "ip_punt_police_reply" }
-func (*IPPuntPoliceReply) GetCrcString() string { return "e8d4e804" }
-func (*IPPuntPoliceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPPuntPoliceReply) Reset() { *m = IPPuntPoliceReply{} }
+func (*IPPuntPoliceReply) GetMessageName() string { return "ip_punt_police_reply" }
+func (*IPPuntPoliceReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPPuntPoliceReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPPuntPoliceReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPPuntRedirect represents VPP binary API message 'ip_punt_redirect'.
+// IPPuntRedirect defines message 'ip_punt_redirect'.
type IPPuntRedirect struct {
Punt PuntRedirect `binapi:"punt_redirect,name=punt" json:"punt,omitempty"`
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
}
-func (m *IPPuntRedirect) Reset() { *m = IPPuntRedirect{} }
-func (*IPPuntRedirect) GetMessageName() string { return "ip_punt_redirect" }
-func (*IPPuntRedirect) GetCrcString() string { return "a9a5592c" }
-func (*IPPuntRedirect) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPPuntRedirect) Reset() { *m = IPPuntRedirect{} }
+func (*IPPuntRedirect) GetMessageName() string { return "ip_punt_redirect" }
+func (*IPPuntRedirect) GetCrcString() string { return "a9a5592c" }
+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
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- size += 4
- // field[2] m.Punt.TxSwIfIndex
- size += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- size += 4
- // field[3] m.Punt.Nh.Un
- size += 16
- // field[1] m.IsAdd
- size += 1
+ size += 4 // m.Punt.RxSwIfIndex
+ size += 4 // m.Punt.TxSwIfIndex
+ size += 4 // m.Punt.Nh.Af
+ size += 1 * 16 // m.Punt.Nh.Un
+ size += 1 // m.IsAdd
return size
}
func (m *IPPuntRedirect) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.RxSwIfIndex))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.TxSwIfIndex))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.Nh.Af))
- pos += 4
- // field[3] m.Punt.Nh.Un
- copy(buf[pos:pos+16], m.Punt.Nh.Un.XXX_UnionData[:])
- pos += 16
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPPuntRedirect) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- m.Punt.RxSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- m.Punt.TxSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- m.Punt.Nh.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Punt.Nh.Un
- copy(m.Punt.Nh.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex))
+ buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex))
+ buf.EncodeUint32(uint32(m.Punt.Nh.Af))
+ buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntRedirect) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Punt.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Punt.TxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Punt.Nh.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Punt.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.IsAdd = buf.DecodeBool()
return nil
}
-// IPPuntRedirectDetails represents VPP binary API message 'ip_punt_redirect_details'.
+// IPPuntRedirectDetails defines message 'ip_punt_redirect_details'.
type IPPuntRedirectDetails struct {
Punt PuntRedirect `binapi:"punt_redirect,name=punt" json:"punt,omitempty"`
}
-func (m *IPPuntRedirectDetails) Reset() { *m = IPPuntRedirectDetails{} }
-func (*IPPuntRedirectDetails) GetMessageName() string { return "ip_punt_redirect_details" }
-func (*IPPuntRedirectDetails) GetCrcString() string { return "3924f5d3" }
-func (*IPPuntRedirectDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPPuntRedirectDetails) Reset() { *m = IPPuntRedirectDetails{} }
+func (*IPPuntRedirectDetails) GetMessageName() string { return "ip_punt_redirect_details" }
+func (*IPPuntRedirectDetails) GetCrcString() string { return "3924f5d3" }
+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
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- size += 4
- // field[2] m.Punt.TxSwIfIndex
- size += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- size += 4
- // field[3] m.Punt.Nh.Un
- size += 16
+ size += 4 // m.Punt.RxSwIfIndex
+ size += 4 // m.Punt.TxSwIfIndex
+ size += 4 // m.Punt.Nh.Af
+ size += 1 * 16 // m.Punt.Nh.Un
return size
}
func (m *IPPuntRedirectDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.RxSwIfIndex))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.TxSwIfIndex))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.Nh.Af))
- pos += 4
- // field[3] m.Punt.Nh.Un
- copy(buf[pos:pos+16], m.Punt.Nh.Un.XXX_UnionData[:])
- pos += 16
- return buf, nil
-}
-func (m *IPPuntRedirectDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- m.Punt.RxSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- m.Punt.TxSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- m.Punt.Nh.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Punt.Nh.Un
- copy(m.Punt.Nh.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex))
+ buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex))
+ buf.EncodeUint32(uint32(m.Punt.Nh.Af))
+ buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntRedirectDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Punt.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Punt.TxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Punt.Nh.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Punt.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
return nil
}
-// IPPuntRedirectDump represents VPP binary API message 'ip_punt_redirect_dump'.
+// IPPuntRedirectDump defines message 'ip_punt_redirect_dump'.
type IPPuntRedirectDump struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
}
-func (m *IPPuntRedirectDump) Reset() { *m = IPPuntRedirectDump{} }
-func (*IPPuntRedirectDump) GetMessageName() string { return "ip_punt_redirect_dump" }
-func (*IPPuntRedirectDump) GetCrcString() string { return "2d033de4" }
-func (*IPPuntRedirectDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPPuntRedirectDump) Reset() { *m = IPPuntRedirectDump{} }
+func (*IPPuntRedirectDump) GetMessageName() string { return "ip_punt_redirect_dump" }
+func (*IPPuntRedirectDump) GetCrcString() string { return "2d033de4" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
return size
}
func (m *IPPuntRedirectDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPPuntRedirectDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntRedirectDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
return nil
}
-// IPPuntRedirectReply represents VPP binary API message 'ip_punt_redirect_reply'.
+// IPPuntRedirectReply defines message 'ip_punt_redirect_reply'.
type IPPuntRedirectReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPPuntRedirectReply) Reset() { *m = IPPuntRedirectReply{} }
-func (*IPPuntRedirectReply) GetMessageName() string { return "ip_punt_redirect_reply" }
-func (*IPPuntRedirectReply) GetCrcString() string { return "e8d4e804" }
-func (*IPPuntRedirectReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPPuntRedirectReply) Reset() { *m = IPPuntRedirectReply{} }
+func (*IPPuntRedirectReply) GetMessageName() string { return "ip_punt_redirect_reply" }
+func (*IPPuntRedirectReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPPuntRedirectReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPPuntRedirectReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPReassemblyEnableDisable represents VPP binary API message 'ip_reassembly_enable_disable'.
+// IPReassemblyEnableDisable defines message 'ip_reassembly_enable_disable'.
type IPReassemblyEnableDisable struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
EnableIP4 bool `binapi:"bool,name=enable_ip4" json:"enable_ip4,omitempty"`
@@ -2801,76 +2280,44 @@ type IPReassemblyEnableDisable struct {
Type IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"`
}
-func (m *IPReassemblyEnableDisable) Reset() { *m = IPReassemblyEnableDisable{} }
-func (*IPReassemblyEnableDisable) GetMessageName() string { return "ip_reassembly_enable_disable" }
-func (*IPReassemblyEnableDisable) GetCrcString() string { return "885c85a6" }
-func (*IPReassemblyEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPReassemblyEnableDisable) Reset() { *m = IPReassemblyEnableDisable{} }
+func (*IPReassemblyEnableDisable) GetMessageName() string { return "ip_reassembly_enable_disable" }
+func (*IPReassemblyEnableDisable) GetCrcString() string { return "885c85a6" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.EnableIP4
- size += 1
- // field[1] m.EnableIP6
- size += 1
- // field[1] m.Type
- size += 4
+ size += 4 // m.SwIfIndex
+ size += 1 // m.EnableIP4
+ size += 1 // m.EnableIP6
+ size += 4 // m.Type
return size
}
func (m *IPReassemblyEnableDisable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.EnableIP4
- if m.EnableIP4 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.EnableIP6
- if m.EnableIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Type
- o.PutUint32(buf[pos:pos+4], uint32(m.Type))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblyEnableDisable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.EnableIP4
- m.EnableIP4 = tmp[pos] != 0
- pos += 1
- // field[1] m.EnableIP6
- m.EnableIP6 = tmp[pos] != 0
- pos += 1
- // field[1] m.Type
- m.Type = IPReassType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.EnableIP4)
+ buf.EncodeBool(m.EnableIP6)
+ buf.EncodeUint32(uint32(m.Type))
+ return buf.Bytes(), nil
+}
+func (m *IPReassemblyEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.EnableIP4 = buf.DecodeBool()
+ m.EnableIP6 = buf.DecodeBool()
+ m.Type = IPReassType(buf.DecodeUint32())
return nil
}
-// IPReassemblyEnableDisableReply represents VPP binary API message 'ip_reassembly_enable_disable_reply'.
+// IPReassemblyEnableDisableReply defines message 'ip_reassembly_enable_disable_reply'.
type IPReassemblyEnableDisableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -2879,103 +2326,70 @@ func (m *IPReassemblyEnableDisableReply) Reset() { *m = IPReassemblyEnableDisabl
func (*IPReassemblyEnableDisableReply) GetMessageName() string {
return "ip_reassembly_enable_disable_reply"
}
-func (*IPReassemblyEnableDisableReply) GetCrcString() string { return "e8d4e804" }
-func (*IPReassemblyEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*IPReassemblyEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPReassemblyEnableDisableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblyEnableDisableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPReassemblyGet represents VPP binary API message 'ip_reassembly_get'.
+// IPReassemblyGet defines message 'ip_reassembly_get'.
type IPReassemblyGet struct {
IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
Type IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"`
}
-func (m *IPReassemblyGet) Reset() { *m = IPReassemblyGet{} }
-func (*IPReassemblyGet) GetMessageName() string { return "ip_reassembly_get" }
-func (*IPReassemblyGet) GetCrcString() string { return "ea13ff63" }
-func (*IPReassemblyGet) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPReassemblyGet) Reset() { *m = IPReassemblyGet{} }
+func (*IPReassemblyGet) GetMessageName() string { return "ip_reassembly_get" }
+func (*IPReassemblyGet) GetCrcString() string { return "ea13ff63" }
+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
- // field[1] m.IsIP6
- size += 1
- // field[1] m.Type
- size += 4
+ size += 1 // m.IsIP6
+ size += 4 // m.Type
return size
}
func (m *IPReassemblyGet) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsIP6
- if m.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Type
- o.PutUint32(buf[pos:pos+4], uint32(m.Type))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblyGet) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsIP6
- m.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[1] m.Type
- m.Type = IPReassType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsIP6)
+ buf.EncodeUint32(uint32(m.Type))
+ return buf.Bytes(), nil
+}
+func (m *IPReassemblyGet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIP6 = buf.DecodeBool()
+ m.Type = IPReassType(buf.DecodeUint32())
return nil
}
-// IPReassemblyGetReply represents VPP binary API message 'ip_reassembly_get_reply'.
+// IPReassemblyGetReply defines message 'ip_reassembly_get_reply'.
type IPReassemblyGetReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
TimeoutMs uint32 `binapi:"u32,name=timeout_ms" json:"timeout_ms,omitempty"`
@@ -2985,90 +2399,50 @@ type IPReassemblyGetReply struct {
IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
}
-func (m *IPReassemblyGetReply) Reset() { *m = IPReassemblyGetReply{} }
-func (*IPReassemblyGetReply) GetMessageName() string { return "ip_reassembly_get_reply" }
-func (*IPReassemblyGetReply) GetCrcString() string { return "d5eb8d34" }
-func (*IPReassemblyGetReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPReassemblyGetReply) Reset() { *m = IPReassemblyGetReply{} }
+func (*IPReassemblyGetReply) GetMessageName() string { return "ip_reassembly_get_reply" }
+func (*IPReassemblyGetReply) GetCrcString() string { return "d5eb8d34" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.TimeoutMs
- size += 4
- // field[1] m.MaxReassemblies
- size += 4
- // field[1] m.MaxReassemblyLength
- size += 4
- // field[1] m.ExpireWalkIntervalMs
- size += 4
- // field[1] m.IsIP6
- size += 1
+ size += 4 // m.Retval
+ size += 4 // m.TimeoutMs
+ size += 4 // m.MaxReassemblies
+ size += 4 // m.MaxReassemblyLength
+ size += 4 // m.ExpireWalkIntervalMs
+ size += 1 // m.IsIP6
return size
}
func (m *IPReassemblyGetReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.TimeoutMs
- o.PutUint32(buf[pos:pos+4], uint32(m.TimeoutMs))
- pos += 4
- // field[1] m.MaxReassemblies
- o.PutUint32(buf[pos:pos+4], uint32(m.MaxReassemblies))
- pos += 4
- // field[1] m.MaxReassemblyLength
- o.PutUint32(buf[pos:pos+4], uint32(m.MaxReassemblyLength))
- pos += 4
- // field[1] m.ExpireWalkIntervalMs
- o.PutUint32(buf[pos:pos+4], uint32(m.ExpireWalkIntervalMs))
- pos += 4
- // field[1] m.IsIP6
- if m.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPReassemblyGetReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TimeoutMs
- m.TimeoutMs = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MaxReassemblies
- m.MaxReassemblies = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MaxReassemblyLength
- m.MaxReassemblyLength = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ExpireWalkIntervalMs
- m.ExpireWalkIntervalMs = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIP6
- m.IsIP6 = tmp[pos] != 0
- pos += 1
+ 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 = buf.DecodeInt32()
+ m.TimeoutMs = buf.DecodeUint32()
+ m.MaxReassemblies = buf.DecodeUint32()
+ m.MaxReassemblyLength = buf.DecodeUint32()
+ m.ExpireWalkIntervalMs = buf.DecodeUint32()
+ m.IsIP6 = buf.DecodeBool()
return nil
}
-// IPReassemblySet represents VPP binary API message 'ip_reassembly_set'.
+// IPReassemblySet defines message 'ip_reassembly_set'.
type IPReassemblySet struct {
TimeoutMs uint32 `binapi:"u32,name=timeout_ms" json:"timeout_ms,omitempty"`
MaxReassemblies uint32 `binapi:"u32,name=max_reassemblies" json:"max_reassemblies,omitempty"`
@@ -3078,831 +2452,415 @@ type IPReassemblySet struct {
Type IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"`
}
-func (m *IPReassemblySet) Reset() { *m = IPReassemblySet{} }
-func (*IPReassemblySet) GetMessageName() string { return "ip_reassembly_set" }
-func (*IPReassemblySet) GetCrcString() string { return "16467d25" }
-func (*IPReassemblySet) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPReassemblySet) Reset() { *m = IPReassemblySet{} }
+func (*IPReassemblySet) GetMessageName() string { return "ip_reassembly_set" }
+func (*IPReassemblySet) GetCrcString() string { return "16467d25" }
+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
- // field[1] m.TimeoutMs
- size += 4
- // field[1] m.MaxReassemblies
- size += 4
- // field[1] m.MaxReassemblyLength
- size += 4
- // field[1] m.ExpireWalkIntervalMs
- size += 4
- // field[1] m.IsIP6
- size += 1
- // field[1] m.Type
- size += 4
+ size += 4 // m.TimeoutMs
+ size += 4 // m.MaxReassemblies
+ size += 4 // m.MaxReassemblyLength
+ size += 4 // m.ExpireWalkIntervalMs
+ size += 1 // m.IsIP6
+ size += 4 // m.Type
return size
}
func (m *IPReassemblySet) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.TimeoutMs
- o.PutUint32(buf[pos:pos+4], uint32(m.TimeoutMs))
- pos += 4
- // field[1] m.MaxReassemblies
- o.PutUint32(buf[pos:pos+4], uint32(m.MaxReassemblies))
- pos += 4
- // field[1] m.MaxReassemblyLength
- o.PutUint32(buf[pos:pos+4], uint32(m.MaxReassemblyLength))
- pos += 4
- // field[1] m.ExpireWalkIntervalMs
- o.PutUint32(buf[pos:pos+4], uint32(m.ExpireWalkIntervalMs))
- pos += 4
- // field[1] m.IsIP6
- if m.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Type
- o.PutUint32(buf[pos:pos+4], uint32(m.Type))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblySet) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.TimeoutMs
- m.TimeoutMs = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MaxReassemblies
- m.MaxReassemblies = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MaxReassemblyLength
- m.MaxReassemblyLength = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ExpireWalkIntervalMs
- m.ExpireWalkIntervalMs = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIP6
- m.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[1] m.Type
- m.Type = IPReassType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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
+}
+func (m *IPReassemblySet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TimeoutMs = buf.DecodeUint32()
+ m.MaxReassemblies = buf.DecodeUint32()
+ m.MaxReassemblyLength = buf.DecodeUint32()
+ m.ExpireWalkIntervalMs = buf.DecodeUint32()
+ m.IsIP6 = buf.DecodeBool()
+ m.Type = IPReassType(buf.DecodeUint32())
return nil
}
-// IPReassemblySetReply represents VPP binary API message 'ip_reassembly_set_reply'.
+// IPReassemblySetReply defines message 'ip_reassembly_set_reply'.
type IPReassemblySetReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPReassemblySetReply) Reset() { *m = IPReassemblySetReply{} }
-func (*IPReassemblySetReply) GetMessageName() string { return "ip_reassembly_set_reply" }
-func (*IPReassemblySetReply) GetCrcString() string { return "e8d4e804" }
-func (*IPReassemblySetReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPReassemblySetReply) Reset() { *m = IPReassemblySetReply{} }
+func (*IPReassemblySetReply) GetMessageName() string { return "ip_reassembly_set_reply" }
+func (*IPReassemblySetReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPReassemblySetReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblySetReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPRouteAddDel represents VPP binary API message 'ip_route_add_del'.
+// IPRouteAddDel defines message 'ip_route_add_del'.
type IPRouteAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
IsMultipath bool `binapi:"bool,name=is_multipath" json:"is_multipath,omitempty"`
Route IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"`
}
-func (m *IPRouteAddDel) Reset() { *m = IPRouteAddDel{} }
-func (*IPRouteAddDel) GetMessageName() string { return "ip_route_add_del" }
-func (*IPRouteAddDel) GetCrcString() string { return "c1ff832d" }
-func (*IPRouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPRouteAddDel) Reset() { *m = IPRouteAddDel{} }
+func (*IPRouteAddDel) GetMessageName() string { return "ip_route_add_del" }
+func (*IPRouteAddDel) GetCrcString() string { return "c1ff832d" }
+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
- // field[1] m.IsAdd
- size += 1
- // field[1] m.IsMultipath
- size += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- size += 4
- // field[2] m.Route.StatsIndex
- size += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- size += 4
- // field[4] m.Route.Prefix.Address.Un
- size += 16
- // field[3] m.Route.Prefix.Len
- size += 1
- // field[2] m.Route.NPaths
- size += 1
- // field[2] m.Route.Paths
+ size += 1 // m.IsAdd
+ size += 1 // m.IsMultipath
+ size += 4 // m.Route.TableID
+ size += 4 // m.Route.StatsIndex
+ size += 4 // m.Route.Prefix.Address.Af
+ size += 1 * 16 // m.Route.Prefix.Address.Un
+ size += 1 // m.Route.Prefix.Len
+ size += 1 // m.Route.NPaths
for j2 := 0; j2 < len(m.Route.Paths); j2++ {
var s2 FibPath
_ = s2
if j2 < len(m.Route.Paths) {
s2 = m.Route.Paths[j2]
}
- // field[3] s2.SwIfIndex
- size += 4
- // field[3] s2.TableID
- size += 4
- // field[3] s2.RpfID
- size += 4
- // field[3] s2.Weight
- size += 1
- // field[3] s2.Preference
- size += 1
- // field[3] s2.Type
- size += 4
- // field[3] s2.Flags
- size += 4
- // field[3] s2.Proto
- size += 4
- // field[3] s2.Nh
- // field[4] s2.Nh.Address
- size += 16
- // field[4] s2.Nh.ViaLabel
- size += 4
- // field[4] s2.Nh.ObjID
- size += 4
- // field[4] s2.Nh.ClassifyTableIndex
- size += 4
- // field[3] s2.NLabels
- size += 1
- // field[3] s2.LabelStack
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
for j3 := 0; j3 < 16; j3++ {
- var s3 FibMplsLabel
- _ = s3
- if j3 < len(s2.LabelStack) {
- s3 = s2.LabelStack[j3]
- }
- // field[4] s3.IsUniform
- size += 1
- // field[4] s3.Label
- size += 4
- // field[4] s3.TTL
- size += 1
- // field[4] s3.Exp
- size += 1
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.IsMultipath
- if m.IsMultipath {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.TableID))
- pos += 4
- // field[2] m.Route.StatsIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.StatsIndex))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.Prefix.Address.Af))
- pos += 4
- // field[4] m.Route.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Route.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] m.Route.Prefix.Len
- buf[pos] = uint8(m.Route.Prefix.Len)
- pos += 1
- // field[2] m.Route.NPaths
- buf[pos] = uint8(len(m.Route.Paths))
- pos += 1
- // field[2] m.Route.Paths
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var v2 FibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.IsMultipath)
+ buf.EncodeUint32(m.Route.TableID)
+ buf.EncodeUint32(m.Route.StatsIndex)
+ buf.EncodeUint32(uint32(m.Route.Prefix.Address.Af))
+ 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 FibPath // Paths
+ if j1 < len(m.Route.Paths) {
+ v1 = m.Route.Paths[j1]
}
- // field[3] v2.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.SwIfIndex))
- pos += 4
- // field[3] v2.TableID
- o.PutUint32(buf[pos:pos+4], uint32(v2.TableID))
- pos += 4
- // field[3] v2.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(v2.RpfID))
- pos += 4
- // field[3] v2.Weight
- buf[pos] = uint8(v2.Weight)
- pos += 1
- // field[3] v2.Preference
- buf[pos] = uint8(v2.Preference)
- pos += 1
- // field[3] v2.Type
- o.PutUint32(buf[pos:pos+4], uint32(v2.Type))
- pos += 4
- // field[3] v2.Flags
- o.PutUint32(buf[pos:pos+4], uint32(v2.Flags))
- pos += 4
- // field[3] v2.Proto
- o.PutUint32(buf[pos:pos+4], uint32(v2.Proto))
- pos += 4
- // field[3] v2.Nh
- // field[4] v2.Nh.Address
- copy(buf[pos:pos+16], v2.Nh.Address.XXX_UnionData[:])
- pos += 16
- // field[4] v2.Nh.ViaLabel
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ViaLabel))
- pos += 4
- // field[4] v2.Nh.ObjID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ObjID))
- pos += 4
- // field[4] v2.Nh.ClassifyTableIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ClassifyTableIndex))
- pos += 4
- // field[3] v2.NLabels
- buf[pos] = uint8(v2.NLabels)
- pos += 1
- // field[3] v2.LabelStack
- for j3 := 0; j3 < 16; j3++ {
- var v3 FibMplsLabel
- if j3 < len(v2.LabelStack) {
- v3 = v2.LabelStack[j3]
- }
- // field[4] v3.IsUniform
- buf[pos] = uint8(v3.IsUniform)
- pos += 1
- // field[4] v3.Label
- o.PutUint32(buf[pos:pos+4], uint32(v3.Label))
- pos += 4
- // field[4] v3.TTL
- buf[pos] = uint8(v3.TTL)
- pos += 1
- // field[4] v3.Exp
- buf[pos] = uint8(v3.Exp)
- pos += 1
+ 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[:], 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++ {
+ 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, nil
-}
-func (m *IPRouteAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.IsMultipath
- m.IsMultipath = tmp[pos] != 0
- pos += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- m.Route.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.StatsIndex
- m.Route.StatsIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- m.Route.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Prefix.Address.Un
- copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.Route.Prefix.Len
- m.Route.Prefix.Len = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.NPaths
- m.Route.NPaths = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.Paths
- m.Route.Paths = make([]FibPath, int(m.Route.NPaths))
- for j2 := 0; j2 < int(m.Route.NPaths); j2++ {
- // field[3] m.Route.Paths[j2].SwIfIndex
- m.Route.Paths[j2].SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].TableID
- m.Route.Paths[j2].TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].RpfID
- m.Route.Paths[j2].RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Weight
- m.Route.Paths[j2].Weight = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].Preference
- m.Route.Paths[j2].Preference = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].Type
- m.Route.Paths[j2].Type = FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Flags
- m.Route.Paths[j2].Flags = FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Proto
- m.Route.Paths[j2].Proto = FibPathNhProto(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Nh
- // field[4] m.Route.Paths[j2].Nh.Address
- copy(m.Route.Paths[j2].Nh.Address.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[4] m.Route.Paths[j2].Nh.ViaLabel
- m.Route.Paths[j2].Nh.ViaLabel = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Nh.ObjID
- m.Route.Paths[j2].Nh.ObjID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Nh.ClassifyTableIndex
- m.Route.Paths[j2].Nh.ClassifyTableIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].NLabels
- m.Route.Paths[j2].NLabels = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].LabelStack
- for j3 := 0; j3 < 16; j3++ {
- // field[4] m.Route.Paths[j2].LabelStack[j3].IsUniform
- m.Route.Paths[j2].LabelStack[j3].IsUniform = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].LabelStack[j3].Label
- m.Route.Paths[j2].LabelStack[j3].Label = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].LabelStack[j3].TTL
- m.Route.Paths[j2].LabelStack[j3].TTL = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].LabelStack[j3].Exp
- m.Route.Paths[j2].LabelStack[j3].Exp = uint8(tmp[pos])
- pos += 1
+ return buf.Bytes(), nil
+}
+func (m *IPRouteAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.IsMultipath = buf.DecodeBool()
+ m.Route.TableID = buf.DecodeUint32()
+ m.Route.StatsIndex = buf.DecodeUint32()
+ m.Route.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ 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([]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()
+ m.Route.Paths[j1].RpfID = buf.DecodeUint32()
+ m.Route.Paths[j1].Weight = buf.DecodeUint8()
+ m.Route.Paths[j1].Preference = buf.DecodeUint8()
+ m.Route.Paths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.Route.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
}
}
return nil
}
-// IPRouteAddDelReply represents VPP binary API message 'ip_route_add_del_reply'.
+// IPRouteAddDelReply defines message 'ip_route_add_del_reply'.
type IPRouteAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
}
-func (m *IPRouteAddDelReply) Reset() { *m = IPRouteAddDelReply{} }
-func (*IPRouteAddDelReply) GetMessageName() string { return "ip_route_add_del_reply" }
-func (*IPRouteAddDelReply) GetCrcString() string { return "1992deab" }
-func (*IPRouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPRouteAddDelReply) Reset() { *m = IPRouteAddDelReply{} }
+func (*IPRouteAddDelReply) GetMessageName() string { return "ip_route_add_del_reply" }
+func (*IPRouteAddDelReply) GetCrcString() string { return "1992deab" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.StatsIndex
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.StatsIndex
return size
}
func (m *IPRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.StatsIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.StatsIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPRouteAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.StatsIndex
- m.StatsIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.StatsIndex = buf.DecodeUint32()
return nil
}
-// IPRouteDetails represents VPP binary API message 'ip_route_details'.
+// IPRouteDetails defines message 'ip_route_details'.
type IPRouteDetails struct {
Route IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"`
}
-func (m *IPRouteDetails) Reset() { *m = IPRouteDetails{} }
-func (*IPRouteDetails) GetMessageName() string { return "ip_route_details" }
-func (*IPRouteDetails) GetCrcString() string { return "d1ffaae1" }
-func (*IPRouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPRouteDetails) Reset() { *m = IPRouteDetails{} }
+func (*IPRouteDetails) GetMessageName() string { return "ip_route_details" }
+func (*IPRouteDetails) GetCrcString() string { return "d1ffaae1" }
+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
- // field[1] m.Route
- // field[2] m.Route.TableID
- size += 4
- // field[2] m.Route.StatsIndex
- size += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- size += 4
- // field[4] m.Route.Prefix.Address.Un
- size += 16
- // field[3] m.Route.Prefix.Len
- size += 1
- // field[2] m.Route.NPaths
- size += 1
- // field[2] m.Route.Paths
+ size += 4 // m.Route.TableID
+ size += 4 // m.Route.StatsIndex
+ size += 4 // m.Route.Prefix.Address.Af
+ size += 1 * 16 // m.Route.Prefix.Address.Un
+ size += 1 // m.Route.Prefix.Len
+ size += 1 // m.Route.NPaths
for j2 := 0; j2 < len(m.Route.Paths); j2++ {
var s2 FibPath
_ = s2
if j2 < len(m.Route.Paths) {
s2 = m.Route.Paths[j2]
}
- // field[3] s2.SwIfIndex
- size += 4
- // field[3] s2.TableID
- size += 4
- // field[3] s2.RpfID
- size += 4
- // field[3] s2.Weight
- size += 1
- // field[3] s2.Preference
- size += 1
- // field[3] s2.Type
- size += 4
- // field[3] s2.Flags
- size += 4
- // field[3] s2.Proto
- size += 4
- // field[3] s2.Nh
- // field[4] s2.Nh.Address
- size += 16
- // field[4] s2.Nh.ViaLabel
- size += 4
- // field[4] s2.Nh.ObjID
- size += 4
- // field[4] s2.Nh.ClassifyTableIndex
- size += 4
- // field[3] s2.NLabels
- size += 1
- // field[3] s2.LabelStack
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
for j3 := 0; j3 < 16; j3++ {
- var s3 FibMplsLabel
- _ = s3
- if j3 < len(s2.LabelStack) {
- s3 = s2.LabelStack[j3]
- }
- // field[4] s3.IsUniform
- size += 1
- // field[4] s3.Label
- size += 4
- // field[4] s3.TTL
- size += 1
- // field[4] s3.Exp
- size += 1
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Route
- // field[2] m.Route.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.TableID))
- pos += 4
- // field[2] m.Route.StatsIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.StatsIndex))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.Prefix.Address.Af))
- pos += 4
- // field[4] m.Route.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Route.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] m.Route.Prefix.Len
- buf[pos] = uint8(m.Route.Prefix.Len)
- pos += 1
- // field[2] m.Route.NPaths
- buf[pos] = uint8(len(m.Route.Paths))
- pos += 1
- // field[2] m.Route.Paths
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var v2 FibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Route.TableID)
+ buf.EncodeUint32(m.Route.StatsIndex)
+ buf.EncodeUint32(uint32(m.Route.Prefix.Address.Af))
+ 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 FibPath // Paths
+ if j1 < len(m.Route.Paths) {
+ v1 = m.Route.Paths[j1]
}
- // field[3] v2.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.SwIfIndex))
- pos += 4
- // field[3] v2.TableID
- o.PutUint32(buf[pos:pos+4], uint32(v2.TableID))
- pos += 4
- // field[3] v2.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(v2.RpfID))
- pos += 4
- // field[3] v2.Weight
- buf[pos] = uint8(v2.Weight)
- pos += 1
- // field[3] v2.Preference
- buf[pos] = uint8(v2.Preference)
- pos += 1
- // field[3] v2.Type
- o.PutUint32(buf[pos:pos+4], uint32(v2.Type))
- pos += 4
- // field[3] v2.Flags
- o.PutUint32(buf[pos:pos+4], uint32(v2.Flags))
- pos += 4
- // field[3] v2.Proto
- o.PutUint32(buf[pos:pos+4], uint32(v2.Proto))
- pos += 4
- // field[3] v2.Nh
- // field[4] v2.Nh.Address
- copy(buf[pos:pos+16], v2.Nh.Address.XXX_UnionData[:])
- pos += 16
- // field[4] v2.Nh.ViaLabel
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ViaLabel))
- pos += 4
- // field[4] v2.Nh.ObjID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ObjID))
- pos += 4
- // field[4] v2.Nh.ClassifyTableIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ClassifyTableIndex))
- pos += 4
- // field[3] v2.NLabels
- buf[pos] = uint8(v2.NLabels)
- pos += 1
- // field[3] v2.LabelStack
- for j3 := 0; j3 < 16; j3++ {
- var v3 FibMplsLabel
- if j3 < len(v2.LabelStack) {
- v3 = v2.LabelStack[j3]
- }
- // field[4] v3.IsUniform
- buf[pos] = uint8(v3.IsUniform)
- pos += 1
- // field[4] v3.Label
- o.PutUint32(buf[pos:pos+4], uint32(v3.Label))
- pos += 4
- // field[4] v3.TTL
- buf[pos] = uint8(v3.TTL)
- pos += 1
- // field[4] v3.Exp
- buf[pos] = uint8(v3.Exp)
- pos += 1
+ 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[:], 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++ {
+ 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, nil
-}
-func (m *IPRouteDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Route
- // field[2] m.Route.TableID
- m.Route.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.StatsIndex
- m.Route.StatsIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- m.Route.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Prefix.Address.Un
- copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.Route.Prefix.Len
- m.Route.Prefix.Len = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.NPaths
- m.Route.NPaths = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.Paths
- m.Route.Paths = make([]FibPath, int(m.Route.NPaths))
- for j2 := 0; j2 < int(m.Route.NPaths); j2++ {
- // field[3] m.Route.Paths[j2].SwIfIndex
- m.Route.Paths[j2].SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].TableID
- m.Route.Paths[j2].TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].RpfID
- m.Route.Paths[j2].RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Weight
- m.Route.Paths[j2].Weight = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].Preference
- m.Route.Paths[j2].Preference = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].Type
- m.Route.Paths[j2].Type = FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Flags
- m.Route.Paths[j2].Flags = FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Proto
- m.Route.Paths[j2].Proto = FibPathNhProto(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Nh
- // field[4] m.Route.Paths[j2].Nh.Address
- copy(m.Route.Paths[j2].Nh.Address.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[4] m.Route.Paths[j2].Nh.ViaLabel
- m.Route.Paths[j2].Nh.ViaLabel = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Nh.ObjID
- m.Route.Paths[j2].Nh.ObjID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Nh.ClassifyTableIndex
- m.Route.Paths[j2].Nh.ClassifyTableIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].NLabels
- m.Route.Paths[j2].NLabels = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].LabelStack
- for j3 := 0; j3 < 16; j3++ {
- // field[4] m.Route.Paths[j2].LabelStack[j3].IsUniform
- m.Route.Paths[j2].LabelStack[j3].IsUniform = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].LabelStack[j3].Label
- m.Route.Paths[j2].LabelStack[j3].Label = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].LabelStack[j3].TTL
- m.Route.Paths[j2].LabelStack[j3].TTL = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].LabelStack[j3].Exp
- m.Route.Paths[j2].LabelStack[j3].Exp = uint8(tmp[pos])
- pos += 1
+ return buf.Bytes(), nil
+}
+func (m *IPRouteDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Route.TableID = buf.DecodeUint32()
+ m.Route.StatsIndex = buf.DecodeUint32()
+ m.Route.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ 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([]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()
+ m.Route.Paths[j1].RpfID = buf.DecodeUint32()
+ m.Route.Paths[j1].Weight = buf.DecodeUint8()
+ m.Route.Paths[j1].Preference = buf.DecodeUint8()
+ m.Route.Paths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.Route.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
}
}
return nil
}
-// IPRouteDump represents VPP binary API message 'ip_route_dump'.
+// IPRouteDump defines message 'ip_route_dump'.
type IPRouteDump struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPRouteDump) Reset() { *m = IPRouteDump{} }
-func (*IPRouteDump) GetMessageName() string { return "ip_route_dump" }
-func (*IPRouteDump) GetCrcString() string { return "b9d2e09e" }
-func (*IPRouteDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPRouteDump) Reset() { *m = IPRouteDump{} }
+func (*IPRouteDump) GetMessageName() string { return "ip_route_dump" }
+func (*IPRouteDump) GetCrcString() string { return "b9d2e09e" }
+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
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPRouteDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPRouteDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPSourceAndPortRangeCheckAddDel represents VPP binary API message 'ip_source_and_port_range_check_add_del'.
+// IPSourceAndPortRangeCheckAddDel defines message 'ip_source_and_port_range_check_add_del'.
type IPSourceAndPortRangeCheckAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
NumberOfRanges uint8 `binapi:"u8,name=number_of_ranges" json:"number_of_ranges,omitempty"`
- LowPorts []uint16 `binapi:"u16[32],name=low_ports" json:"low_ports,omitempty" struc:"[32]uint16"`
- HighPorts []uint16 `binapi:"u16[32],name=high_ports" json:"high_ports,omitempty" struc:"[32]uint16"`
+ LowPorts []uint16 `binapi:"u16[32],name=low_ports" json:"low_ports,omitempty"`
+ HighPorts []uint16 `binapi:"u16[32],name=high_ports" json:"high_ports,omitempty"`
VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
}
@@ -3910,128 +2868,72 @@ func (m *IPSourceAndPortRangeCheckAddDel) Reset() { *m = IPSourceAndPortRangeChe
func (*IPSourceAndPortRangeCheckAddDel) GetMessageName() string {
return "ip_source_and_port_range_check_add_del"
}
-func (*IPSourceAndPortRangeCheckAddDel) GetCrcString() string { return "8bfc76f2" }
-func (*IPSourceAndPortRangeCheckAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (*IPSourceAndPortRangeCheckAddDel) GetCrcString() string { return "8bfc76f2" }
+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
- // field[1] m.IsAdd
- size += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 4
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
- // field[1] m.NumberOfRanges
- size += 1
- // field[1] m.LowPorts
- size += 64
- // field[1] m.HighPorts
- size += 64
- // field[1] m.VrfID
- size += 4
+ size += 1 // m.IsAdd
+ size += 4 // m.Prefix.Address.Af
+ size += 1 * 16 // m.Prefix.Address.Un
+ size += 1 // m.Prefix.Len
+ size += 1 // m.NumberOfRanges
+ size += 2 * 32 // m.LowPorts
+ size += 2 * 32 // m.HighPorts
+ size += 4 // m.VrfID
return size
}
func (m *IPSourceAndPortRangeCheckAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Prefix.Address.Af))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[2] m.Prefix.Len
- buf[pos] = uint8(m.Prefix.Len)
- pos += 1
- // field[1] m.NumberOfRanges
- buf[pos] = uint8(m.NumberOfRanges)
- pos += 1
- // field[1] m.LowPorts
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.Prefix.Address.Af))
+ 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])
}
- o.PutUint16(buf[pos:pos+2], uint16(x))
- pos += 2
+ buf.EncodeUint16(x)
}
- // field[1] m.HighPorts
for i := 0; i < 32; i++ {
var x uint16
if i < len(m.HighPorts) {
x = uint16(m.HighPorts[i])
}
- o.PutUint16(buf[pos:pos+2], uint16(x))
- pos += 2
- }
- // field[1] m.VrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.VrfID))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceAndPortRangeCheckAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Prefix.Len
- m.Prefix.Len = uint8(tmp[pos])
- pos += 1
- // field[1] m.NumberOfRanges
- m.NumberOfRanges = uint8(tmp[pos])
- pos += 1
- // field[1] m.LowPorts
+ buf.EncodeUint16(x)
+ }
+ buf.EncodeUint32(m.VrfID)
+ return buf.Bytes(), nil
+}
+func (m *IPSourceAndPortRangeCheckAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
+ m.NumberOfRanges = buf.DecodeUint8()
m.LowPorts = make([]uint16, 32)
for i := 0; i < len(m.LowPorts); i++ {
- m.LowPorts[i] = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ m.LowPorts[i] = buf.DecodeUint16()
}
- // field[1] m.HighPorts
m.HighPorts = make([]uint16, 32)
for i := 0; i < len(m.HighPorts); i++ {
- m.HighPorts[i] = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ m.HighPorts[i] = buf.DecodeUint16()
}
- // field[1] m.VrfID
- m.VrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ m.VrfID = buf.DecodeUint32()
return nil
}
-// IPSourceAndPortRangeCheckAddDelReply represents VPP binary API message 'ip_source_and_port_range_check_add_del_reply'.
+// IPSourceAndPortRangeCheckAddDelReply defines message 'ip_source_and_port_range_check_add_del_reply'.
type IPSourceAndPortRangeCheckAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -4045,43 +2947,28 @@ 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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPSourceAndPortRangeCheckAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceAndPortRangeCheckAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPSourceAndPortRangeCheckInterfaceAddDel represents VPP binary API message 'ip_source_and_port_range_check_interface_add_del'.
+// IPSourceAndPortRangeCheckInterfaceAddDel defines message 'ip_source_and_port_range_check_interface_add_del'.
type IPSourceAndPortRangeCheckInterfaceAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
@@ -4102,85 +2989,43 @@ 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
- // field[1] m.IsAdd
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.TCPInVrfID
- size += 4
- // field[1] m.TCPOutVrfID
- size += 4
- // field[1] m.UDPInVrfID
- size += 4
- // field[1] m.UDPOutVrfID
- size += 4
+ size += 1 // m.IsAdd
+ size += 4 // m.SwIfIndex
+ size += 4 // m.TCPInVrfID
+ size += 4 // m.TCPOutVrfID
+ size += 4 // m.UDPInVrfID
+ size += 4 // m.UDPOutVrfID
return size
}
func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.TCPInVrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.TCPInVrfID))
- pos += 4
- // field[1] m.TCPOutVrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.TCPOutVrfID))
- pos += 4
- // field[1] m.UDPInVrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.UDPInVrfID))
- pos += 4
- // field[1] m.UDPOutVrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.UDPOutVrfID))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TCPInVrfID
- m.TCPInVrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TCPOutVrfID
- m.TCPOutVrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.UDPInVrfID
- m.UDPInVrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.UDPOutVrfID
- m.UDPOutVrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.TCPInVrfID = buf.DecodeUint32()
+ m.TCPOutVrfID = buf.DecodeUint32()
+ m.UDPInVrfID = buf.DecodeUint32()
+ m.UDPOutVrfID = buf.DecodeUint32()
return nil
}
-// IPSourceAndPortRangeCheckInterfaceAddDelReply represents VPP binary API message 'ip_source_and_port_range_check_interface_add_del_reply'.
+// IPSourceAndPortRangeCheckInterfaceAddDelReply defines message 'ip_source_and_port_range_check_interface_add_del_reply'.
type IPSourceAndPortRangeCheckInterfaceAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -4196,43 +3041,28 @@ 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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPSourceCheckInterfaceAddDel represents VPP binary API message 'ip_source_check_interface_add_del'.
+// IPSourceCheckInterfaceAddDel defines message 'ip_source_check_interface_add_del'.
type IPSourceCheckInterfaceAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
Loose bool `binapi:"bool,name=loose" json:"loose,omitempty"`
@@ -4243,66 +3073,39 @@ func (m *IPSourceCheckInterfaceAddDel) Reset() { *m = IPSourceCheckInterfaceAddD
func (*IPSourceCheckInterfaceAddDel) GetMessageName() string {
return "ip_source_check_interface_add_del"
}
-func (*IPSourceCheckInterfaceAddDel) GetCrcString() string { return "6612356b" }
-func (*IPSourceCheckInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (*IPSourceCheckInterfaceAddDel) GetCrcString() string { return "6612356b" }
+func (*IPSourceCheckInterfaceAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPSourceCheckInterfaceAddDel) Size() int {
+func (m *IPSourceCheckInterfaceAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.Loose
- size += 1
- // field[1] m.SwIfIndex
- size += 4
+ size += 1 // m.IsAdd
+ size += 1 // m.Loose
+ size += 4 // m.SwIfIndex
return size
}
func (m *IPSourceCheckInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Loose
- if m.Loose {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceCheckInterfaceAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.Loose
- m.Loose = tmp[pos] != 0
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.Loose)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IPSourceCheckInterfaceAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Loose = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
return nil
}
-// IPSourceCheckInterfaceAddDelReply represents VPP binary API message 'ip_source_check_interface_add_del_reply'.
+// IPSourceCheckInterfaceAddDelReply defines message 'ip_source_check_interface_add_del_reply'.
type IPSourceCheckInterfaceAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -4311,882 +3114,547 @@ func (m *IPSourceCheckInterfaceAddDelReply) Reset() { *m = IPSourceCheckInterfac
func (*IPSourceCheckInterfaceAddDelReply) GetMessageName() string {
return "ip_source_check_interface_add_del_reply"
}
-func (*IPSourceCheckInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*IPSourceCheckInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*IPSourceCheckInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*IPSourceCheckInterfaceAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPSourceCheckInterfaceAddDelReply) Size() int {
+func (m *IPSourceCheckInterfaceAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPSourceCheckInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceCheckInterfaceAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPSourceCheckInterfaceAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPTableAddDel represents VPP binary API message 'ip_table_add_del'.
+// IPTableAddDel defines message 'ip_table_add_del'.
type IPTableAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableAddDel) Reset() { *m = IPTableAddDel{} }
-func (*IPTableAddDel) GetMessageName() string { return "ip_table_add_del" }
-func (*IPTableAddDel) GetCrcString() string { return "0ffdaec0" }
-func (*IPTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableAddDel) Reset() { *m = IPTableAddDel{} }
+func (*IPTableAddDel) GetMessageName() string { return "ip_table_add_del" }
+func (*IPTableAddDel) GetCrcString() string { return "0ffdaec0" }
+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
- // field[1] m.IsAdd
- size += 1
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ size += 1 // m.IsAdd
+ size += 4 // m.Table.TableID
+ size += 1 // m.Table.IsIP6
+ size += 64 // m.Table.Name
return size
}
func (m *IPTableAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableAddDelReply represents VPP binary API message 'ip_table_add_del_reply'.
+// IPTableAddDelReply defines message 'ip_table_add_del_reply'.
type IPTableAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPTableAddDelReply) Reset() { *m = IPTableAddDelReply{} }
-func (*IPTableAddDelReply) GetMessageName() string { return "ip_table_add_del_reply" }
-func (*IPTableAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*IPTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableAddDelReply) Reset() { *m = IPTableAddDelReply{} }
+func (*IPTableAddDelReply) GetMessageName() string { return "ip_table_add_del_reply" }
+func (*IPTableAddDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPTableAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPTableAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPTableDetails represents VPP binary API message 'ip_table_details'.
+// IPTableDetails defines message 'ip_table_details'.
type IPTableDetails struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableDetails) Reset() { *m = IPTableDetails{} }
-func (*IPTableDetails) GetMessageName() string { return "ip_table_details" }
-func (*IPTableDetails) GetCrcString() string { return "c79fca0f" }
-func (*IPTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableDetails) Reset() { *m = IPTableDetails{} }
+func (*IPTableDetails) GetMessageName() string { return "ip_table_details" }
+func (*IPTableDetails) GetCrcString() string { return "c79fca0f" }
+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
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableDump represents VPP binary API message 'ip_table_dump'.
+// IPTableDump defines message 'ip_table_dump'.
type IPTableDump struct{}
-func (m *IPTableDump) Reset() { *m = IPTableDump{} }
-func (*IPTableDump) GetMessageName() string { return "ip_table_dump" }
-func (*IPTableDump) GetCrcString() string { return "51077d14" }
-func (*IPTableDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableDump) Reset() { *m = IPTableDump{} }
+func (*IPTableDump) GetMessageName() string { return "ip_table_dump" }
+func (*IPTableDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *IPTableDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *IPTableDump) Unmarshal(b []byte) error {
return nil
}
-// IPTableFlush represents VPP binary API message 'ip_table_flush'.
+// IPTableFlush defines message 'ip_table_flush'.
type IPTableFlush struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableFlush) Reset() { *m = IPTableFlush{} }
-func (*IPTableFlush) GetMessageName() string { return "ip_table_flush" }
-func (*IPTableFlush) GetCrcString() string { return "b9d2e09e" }
-func (*IPTableFlush) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableFlush) Reset() { *m = IPTableFlush{} }
+func (*IPTableFlush) GetMessageName() string { return "ip_table_flush" }
+func (*IPTableFlush) GetCrcString() string { return "b9d2e09e" }
+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
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableFlush) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableFlush) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableFlushReply represents VPP binary API message 'ip_table_flush_reply'.
+// IPTableFlushReply defines message 'ip_table_flush_reply'.
type IPTableFlushReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPTableFlushReply) Reset() { *m = IPTableFlushReply{} }
-func (*IPTableFlushReply) GetMessageName() string { return "ip_table_flush_reply" }
-func (*IPTableFlushReply) GetCrcString() string { return "e8d4e804" }
-func (*IPTableFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableFlushReply) Reset() { *m = IPTableFlushReply{} }
+func (*IPTableFlushReply) GetMessageName() string { return "ip_table_flush_reply" }
+func (*IPTableFlushReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPTableFlushReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPTableFlushReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPTableReplaceBegin represents VPP binary API message 'ip_table_replace_begin'.
+// IPTableReplaceBegin defines message 'ip_table_replace_begin'.
type IPTableReplaceBegin struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableReplaceBegin) Reset() { *m = IPTableReplaceBegin{} }
-func (*IPTableReplaceBegin) GetMessageName() string { return "ip_table_replace_begin" }
-func (*IPTableReplaceBegin) GetCrcString() string { return "b9d2e09e" }
-func (*IPTableReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableReplaceBegin) Reset() { *m = IPTableReplaceBegin{} }
+func (*IPTableReplaceBegin) GetMessageName() string { return "ip_table_replace_begin" }
+func (*IPTableReplaceBegin) GetCrcString() string { return "b9d2e09e" }
+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
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableReplaceBegin) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableReplaceBegin) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableReplaceBeginReply represents VPP binary API message 'ip_table_replace_begin_reply'.
+// IPTableReplaceBeginReply defines message 'ip_table_replace_begin_reply'.
type IPTableReplaceBeginReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPTableReplaceBeginReply) Reset() { *m = IPTableReplaceBeginReply{} }
-func (*IPTableReplaceBeginReply) GetMessageName() string { return "ip_table_replace_begin_reply" }
-func (*IPTableReplaceBeginReply) GetCrcString() string { return "e8d4e804" }
-func (*IPTableReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableReplaceBeginReply) Reset() { *m = IPTableReplaceBeginReply{} }
+func (*IPTableReplaceBeginReply) GetMessageName() string { return "ip_table_replace_begin_reply" }
+func (*IPTableReplaceBeginReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPTableReplaceBeginReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPTableReplaceBeginReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPTableReplaceEnd represents VPP binary API message 'ip_table_replace_end'.
+// IPTableReplaceEnd defines message 'ip_table_replace_end'.
type IPTableReplaceEnd struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableReplaceEnd) Reset() { *m = IPTableReplaceEnd{} }
-func (*IPTableReplaceEnd) GetMessageName() string { return "ip_table_replace_end" }
-func (*IPTableReplaceEnd) GetCrcString() string { return "b9d2e09e" }
-func (*IPTableReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableReplaceEnd) Reset() { *m = IPTableReplaceEnd{} }
+func (*IPTableReplaceEnd) GetMessageName() string { return "ip_table_replace_end" }
+func (*IPTableReplaceEnd) GetCrcString() string { return "b9d2e09e" }
+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
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableReplaceEnd) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableReplaceEnd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableReplaceEndReply represents VPP binary API message 'ip_table_replace_end_reply'.
+// IPTableReplaceEndReply defines message 'ip_table_replace_end_reply'.
type IPTableReplaceEndReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPTableReplaceEndReply) Reset() { *m = IPTableReplaceEndReply{} }
-func (*IPTableReplaceEndReply) GetMessageName() string { return "ip_table_replace_end_reply" }
-func (*IPTableReplaceEndReply) GetCrcString() string { return "e8d4e804" }
-func (*IPTableReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableReplaceEndReply) Reset() { *m = IPTableReplaceEndReply{} }
+func (*IPTableReplaceEndReply) GetMessageName() string { return "ip_table_replace_end_reply" }
+func (*IPTableReplaceEndReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPTableReplaceEndReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPTableReplaceEndReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// IPUnnumberedDetails represents VPP binary API message 'ip_unnumbered_details'.
+// IPUnnumberedDetails defines message 'ip_unnumbered_details'.
type IPUnnumberedDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IPSwIfIndex InterfaceIndex `binapi:"interface_index,name=ip_sw_if_index" json:"ip_sw_if_index,omitempty"`
}
-func (m *IPUnnumberedDetails) Reset() { *m = IPUnnumberedDetails{} }
-func (*IPUnnumberedDetails) GetMessageName() string { return "ip_unnumbered_details" }
-func (*IPUnnumberedDetails) GetCrcString() string { return "aa12a483" }
-func (*IPUnnumberedDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPUnnumberedDetails) Reset() { *m = IPUnnumberedDetails{} }
+func (*IPUnnumberedDetails) GetMessageName() string { return "ip_unnumbered_details" }
+func (*IPUnnumberedDetails) GetCrcString() string { return "aa12a483" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IPSwIfIndex
- size += 4
+ size += 4 // m.SwIfIndex
+ size += 4 // m.IPSwIfIndex
return size
}
func (m *IPUnnumberedDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IPSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.IPSwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPUnnumberedDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IPSwIfIndex
- m.IPSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.IPSwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IPUnnumberedDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IPSwIfIndex = InterfaceIndex(buf.DecodeUint32())
return nil
}
-// IPUnnumberedDump represents VPP binary API message 'ip_unnumbered_dump'.
+// IPUnnumberedDump defines message 'ip_unnumbered_dump'.
type IPUnnumberedDump struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
-func (m *IPUnnumberedDump) Reset() { *m = IPUnnumberedDump{} }
-func (*IPUnnumberedDump) GetMessageName() string { return "ip_unnumbered_dump" }
-func (*IPUnnumberedDump) GetCrcString() string { return "f9e6675e" }
-func (*IPUnnumberedDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPUnnumberedDump) Reset() { *m = IPUnnumberedDump{} }
+func (*IPUnnumberedDump) GetMessageName() string { return "ip_unnumbered_dump" }
+func (*IPUnnumberedDump) GetCrcString() string { return "f9e6675e" }
+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
- // field[1] m.SwIfIndex
- size += 4
+ size += 4 // m.SwIfIndex
return size
}
func (m *IPUnnumberedDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPUnnumberedDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IPUnnumberedDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
return nil
}
-// MfibSignalDetails represents VPP binary API message 'mfib_signal_details'.
+// MfibSignalDetails defines message 'mfib_signal_details'.
type MfibSignalDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
Prefix Mprefix `binapi:"mprefix,name=prefix" json:"prefix,omitempty"`
IPPacketLen uint16 `binapi:"u16,name=ip_packet_len" json:"ip_packet_len,omitempty"`
- IPPacketData []byte `binapi:"u8[256],name=ip_packet_data" json:"ip_packet_data,omitempty" struc:"[256]byte"`
+ IPPacketData []byte `binapi:"u8[256],name=ip_packet_data" json:"ip_packet_data,omitempty"`
}
-func (m *MfibSignalDetails) Reset() { *m = MfibSignalDetails{} }
-func (*MfibSignalDetails) GetMessageName() string { return "mfib_signal_details" }
-func (*MfibSignalDetails) GetCrcString() string { return "64398a9a" }
-func (*MfibSignalDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MfibSignalDetails) Reset() { *m = MfibSignalDetails{} }
+func (*MfibSignalDetails) GetMessageName() string { return "mfib_signal_details" }
+func (*MfibSignalDetails) GetCrcString() string { return "64398a9a" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.TableID
- size += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Af
- size += 4
- // field[2] m.Prefix.GrpAddressLength
- size += 2
- // field[2] m.Prefix.GrpAddress
- size += 16
- // field[2] m.Prefix.SrcAddress
- size += 16
- // field[1] m.IPPacketLen
- size += 2
- // field[1] m.IPPacketData
- size += 256
+ size += 4 // m.SwIfIndex
+ size += 4 // m.TableID
+ size += 4 // m.Prefix.Af
+ size += 2 // m.Prefix.GrpAddressLength
+ size += 1 * 16 // m.Prefix.GrpAddress
+ size += 1 * 16 // m.Prefix.SrcAddress
+ size += 2 // m.IPPacketLen
+ size += 1 * 256 // m.IPPacketData
return size
}
func (m *MfibSignalDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.TableID))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Prefix.Af))
- pos += 4
- // field[2] m.Prefix.GrpAddressLength
- o.PutUint16(buf[pos:pos+2], uint16(m.Prefix.GrpAddressLength))
- pos += 2
- // field[2] m.Prefix.GrpAddress
- copy(buf[pos:pos+16], m.Prefix.GrpAddress.XXX_UnionData[:])
- pos += 16
- // field[2] m.Prefix.SrcAddress
- copy(buf[pos:pos+16], m.Prefix.SrcAddress.XXX_UnionData[:])
- pos += 16
- // field[1] m.IPPacketLen
- o.PutUint16(buf[pos:pos+2], uint16(m.IPPacketLen))
- pos += 2
- // field[1] m.IPPacketData
- for i := 0; i < 256; i++ {
- var x uint8
- if i < len(m.IPPacketData) {
- x = uint8(m.IPPacketData[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *MfibSignalDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TableID
- m.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Af
- m.Prefix.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Prefix.GrpAddressLength
- m.Prefix.GrpAddressLength = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.Prefix.GrpAddress
- copy(m.Prefix.GrpAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Prefix.SrcAddress
- copy(m.Prefix.SrcAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[1] m.IPPacketLen
- m.IPPacketLen = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.IPPacketData
- m.IPPacketData = make([]uint8, 256)
- for i := 0; i < len(m.IPPacketData); i++ {
- m.IPPacketData[i] = uint8(tmp[pos])
- pos += 1
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeUint32(uint32(m.Prefix.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.TableID = buf.DecodeUint32()
+ m.Prefix.Af = AddressFamily(buf.DecodeUint32())
+ m.Prefix.GrpAddressLength = buf.DecodeUint16()
+ copy(m.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16))
+ copy(m.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.IPPacketLen = buf.DecodeUint16()
+ m.IPPacketData = make([]byte, 256)
+ copy(m.IPPacketData, buf.DecodeBytes(len(m.IPPacketData)))
return nil
}
-// MfibSignalDump represents VPP binary API message 'mfib_signal_dump'.
+// MfibSignalDump defines message 'mfib_signal_dump'.
type MfibSignalDump struct{}
-func (m *MfibSignalDump) Reset() { *m = MfibSignalDump{} }
-func (*MfibSignalDump) GetMessageName() string { return "mfib_signal_dump" }
-func (*MfibSignalDump) GetCrcString() string { return "51077d14" }
-func (*MfibSignalDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MfibSignalDump) Reset() { *m = MfibSignalDump{} }
+func (*MfibSignalDump) GetMessageName() string { return "mfib_signal_dump" }
+func (*MfibSignalDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *MfibSignalDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *MfibSignalDump) Unmarshal(b []byte) error {
return nil
}
-// SetIPFlowHash represents VPP binary API message 'set_ip_flow_hash'.
+// SetIPFlowHash defines message 'set_ip_flow_hash'.
type SetIPFlowHash struct {
VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
@@ -5199,231 +3667,129 @@ type SetIPFlowHash struct {
Symmetric bool `binapi:"bool,name=symmetric" json:"symmetric,omitempty"`
}
-func (m *SetIPFlowHash) Reset() { *m = SetIPFlowHash{} }
-func (*SetIPFlowHash) GetMessageName() string { return "set_ip_flow_hash" }
-func (*SetIPFlowHash) GetCrcString() string { return "084ee09e" }
-func (*SetIPFlowHash) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SetIPFlowHash) Reset() { *m = SetIPFlowHash{} }
+func (*SetIPFlowHash) GetMessageName() string { return "set_ip_flow_hash" }
+func (*SetIPFlowHash) GetCrcString() string { return "084ee09e" }
+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
- // field[1] m.VrfID
- size += 4
- // field[1] m.IsIPv6
- size += 1
- // field[1] m.Src
- size += 1
- // field[1] m.Dst
- size += 1
- // field[1] m.Sport
- size += 1
- // field[1] m.Dport
- size += 1
- // field[1] m.Proto
- size += 1
- // field[1] m.Reverse
- size += 1
- // field[1] m.Symmetric
- size += 1
+ size += 4 // m.VrfID
+ size += 1 // m.IsIPv6
+ size += 1 // m.Src
+ size += 1 // m.Dst
+ size += 1 // m.Sport
+ size += 1 // m.Dport
+ size += 1 // m.Proto
+ size += 1 // m.Reverse
+ size += 1 // m.Symmetric
return size
}
func (m *SetIPFlowHash) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.VrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.VrfID))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Src
- if m.Src {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Dst
- if m.Dst {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Sport
- if m.Sport {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Dport
- if m.Dport {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Proto
- if m.Proto {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Reverse
- if m.Reverse {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Symmetric
- if m.Symmetric {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SetIPFlowHash) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.VrfID
- m.VrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
- // field[1] m.Src
- m.Src = tmp[pos] != 0
- pos += 1
- // field[1] m.Dst
- m.Dst = tmp[pos] != 0
- pos += 1
- // field[1] m.Sport
- m.Sport = tmp[pos] != 0
- pos += 1
- // field[1] m.Dport
- m.Dport = tmp[pos] != 0
- pos += 1
- // field[1] m.Proto
- m.Proto = tmp[pos] != 0
- pos += 1
- // field[1] m.Reverse
- m.Reverse = tmp[pos] != 0
- pos += 1
- // field[1] m.Symmetric
- m.Symmetric = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeBool(m.IsIPv6)
+ buf.EncodeBool(m.Src)
+ buf.EncodeBool(m.Dst)
+ buf.EncodeBool(m.Sport)
+ buf.EncodeBool(m.Dport)
+ buf.EncodeBool(m.Proto)
+ buf.EncodeBool(m.Reverse)
+ buf.EncodeBool(m.Symmetric)
+ return buf.Bytes(), nil
+}
+func (m *SetIPFlowHash) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.VrfID = buf.DecodeUint32()
+ m.IsIPv6 = buf.DecodeBool()
+ m.Src = buf.DecodeBool()
+ m.Dst = buf.DecodeBool()
+ m.Sport = buf.DecodeBool()
+ m.Dport = buf.DecodeBool()
+ m.Proto = buf.DecodeBool()
+ m.Reverse = buf.DecodeBool()
+ m.Symmetric = buf.DecodeBool()
return nil
}
-// SetIPFlowHashReply represents VPP binary API message 'set_ip_flow_hash_reply'.
+// SetIPFlowHashReply defines message 'set_ip_flow_hash_reply'.
type SetIPFlowHashReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SetIPFlowHashReply) Reset() { *m = SetIPFlowHashReply{} }
-func (*SetIPFlowHashReply) GetMessageName() string { return "set_ip_flow_hash_reply" }
-func (*SetIPFlowHashReply) GetCrcString() string { return "e8d4e804" }
-func (*SetIPFlowHashReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SetIPFlowHashReply) Reset() { *m = SetIPFlowHashReply{} }
+func (*SetIPFlowHashReply) GetMessageName() string { return "set_ip_flow_hash_reply" }
+func (*SetIPFlowHashReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SetIPFlowHashReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SetIPFlowHashReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// SwInterfaceIP6EnableDisable represents VPP binary API message 'sw_interface_ip6_enable_disable'.
+// SwInterfaceIP6EnableDisable defines message 'sw_interface_ip6_enable_disable'.
type SwInterfaceIP6EnableDisable struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
}
-func (m *SwInterfaceIP6EnableDisable) Reset() { *m = SwInterfaceIP6EnableDisable{} }
-func (*SwInterfaceIP6EnableDisable) GetMessageName() string { return "sw_interface_ip6_enable_disable" }
-func (*SwInterfaceIP6EnableDisable) GetCrcString() string { return "ae6cfcfb" }
-func (*SwInterfaceIP6EnableDisable) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SwInterfaceIP6EnableDisable) Reset() { *m = SwInterfaceIP6EnableDisable{} }
+func (*SwInterfaceIP6EnableDisable) GetMessageName() string { return "sw_interface_ip6_enable_disable" }
+func (*SwInterfaceIP6EnableDisable) GetCrcString() string { return "ae6cfcfb" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Enable
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
return size
}
func (m *SwInterfaceIP6EnableDisable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Enable
- if m.Enable {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceIP6EnableDisable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Enable
- m.Enable = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceIP6EnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Enable = buf.DecodeBool()
return nil
}
-// SwInterfaceIP6EnableDisableReply represents VPP binary API message 'sw_interface_ip6_enable_disable_reply'.
+// SwInterfaceIP6EnableDisableReply defines message 'sw_interface_ip6_enable_disable_reply'.
type SwInterfaceIP6EnableDisableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -5432,46 +3798,33 @@ func (m *SwInterfaceIP6EnableDisableReply) Reset() { *m = SwInterfaceIP6EnableDi
func (*SwInterfaceIP6EnableDisableReply) GetMessageName() string {
return "sw_interface_ip6_enable_disable_reply"
}
-func (*SwInterfaceIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*SwInterfaceIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SwInterfaceIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceIP6EnableDisableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
-// SwInterfaceIP6SetLinkLocalAddress represents VPP binary API message 'sw_interface_ip6_set_link_local_address'.
+// SwInterfaceIP6SetLinkLocalAddress defines message 'sw_interface_ip6_set_link_local_address'.
type SwInterfaceIP6SetLinkLocalAddress struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IP IP6Address `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
@@ -5481,62 +3834,36 @@ func (m *SwInterfaceIP6SetLinkLocalAddress) Reset() { *m = SwInterfaceIP6SetLink
func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageName() string {
return "sw_interface_ip6_set_link_local_address"
}
-func (*SwInterfaceIP6SetLinkLocalAddress) GetCrcString() string { return "2931d9fa" }
-func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageType() api.MessageType { return api.RequestMessage }
+func (*SwInterfaceIP6SetLinkLocalAddress) GetCrcString() string { return "2931d9fa" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IP
- size += 16
+ size += 4 // m.SwIfIndex
+ size += 1 * 16 // m.IP
return size
}
func (m *SwInterfaceIP6SetLinkLocalAddress) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IP
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.IP) {
- x = uint8(m.IP[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SwInterfaceIP6SetLinkLocalAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IP
- for i := 0; i < len(m.IP); i++ {
- m.IP[i] = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBytes(m.IP[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceIP6SetLinkLocalAddress) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.IP[:], buf.DecodeBytes(16))
return nil
}
-// SwInterfaceIP6SetLinkLocalAddressReply represents VPP binary API message 'sw_interface_ip6_set_link_local_address_reply'.
+// SwInterfaceIP6SetLinkLocalAddressReply defines message 'sw_interface_ip6_set_link_local_address_reply'.
type SwInterfaceIP6SetLinkLocalAddressReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -5552,104 +3879,89 @@ 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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SwInterfaceIP6SetLinkLocalAddressReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceIP6SetLinkLocalAddressReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
return nil
}
func init() { file_ip_binapi_init() }
func file_ip_binapi_init() {
- api.RegisterMessage((*IoamDisable)(nil), "ip.IoamDisable")
- api.RegisterMessage((*IoamDisableReply)(nil), "ip.IoamDisableReply")
- api.RegisterMessage((*IoamEnable)(nil), "ip.IoamEnable")
- api.RegisterMessage((*IoamEnableReply)(nil), "ip.IoamEnableReply")
- api.RegisterMessage((*IPAddressDetails)(nil), "ip.IPAddressDetails")
- api.RegisterMessage((*IPAddressDump)(nil), "ip.IPAddressDump")
- api.RegisterMessage((*IPContainerProxyAddDel)(nil), "ip.IPContainerProxyAddDel")
- api.RegisterMessage((*IPContainerProxyAddDelReply)(nil), "ip.IPContainerProxyAddDelReply")
- api.RegisterMessage((*IPContainerProxyDetails)(nil), "ip.IPContainerProxyDetails")
- api.RegisterMessage((*IPContainerProxyDump)(nil), "ip.IPContainerProxyDump")
- api.RegisterMessage((*IPDetails)(nil), "ip.IPDetails")
- api.RegisterMessage((*IPDump)(nil), "ip.IPDump")
- api.RegisterMessage((*IPMrouteAddDel)(nil), "ip.IPMrouteAddDel")
- api.RegisterMessage((*IPMrouteAddDelReply)(nil), "ip.IPMrouteAddDelReply")
- api.RegisterMessage((*IPMrouteDetails)(nil), "ip.IPMrouteDetails")
- api.RegisterMessage((*IPMrouteDump)(nil), "ip.IPMrouteDump")
- api.RegisterMessage((*IPMtableDetails)(nil), "ip.IPMtableDetails")
- api.RegisterMessage((*IPMtableDump)(nil), "ip.IPMtableDump")
- api.RegisterMessage((*IPPuntPolice)(nil), "ip.IPPuntPolice")
- api.RegisterMessage((*IPPuntPoliceReply)(nil), "ip.IPPuntPoliceReply")
- api.RegisterMessage((*IPPuntRedirect)(nil), "ip.IPPuntRedirect")
- api.RegisterMessage((*IPPuntRedirectDetails)(nil), "ip.IPPuntRedirectDetails")
- api.RegisterMessage((*IPPuntRedirectDump)(nil), "ip.IPPuntRedirectDump")
- api.RegisterMessage((*IPPuntRedirectReply)(nil), "ip.IPPuntRedirectReply")
- api.RegisterMessage((*IPReassemblyEnableDisable)(nil), "ip.IPReassemblyEnableDisable")
- api.RegisterMessage((*IPReassemblyEnableDisableReply)(nil), "ip.IPReassemblyEnableDisableReply")
- api.RegisterMessage((*IPReassemblyGet)(nil), "ip.IPReassemblyGet")
- api.RegisterMessage((*IPReassemblyGetReply)(nil), "ip.IPReassemblyGetReply")
- api.RegisterMessage((*IPReassemblySet)(nil), "ip.IPReassemblySet")
- api.RegisterMessage((*IPReassemblySetReply)(nil), "ip.IPReassemblySetReply")
- api.RegisterMessage((*IPRouteAddDel)(nil), "ip.IPRouteAddDel")
- api.RegisterMessage((*IPRouteAddDelReply)(nil), "ip.IPRouteAddDelReply")
- api.RegisterMessage((*IPRouteDetails)(nil), "ip.IPRouteDetails")
- api.RegisterMessage((*IPRouteDump)(nil), "ip.IPRouteDump")
- api.RegisterMessage((*IPSourceAndPortRangeCheckAddDel)(nil), "ip.IPSourceAndPortRangeCheckAddDel")
- api.RegisterMessage((*IPSourceAndPortRangeCheckAddDelReply)(nil), "ip.IPSourceAndPortRangeCheckAddDelReply")
- api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), "ip.IPSourceAndPortRangeCheckInterfaceAddDel")
- api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), "ip.IPSourceAndPortRangeCheckInterfaceAddDelReply")
- api.RegisterMessage((*IPSourceCheckInterfaceAddDel)(nil), "ip.IPSourceCheckInterfaceAddDel")
- api.RegisterMessage((*IPSourceCheckInterfaceAddDelReply)(nil), "ip.IPSourceCheckInterfaceAddDelReply")
- api.RegisterMessage((*IPTableAddDel)(nil), "ip.IPTableAddDel")
- api.RegisterMessage((*IPTableAddDelReply)(nil), "ip.IPTableAddDelReply")
- api.RegisterMessage((*IPTableDetails)(nil), "ip.IPTableDetails")
- api.RegisterMessage((*IPTableDump)(nil), "ip.IPTableDump")
- api.RegisterMessage((*IPTableFlush)(nil), "ip.IPTableFlush")
- api.RegisterMessage((*IPTableFlushReply)(nil), "ip.IPTableFlushReply")
- api.RegisterMessage((*IPTableReplaceBegin)(nil), "ip.IPTableReplaceBegin")
- api.RegisterMessage((*IPTableReplaceBeginReply)(nil), "ip.IPTableReplaceBeginReply")
- api.RegisterMessage((*IPTableReplaceEnd)(nil), "ip.IPTableReplaceEnd")
- api.RegisterMessage((*IPTableReplaceEndReply)(nil), "ip.IPTableReplaceEndReply")
- api.RegisterMessage((*IPUnnumberedDetails)(nil), "ip.IPUnnumberedDetails")
- api.RegisterMessage((*IPUnnumberedDump)(nil), "ip.IPUnnumberedDump")
- api.RegisterMessage((*MfibSignalDetails)(nil), "ip.MfibSignalDetails")
- api.RegisterMessage((*MfibSignalDump)(nil), "ip.MfibSignalDump")
- api.RegisterMessage((*SetIPFlowHash)(nil), "ip.SetIPFlowHash")
- api.RegisterMessage((*SetIPFlowHashReply)(nil), "ip.SetIPFlowHashReply")
- api.RegisterMessage((*SwInterfaceIP6EnableDisable)(nil), "ip.SwInterfaceIP6EnableDisable")
- api.RegisterMessage((*SwInterfaceIP6EnableDisableReply)(nil), "ip.SwInterfaceIP6EnableDisableReply")
- api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddress)(nil), "ip.SwInterfaceIP6SetLinkLocalAddress")
- api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddressReply)(nil), "ip.SwInterfaceIP6SetLinkLocalAddressReply")
+ api.RegisterMessage((*IoamDisable)(nil), "ioam_disable_6b16a45e")
+ api.RegisterMessage((*IoamDisableReply)(nil), "ioam_disable_reply_e8d4e804")
+ api.RegisterMessage((*IoamEnable)(nil), "ioam_enable_51ccd868")
+ api.RegisterMessage((*IoamEnableReply)(nil), "ioam_enable_reply_e8d4e804")
+ api.RegisterMessage((*IPAddressDetails)(nil), "ip_address_details_b1199745")
+ api.RegisterMessage((*IPAddressDump)(nil), "ip_address_dump_2d033de4")
+ api.RegisterMessage((*IPContainerProxyAddDel)(nil), "ip_container_proxy_add_del_91189f40")
+ api.RegisterMessage((*IPContainerProxyAddDelReply)(nil), "ip_container_proxy_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPContainerProxyDetails)(nil), "ip_container_proxy_details_0ee460e8")
+ api.RegisterMessage((*IPContainerProxyDump)(nil), "ip_container_proxy_dump_51077d14")
+ api.RegisterMessage((*IPDetails)(nil), "ip_details_eb152d07")
+ api.RegisterMessage((*IPDump)(nil), "ip_dump_98d231ca")
+ api.RegisterMessage((*IPMrouteAddDel)(nil), "ip_mroute_add_del_f6627d17")
+ api.RegisterMessage((*IPMrouteAddDelReply)(nil), "ip_mroute_add_del_reply_1992deab")
+ api.RegisterMessage((*IPMrouteDetails)(nil), "ip_mroute_details_c1cb4b44")
+ api.RegisterMessage((*IPMrouteDump)(nil), "ip_mroute_dump_b9d2e09e")
+ api.RegisterMessage((*IPMtableDetails)(nil), "ip_mtable_details_b9d2e09e")
+ api.RegisterMessage((*IPMtableDump)(nil), "ip_mtable_dump_51077d14")
+ api.RegisterMessage((*IPPuntPolice)(nil), "ip_punt_police_db867cea")
+ api.RegisterMessage((*IPPuntPoliceReply)(nil), "ip_punt_police_reply_e8d4e804")
+ api.RegisterMessage((*IPPuntRedirect)(nil), "ip_punt_redirect_a9a5592c")
+ api.RegisterMessage((*IPPuntRedirectDetails)(nil), "ip_punt_redirect_details_3924f5d3")
+ api.RegisterMessage((*IPPuntRedirectDump)(nil), "ip_punt_redirect_dump_2d033de4")
+ api.RegisterMessage((*IPPuntRedirectReply)(nil), "ip_punt_redirect_reply_e8d4e804")
+ api.RegisterMessage((*IPReassemblyEnableDisable)(nil), "ip_reassembly_enable_disable_885c85a6")
+ api.RegisterMessage((*IPReassemblyEnableDisableReply)(nil), "ip_reassembly_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*IPReassemblyGet)(nil), "ip_reassembly_get_ea13ff63")
+ api.RegisterMessage((*IPReassemblyGetReply)(nil), "ip_reassembly_get_reply_d5eb8d34")
+ api.RegisterMessage((*IPReassemblySet)(nil), "ip_reassembly_set_16467d25")
+ api.RegisterMessage((*IPReassemblySetReply)(nil), "ip_reassembly_set_reply_e8d4e804")
+ api.RegisterMessage((*IPRouteAddDel)(nil), "ip_route_add_del_c1ff832d")
+ api.RegisterMessage((*IPRouteAddDelReply)(nil), "ip_route_add_del_reply_1992deab")
+ api.RegisterMessage((*IPRouteDetails)(nil), "ip_route_details_d1ffaae1")
+ api.RegisterMessage((*IPRouteDump)(nil), "ip_route_dump_b9d2e09e")
+ api.RegisterMessage((*IPSourceAndPortRangeCheckAddDel)(nil), "ip_source_and_port_range_check_add_del_8bfc76f2")
+ api.RegisterMessage((*IPSourceAndPortRangeCheckAddDelReply)(nil), "ip_source_and_port_range_check_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), "ip_source_and_port_range_check_interface_add_del_e1ba8987")
+ api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), "ip_source_and_port_range_check_interface_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPSourceCheckInterfaceAddDel)(nil), "ip_source_check_interface_add_del_6612356b")
+ api.RegisterMessage((*IPSourceCheckInterfaceAddDelReply)(nil), "ip_source_check_interface_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPTableAddDel)(nil), "ip_table_add_del_0ffdaec0")
+ api.RegisterMessage((*IPTableAddDelReply)(nil), "ip_table_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPTableDetails)(nil), "ip_table_details_c79fca0f")
+ api.RegisterMessage((*IPTableDump)(nil), "ip_table_dump_51077d14")
+ api.RegisterMessage((*IPTableFlush)(nil), "ip_table_flush_b9d2e09e")
+ api.RegisterMessage((*IPTableFlushReply)(nil), "ip_table_flush_reply_e8d4e804")
+ api.RegisterMessage((*IPTableReplaceBegin)(nil), "ip_table_replace_begin_b9d2e09e")
+ api.RegisterMessage((*IPTableReplaceBeginReply)(nil), "ip_table_replace_begin_reply_e8d4e804")
+ api.RegisterMessage((*IPTableReplaceEnd)(nil), "ip_table_replace_end_b9d2e09e")
+ api.RegisterMessage((*IPTableReplaceEndReply)(nil), "ip_table_replace_end_reply_e8d4e804")
+ api.RegisterMessage((*IPUnnumberedDetails)(nil), "ip_unnumbered_details_aa12a483")
+ api.RegisterMessage((*IPUnnumberedDump)(nil), "ip_unnumbered_dump_f9e6675e")
+ api.RegisterMessage((*MfibSignalDetails)(nil), "mfib_signal_details_64398a9a")
+ api.RegisterMessage((*MfibSignalDump)(nil), "mfib_signal_dump_51077d14")
+ api.RegisterMessage((*SetIPFlowHash)(nil), "set_ip_flow_hash_084ee09e")
+ api.RegisterMessage((*SetIPFlowHashReply)(nil), "set_ip_flow_hash_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceIP6EnableDisable)(nil), "sw_interface_ip6_enable_disable_ae6cfcfb")
+ api.RegisterMessage((*SwInterfaceIP6EnableDisableReply)(nil), "sw_interface_ip6_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddress)(nil), "sw_interface_ip6_set_link_local_address_2931d9fa")
+ api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddressReply)(nil), "sw_interface_ip6_set_link_local_address_reply_e8d4e804")
}
// Messages returns list of all messages in this module.
@@ -5717,14 +4029,3 @@ func AllMessages() []api.Message {
(*SwInterfaceIP6SetLinkLocalAddressReply)(nil),
}
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
diff --git a/internal/testbinapi/binapi2001/ip/ip_rpc.ba.go b/internal/testbinapi/binapi2001/ip/ip_rpc.ba.go
index e0580d5..88dbb6b 100644
--- a/internal/testbinapi/binapi2001/ip/ip_rpc.ba.go
+++ b/internal/testbinapi/binapi2001/ip/ip_rpc.ba.go
@@ -4,370 +4,345 @@ package ip
import (
"context"
- "io"
-
+ "fmt"
api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
)
-// RPCService represents RPC service API for ip module.
+// RPCService defines RPC service ip.
type RPCService interface {
- DumpIPAddress(ctx context.Context, in *IPAddressDump) (RPCService_DumpIPAddressClient, error)
- DumpIPContainerProxy(ctx context.Context, in *IPContainerProxyDump) (RPCService_DumpIPContainerProxyClient, error)
- DumpIP(ctx context.Context, in *IPDump) (RPCService_DumpIPClient, error)
- DumpIPMroute(ctx context.Context, in *IPMrouteDump) (RPCService_DumpIPMrouteClient, error)
- DumpIPMtable(ctx context.Context, in *IPMtableDump) (RPCService_DumpIPMtableClient, error)
- DumpIPPuntRedirect(ctx context.Context, in *IPPuntRedirectDump) (RPCService_DumpIPPuntRedirectClient, error)
- DumpIPRoute(ctx context.Context, in *IPRouteDump) (RPCService_DumpIPRouteClient, error)
- DumpIPTable(ctx context.Context, in *IPTableDump) (RPCService_DumpIPTableClient, error)
- DumpIPUnnumbered(ctx context.Context, in *IPUnnumberedDump) (RPCService_DumpIPUnnumberedClient, error)
- DumpMfibSignal(ctx context.Context, in *MfibSignalDump) (RPCService_DumpMfibSignalClient, error)
IoamDisable(ctx context.Context, in *IoamDisable) (*IoamDisableReply, error)
IoamEnable(ctx context.Context, in *IoamEnable) (*IoamEnableReply, error)
+ IPAddressDump(ctx context.Context, in *IPAddressDump) (RPCService_IPAddressDumpClient, error)
IPContainerProxyAddDel(ctx context.Context, in *IPContainerProxyAddDel) (*IPContainerProxyAddDelReply, error)
+ IPContainerProxyDump(ctx context.Context, in *IPContainerProxyDump) (RPCService_IPContainerProxyDumpClient, error)
+ IPDump(ctx context.Context, in *IPDump) (RPCService_IPDumpClient, error)
IPMrouteAddDel(ctx context.Context, in *IPMrouteAddDel) (*IPMrouteAddDelReply, error)
+ IPMrouteDump(ctx context.Context, in *IPMrouteDump) (RPCService_IPMrouteDumpClient, error)
+ IPMtableDump(ctx context.Context, in *IPMtableDump) (RPCService_IPMtableDumpClient, error)
IPPuntPolice(ctx context.Context, in *IPPuntPolice) (*IPPuntPoliceReply, error)
IPPuntRedirect(ctx context.Context, in *IPPuntRedirect) (*IPPuntRedirectReply, error)
+ IPPuntRedirectDump(ctx context.Context, in *IPPuntRedirectDump) (RPCService_IPPuntRedirectDumpClient, error)
IPReassemblyEnableDisable(ctx context.Context, in *IPReassemblyEnableDisable) (*IPReassemblyEnableDisableReply, error)
IPReassemblyGet(ctx context.Context, in *IPReassemblyGet) (*IPReassemblyGetReply, error)
IPReassemblySet(ctx context.Context, in *IPReassemblySet) (*IPReassemblySetReply, error)
IPRouteAddDel(ctx context.Context, in *IPRouteAddDel) (*IPRouteAddDelReply, error)
+ IPRouteDump(ctx context.Context, in *IPRouteDump) (RPCService_IPRouteDumpClient, error)
IPSourceAndPortRangeCheckAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckAddDel) (*IPSourceAndPortRangeCheckAddDelReply, error)
IPSourceAndPortRangeCheckInterfaceAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckInterfaceAddDel) (*IPSourceAndPortRangeCheckInterfaceAddDelReply, error)
IPSourceCheckInterfaceAddDel(ctx context.Context, in *IPSourceCheckInterfaceAddDel) (*IPSourceCheckInterfaceAddDelReply, error)
IPTableAddDel(ctx context.Context, in *IPTableAddDel) (*IPTableAddDelReply, error)
+ IPTableDump(ctx context.Context, in *IPTableDump) (RPCService_IPTableDumpClient, error)
IPTableFlush(ctx context.Context, in *IPTableFlush) (*IPTableFlushReply, error)
IPTableReplaceBegin(ctx context.Context, in *IPTableReplaceBegin) (*IPTableReplaceBeginReply, error)
IPTableReplaceEnd(ctx context.Context, in *IPTableReplaceEnd) (*IPTableReplaceEndReply, error)
+ IPUnnumberedDump(ctx context.Context, in *IPUnnumberedDump) (RPCService_IPUnnumberedDumpClient, error)
+ MfibSignalDump(ctx context.Context, in *MfibSignalDump) (RPCService_MfibSignalDumpClient, error)
SetIPFlowHash(ctx context.Context, in *SetIPFlowHash) (*SetIPFlowHashReply, error)
SwInterfaceIP6EnableDisable(ctx context.Context, in *SwInterfaceIP6EnableDisable) (*SwInterfaceIP6EnableDisableReply, error)
SwInterfaceIP6SetLinkLocalAddress(ctx context.Context, in *SwInterfaceIP6SetLinkLocalAddress) (*SwInterfaceIP6SetLinkLocalAddressReply, error)
}
type serviceClient struct {
- ch api.Channel
+ conn api.Connection
}
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
}
-func (c *serviceClient) DumpIPAddress(ctx context.Context, in *IPAddressDump) (RPCService_DumpIPAddressClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPAddressClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPAddressClient interface {
- Recv() (*IPAddressDetails, error)
+func (c *serviceClient) IoamDisable(ctx context.Context, in *IoamDisable) (*IoamDisableReply, error) {
+ out := new(IoamDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-type serviceClient_DumpIPAddressClient struct {
- api.MultiRequestCtx
+func (c *serviceClient) IoamEnable(ctx context.Context, in *IoamEnable) (*IoamEnableReply, error) {
+ out := new(IoamEnableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-func (c *serviceClient_DumpIPAddressClient) Recv() (*IPAddressDetails, error) {
- m := new(IPAddressDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) IPAddressDump(ctx context.Context, in *IPAddressDump) (RPCService_IPAddressDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
+ x := &serviceClient_IPAddressDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
}
- return m, nil
-}
-
-func (c *serviceClient) DumpIPContainerProxy(ctx context.Context, in *IPContainerProxyDump) (RPCService_DumpIPContainerProxyClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPContainerProxyClient{stream}
return x, nil
}
-type RPCService_DumpIPContainerProxyClient interface {
- Recv() (*IPContainerProxyDetails, error)
+type RPCService_IPAddressDumpClient interface {
+ Recv() (*IPAddressDetails, error)
+ api.Stream
}
-type serviceClient_DumpIPContainerProxyClient struct {
- api.MultiRequestCtx
+type serviceClient_IPAddressDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpIPContainerProxyClient) Recv() (*IPContainerProxyDetails, error) {
- m := new(IPContainerProxyDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_IPAddressDumpClient) Recv() (*IPAddressDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *IPAddressDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
-}
-
-func (c *serviceClient) DumpIP(ctx context.Context, in *IPDump) (RPCService_DumpIPClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPClient{stream}
- return x, nil
}
-type RPCService_DumpIPClient interface {
- Recv() (*IPDetails, error)
-}
-
-type serviceClient_DumpIPClient struct {
- api.MultiRequestCtx
+func (c *serviceClient) IPContainerProxyAddDel(ctx context.Context, in *IPContainerProxyAddDel) (*IPContainerProxyAddDelReply, error) {
+ out := new(IPContainerProxyAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-func (c *serviceClient_DumpIPClient) Recv() (*IPDetails, error) {
- m := new(IPDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) IPContainerProxyDump(ctx context.Context, in *IPContainerProxyDump) (RPCService_IPContainerProxyDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
+ x := &serviceClient_IPContainerProxyDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
}
- return m, nil
-}
-
-func (c *serviceClient) DumpIPMroute(ctx context.Context, in *IPMrouteDump) (RPCService_DumpIPMrouteClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPMrouteClient{stream}
return x, nil
}
-type RPCService_DumpIPMrouteClient interface {
- Recv() (*IPMrouteDetails, error)
+type RPCService_IPContainerProxyDumpClient interface {
+ Recv() (*IPContainerProxyDetails, error)
+ api.Stream
}
-type serviceClient_DumpIPMrouteClient struct {
- api.MultiRequestCtx
+type serviceClient_IPContainerProxyDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpIPMrouteClient) Recv() (*IPMrouteDetails, error) {
- m := new(IPMrouteDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_IPContainerProxyDumpClient) Recv() (*IPContainerProxyDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *IPContainerProxyDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
-}
-
-func (c *serviceClient) DumpIPMtable(ctx context.Context, in *IPMtableDump) (RPCService_DumpIPMtableClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPMtableClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPMtableClient interface {
- Recv() (*IPMtableDetails, error)
}
-type serviceClient_DumpIPMtableClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPMtableClient) Recv() (*IPMtableDetails, error) {
- m := new(IPMtableDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) IPDump(ctx context.Context, in *IPDump) (RPCService_IPDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
+ x := &serviceClient_IPDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
}
- return m, nil
-}
-
-func (c *serviceClient) DumpIPPuntRedirect(ctx context.Context, in *IPPuntRedirectDump) (RPCService_DumpIPPuntRedirectClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPPuntRedirectClient{stream}
return x, nil
}
-type RPCService_DumpIPPuntRedirectClient interface {
- Recv() (*IPPuntRedirectDetails, error)
+type RPCService_IPDumpClient interface {
+ Recv() (*IPDetails, error)
+ api.Stream
}
-type serviceClient_DumpIPPuntRedirectClient struct {
- api.MultiRequestCtx
+type serviceClient_IPDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpIPPuntRedirectClient) Recv() (*IPPuntRedirectDetails, error) {
- m := new(IPPuntRedirectDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_IPDumpClient) Recv() (*IPDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *IPDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
}
-func (c *serviceClient) DumpIPRoute(ctx context.Context, in *IPRouteDump) (RPCService_DumpIPRouteClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPRouteClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPRouteClient interface {
- Recv() (*IPRouteDetails, error)
-}
-
-type serviceClient_DumpIPRouteClient struct {
- api.MultiRequestCtx
+func (c *serviceClient) IPMrouteAddDel(ctx context.Context, in *IPMrouteAddDel) (*IPMrouteAddDelReply, error) {
+ out := new(IPMrouteAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-func (c *serviceClient_DumpIPRouteClient) Recv() (*IPRouteDetails, error) {
- m := new(IPRouteDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) IPMrouteDump(ctx context.Context, in *IPMrouteDump) (RPCService_IPMrouteDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
+ x := &serviceClient_IPMrouteDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
}
- return m, nil
-}
-
-func (c *serviceClient) DumpIPTable(ctx context.Context, in *IPTableDump) (RPCService_DumpIPTableClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPTableClient{stream}
return x, nil
}
-type RPCService_DumpIPTableClient interface {
- Recv() (*IPTableDetails, error)
+type RPCService_IPMrouteDumpClient interface {
+ Recv() (*IPMrouteDetails, error)
+ api.Stream
}
-type serviceClient_DumpIPTableClient struct {
- api.MultiRequestCtx
+type serviceClient_IPMrouteDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpIPTableClient) Recv() (*IPTableDetails, error) {
- m := new(IPTableDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_IPMrouteDumpClient) Recv() (*IPMrouteDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *IPMrouteDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
}
-func (c *serviceClient) DumpIPUnnumbered(ctx context.Context, in *IPUnnumberedDump) (RPCService_DumpIPUnnumberedClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPUnnumberedClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPUnnumberedClient interface {
- Recv() (*IPUnnumberedDetails, error)
-}
-
-type serviceClient_DumpIPUnnumberedClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPUnnumberedClient) Recv() (*IPUnnumberedDetails, error) {
- m := new(IPUnnumberedDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) IPMtableDump(ctx context.Context, in *IPMtableDump) (RPCService_IPMtableDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
+ x := &serviceClient_IPMtableDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
}
- return m, nil
-}
-
-func (c *serviceClient) DumpMfibSignal(ctx context.Context, in *MfibSignalDump) (RPCService_DumpMfibSignalClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMfibSignalClient{stream}
return x, nil
}
-type RPCService_DumpMfibSignalClient interface {
- Recv() (*MfibSignalDetails, error)
+type RPCService_IPMtableDumpClient interface {
+ Recv() (*IPMtableDetails, error)
+ api.Stream
}
-type serviceClient_DumpMfibSignalClient struct {
- api.MultiRequestCtx
+type serviceClient_IPMtableDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpMfibSignalClient) Recv() (*MfibSignalDetails, error) {
- m := new(MfibSignalDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_IPMtableDumpClient) Recv() (*IPMtableDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *IPMtableDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
}
-func (c *serviceClient) IoamDisable(ctx context.Context, in *IoamDisable) (*IoamDisableReply, error) {
- out := new(IoamDisableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+func (c *serviceClient) IPPuntPolice(ctx context.Context, in *IPPuntPolice) (*IPPuntPoliceReply, error) {
+ out := new(IPPuntPoliceReply)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
-func (c *serviceClient) IoamEnable(ctx context.Context, in *IoamEnable) (*IoamEnableReply, error) {
- out := new(IoamEnableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+func (c *serviceClient) IPPuntRedirect(ctx context.Context, in *IPPuntRedirect) (*IPPuntRedirectReply, error) {
+ out := new(IPPuntRedirectReply)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
-func (c *serviceClient) IPContainerProxyAddDel(ctx context.Context, in *IPContainerProxyAddDel) (*IPContainerProxyAddDelReply, error) {
- out := new(IPContainerProxyAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+func (c *serviceClient) IPPuntRedirectDump(ctx context.Context, in *IPPuntRedirectDump) (RPCService_IPPuntRedirectDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- return out, nil
-}
-
-func (c *serviceClient) IPMrouteAddDel(ctx context.Context, in *IPMrouteAddDel) (*IPMrouteAddDelReply, error) {
- out := new(IPMrouteAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
+ x := &serviceClient_IPPuntRedirectDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
return nil, err
}
- return out, nil
-}
-
-func (c *serviceClient) IPPuntPolice(ctx context.Context, in *IPPuntPolice) (*IPPuntPoliceReply, error) {
- out := new(IPPuntPoliceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
return nil, err
}
- return out, nil
+ return x, nil
}
-func (c *serviceClient) IPPuntRedirect(ctx context.Context, in *IPPuntRedirect) (*IPPuntRedirectReply, error) {
- out := new(IPPuntRedirectReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+type RPCService_IPPuntRedirectDumpClient interface {
+ Recv() (*IPPuntRedirectDetails, error)
+ api.Stream
+}
+
+type serviceClient_IPPuntRedirectDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IPPuntRedirectDumpClient) Recv() (*IPPuntRedirectDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- return out, nil
+ switch m := msg.(type) {
+ case *IPPuntRedirectDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
}
func (c *serviceClient) IPReassemblyEnableDisable(ctx context.Context, in *IPReassemblyEnableDisable) (*IPReassemblyEnableDisableReply, error) {
out := new(IPReassemblyEnableDisableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -376,7 +351,7 @@ func (c *serviceClient) IPReassemblyEnableDisable(ctx context.Context, in *IPRea
func (c *serviceClient) IPReassemblyGet(ctx context.Context, in *IPReassemblyGet) (*IPReassemblyGetReply, error) {
out := new(IPReassemblyGetReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -385,7 +360,7 @@ func (c *serviceClient) IPReassemblyGet(ctx context.Context, in *IPReassemblyGet
func (c *serviceClient) IPReassemblySet(ctx context.Context, in *IPReassemblySet) (*IPReassemblySetReply, error) {
out := new(IPReassemblySetReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -394,16 +369,55 @@ func (c *serviceClient) IPReassemblySet(ctx context.Context, in *IPReassemblySet
func (c *serviceClient) IPRouteAddDel(ctx context.Context, in *IPRouteAddDel) (*IPRouteAddDelReply, error) {
out := new(IPRouteAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
+func (c *serviceClient) IPRouteDump(ctx context.Context, in *IPRouteDump) (RPCService_IPRouteDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IPRouteDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IPRouteDumpClient interface {
+ Recv() (*IPRouteDetails, error)
+ api.Stream
+}
+
+type serviceClient_IPRouteDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IPRouteDumpClient) Recv() (*IPRouteDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IPRouteDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
func (c *serviceClient) IPSourceAndPortRangeCheckAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckAddDel) (*IPSourceAndPortRangeCheckAddDelReply, error) {
out := new(IPSourceAndPortRangeCheckAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -412,7 +426,7 @@ func (c *serviceClient) IPSourceAndPortRangeCheckAddDel(ctx context.Context, in
func (c *serviceClient) IPSourceAndPortRangeCheckInterfaceAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckInterfaceAddDel) (*IPSourceAndPortRangeCheckInterfaceAddDelReply, error) {
out := new(IPSourceAndPortRangeCheckInterfaceAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -421,7 +435,7 @@ func (c *serviceClient) IPSourceAndPortRangeCheckInterfaceAddDel(ctx context.Con
func (c *serviceClient) IPSourceCheckInterfaceAddDel(ctx context.Context, in *IPSourceCheckInterfaceAddDel) (*IPSourceCheckInterfaceAddDelReply, error) {
out := new(IPSourceCheckInterfaceAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -430,16 +444,55 @@ func (c *serviceClient) IPSourceCheckInterfaceAddDel(ctx context.Context, in *IP
func (c *serviceClient) IPTableAddDel(ctx context.Context, in *IPTableAddDel) (*IPTableAddDelReply, error) {
out := new(IPTableAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
+func (c *serviceClient) IPTableDump(ctx context.Context, in *IPTableDump) (RPCService_IPTableDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IPTableDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IPTableDumpClient interface {
+ Recv() (*IPTableDetails, error)
+ api.Stream
+}
+
+type serviceClient_IPTableDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IPTableDumpClient) Recv() (*IPTableDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IPTableDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
func (c *serviceClient) IPTableFlush(ctx context.Context, in *IPTableFlush) (*IPTableFlushReply, error) {
out := new(IPTableFlushReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -448,7 +501,7 @@ func (c *serviceClient) IPTableFlush(ctx context.Context, in *IPTableFlush) (*IP
func (c *serviceClient) IPTableReplaceBegin(ctx context.Context, in *IPTableReplaceBegin) (*IPTableReplaceBeginReply, error) {
out := new(IPTableReplaceBeginReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -457,16 +510,94 @@ func (c *serviceClient) IPTableReplaceBegin(ctx context.Context, in *IPTableRepl
func (c *serviceClient) IPTableReplaceEnd(ctx context.Context, in *IPTableReplaceEnd) (*IPTableReplaceEndReply, error) {
out := new(IPTableReplaceEndReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
+func (c *serviceClient) IPUnnumberedDump(ctx context.Context, in *IPUnnumberedDump) (RPCService_IPUnnumberedDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IPUnnumberedDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IPUnnumberedDumpClient interface {
+ Recv() (*IPUnnumberedDetails, error)
+ api.Stream
+}
+
+type serviceClient_IPUnnumberedDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IPUnnumberedDumpClient) Recv() (*IPUnnumberedDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IPUnnumberedDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) MfibSignalDump(ctx context.Context, in *MfibSignalDump) (RPCService_MfibSignalDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_MfibSignalDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_MfibSignalDumpClient interface {
+ Recv() (*MfibSignalDetails, error)
+ api.Stream
+}
+
+type serviceClient_MfibSignalDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MfibSignalDumpClient) Recv() (*MfibSignalDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *MfibSignalDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
func (c *serviceClient) SetIPFlowHash(ctx context.Context, in *SetIPFlowHash) (*SetIPFlowHashReply, error) {
out := new(SetIPFlowHashReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -475,7 +606,7 @@ func (c *serviceClient) SetIPFlowHash(ctx context.Context, in *SetIPFlowHash) (*
func (c *serviceClient) SwInterfaceIP6EnableDisable(ctx context.Context, in *SwInterfaceIP6EnableDisable) (*SwInterfaceIP6EnableDisableReply, error) {
out := new(SwInterfaceIP6EnableDisableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -484,14 +615,9 @@ func (c *serviceClient) SwInterfaceIP6EnableDisable(ctx context.Context, in *SwI
func (c *serviceClient) SwInterfaceIP6SetLinkLocalAddress(ctx context.Context, in *SwInterfaceIP6SetLinkLocalAddress) (*SwInterfaceIP6SetLinkLocalAddressReply, error) {
out := new(SwInterfaceIP6SetLinkLocalAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/internal/testbinapi/binapi2001/ip6_nd/ip6_nd.ba.go b/internal/testbinapi/binapi2001/ip6_nd/ip6_nd.ba.go
new file mode 100644
index 0000000..e21f2d3
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ip6_nd/ip6_nd.ba.go
@@ -0,0 +1,1520 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/ip6_nd.api.json
+
+// Package ip6_nd contains generated bindings for API file ip6_nd.api.
+//
+// Contents:
+// 6 aliases
+// 10 enums
+// 7 structs
+// 1 union
+// 13 messages
+//
+package ip6_nd
+
+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 = "ip6_nd"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xbb8ff0e9
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6RaPrefixInfo defines type 'ip6_ra_prefix_info'.
+type IP6RaPrefixInfo struct {
+ Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
+ Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"`
+ ValidTime uint32 `binapi:"u32,name=valid_time" json:"valid_time,omitempty"`
+ PreferredTime uint32 `binapi:"u32,name=preferred_time" json:"preferred_time,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// IP6RaEvent defines message 'ip6_ra_event'.
+type IP6RaEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ RouterAddr IP6Address `binapi:"ip6_address,name=router_addr" json:"router_addr,omitempty"`
+ CurrentHopLimit uint8 `binapi:"u8,name=current_hop_limit" json:"current_hop_limit,omitempty"`
+ Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"`
+ RouterLifetimeInSec uint16 `binapi:"u16,name=router_lifetime_in_sec" json:"router_lifetime_in_sec,omitempty"`
+ NeighborReachableTimeInMsec uint32 `binapi:"u32,name=neighbor_reachable_time_in_msec" json:"neighbor_reachable_time_in_msec,omitempty"`
+ TimeInMsecBetweenRetransmittedNeighborSolicitations uint32 `binapi:"u32,name=time_in_msec_between_retransmitted_neighbor_solicitations" json:"time_in_msec_between_retransmitted_neighbor_solicitations,omitempty"`
+ NPrefixes uint32 `binapi:"u32,name=n_prefixes" json:"-"`
+ Prefixes []IP6RaPrefixInfo `binapi:"ip6_ra_prefix_info[n_prefixes],name=prefixes" json:"prefixes,omitempty"`
+}
+
+func (m *IP6RaEvent) Reset() { *m = IP6RaEvent{} }
+func (*IP6RaEvent) GetMessageName() string { return "ip6_ra_event" }
+func (*IP6RaEvent) GetCrcString() string { return "47e8cfbe" }
+func (*IP6RaEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *IP6RaEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.SwIfIndex
+ size += 1 * 16 // m.RouterAddr
+ size += 1 // m.CurrentHopLimit
+ size += 1 // m.Flags
+ size += 2 // m.RouterLifetimeInSec
+ size += 4 // m.NeighborReachableTimeInMsec
+ size += 4 // m.TimeInMsecBetweenRetransmittedNeighborSolicitations
+ size += 4 // m.NPrefixes
+ for j1 := 0; j1 < len(m.Prefixes); j1++ {
+ var s1 IP6RaPrefixInfo
+ _ = s1
+ if j1 < len(m.Prefixes) {
+ s1 = m.Prefixes[j1]
+ }
+ size += 4 // s1.Prefix.Address.Af
+ size += 1 * 16 // s1.Prefix.Address.Un
+ size += 1 // s1.Prefix.Len
+ size += 1 // s1.Flags
+ size += 4 // s1.ValidTime
+ size += 4 // s1.PreferredTime
+ }
+ return size
+}
+func (m *IP6RaEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PID)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBytes(m.RouterAddr[:], 16)
+ 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 // Prefixes
+ if j0 < len(m.Prefixes) {
+ v0 = m.Prefixes[j0]
+ }
+ buf.EncodeUint32(uint32(v0.Prefix.Address.Af))
+ 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
+}
+func (m *IP6RaEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.RouterAddr[:], buf.DecodeBytes(16))
+ m.CurrentHopLimit = buf.DecodeUint8()
+ m.Flags = buf.DecodeUint8()
+ m.RouterLifetimeInSec = buf.DecodeUint16()
+ m.NeighborReachableTimeInMsec = buf.DecodeUint32()
+ m.TimeInMsecBetweenRetransmittedNeighborSolicitations = buf.DecodeUint32()
+ m.NPrefixes = buf.DecodeUint32()
+ m.Prefixes = make([]IP6RaPrefixInfo, m.NPrefixes)
+ for j0 := 0; j0 < len(m.Prefixes); j0++ {
+ m.Prefixes[j0].Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefixes[j0].Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefixes[j0].Prefix.Len = buf.DecodeUint8()
+ m.Prefixes[j0].Flags = buf.DecodeUint8()
+ m.Prefixes[j0].ValidTime = buf.DecodeUint32()
+ m.Prefixes[j0].PreferredTime = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// IP6ndProxyAddDel defines message 'ip6nd_proxy_add_del'.
+type IP6ndProxyAddDel struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ IP IP6Address `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
+}
+
+func (m *IP6ndProxyAddDel) Reset() { *m = IP6ndProxyAddDel{} }
+func (*IP6ndProxyAddDel) GetMessageName() string { return "ip6nd_proxy_add_del" }
+func (*IP6ndProxyAddDel) GetCrcString() string { return "3fdf6659" }
+func (*IP6ndProxyAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IP6ndProxyAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsAdd
+ size += 1 * 16 // m.IP
+ return size
+}
+func (m *IP6ndProxyAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBytes(m.IP[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *IP6ndProxyAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsAdd = buf.DecodeBool()
+ copy(m.IP[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// IP6ndProxyAddDelReply defines message 'ip6nd_proxy_add_del_reply'.
+type IP6ndProxyAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IP6ndProxyAddDelReply) Reset() { *m = IP6ndProxyAddDelReply{} }
+func (*IP6ndProxyAddDelReply) GetMessageName() string { return "ip6nd_proxy_add_del_reply" }
+func (*IP6ndProxyAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*IP6ndProxyAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IP6ndProxyAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IP6ndProxyAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IP6ndProxyDetails defines message 'ip6nd_proxy_details'.
+type IP6ndProxyDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IP IP6Address `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
+}
+
+func (m *IP6ndProxyDetails) Reset() { *m = IP6ndProxyDetails{} }
+func (*IP6ndProxyDetails) GetMessageName() string { return "ip6nd_proxy_details" }
+func (*IP6ndProxyDetails) GetCrcString() string { return "d35be8ff" }
+func (*IP6ndProxyDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IP6ndProxyDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 * 16 // m.IP
+ return size
+}
+func (m *IP6ndProxyDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBytes(m.IP[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *IP6ndProxyDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.IP[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// IP6ndProxyDump defines message 'ip6nd_proxy_dump'.
+type IP6ndProxyDump struct{}
+
+func (m *IP6ndProxyDump) Reset() { *m = IP6ndProxyDump{} }
+func (*IP6ndProxyDump) GetMessageName() string { return "ip6nd_proxy_dump" }
+func (*IP6ndProxyDump) GetCrcString() string { return "51077d14" }
+func (*IP6ndProxyDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IP6ndProxyDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *IP6ndProxyDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *IP6ndProxyDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// IP6ndSendRouterSolicitation defines message 'ip6nd_send_router_solicitation'.
+type IP6ndSendRouterSolicitation struct {
+ Irt uint32 `binapi:"u32,name=irt" json:"irt,omitempty"`
+ Mrt uint32 `binapi:"u32,name=mrt" json:"mrt,omitempty"`
+ Mrc uint32 `binapi:"u32,name=mrc" json:"mrc,omitempty"`
+ Mrd uint32 `binapi:"u32,name=mrd" json:"mrd,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Stop bool `binapi:"bool,name=stop" json:"stop,omitempty"`
+}
+
+func (m *IP6ndSendRouterSolicitation) Reset() { *m = IP6ndSendRouterSolicitation{} }
+func (*IP6ndSendRouterSolicitation) GetMessageName() string { return "ip6nd_send_router_solicitation" }
+func (*IP6ndSendRouterSolicitation) GetCrcString() string { return "e5de609c" }
+func (*IP6ndSendRouterSolicitation) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IP6ndSendRouterSolicitation) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Irt
+ size += 4 // m.Mrt
+ size += 4 // m.Mrc
+ size += 4 // m.Mrd
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Stop
+ return size
+}
+func (m *IP6ndSendRouterSolicitation) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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
+}
+func (m *IP6ndSendRouterSolicitation) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Irt = buf.DecodeUint32()
+ m.Mrt = buf.DecodeUint32()
+ m.Mrc = buf.DecodeUint32()
+ m.Mrd = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Stop = buf.DecodeBool()
+ return nil
+}
+
+// IP6ndSendRouterSolicitationReply defines message 'ip6nd_send_router_solicitation_reply'.
+type IP6ndSendRouterSolicitationReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IP6ndSendRouterSolicitationReply) Reset() { *m = IP6ndSendRouterSolicitationReply{} }
+func (*IP6ndSendRouterSolicitationReply) GetMessageName() string {
+ return "ip6nd_send_router_solicitation_reply"
+}
+func (*IP6ndSendRouterSolicitationReply) GetCrcString() string { return "e8d4e804" }
+func (*IP6ndSendRouterSolicitationReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IP6ndSendRouterSolicitationReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IP6ndSendRouterSolicitationReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceIP6ndRaConfig defines message 'sw_interface_ip6nd_ra_config'.
+type SwInterfaceIP6ndRaConfig struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Suppress uint8 `binapi:"u8,name=suppress" json:"suppress,omitempty"`
+ Managed uint8 `binapi:"u8,name=managed" json:"managed,omitempty"`
+ Other uint8 `binapi:"u8,name=other" json:"other,omitempty"`
+ LlOption uint8 `binapi:"u8,name=ll_option" json:"ll_option,omitempty"`
+ SendUnicast uint8 `binapi:"u8,name=send_unicast" json:"send_unicast,omitempty"`
+ Cease uint8 `binapi:"u8,name=cease" json:"cease,omitempty"`
+ IsNo bool `binapi:"bool,name=is_no" json:"is_no,omitempty"`
+ DefaultRouter uint8 `binapi:"u8,name=default_router" json:"default_router,omitempty"`
+ MaxInterval uint32 `binapi:"u32,name=max_interval" json:"max_interval,omitempty"`
+ MinInterval uint32 `binapi:"u32,name=min_interval" json:"min_interval,omitempty"`
+ Lifetime uint32 `binapi:"u32,name=lifetime" json:"lifetime,omitempty"`
+ InitialCount uint32 `binapi:"u32,name=initial_count" json:"initial_count,omitempty"`
+ InitialInterval uint32 `binapi:"u32,name=initial_interval" json:"initial_interval,omitempty"`
+}
+
+func (m *SwInterfaceIP6ndRaConfig) Reset() { *m = SwInterfaceIP6ndRaConfig{} }
+func (*SwInterfaceIP6ndRaConfig) GetMessageName() string { return "sw_interface_ip6nd_ra_config" }
+func (*SwInterfaceIP6ndRaConfig) GetCrcString() string { return "3eb00b1c" }
+func (*SwInterfaceIP6ndRaConfig) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceIP6ndRaConfig) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Suppress
+ size += 1 // m.Managed
+ size += 1 // m.Other
+ size += 1 // m.LlOption
+ size += 1 // m.SendUnicast
+ size += 1 // m.Cease
+ size += 1 // m.IsNo
+ size += 1 // m.DefaultRouter
+ size += 4 // m.MaxInterval
+ size += 4 // m.MinInterval
+ size += 4 // m.Lifetime
+ size += 4 // m.InitialCount
+ size += 4 // m.InitialInterval
+ return size
+}
+func (m *SwInterfaceIP6ndRaConfig) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ 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(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 {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Suppress = buf.DecodeUint8()
+ m.Managed = buf.DecodeUint8()
+ m.Other = buf.DecodeUint8()
+ m.LlOption = buf.DecodeUint8()
+ m.SendUnicast = buf.DecodeUint8()
+ m.Cease = buf.DecodeUint8()
+ m.IsNo = buf.DecodeBool()
+ m.DefaultRouter = buf.DecodeUint8()
+ m.MaxInterval = buf.DecodeUint32()
+ m.MinInterval = buf.DecodeUint32()
+ m.Lifetime = buf.DecodeUint32()
+ m.InitialCount = buf.DecodeUint32()
+ m.InitialInterval = buf.DecodeUint32()
+ return nil
+}
+
+// SwInterfaceIP6ndRaConfigReply defines message 'sw_interface_ip6nd_ra_config_reply'.
+type SwInterfaceIP6ndRaConfigReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceIP6ndRaConfigReply) Reset() { *m = SwInterfaceIP6ndRaConfigReply{} }
+func (*SwInterfaceIP6ndRaConfigReply) GetMessageName() string {
+ return "sw_interface_ip6nd_ra_config_reply"
+}
+func (*SwInterfaceIP6ndRaConfigReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceIP6ndRaConfigReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceIP6ndRaConfigReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceIP6ndRaConfigReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceIP6ndRaPrefix defines message 'sw_interface_ip6nd_ra_prefix'.
+type SwInterfaceIP6ndRaPrefix struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
+ UseDefault bool `binapi:"bool,name=use_default" json:"use_default,omitempty"`
+ NoAdvertise bool `binapi:"bool,name=no_advertise" json:"no_advertise,omitempty"`
+ OffLink bool `binapi:"bool,name=off_link" json:"off_link,omitempty"`
+ NoAutoconfig bool `binapi:"bool,name=no_autoconfig" json:"no_autoconfig,omitempty"`
+ NoOnlink bool `binapi:"bool,name=no_onlink" json:"no_onlink,omitempty"`
+ IsNo bool `binapi:"bool,name=is_no" json:"is_no,omitempty"`
+ ValLifetime uint32 `binapi:"u32,name=val_lifetime" json:"val_lifetime,omitempty"`
+ PrefLifetime uint32 `binapi:"u32,name=pref_lifetime" json:"pref_lifetime,omitempty"`
+}
+
+func (m *SwInterfaceIP6ndRaPrefix) Reset() { *m = SwInterfaceIP6ndRaPrefix{} }
+func (*SwInterfaceIP6ndRaPrefix) GetMessageName() string { return "sw_interface_ip6nd_ra_prefix" }
+func (*SwInterfaceIP6ndRaPrefix) GetCrcString() string { return "e098785f" }
+func (*SwInterfaceIP6ndRaPrefix) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceIP6ndRaPrefix) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Prefix.Address.Af
+ size += 1 * 16 // m.Prefix.Address.Un
+ size += 1 // m.Prefix.Len
+ size += 1 // m.UseDefault
+ size += 1 // m.NoAdvertise
+ size += 1 // m.OffLink
+ size += 1 // m.NoAutoconfig
+ size += 1 // m.NoOnlink
+ size += 1 // m.IsNo
+ size += 4 // m.ValLifetime
+ size += 4 // m.PrefLifetime
+ return size
+}
+func (m *SwInterfaceIP6ndRaPrefix) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Prefix.Address.Af))
+ 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(m.ValLifetime)
+ buf.EncodeUint32(m.PrefLifetime)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceIP6ndRaPrefix) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
+ m.UseDefault = buf.DecodeBool()
+ m.NoAdvertise = buf.DecodeBool()
+ m.OffLink = buf.DecodeBool()
+ m.NoAutoconfig = buf.DecodeBool()
+ m.NoOnlink = buf.DecodeBool()
+ m.IsNo = buf.DecodeBool()
+ m.ValLifetime = buf.DecodeUint32()
+ m.PrefLifetime = buf.DecodeUint32()
+ return nil
+}
+
+// SwInterfaceIP6ndRaPrefixReply defines message 'sw_interface_ip6nd_ra_prefix_reply'.
+type SwInterfaceIP6ndRaPrefixReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceIP6ndRaPrefixReply) Reset() { *m = SwInterfaceIP6ndRaPrefixReply{} }
+func (*SwInterfaceIP6ndRaPrefixReply) GetMessageName() string {
+ return "sw_interface_ip6nd_ra_prefix_reply"
+}
+func (*SwInterfaceIP6ndRaPrefixReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceIP6ndRaPrefixReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceIP6ndRaPrefixReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceIP6ndRaPrefixReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// WantIP6RaEvents defines message 'want_ip6_ra_events'.
+type WantIP6RaEvents struct {
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *WantIP6RaEvents) Reset() { *m = WantIP6RaEvents{} }
+func (*WantIP6RaEvents) GetMessageName() string { return "want_ip6_ra_events" }
+func (*WantIP6RaEvents) GetCrcString() string { return "3ec6d6c2" }
+func (*WantIP6RaEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantIP6RaEvents) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ size += 4 // m.PID
+ return size
+}
+func (m *WantIP6RaEvents) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ buf.EncodeUint32(m.PID)
+ return buf.Bytes(), nil
+}
+func (m *WantIP6RaEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// WantIP6RaEventsReply defines message 'want_ip6_ra_events_reply'.
+type WantIP6RaEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantIP6RaEventsReply) Reset() { *m = WantIP6RaEventsReply{} }
+func (*WantIP6RaEventsReply) GetMessageName() string { return "want_ip6_ra_events_reply" }
+func (*WantIP6RaEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantIP6RaEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantIP6RaEventsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantIP6RaEventsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_ip6_nd_binapi_init() }
+func file_ip6_nd_binapi_init() {
+ api.RegisterMessage((*IP6RaEvent)(nil), "ip6_ra_event_47e8cfbe")
+ api.RegisterMessage((*IP6ndProxyAddDel)(nil), "ip6nd_proxy_add_del_3fdf6659")
+ api.RegisterMessage((*IP6ndProxyAddDelReply)(nil), "ip6nd_proxy_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IP6ndProxyDetails)(nil), "ip6nd_proxy_details_d35be8ff")
+ api.RegisterMessage((*IP6ndProxyDump)(nil), "ip6nd_proxy_dump_51077d14")
+ api.RegisterMessage((*IP6ndSendRouterSolicitation)(nil), "ip6nd_send_router_solicitation_e5de609c")
+ api.RegisterMessage((*IP6ndSendRouterSolicitationReply)(nil), "ip6nd_send_router_solicitation_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceIP6ndRaConfig)(nil), "sw_interface_ip6nd_ra_config_3eb00b1c")
+ api.RegisterMessage((*SwInterfaceIP6ndRaConfigReply)(nil), "sw_interface_ip6nd_ra_config_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceIP6ndRaPrefix)(nil), "sw_interface_ip6nd_ra_prefix_e098785f")
+ api.RegisterMessage((*SwInterfaceIP6ndRaPrefixReply)(nil), "sw_interface_ip6nd_ra_prefix_reply_e8d4e804")
+ api.RegisterMessage((*WantIP6RaEvents)(nil), "want_ip6_ra_events_3ec6d6c2")
+ api.RegisterMessage((*WantIP6RaEventsReply)(nil), "want_ip6_ra_events_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*IP6RaEvent)(nil),
+ (*IP6ndProxyAddDel)(nil),
+ (*IP6ndProxyAddDelReply)(nil),
+ (*IP6ndProxyDetails)(nil),
+ (*IP6ndProxyDump)(nil),
+ (*IP6ndSendRouterSolicitation)(nil),
+ (*IP6ndSendRouterSolicitationReply)(nil),
+ (*SwInterfaceIP6ndRaConfig)(nil),
+ (*SwInterfaceIP6ndRaConfigReply)(nil),
+ (*SwInterfaceIP6ndRaPrefix)(nil),
+ (*SwInterfaceIP6ndRaPrefixReply)(nil),
+ (*WantIP6RaEvents)(nil),
+ (*WantIP6RaEventsReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ip6_nd/ip6_nd_rpc.ba.go b/internal/testbinapi/binapi2001/ip6_nd/ip6_nd_rpc.ba.go
new file mode 100644
index 0000000..e4840db
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ip6_nd/ip6_nd_rpc.ba.go
@@ -0,0 +1,113 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ip6_nd
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service ip6_nd.
+type RPCService interface {
+ IP6ndProxyAddDel(ctx context.Context, in *IP6ndProxyAddDel) (*IP6ndProxyAddDelReply, error)
+ IP6ndProxyDump(ctx context.Context, in *IP6ndProxyDump) (RPCService_IP6ndProxyDumpClient, error)
+ IP6ndSendRouterSolicitation(ctx context.Context, in *IP6ndSendRouterSolicitation) (*IP6ndSendRouterSolicitationReply, error)
+ SwInterfaceIP6ndRaConfig(ctx context.Context, in *SwInterfaceIP6ndRaConfig) (*SwInterfaceIP6ndRaConfigReply, error)
+ SwInterfaceIP6ndRaPrefix(ctx context.Context, in *SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error)
+ WantIP6RaEvents(ctx context.Context, in *WantIP6RaEvents) (*WantIP6RaEventsReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) IP6ndProxyAddDel(ctx context.Context, in *IP6ndProxyAddDel) (*IP6ndProxyAddDelReply, error) {
+ out := new(IP6ndProxyAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IP6ndProxyDump(ctx context.Context, in *IP6ndProxyDump) (RPCService_IP6ndProxyDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IP6ndProxyDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IP6ndProxyDumpClient interface {
+ Recv() (*IP6ndProxyDetails, error)
+ api.Stream
+}
+
+type serviceClient_IP6ndProxyDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IP6ndProxyDumpClient) Recv() (*IP6ndProxyDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IP6ndProxyDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IP6ndSendRouterSolicitation(ctx context.Context, in *IP6ndSendRouterSolicitation) (*IP6ndSendRouterSolicitationReply, error) {
+ out := new(IP6ndSendRouterSolicitationReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwInterfaceIP6ndRaConfig(ctx context.Context, in *SwInterfaceIP6ndRaConfig) (*SwInterfaceIP6ndRaConfigReply, error) {
+ out := new(SwInterfaceIP6ndRaConfigReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwInterfaceIP6ndRaPrefix(ctx context.Context, in *SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error) {
+ out := new(SwInterfaceIP6ndRaPrefixReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) WantIP6RaEvents(ctx context.Context, in *WantIP6RaEvents) (*WantIP6RaEventsReply, error) {
+ out := new(WantIP6RaEventsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor.ba.go b/internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor.ba.go
new file mode 100644
index 0000000..93def01
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor.ba.go
@@ -0,0 +1,1341 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/ip_neighbor.api.json
+
+// Package ip_neighbor contains generated bindings for API file ip_neighbor.api.
+//
+// Contents:
+// 7 aliases
+// 11 enums
+// 7 structs
+// 1 union
+// 9 messages
+//
+package ip_neighbor
+
+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 = "ip_neighbor"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xdae37c55
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPNeighborFlags defines enum 'ip_neighbor_flags'.
+type IPNeighborFlags uint8
+
+const (
+ IP_API_NEIGHBOR_FLAG_NONE IPNeighborFlags = 0
+ IP_API_NEIGHBOR_FLAG_STATIC IPNeighborFlags = 1
+ IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY IPNeighborFlags = 2
+)
+
+var (
+ IPNeighborFlags_name = map[uint8]string{
+ 0: "IP_API_NEIGHBOR_FLAG_NONE",
+ 1: "IP_API_NEIGHBOR_FLAG_STATIC",
+ 2: "IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY",
+ }
+ IPNeighborFlags_value = map[string]uint8{
+ "IP_API_NEIGHBOR_FLAG_NONE": 0,
+ "IP_API_NEIGHBOR_FLAG_STATIC": 1,
+ "IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY": 2,
+ }
+)
+
+func (x IPNeighborFlags) String() string {
+ s, ok := IPNeighborFlags_name[uint8(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint8) string {
+ s, ok := IPNeighborFlags_name[uint8(n)]
+ if ok {
+ return s
+ }
+ return "IPNeighborFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint8(0); i <= 8; i++ {
+ val := uint8(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint8(x))
+ }
+ return s
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IPNeighbor defines type 'ip_neighbor'.
+type IPNeighbor struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Flags IPNeighborFlags `binapi:"ip_neighbor_flags,name=flags" json:"flags,omitempty"`
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ IPAddress Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// IPNeighborAddDel defines message 'ip_neighbor_add_del'.
+type IPNeighborAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"`
+}
+
+func (m *IPNeighborAddDel) Reset() { *m = IPNeighborAddDel{} }
+func (*IPNeighborAddDel) GetMessageName() string { return "ip_neighbor_add_del" }
+func (*IPNeighborAddDel) GetCrcString() string { return "105518b6" }
+func (*IPNeighborAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IPNeighborAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Neighbor.SwIfIndex
+ size += 1 // m.Neighbor.Flags
+ size += 1 * 6 // m.Neighbor.MacAddress
+ size += 4 // m.Neighbor.IPAddress.Af
+ size += 1 * 16 // m.Neighbor.IPAddress.Un
+ return size
+}
+func (m *IPNeighborAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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.EncodeUint32(uint32(m.Neighbor.IPAddress.Af))
+ buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *IPNeighborAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Neighbor.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8())
+ copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6))
+ m.Neighbor.IPAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// IPNeighborAddDelReply defines message 'ip_neighbor_add_del_reply'.
+type IPNeighborAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
+}
+
+func (m *IPNeighborAddDelReply) Reset() { *m = IPNeighborAddDelReply{} }
+func (*IPNeighborAddDelReply) GetMessageName() string { return "ip_neighbor_add_del_reply" }
+func (*IPNeighborAddDelReply) GetCrcString() string { return "1992deab" }
+func (*IPNeighborAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IPNeighborAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.StatsIndex
+ return size
+}
+func (m *IPNeighborAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.StatsIndex = buf.DecodeUint32()
+ return nil
+}
+
+// IPNeighborConfig defines message 'ip_neighbor_config'.
+type IPNeighborConfig struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ MaxNumber uint32 `binapi:"u32,name=max_number" json:"max_number,omitempty"`
+ MaxAge uint32 `binapi:"u32,name=max_age" json:"max_age,omitempty"`
+ Recycle bool `binapi:"bool,name=recycle" json:"recycle,omitempty"`
+}
+
+func (m *IPNeighborConfig) Reset() { *m = IPNeighborConfig{} }
+func (*IPNeighborConfig) GetMessageName() string { return "ip_neighbor_config" }
+func (*IPNeighborConfig) GetCrcString() string { return "f4a5cf44" }
+func (*IPNeighborConfig) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IPNeighborConfig) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Af
+ size += 4 // m.MaxNumber
+ size += 4 // m.MaxAge
+ size += 1 // m.Recycle
+ return size
+}
+func (m *IPNeighborConfig) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Af))
+ buf.EncodeUint32(m.MaxNumber)
+ buf.EncodeUint32(m.MaxAge)
+ buf.EncodeBool(m.Recycle)
+ return buf.Bytes(), nil
+}
+func (m *IPNeighborConfig) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Af = AddressFamily(buf.DecodeUint32())
+ m.MaxNumber = buf.DecodeUint32()
+ m.MaxAge = buf.DecodeUint32()
+ m.Recycle = buf.DecodeBool()
+ return nil
+}
+
+// IPNeighborConfigReply defines message 'ip_neighbor_config_reply'.
+type IPNeighborConfigReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IPNeighborConfigReply) Reset() { *m = IPNeighborConfigReply{} }
+func (*IPNeighborConfigReply) GetMessageName() string { return "ip_neighbor_config_reply" }
+func (*IPNeighborConfigReply) GetCrcString() string { return "e8d4e804" }
+func (*IPNeighborConfigReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IPNeighborConfigReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IPNeighborConfigReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IPNeighborDetails defines message 'ip_neighbor_details'.
+type IPNeighborDetails struct {
+ Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"`
+}
+
+func (m *IPNeighborDetails) Reset() { *m = IPNeighborDetails{} }
+func (*IPNeighborDetails) GetMessageName() string { return "ip_neighbor_details" }
+func (*IPNeighborDetails) GetCrcString() string { return "59121ce9" }
+func (*IPNeighborDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IPNeighborDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Neighbor.SwIfIndex
+ size += 1 // m.Neighbor.Flags
+ size += 1 * 6 // m.Neighbor.MacAddress
+ size += 4 // m.Neighbor.IPAddress.Af
+ size += 1 * 16 // m.Neighbor.IPAddress.Un
+ return size
+}
+func (m *IPNeighborDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex))
+ buf.EncodeUint8(uint8(m.Neighbor.Flags))
+ buf.EncodeBytes(m.Neighbor.MacAddress[:], 6)
+ buf.EncodeUint32(uint32(m.Neighbor.IPAddress.Af))
+ 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.Neighbor.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8())
+ copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6))
+ m.Neighbor.IPAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// IPNeighborDump defines message 'ip_neighbor_dump'.
+type IPNeighborDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+}
+
+func (m *IPNeighborDump) Reset() { *m = IPNeighborDump{} }
+func (*IPNeighborDump) GetMessageName() string { return "ip_neighbor_dump" }
+func (*IPNeighborDump) GetCrcString() string { return "cd831298" }
+func (*IPNeighborDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IPNeighborDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Af
+ return size
+}
+func (m *IPNeighborDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Af))
+ return buf.Bytes(), nil
+}
+func (m *IPNeighborDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Af = AddressFamily(buf.DecodeUint32())
+ return nil
+}
+
+// IPNeighborEvent defines message 'ip_neighbor_event'.
+type IPNeighborEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"`
+}
+
+func (m *IPNeighborEvent) Reset() { *m = IPNeighborEvent{} }
+func (*IPNeighborEvent) GetMessageName() string { return "ip_neighbor_event" }
+func (*IPNeighborEvent) GetCrcString() string { return "83933131" }
+func (*IPNeighborEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *IPNeighborEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.Neighbor.SwIfIndex
+ size += 1 // m.Neighbor.Flags
+ size += 1 * 6 // m.Neighbor.MacAddress
+ size += 4 // m.Neighbor.IPAddress.Af
+ size += 1 * 16 // m.Neighbor.IPAddress.Un
+ return size
+}
+func (m *IPNeighborEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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.EncodeUint32(uint32(m.Neighbor.IPAddress.Af))
+ buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *IPNeighborEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.Neighbor.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8())
+ copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6))
+ m.Neighbor.IPAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// WantIPNeighborEvents defines message 'want_ip_neighbor_events'.
+type WantIPNeighborEvents struct {
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ IP Address `binapi:"address,name=ip" json:"ip,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
+}
+
+func (m *WantIPNeighborEvents) Reset() { *m = WantIPNeighborEvents{} }
+func (*WantIPNeighborEvents) GetMessageName() string { return "want_ip_neighbor_events" }
+func (*WantIPNeighborEvents) GetCrcString() string { return "1a312870" }
+func (*WantIPNeighborEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantIPNeighborEvents) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ size += 4 // m.PID
+ size += 4 // m.IP.Af
+ size += 1 * 16 // m.IP.Un
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *WantIPNeighborEvents) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ buf.EncodeUint32(m.PID)
+ buf.EncodeUint32(uint32(m.IP.Af))
+ buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *WantIPNeighborEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ m.PID = buf.DecodeUint32()
+ m.IP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// WantIPNeighborEventsReply defines message 'want_ip_neighbor_events_reply'.
+type WantIPNeighborEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantIPNeighborEventsReply) Reset() { *m = WantIPNeighborEventsReply{} }
+func (*WantIPNeighborEventsReply) GetMessageName() string { return "want_ip_neighbor_events_reply" }
+func (*WantIPNeighborEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantIPNeighborEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantIPNeighborEventsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantIPNeighborEventsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_ip_neighbor_binapi_init() }
+func file_ip_neighbor_binapi_init() {
+ api.RegisterMessage((*IPNeighborAddDel)(nil), "ip_neighbor_add_del_105518b6")
+ api.RegisterMessage((*IPNeighborAddDelReply)(nil), "ip_neighbor_add_del_reply_1992deab")
+ api.RegisterMessage((*IPNeighborConfig)(nil), "ip_neighbor_config_f4a5cf44")
+ api.RegisterMessage((*IPNeighborConfigReply)(nil), "ip_neighbor_config_reply_e8d4e804")
+ api.RegisterMessage((*IPNeighborDetails)(nil), "ip_neighbor_details_59121ce9")
+ api.RegisterMessage((*IPNeighborDump)(nil), "ip_neighbor_dump_cd831298")
+ api.RegisterMessage((*IPNeighborEvent)(nil), "ip_neighbor_event_83933131")
+ api.RegisterMessage((*WantIPNeighborEvents)(nil), "want_ip_neighbor_events_1a312870")
+ api.RegisterMessage((*WantIPNeighborEventsReply)(nil), "want_ip_neighbor_events_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*IPNeighborAddDel)(nil),
+ (*IPNeighborAddDelReply)(nil),
+ (*IPNeighborConfig)(nil),
+ (*IPNeighborConfigReply)(nil),
+ (*IPNeighborDetails)(nil),
+ (*IPNeighborDump)(nil),
+ (*IPNeighborEvent)(nil),
+ (*WantIPNeighborEvents)(nil),
+ (*WantIPNeighborEventsReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor_rpc.ba.go b/internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor_rpc.ba.go
new file mode 100644
index 0000000..89a64d6
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ip_neighbor/ip_neighbor_rpc.ba.go
@@ -0,0 +1,93 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ip_neighbor
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service ip_neighbor.
+type RPCService interface {
+ IPNeighborAddDel(ctx context.Context, in *IPNeighborAddDel) (*IPNeighborAddDelReply, error)
+ IPNeighborConfig(ctx context.Context, in *IPNeighborConfig) (*IPNeighborConfigReply, error)
+ IPNeighborDump(ctx context.Context, in *IPNeighborDump) (RPCService_IPNeighborDumpClient, error)
+ WantIPNeighborEvents(ctx context.Context, in *WantIPNeighborEvents) (*WantIPNeighborEventsReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) IPNeighborAddDel(ctx context.Context, in *IPNeighborAddDel) (*IPNeighborAddDelReply, error) {
+ out := new(IPNeighborAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IPNeighborConfig(ctx context.Context, in *IPNeighborConfig) (*IPNeighborConfigReply, error) {
+ out := new(IPNeighborConfigReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IPNeighborDump(ctx context.Context, in *IPNeighborDump) (RPCService_IPNeighborDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IPNeighborDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IPNeighborDumpClient interface {
+ Recv() (*IPNeighborDetails, error)
+ api.Stream
+}
+
+type serviceClient_IPNeighborDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IPNeighborDumpClient) Recv() (*IPNeighborDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IPNeighborDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) WantIPNeighborEvents(ctx context.Context, in *WantIPNeighborEvents) (*WantIPNeighborEventsReply, error) {
+ out := new(WantIPNeighborEventsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ip_types/ip_types.ba.go b/internal/testbinapi/binapi2001/ip_types/ip_types.ba.go
new file mode 100644
index 0000000..67d02c9
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ip_types/ip_types.ba.go
@@ -0,0 +1,589 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/ip_types.api.json
+
+// Package ip_types contains generated bindings for API file ip_types.api.
+//
+// Contents:
+// 5 aliases
+// 4 enums
+// 6 structs
+// 1 union
+//
+package ip_types
+
+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
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
diff --git a/internal/testbinapi/binapi2001/ipfix_export/ipfix_export.ba.go b/internal/testbinapi/binapi2001/ipfix_export/ipfix_export.ba.go
new file mode 100644
index 0000000..12b020b
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ipfix_export/ipfix_export.ba.go
@@ -0,0 +1,1162 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/ipfix_export.api.json
+
+// Package ipfix_export contains generated bindings for API file ipfix_export.api.
+//
+// Contents:
+// 5 aliases
+// 4 enums
+// 6 structs
+// 1 union
+// 14 messages
+//
+package ipfix_export
+
+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 = "ipfix_export"
+ APIVersion = "2.0.1"
+ VersionCrc = 0xee6ea488
+)
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// IpfixClassifyStreamDetails defines message 'ipfix_classify_stream_details'.
+type IpfixClassifyStreamDetails struct {
+ DomainID uint32 `binapi:"u32,name=domain_id" json:"domain_id,omitempty"`
+ SrcPort uint16 `binapi:"u16,name=src_port" json:"src_port,omitempty"`
+}
+
+func (m *IpfixClassifyStreamDetails) Reset() { *m = IpfixClassifyStreamDetails{} }
+func (*IpfixClassifyStreamDetails) GetMessageName() string { return "ipfix_classify_stream_details" }
+func (*IpfixClassifyStreamDetails) GetCrcString() string { return "2903539d" }
+func (*IpfixClassifyStreamDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpfixClassifyStreamDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.DomainID
+ size += 2 // m.SrcPort
+ return size
+}
+func (m *IpfixClassifyStreamDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.DomainID)
+ buf.EncodeUint16(m.SrcPort)
+ return buf.Bytes(), nil
+}
+func (m *IpfixClassifyStreamDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.DomainID = buf.DecodeUint32()
+ m.SrcPort = buf.DecodeUint16()
+ return nil
+}
+
+// IpfixClassifyStreamDump defines message 'ipfix_classify_stream_dump'.
+type IpfixClassifyStreamDump struct{}
+
+func (m *IpfixClassifyStreamDump) Reset() { *m = IpfixClassifyStreamDump{} }
+func (*IpfixClassifyStreamDump) GetMessageName() string { return "ipfix_classify_stream_dump" }
+func (*IpfixClassifyStreamDump) GetCrcString() string { return "51077d14" }
+func (*IpfixClassifyStreamDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpfixClassifyStreamDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *IpfixClassifyStreamDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *IpfixClassifyStreamDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// IpfixClassifyTableAddDel defines message 'ipfix_classify_table_add_del'.
+type IpfixClassifyTableAddDel struct {
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ IPVersion AddressFamily `binapi:"address_family,name=ip_version" json:"ip_version,omitempty"`
+ TransportProtocol IPProto `binapi:"ip_proto,name=transport_protocol" json:"transport_protocol,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *IpfixClassifyTableAddDel) Reset() { *m = IpfixClassifyTableAddDel{} }
+func (*IpfixClassifyTableAddDel) GetMessageName() string { return "ipfix_classify_table_add_del" }
+func (*IpfixClassifyTableAddDel) GetCrcString() string { return "5118bc5e" }
+func (*IpfixClassifyTableAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpfixClassifyTableAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.TableID
+ size += 4 // m.IPVersion
+ size += 4 // m.TransportProtocol
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *IpfixClassifyTableAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeUint32(uint32(m.IPVersion))
+ buf.EncodeUint32(uint32(m.TransportProtocol))
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *IpfixClassifyTableAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TableID = buf.DecodeUint32()
+ m.IPVersion = AddressFamily(buf.DecodeUint32())
+ m.TransportProtocol = IPProto(buf.DecodeUint32())
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// IpfixClassifyTableAddDelReply defines message 'ipfix_classify_table_add_del_reply'.
+type IpfixClassifyTableAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IpfixClassifyTableAddDelReply) Reset() { *m = IpfixClassifyTableAddDelReply{} }
+func (*IpfixClassifyTableAddDelReply) GetMessageName() string {
+ return "ipfix_classify_table_add_del_reply"
+}
+func (*IpfixClassifyTableAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*IpfixClassifyTableAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpfixClassifyTableAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IpfixClassifyTableAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IpfixClassifyTableDetails defines message 'ipfix_classify_table_details'.
+type IpfixClassifyTableDetails struct {
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ IPVersion AddressFamily `binapi:"address_family,name=ip_version" json:"ip_version,omitempty"`
+ TransportProtocol IPProto `binapi:"ip_proto,name=transport_protocol" json:"transport_protocol,omitempty"`
+}
+
+func (m *IpfixClassifyTableDetails) Reset() { *m = IpfixClassifyTableDetails{} }
+func (*IpfixClassifyTableDetails) GetMessageName() string { return "ipfix_classify_table_details" }
+func (*IpfixClassifyTableDetails) GetCrcString() string { return "7c8351ec" }
+func (*IpfixClassifyTableDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpfixClassifyTableDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.TableID
+ size += 4 // m.IPVersion
+ size += 4 // m.TransportProtocol
+ return size
+}
+func (m *IpfixClassifyTableDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeUint32(uint32(m.IPVersion))
+ buf.EncodeUint32(uint32(m.TransportProtocol))
+ return buf.Bytes(), nil
+}
+func (m *IpfixClassifyTableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TableID = buf.DecodeUint32()
+ m.IPVersion = AddressFamily(buf.DecodeUint32())
+ m.TransportProtocol = IPProto(buf.DecodeUint32())
+ return nil
+}
+
+// IpfixClassifyTableDump defines message 'ipfix_classify_table_dump'.
+type IpfixClassifyTableDump struct{}
+
+func (m *IpfixClassifyTableDump) Reset() { *m = IpfixClassifyTableDump{} }
+func (*IpfixClassifyTableDump) GetMessageName() string { return "ipfix_classify_table_dump" }
+func (*IpfixClassifyTableDump) GetCrcString() string { return "51077d14" }
+func (*IpfixClassifyTableDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpfixClassifyTableDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *IpfixClassifyTableDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *IpfixClassifyTableDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// IpfixExporterDetails defines message 'ipfix_exporter_details'.
+type IpfixExporterDetails struct {
+ CollectorAddress Address `binapi:"address,name=collector_address" json:"collector_address,omitempty"`
+ CollectorPort uint16 `binapi:"u16,name=collector_port" json:"collector_port,omitempty"`
+ SrcAddress Address `binapi:"address,name=src_address" json:"src_address,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ PathMtu uint32 `binapi:"u32,name=path_mtu" json:"path_mtu,omitempty"`
+ TemplateInterval uint32 `binapi:"u32,name=template_interval" json:"template_interval,omitempty"`
+ UDPChecksum bool `binapi:"bool,name=udp_checksum" json:"udp_checksum,omitempty"`
+}
+
+func (m *IpfixExporterDetails) Reset() { *m = IpfixExporterDetails{} }
+func (*IpfixExporterDetails) GetMessageName() string { return "ipfix_exporter_details" }
+func (*IpfixExporterDetails) GetCrcString() string { return "11e07413" }
+func (*IpfixExporterDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpfixExporterDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.CollectorAddress.Af
+ size += 1 * 16 // m.CollectorAddress.Un
+ size += 2 // m.CollectorPort
+ size += 4 // m.SrcAddress.Af
+ size += 1 * 16 // m.SrcAddress.Un
+ size += 4 // m.VrfID
+ size += 4 // m.PathMtu
+ size += 4 // m.TemplateInterval
+ size += 1 // m.UDPChecksum
+ return size
+}
+func (m *IpfixExporterDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.CollectorAddress.Af))
+ buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint16(m.CollectorPort)
+ buf.EncodeUint32(uint32(m.SrcAddress.Af))
+ 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
+}
+func (m *IpfixExporterDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.CollectorAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.CollectorAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.CollectorPort = buf.DecodeUint16()
+ m.SrcAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.VrfID = buf.DecodeUint32()
+ m.PathMtu = buf.DecodeUint32()
+ m.TemplateInterval = buf.DecodeUint32()
+ m.UDPChecksum = buf.DecodeBool()
+ return nil
+}
+
+// IpfixExporterDump defines message 'ipfix_exporter_dump'.
+type IpfixExporterDump struct{}
+
+func (m *IpfixExporterDump) Reset() { *m = IpfixExporterDump{} }
+func (*IpfixExporterDump) GetMessageName() string { return "ipfix_exporter_dump" }
+func (*IpfixExporterDump) GetCrcString() string { return "51077d14" }
+func (*IpfixExporterDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpfixExporterDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *IpfixExporterDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *IpfixExporterDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// IpfixFlush defines message 'ipfix_flush'.
+type IpfixFlush struct{}
+
+func (m *IpfixFlush) Reset() { *m = IpfixFlush{} }
+func (*IpfixFlush) GetMessageName() string { return "ipfix_flush" }
+func (*IpfixFlush) GetCrcString() string { return "51077d14" }
+func (*IpfixFlush) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpfixFlush) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *IpfixFlush) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *IpfixFlush) Unmarshal(b []byte) error {
+ return nil
+}
+
+// IpfixFlushReply defines message 'ipfix_flush_reply'.
+type IpfixFlushReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IpfixFlushReply) Reset() { *m = IpfixFlushReply{} }
+func (*IpfixFlushReply) GetMessageName() string { return "ipfix_flush_reply" }
+func (*IpfixFlushReply) GetCrcString() string { return "e8d4e804" }
+func (*IpfixFlushReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpfixFlushReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IpfixFlushReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SetIpfixClassifyStream defines message 'set_ipfix_classify_stream'.
+type SetIpfixClassifyStream struct {
+ DomainID uint32 `binapi:"u32,name=domain_id" json:"domain_id,omitempty"`
+ SrcPort uint16 `binapi:"u16,name=src_port" json:"src_port,omitempty"`
+}
+
+func (m *SetIpfixClassifyStream) Reset() { *m = SetIpfixClassifyStream{} }
+func (*SetIpfixClassifyStream) GetMessageName() string { return "set_ipfix_classify_stream" }
+func (*SetIpfixClassifyStream) GetCrcString() string { return "c9cbe053" }
+func (*SetIpfixClassifyStream) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SetIpfixClassifyStream) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.DomainID
+ size += 2 // m.SrcPort
+ return size
+}
+func (m *SetIpfixClassifyStream) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.DomainID)
+ buf.EncodeUint16(m.SrcPort)
+ return buf.Bytes(), nil
+}
+func (m *SetIpfixClassifyStream) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.DomainID = buf.DecodeUint32()
+ m.SrcPort = buf.DecodeUint16()
+ return nil
+}
+
+// SetIpfixClassifyStreamReply defines message 'set_ipfix_classify_stream_reply'.
+type SetIpfixClassifyStreamReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SetIpfixClassifyStreamReply) Reset() { *m = SetIpfixClassifyStreamReply{} }
+func (*SetIpfixClassifyStreamReply) GetMessageName() string { return "set_ipfix_classify_stream_reply" }
+func (*SetIpfixClassifyStreamReply) GetCrcString() string { return "e8d4e804" }
+func (*SetIpfixClassifyStreamReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SetIpfixClassifyStreamReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SetIpfixClassifyStreamReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SetIpfixExporter defines message 'set_ipfix_exporter'.
+type SetIpfixExporter struct {
+ CollectorAddress Address `binapi:"address,name=collector_address" json:"collector_address,omitempty"`
+ CollectorPort uint16 `binapi:"u16,name=collector_port" json:"collector_port,omitempty"`
+ SrcAddress Address `binapi:"address,name=src_address" json:"src_address,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ PathMtu uint32 `binapi:"u32,name=path_mtu" json:"path_mtu,omitempty"`
+ TemplateInterval uint32 `binapi:"u32,name=template_interval" json:"template_interval,omitempty"`
+ UDPChecksum bool `binapi:"bool,name=udp_checksum" json:"udp_checksum,omitempty"`
+}
+
+func (m *SetIpfixExporter) Reset() { *m = SetIpfixExporter{} }
+func (*SetIpfixExporter) GetMessageName() string { return "set_ipfix_exporter" }
+func (*SetIpfixExporter) GetCrcString() string { return "69284e07" }
+func (*SetIpfixExporter) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SetIpfixExporter) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.CollectorAddress.Af
+ size += 1 * 16 // m.CollectorAddress.Un
+ size += 2 // m.CollectorPort
+ size += 4 // m.SrcAddress.Af
+ size += 1 * 16 // m.SrcAddress.Un
+ size += 4 // m.VrfID
+ size += 4 // m.PathMtu
+ size += 4 // m.TemplateInterval
+ size += 1 // m.UDPChecksum
+ return size
+}
+func (m *SetIpfixExporter) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.CollectorAddress.Af))
+ buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint16(m.CollectorPort)
+ buf.EncodeUint32(uint32(m.SrcAddress.Af))
+ 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
+}
+func (m *SetIpfixExporter) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.CollectorAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.CollectorAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.CollectorPort = buf.DecodeUint16()
+ m.SrcAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.VrfID = buf.DecodeUint32()
+ m.PathMtu = buf.DecodeUint32()
+ m.TemplateInterval = buf.DecodeUint32()
+ m.UDPChecksum = buf.DecodeBool()
+ return nil
+}
+
+// SetIpfixExporterReply defines message 'set_ipfix_exporter_reply'.
+type SetIpfixExporterReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SetIpfixExporterReply) Reset() { *m = SetIpfixExporterReply{} }
+func (*SetIpfixExporterReply) GetMessageName() string { return "set_ipfix_exporter_reply" }
+func (*SetIpfixExporterReply) GetCrcString() string { return "e8d4e804" }
+func (*SetIpfixExporterReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SetIpfixExporterReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SetIpfixExporterReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_ipfix_export_binapi_init() }
+func file_ipfix_export_binapi_init() {
+ api.RegisterMessage((*IpfixClassifyStreamDetails)(nil), "ipfix_classify_stream_details_2903539d")
+ api.RegisterMessage((*IpfixClassifyStreamDump)(nil), "ipfix_classify_stream_dump_51077d14")
+ api.RegisterMessage((*IpfixClassifyTableAddDel)(nil), "ipfix_classify_table_add_del_5118bc5e")
+ api.RegisterMessage((*IpfixClassifyTableAddDelReply)(nil), "ipfix_classify_table_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IpfixClassifyTableDetails)(nil), "ipfix_classify_table_details_7c8351ec")
+ api.RegisterMessage((*IpfixClassifyTableDump)(nil), "ipfix_classify_table_dump_51077d14")
+ api.RegisterMessage((*IpfixExporterDetails)(nil), "ipfix_exporter_details_11e07413")
+ api.RegisterMessage((*IpfixExporterDump)(nil), "ipfix_exporter_dump_51077d14")
+ api.RegisterMessage((*IpfixFlush)(nil), "ipfix_flush_51077d14")
+ api.RegisterMessage((*IpfixFlushReply)(nil), "ipfix_flush_reply_e8d4e804")
+ api.RegisterMessage((*SetIpfixClassifyStream)(nil), "set_ipfix_classify_stream_c9cbe053")
+ api.RegisterMessage((*SetIpfixClassifyStreamReply)(nil), "set_ipfix_classify_stream_reply_e8d4e804")
+ api.RegisterMessage((*SetIpfixExporter)(nil), "set_ipfix_exporter_69284e07")
+ api.RegisterMessage((*SetIpfixExporterReply)(nil), "set_ipfix_exporter_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*IpfixClassifyStreamDetails)(nil),
+ (*IpfixClassifyStreamDump)(nil),
+ (*IpfixClassifyTableAddDel)(nil),
+ (*IpfixClassifyTableAddDelReply)(nil),
+ (*IpfixClassifyTableDetails)(nil),
+ (*IpfixClassifyTableDump)(nil),
+ (*IpfixExporterDetails)(nil),
+ (*IpfixExporterDump)(nil),
+ (*IpfixFlush)(nil),
+ (*IpfixFlushReply)(nil),
+ (*SetIpfixClassifyStream)(nil),
+ (*SetIpfixClassifyStreamReply)(nil),
+ (*SetIpfixExporter)(nil),
+ (*SetIpfixExporterReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ipfix_export/ipfix_export_rpc.ba.go b/internal/testbinapi/binapi2001/ipfix_export/ipfix_export_rpc.ba.go
new file mode 100644
index 0000000..0189d4d
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ipfix_export/ipfix_export_rpc.ba.go
@@ -0,0 +1,183 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ipfix_export
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service ipfix_export.
+type RPCService interface {
+ IpfixClassifyStreamDump(ctx context.Context, in *IpfixClassifyStreamDump) (RPCService_IpfixClassifyStreamDumpClient, error)
+ IpfixClassifyTableAddDel(ctx context.Context, in *IpfixClassifyTableAddDel) (*IpfixClassifyTableAddDelReply, error)
+ IpfixClassifyTableDump(ctx context.Context, in *IpfixClassifyTableDump) (RPCService_IpfixClassifyTableDumpClient, error)
+ IpfixExporterDump(ctx context.Context, in *IpfixExporterDump) (RPCService_IpfixExporterDumpClient, error)
+ IpfixFlush(ctx context.Context, in *IpfixFlush) (*IpfixFlushReply, error)
+ SetIpfixClassifyStream(ctx context.Context, in *SetIpfixClassifyStream) (*SetIpfixClassifyStreamReply, error)
+ SetIpfixExporter(ctx context.Context, in *SetIpfixExporter) (*SetIpfixExporterReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) IpfixClassifyStreamDump(ctx context.Context, in *IpfixClassifyStreamDump) (RPCService_IpfixClassifyStreamDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpfixClassifyStreamDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpfixClassifyStreamDumpClient interface {
+ Recv() (*IpfixClassifyStreamDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpfixClassifyStreamDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpfixClassifyStreamDumpClient) Recv() (*IpfixClassifyStreamDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpfixClassifyStreamDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IpfixClassifyTableAddDel(ctx context.Context, in *IpfixClassifyTableAddDel) (*IpfixClassifyTableAddDelReply, error) {
+ out := new(IpfixClassifyTableAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpfixClassifyTableDump(ctx context.Context, in *IpfixClassifyTableDump) (RPCService_IpfixClassifyTableDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpfixClassifyTableDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpfixClassifyTableDumpClient interface {
+ Recv() (*IpfixClassifyTableDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpfixClassifyTableDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpfixClassifyTableDumpClient) Recv() (*IpfixClassifyTableDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpfixClassifyTableDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IpfixExporterDump(ctx context.Context, in *IpfixExporterDump) (RPCService_IpfixExporterDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpfixExporterDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpfixExporterDumpClient interface {
+ Recv() (*IpfixExporterDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpfixExporterDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpfixExporterDumpClient) Recv() (*IpfixExporterDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpfixExporterDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IpfixFlush(ctx context.Context, in *IpfixFlush) (*IpfixFlushReply, error) {
+ out := new(IpfixFlushReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SetIpfixClassifyStream(ctx context.Context, in *SetIpfixClassifyStream) (*SetIpfixClassifyStreamReply, error) {
+ out := new(SetIpfixClassifyStreamReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SetIpfixExporter(ctx context.Context, in *SetIpfixExporter) (*SetIpfixExporterReply, error) {
+ out := new(SetIpfixExporterReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ipip/ipip.ba.go b/internal/testbinapi/binapi2001/ipip/ipip.ba.go
new file mode 100644
index 0000000..e345dc7
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ipip/ipip.ba.go
@@ -0,0 +1,1365 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/ipip.api.json
+
+// Package ipip contains generated bindings for API file ipip.api.
+//
+// Contents:
+// 6 aliases
+// 11 enums
+// 7 structs
+// 1 union
+// 10 messages
+//
+package ipip
+
+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 = "ipip"
+ APIVersion = "2.0.0"
+ VersionCrc = 0xf108649c
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IpipTunnelFlags defines enum 'ipip_tunnel_flags'.
+type IpipTunnelFlags uint8
+
+const (
+ IPIP_TUNNEL_API_FLAG_NONE IpipTunnelFlags = 0
+ IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DF IpipTunnelFlags = 1
+ IPIP_TUNNEL_API_FLAG_ENCAP_SET_DF IpipTunnelFlags = 2
+ IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DSCP IpipTunnelFlags = 4
+ IPIP_TUNNEL_API_FLAG_ENCAP_COPY_ECN IpipTunnelFlags = 8
+ IPIP_TUNNEL_API_FLAG_DECAP_COPY_ECN IpipTunnelFlags = 16
+)
+
+var (
+ IpipTunnelFlags_name = map[uint8]string{
+ 0: "IPIP_TUNNEL_API_FLAG_NONE",
+ 1: "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DF",
+ 2: "IPIP_TUNNEL_API_FLAG_ENCAP_SET_DF",
+ 4: "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DSCP",
+ 8: "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_ECN",
+ 16: "IPIP_TUNNEL_API_FLAG_DECAP_COPY_ECN",
+ }
+ IpipTunnelFlags_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IpipTunnelFlags) String() string {
+ s, ok := IpipTunnelFlags_name[uint8(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint8) string {
+ s, ok := IpipTunnelFlags_name[uint8(n)]
+ if ok {
+ return s
+ }
+ return "IpipTunnelFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint8(0); i <= 8; i++ {
+ val := uint8(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint8(x))
+ }
+ return s
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IpipTunnel defines type 'ipip_tunnel'.
+type IpipTunnel struct {
+ Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
+ Src Address `binapi:"address,name=src" json:"src,omitempty"`
+ Dst Address `binapi:"address,name=dst" json:"dst,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ Flags IpipTunnelFlags `binapi:"ipip_tunnel_flags,name=flags" json:"flags,omitempty"`
+ Dscp IPDscp `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// Ipip6rdAddTunnel defines message 'ipip_6rd_add_tunnel'.
+type Ipip6rdAddTunnel struct {
+ IP6TableID uint32 `binapi:"u32,name=ip6_table_id" json:"ip6_table_id,omitempty"`
+ IP4TableID uint32 `binapi:"u32,name=ip4_table_id" json:"ip4_table_id,omitempty"`
+ IP6Prefix IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"`
+ IP4Prefix IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"`
+ IP4Src IP4Address `binapi:"ip4_address,name=ip4_src" json:"ip4_src,omitempty"`
+ SecurityCheck bool `binapi:"bool,name=security_check" json:"security_check,omitempty"`
+ TcTos uint8 `binapi:"u8,name=tc_tos" json:"tc_tos,omitempty"`
+}
+
+func (m *Ipip6rdAddTunnel) Reset() { *m = Ipip6rdAddTunnel{} }
+func (*Ipip6rdAddTunnel) GetMessageName() string { return "ipip_6rd_add_tunnel" }
+func (*Ipip6rdAddTunnel) GetCrcString() string { return "56e93cc0" }
+func (*Ipip6rdAddTunnel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ipip6rdAddTunnel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.IP6TableID
+ size += 4 // m.IP4TableID
+ size += 1 * 16 // m.IP6Prefix.Address
+ size += 1 // m.IP6Prefix.Len
+ size += 1 * 4 // m.IP4Prefix.Address
+ size += 1 // m.IP4Prefix.Len
+ size += 1 * 4 // m.IP4Src
+ size += 1 // m.SecurityCheck
+ size += 1 // m.TcTos
+ return size
+}
+func (m *Ipip6rdAddTunnel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.IP6TableID)
+ buf.EncodeUint32(m.IP4TableID)
+ buf.EncodeBytes(m.IP6Prefix.Address[:], 16)
+ buf.EncodeUint8(m.IP6Prefix.Len)
+ buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
+ buf.EncodeUint8(m.IP4Prefix.Len)
+ buf.EncodeBytes(m.IP4Src[:], 4)
+ buf.EncodeBool(m.SecurityCheck)
+ buf.EncodeUint8(m.TcTos)
+ return buf.Bytes(), nil
+}
+func (m *Ipip6rdAddTunnel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IP6TableID = buf.DecodeUint32()
+ m.IP4TableID = buf.DecodeUint32()
+ copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16))
+ m.IP6Prefix.Len = buf.DecodeUint8()
+ copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4))
+ m.IP4Prefix.Len = buf.DecodeUint8()
+ copy(m.IP4Src[:], buf.DecodeBytes(4))
+ m.SecurityCheck = buf.DecodeBool()
+ m.TcTos = buf.DecodeUint8()
+ return nil
+}
+
+// Ipip6rdAddTunnelReply defines message 'ipip_6rd_add_tunnel_reply'.
+type Ipip6rdAddTunnelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Ipip6rdAddTunnelReply) Reset() { *m = Ipip6rdAddTunnelReply{} }
+func (*Ipip6rdAddTunnelReply) GetMessageName() string { return "ipip_6rd_add_tunnel_reply" }
+func (*Ipip6rdAddTunnelReply) GetCrcString() string { return "5383d31f" }
+func (*Ipip6rdAddTunnelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ipip6rdAddTunnelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Ipip6rdAddTunnelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Ipip6rdDelTunnel defines message 'ipip_6rd_del_tunnel'.
+type Ipip6rdDelTunnel struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Ipip6rdDelTunnel) Reset() { *m = Ipip6rdDelTunnel{} }
+func (*Ipip6rdDelTunnel) GetMessageName() string { return "ipip_6rd_del_tunnel" }
+func (*Ipip6rdDelTunnel) GetCrcString() string { return "f9e6675e" }
+func (*Ipip6rdDelTunnel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Ipip6rdDelTunnel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Ipip6rdDelTunnel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Ipip6rdDelTunnel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Ipip6rdDelTunnelReply defines message 'ipip_6rd_del_tunnel_reply'.
+type Ipip6rdDelTunnelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Ipip6rdDelTunnelReply) Reset() { *m = Ipip6rdDelTunnelReply{} }
+func (*Ipip6rdDelTunnelReply) GetMessageName() string { return "ipip_6rd_del_tunnel_reply" }
+func (*Ipip6rdDelTunnelReply) GetCrcString() string { return "e8d4e804" }
+func (*Ipip6rdDelTunnelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Ipip6rdDelTunnelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Ipip6rdDelTunnelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IpipAddTunnel defines message 'ipip_add_tunnel'.
+type IpipAddTunnel struct {
+ Tunnel IpipTunnel `binapi:"ipip_tunnel,name=tunnel" json:"tunnel,omitempty"`
+}
+
+func (m *IpipAddTunnel) Reset() { *m = IpipAddTunnel{} }
+func (*IpipAddTunnel) GetMessageName() string { return "ipip_add_tunnel" }
+func (*IpipAddTunnel) GetCrcString() string { return "ef93caab" }
+func (*IpipAddTunnel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpipAddTunnel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Tunnel.Instance
+ size += 4 // m.Tunnel.Src.Af
+ size += 1 * 16 // m.Tunnel.Src.Un
+ size += 4 // m.Tunnel.Dst.Af
+ size += 1 * 16 // m.Tunnel.Dst.Un
+ size += 4 // m.Tunnel.SwIfIndex
+ size += 4 // m.Tunnel.TableID
+ size += 1 // m.Tunnel.Flags
+ size += 1 // m.Tunnel.Dscp
+ return size
+}
+func (m *IpipAddTunnel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Tunnel.Instance)
+ buf.EncodeUint32(uint32(m.Tunnel.Src.Af))
+ buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.Dst.Af))
+ buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
+ buf.EncodeUint32(m.Tunnel.TableID)
+ buf.EncodeUint8(uint8(m.Tunnel.Flags))
+ buf.EncodeUint8(uint8(m.Tunnel.Dscp))
+ return buf.Bytes(), nil
+}
+func (m *IpipAddTunnel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Tunnel.Instance = buf.DecodeUint32()
+ m.Tunnel.Src.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.Dst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tunnel.TableID = buf.DecodeUint32()
+ m.Tunnel.Flags = IpipTunnelFlags(buf.DecodeUint8())
+ m.Tunnel.Dscp = IPDscp(buf.DecodeUint8())
+ return nil
+}
+
+// IpipAddTunnelReply defines message 'ipip_add_tunnel_reply'.
+type IpipAddTunnelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IpipAddTunnelReply) Reset() { *m = IpipAddTunnelReply{} }
+func (*IpipAddTunnelReply) GetMessageName() string { return "ipip_add_tunnel_reply" }
+func (*IpipAddTunnelReply) GetCrcString() string { return "5383d31f" }
+func (*IpipAddTunnelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpipAddTunnelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IpipAddTunnelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// IpipDelTunnel defines message 'ipip_del_tunnel'.
+type IpipDelTunnel struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IpipDelTunnel) Reset() { *m = IpipDelTunnel{} }
+func (*IpipDelTunnel) GetMessageName() string { return "ipip_del_tunnel" }
+func (*IpipDelTunnel) GetCrcString() string { return "f9e6675e" }
+func (*IpipDelTunnel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpipDelTunnel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IpipDelTunnel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IpipDelTunnel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// IpipDelTunnelReply defines message 'ipip_del_tunnel_reply'.
+type IpipDelTunnelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IpipDelTunnelReply) Reset() { *m = IpipDelTunnelReply{} }
+func (*IpipDelTunnelReply) GetMessageName() string { return "ipip_del_tunnel_reply" }
+func (*IpipDelTunnelReply) GetCrcString() string { return "e8d4e804" }
+func (*IpipDelTunnelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpipDelTunnelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IpipDelTunnelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IpipTunnelDetails defines message 'ipip_tunnel_details'.
+type IpipTunnelDetails struct {
+ Tunnel IpipTunnel `binapi:"ipip_tunnel,name=tunnel" json:"tunnel,omitempty"`
+}
+
+func (m *IpipTunnelDetails) Reset() { *m = IpipTunnelDetails{} }
+func (*IpipTunnelDetails) GetMessageName() string { return "ipip_tunnel_details" }
+func (*IpipTunnelDetails) GetCrcString() string { return "7f7b5b85" }
+func (*IpipTunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpipTunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Tunnel.Instance
+ size += 4 // m.Tunnel.Src.Af
+ size += 1 * 16 // m.Tunnel.Src.Un
+ size += 4 // m.Tunnel.Dst.Af
+ size += 1 * 16 // m.Tunnel.Dst.Un
+ size += 4 // m.Tunnel.SwIfIndex
+ size += 4 // m.Tunnel.TableID
+ size += 1 // m.Tunnel.Flags
+ size += 1 // m.Tunnel.Dscp
+ return size
+}
+func (m *IpipTunnelDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Tunnel.Instance)
+ buf.EncodeUint32(uint32(m.Tunnel.Src.Af))
+ buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.Dst.Af))
+ buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
+ buf.EncodeUint32(m.Tunnel.TableID)
+ buf.EncodeUint8(uint8(m.Tunnel.Flags))
+ buf.EncodeUint8(uint8(m.Tunnel.Dscp))
+ return buf.Bytes(), nil
+}
+func (m *IpipTunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Tunnel.Instance = buf.DecodeUint32()
+ m.Tunnel.Src.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.Dst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tunnel.TableID = buf.DecodeUint32()
+ m.Tunnel.Flags = IpipTunnelFlags(buf.DecodeUint8())
+ m.Tunnel.Dscp = IPDscp(buf.DecodeUint8())
+ return nil
+}
+
+// IpipTunnelDump defines message 'ipip_tunnel_dump'.
+type IpipTunnelDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IpipTunnelDump) Reset() { *m = IpipTunnelDump{} }
+func (*IpipTunnelDump) GetMessageName() string { return "ipip_tunnel_dump" }
+func (*IpipTunnelDump) GetCrcString() string { return "f9e6675e" }
+func (*IpipTunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpipTunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IpipTunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IpipTunnelDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+func init() { file_ipip_binapi_init() }
+func file_ipip_binapi_init() {
+ api.RegisterMessage((*Ipip6rdAddTunnel)(nil), "ipip_6rd_add_tunnel_56e93cc0")
+ api.RegisterMessage((*Ipip6rdAddTunnelReply)(nil), "ipip_6rd_add_tunnel_reply_5383d31f")
+ api.RegisterMessage((*Ipip6rdDelTunnel)(nil), "ipip_6rd_del_tunnel_f9e6675e")
+ api.RegisterMessage((*Ipip6rdDelTunnelReply)(nil), "ipip_6rd_del_tunnel_reply_e8d4e804")
+ api.RegisterMessage((*IpipAddTunnel)(nil), "ipip_add_tunnel_ef93caab")
+ api.RegisterMessage((*IpipAddTunnelReply)(nil), "ipip_add_tunnel_reply_5383d31f")
+ api.RegisterMessage((*IpipDelTunnel)(nil), "ipip_del_tunnel_f9e6675e")
+ api.RegisterMessage((*IpipDelTunnelReply)(nil), "ipip_del_tunnel_reply_e8d4e804")
+ api.RegisterMessage((*IpipTunnelDetails)(nil), "ipip_tunnel_details_7f7b5b85")
+ api.RegisterMessage((*IpipTunnelDump)(nil), "ipip_tunnel_dump_f9e6675e")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*Ipip6rdAddTunnel)(nil),
+ (*Ipip6rdAddTunnelReply)(nil),
+ (*Ipip6rdDelTunnel)(nil),
+ (*Ipip6rdDelTunnelReply)(nil),
+ (*IpipAddTunnel)(nil),
+ (*IpipAddTunnelReply)(nil),
+ (*IpipDelTunnel)(nil),
+ (*IpipDelTunnelReply)(nil),
+ (*IpipTunnelDetails)(nil),
+ (*IpipTunnelDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ipip/ipip_rpc.ba.go b/internal/testbinapi/binapi2001/ipip/ipip_rpc.ba.go
new file mode 100644
index 0000000..66acb4e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ipip/ipip_rpc.ba.go
@@ -0,0 +1,103 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ipip
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service ipip.
+type RPCService interface {
+ Ipip6rdAddTunnel(ctx context.Context, in *Ipip6rdAddTunnel) (*Ipip6rdAddTunnelReply, error)
+ Ipip6rdDelTunnel(ctx context.Context, in *Ipip6rdDelTunnel) (*Ipip6rdDelTunnelReply, error)
+ IpipAddTunnel(ctx context.Context, in *IpipAddTunnel) (*IpipAddTunnelReply, error)
+ IpipDelTunnel(ctx context.Context, in *IpipDelTunnel) (*IpipDelTunnelReply, error)
+ IpipTunnelDump(ctx context.Context, in *IpipTunnelDump) (RPCService_IpipTunnelDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) Ipip6rdAddTunnel(ctx context.Context, in *Ipip6rdAddTunnel) (*Ipip6rdAddTunnelReply, error) {
+ out := new(Ipip6rdAddTunnelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Ipip6rdDelTunnel(ctx context.Context, in *Ipip6rdDelTunnel) (*Ipip6rdDelTunnelReply, error) {
+ out := new(Ipip6rdDelTunnelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpipAddTunnel(ctx context.Context, in *IpipAddTunnel) (*IpipAddTunnelReply, error) {
+ out := new(IpipAddTunnelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpipDelTunnel(ctx context.Context, in *IpipDelTunnel) (*IpipDelTunnelReply, error) {
+ out := new(IpipDelTunnelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpipTunnelDump(ctx context.Context, in *IpipTunnelDump) (RPCService_IpipTunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpipTunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpipTunnelDumpClient interface {
+ Recv() (*IpipTunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpipTunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpipTunnelDumpClient) Recv() (*IpipTunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpipTunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ipip_types/ipip_types.ba.go b/internal/testbinapi/binapi2001/ipip_types/ipip_types.ba.go
new file mode 100644
index 0000000..62d42d7
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ipip_types/ipip_types.ba.go
@@ -0,0 +1,81 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/ipip_types.api.json
+
+// Package ipip_types contains generated bindings for API file ipip_types.api.
+//
+// Contents:
+// 1 enum
+//
+package ipip_types
+
+import (
+ api "git.fd.io/govpp.git/api"
+ "strconv"
+)
+
+// 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
+
+// IpipTunnelFlags defines enum 'ipip_tunnel_flags'.
+type IpipTunnelFlags uint8
+
+const (
+ IPIP_TUNNEL_API_FLAG_NONE IpipTunnelFlags = 0
+ IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DF IpipTunnelFlags = 1
+ IPIP_TUNNEL_API_FLAG_ENCAP_SET_DF IpipTunnelFlags = 2
+ IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DSCP IpipTunnelFlags = 4
+ IPIP_TUNNEL_API_FLAG_ENCAP_COPY_ECN IpipTunnelFlags = 8
+ IPIP_TUNNEL_API_FLAG_DECAP_COPY_ECN IpipTunnelFlags = 16
+)
+
+var (
+ IpipTunnelFlags_name = map[uint8]string{
+ 0: "IPIP_TUNNEL_API_FLAG_NONE",
+ 1: "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DF",
+ 2: "IPIP_TUNNEL_API_FLAG_ENCAP_SET_DF",
+ 4: "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_DSCP",
+ 8: "IPIP_TUNNEL_API_FLAG_ENCAP_COPY_ECN",
+ 16: "IPIP_TUNNEL_API_FLAG_DECAP_COPY_ECN",
+ }
+ IpipTunnelFlags_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IpipTunnelFlags) String() string {
+ s, ok := IpipTunnelFlags_name[uint8(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint8) string {
+ s, ok := IpipTunnelFlags_name[uint8(n)]
+ if ok {
+ return s
+ }
+ return "IpipTunnelFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint8(0); i <= 8; i++ {
+ val := uint8(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint8(x))
+ }
+ return s
+}
diff --git a/internal/testbinapi/binapi2001/ipsec/ipsec.ba.go b/internal/testbinapi/binapi2001/ipsec/ipsec.ba.go
new file mode 100644
index 0000000..b1c0079
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ipsec/ipsec.ba.go
@@ -0,0 +1,2590 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/ipsec.api.json
+
+// Package ipsec contains generated bindings for API file ipsec.api.
+//
+// Contents:
+// 6 aliases
+// 15 enums
+// 10 structs
+// 1 union
+// 30 messages
+//
+package ipsec
+
+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 = "ipsec"
+ APIVersion = "3.0.0"
+ VersionCrc = 0x5a59fef9
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IpsecCryptoAlg defines enum 'ipsec_crypto_alg'.
+type IpsecCryptoAlg uint32
+
+const (
+ IPSEC_API_CRYPTO_ALG_NONE IpsecCryptoAlg = 0
+ IPSEC_API_CRYPTO_ALG_AES_CBC_128 IpsecCryptoAlg = 1
+ IPSEC_API_CRYPTO_ALG_AES_CBC_192 IpsecCryptoAlg = 2
+ IPSEC_API_CRYPTO_ALG_AES_CBC_256 IpsecCryptoAlg = 3
+ IPSEC_API_CRYPTO_ALG_AES_CTR_128 IpsecCryptoAlg = 4
+ IPSEC_API_CRYPTO_ALG_AES_CTR_192 IpsecCryptoAlg = 5
+ IPSEC_API_CRYPTO_ALG_AES_CTR_256 IpsecCryptoAlg = 6
+ IPSEC_API_CRYPTO_ALG_AES_GCM_128 IpsecCryptoAlg = 7
+ IPSEC_API_CRYPTO_ALG_AES_GCM_192 IpsecCryptoAlg = 8
+ IPSEC_API_CRYPTO_ALG_AES_GCM_256 IpsecCryptoAlg = 9
+ IPSEC_API_CRYPTO_ALG_DES_CBC IpsecCryptoAlg = 10
+ IPSEC_API_CRYPTO_ALG_3DES_CBC IpsecCryptoAlg = 11
+)
+
+var (
+ IpsecCryptoAlg_name = map[uint32]string{
+ 0: "IPSEC_API_CRYPTO_ALG_NONE",
+ 1: "IPSEC_API_CRYPTO_ALG_AES_CBC_128",
+ 2: "IPSEC_API_CRYPTO_ALG_AES_CBC_192",
+ 3: "IPSEC_API_CRYPTO_ALG_AES_CBC_256",
+ 4: "IPSEC_API_CRYPTO_ALG_AES_CTR_128",
+ 5: "IPSEC_API_CRYPTO_ALG_AES_CTR_192",
+ 6: "IPSEC_API_CRYPTO_ALG_AES_CTR_256",
+ 7: "IPSEC_API_CRYPTO_ALG_AES_GCM_128",
+ 8: "IPSEC_API_CRYPTO_ALG_AES_GCM_192",
+ 9: "IPSEC_API_CRYPTO_ALG_AES_GCM_256",
+ 10: "IPSEC_API_CRYPTO_ALG_DES_CBC",
+ 11: "IPSEC_API_CRYPTO_ALG_3DES_CBC",
+ }
+ IpsecCryptoAlg_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IpsecCryptoAlg) String() string {
+ s, ok := IpsecCryptoAlg_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IpsecCryptoAlg(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IpsecIntegAlg defines enum 'ipsec_integ_alg'.
+type IpsecIntegAlg uint32
+
+const (
+ IPSEC_API_INTEG_ALG_NONE IpsecIntegAlg = 0
+ IPSEC_API_INTEG_ALG_MD5_96 IpsecIntegAlg = 1
+ IPSEC_API_INTEG_ALG_SHA1_96 IpsecIntegAlg = 2
+ IPSEC_API_INTEG_ALG_SHA_256_96 IpsecIntegAlg = 3
+ IPSEC_API_INTEG_ALG_SHA_256_128 IpsecIntegAlg = 4
+ IPSEC_API_INTEG_ALG_SHA_384_192 IpsecIntegAlg = 5
+ IPSEC_API_INTEG_ALG_SHA_512_256 IpsecIntegAlg = 6
+)
+
+var (
+ IpsecIntegAlg_name = map[uint32]string{
+ 0: "IPSEC_API_INTEG_ALG_NONE",
+ 1: "IPSEC_API_INTEG_ALG_MD5_96",
+ 2: "IPSEC_API_INTEG_ALG_SHA1_96",
+ 3: "IPSEC_API_INTEG_ALG_SHA_256_96",
+ 4: "IPSEC_API_INTEG_ALG_SHA_256_128",
+ 5: "IPSEC_API_INTEG_ALG_SHA_384_192",
+ 6: "IPSEC_API_INTEG_ALG_SHA_512_256",
+ }
+ IpsecIntegAlg_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IpsecIntegAlg) String() string {
+ s, ok := IpsecIntegAlg_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IpsecIntegAlg(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IpsecProto defines enum 'ipsec_proto'.
+type IpsecProto uint32
+
+const (
+ IPSEC_API_PROTO_ESP IpsecProto = 1
+ IPSEC_API_PROTO_AH IpsecProto = 2
+)
+
+var (
+ IpsecProto_name = map[uint32]string{
+ 1: "IPSEC_API_PROTO_ESP",
+ 2: "IPSEC_API_PROTO_AH",
+ }
+ IpsecProto_value = map[string]uint32{
+ "IPSEC_API_PROTO_ESP": 1,
+ "IPSEC_API_PROTO_AH": 2,
+ }
+)
+
+func (x IpsecProto) String() string {
+ s, ok := IpsecProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IpsecProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IpsecSadFlags defines enum 'ipsec_sad_flags'.
+type IpsecSadFlags uint32
+
+const (
+ IPSEC_API_SAD_FLAG_NONE IpsecSadFlags = 0
+ IPSEC_API_SAD_FLAG_USE_ESN IpsecSadFlags = 1
+ IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY IpsecSadFlags = 2
+ IPSEC_API_SAD_FLAG_IS_TUNNEL IpsecSadFlags = 4
+ IPSEC_API_SAD_FLAG_IS_TUNNEL_V6 IpsecSadFlags = 8
+ IPSEC_API_SAD_FLAG_UDP_ENCAP IpsecSadFlags = 16
+)
+
+var (
+ IpsecSadFlags_name = map[uint32]string{
+ 0: "IPSEC_API_SAD_FLAG_NONE",
+ 1: "IPSEC_API_SAD_FLAG_USE_ESN",
+ 2: "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY",
+ 4: "IPSEC_API_SAD_FLAG_IS_TUNNEL",
+ 8: "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6",
+ 16: "IPSEC_API_SAD_FLAG_UDP_ENCAP",
+ }
+ IpsecSadFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IpsecSadFlags) String() string {
+ s, ok := IpsecSadFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IpsecSadFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IpsecSadFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IpsecSpdAction defines enum 'ipsec_spd_action'.
+type IpsecSpdAction uint32
+
+const (
+ IPSEC_API_SPD_ACTION_BYPASS IpsecSpdAction = 0
+ IPSEC_API_SPD_ACTION_DISCARD IpsecSpdAction = 1
+ IPSEC_API_SPD_ACTION_RESOLVE IpsecSpdAction = 2
+ IPSEC_API_SPD_ACTION_PROTECT IpsecSpdAction = 3
+)
+
+var (
+ IpsecSpdAction_name = map[uint32]string{
+ 0: "IPSEC_API_SPD_ACTION_BYPASS",
+ 1: "IPSEC_API_SPD_ACTION_DISCARD",
+ 2: "IPSEC_API_SPD_ACTION_RESOLVE",
+ 3: "IPSEC_API_SPD_ACTION_PROTECT",
+ }
+ IpsecSpdAction_value = map[string]uint32{
+ "IPSEC_API_SPD_ACTION_BYPASS": 0,
+ "IPSEC_API_SPD_ACTION_DISCARD": 1,
+ "IPSEC_API_SPD_ACTION_RESOLVE": 2,
+ "IPSEC_API_SPD_ACTION_PROTECT": 3,
+ }
+)
+
+func (x IpsecSpdAction) String() string {
+ s, ok := IpsecSpdAction_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IpsecSpdAction(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IpsecSadEntry defines type 'ipsec_sad_entry'.
+type IpsecSadEntry struct {
+ SadID uint32 `binapi:"u32,name=sad_id" json:"sad_id,omitempty"`
+ Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"`
+ Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
+ CryptoAlgorithm IpsecCryptoAlg `binapi:"ipsec_crypto_alg,name=crypto_algorithm" json:"crypto_algorithm,omitempty"`
+ CryptoKey Key `binapi:"key,name=crypto_key" json:"crypto_key,omitempty"`
+ IntegrityAlgorithm IpsecIntegAlg `binapi:"ipsec_integ_alg,name=integrity_algorithm" json:"integrity_algorithm,omitempty"`
+ IntegrityKey Key `binapi:"key,name=integrity_key" json:"integrity_key,omitempty"`
+ Flags IpsecSadFlags `binapi:"ipsec_sad_flags,name=flags" json:"flags,omitempty"`
+ TunnelSrc Address `binapi:"address,name=tunnel_src" json:"tunnel_src,omitempty"`
+ TunnelDst 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"`
+}
+
+// IpsecSpdEntry defines type 'ipsec_spd_entry'.
+type IpsecSpdEntry struct {
+ SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
+ Priority int32 `binapi:"i32,name=priority" json:"priority,omitempty"`
+ IsOutbound uint8 `binapi:"u8,name=is_outbound" json:"is_outbound,omitempty"`
+ SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
+ Policy IpsecSpdAction `binapi:"ipsec_spd_action,name=policy" json:"policy,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ RemoteAddressStart Address `binapi:"address,name=remote_address_start" json:"remote_address_start,omitempty"`
+ RemoteAddressStop Address `binapi:"address,name=remote_address_stop" json:"remote_address_stop,omitempty"`
+ LocalAddressStart Address `binapi:"address,name=local_address_start" json:"local_address_start,omitempty"`
+ LocalAddressStop Address `binapi:"address,name=local_address_stop" json:"local_address_stop,omitempty"`
+ RemotePortStart uint16 `binapi:"u16,name=remote_port_start" json:"remote_port_start,omitempty"`
+ RemotePortStop uint16 `binapi:"u16,name=remote_port_stop" json:"remote_port_stop,omitempty"`
+ LocalPortStart uint16 `binapi:"u16,name=local_port_start" json:"local_port_start,omitempty"`
+ LocalPortStop uint16 `binapi:"u16,name=local_port_stop" json:"local_port_stop,omitempty"`
+}
+
+// IpsecTunnelProtect defines type 'ipsec_tunnel_protect'.
+type IpsecTunnelProtect struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SaOut uint32 `binapi:"u32,name=sa_out" json:"sa_out,omitempty"`
+ NSaIn uint8 `binapi:"u8,name=n_sa_in" json:"-"`
+ SaIn []uint32 `binapi:"u32[n_sa_in],name=sa_in" json:"sa_in,omitempty"`
+}
+
+// Key defines type 'key'.
+type Key struct {
+ Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
+ Data []byte `binapi:"u8[128],name=data" json:"data,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// IpsecBackendDetails defines message 'ipsec_backend_details'.
+type IpsecBackendDetails struct {
+ Name []byte `binapi:"u8[128],name=name" json:"name,omitempty"`
+ Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
+ Index uint8 `binapi:"u8,name=index" json:"index,omitempty"`
+ Active uint8 `binapi:"u8,name=active" json:"active,omitempty"`
+}
+
+func (m *IpsecBackendDetails) Reset() { *m = IpsecBackendDetails{} }
+func (*IpsecBackendDetails) GetMessageName() string { return "ipsec_backend_details" }
+func (*IpsecBackendDetails) GetCrcString() string { return "7700751c" }
+func (*IpsecBackendDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecBackendDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 128 // m.Name
+ size += 4 // m.Protocol
+ size += 1 // m.Index
+ size += 1 // m.Active
+ return size
+}
+func (m *IpsecBackendDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Name, 128)
+ buf.EncodeUint32(uint32(m.Protocol))
+ buf.EncodeUint8(m.Index)
+ buf.EncodeUint8(m.Active)
+ return buf.Bytes(), nil
+}
+func (m *IpsecBackendDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = make([]byte, 128)
+ copy(m.Name, buf.DecodeBytes(len(m.Name)))
+ m.Protocol = IpsecProto(buf.DecodeUint32())
+ m.Index = buf.DecodeUint8()
+ m.Active = buf.DecodeUint8()
+ return nil
+}
+
+// IpsecBackendDump defines message 'ipsec_backend_dump'.
+type IpsecBackendDump struct{}
+
+func (m *IpsecBackendDump) Reset() { *m = IpsecBackendDump{} }
+func (*IpsecBackendDump) GetMessageName() string { return "ipsec_backend_dump" }
+func (*IpsecBackendDump) GetCrcString() string { return "51077d14" }
+func (*IpsecBackendDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecBackendDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *IpsecBackendDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *IpsecBackendDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// IpsecInterfaceAddDelSpd defines message 'ipsec_interface_add_del_spd'.
+type IpsecInterfaceAddDelSpd struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
+}
+
+func (m *IpsecInterfaceAddDelSpd) Reset() { *m = IpsecInterfaceAddDelSpd{} }
+func (*IpsecInterfaceAddDelSpd) GetMessageName() string { return "ipsec_interface_add_del_spd" }
+func (*IpsecInterfaceAddDelSpd) GetCrcString() string { return "1e3b8286" }
+func (*IpsecInterfaceAddDelSpd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecInterfaceAddDelSpd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.SwIfIndex
+ size += 4 // m.SpdID
+ return size
+}
+func (m *IpsecInterfaceAddDelSpd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.SpdID)
+ return buf.Bytes(), nil
+}
+func (m *IpsecInterfaceAddDelSpd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.SpdID = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecInterfaceAddDelSpdReply defines message 'ipsec_interface_add_del_spd_reply'.
+type IpsecInterfaceAddDelSpdReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IpsecInterfaceAddDelSpdReply) Reset() { *m = IpsecInterfaceAddDelSpdReply{} }
+func (*IpsecInterfaceAddDelSpdReply) GetMessageName() string {
+ return "ipsec_interface_add_del_spd_reply"
+}
+func (*IpsecInterfaceAddDelSpdReply) GetCrcString() string { return "e8d4e804" }
+func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecInterfaceAddDelSpdReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IpsecInterfaceAddDelSpdReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IpsecSaDetails defines message 'ipsec_sa_details'.
+type IpsecSaDetails struct {
+ Entry IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
+ SeqOutbound uint64 `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"`
+ LastSeqInbound uint64 `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"`
+ ReplayWindow uint64 `binapi:"u64,name=replay_window" json:"replay_window,omitempty"`
+ TotalDataSize uint64 `binapi:"u64,name=total_data_size" json:"total_data_size,omitempty"`
+}
+
+func (m *IpsecSaDetails) Reset() { *m = IpsecSaDetails{} }
+func (*IpsecSaDetails) GetMessageName() string { return "ipsec_sa_details" }
+func (*IpsecSaDetails) GetCrcString() string { return "9c8d829a" }
+func (*IpsecSaDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecSaDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Entry.SadID
+ size += 4 // m.Entry.Spi
+ size += 4 // m.Entry.Protocol
+ size += 4 // m.Entry.CryptoAlgorithm
+ size += 1 // m.Entry.CryptoKey.Length
+ size += 1 * 128 // m.Entry.CryptoKey.Data
+ size += 4 // m.Entry.IntegrityAlgorithm
+ size += 1 // m.Entry.IntegrityKey.Length
+ size += 1 * 128 // m.Entry.IntegrityKey.Data
+ size += 4 // m.Entry.Flags
+ size += 4 // m.Entry.TunnelSrc.Af
+ size += 1 * 16 // m.Entry.TunnelSrc.Un
+ size += 4 // m.Entry.TunnelDst.Af
+ size += 1 * 16 // m.Entry.TunnelDst.Un
+ size += 4 // m.Entry.TxTableID
+ size += 4 // m.Entry.Salt
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Salt
+ size += 8 // m.SeqOutbound
+ size += 8 // m.LastSeqInbound
+ size += 8 // m.ReplayWindow
+ size += 8 // m.TotalDataSize
+ return size
+}
+func (m *IpsecSaDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(m.Entry.CryptoKey.Length)
+ buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
+ buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
+ buf.EncodeUint8(m.Entry.IntegrityKey.Length)
+ buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
+ buf.EncodeUint32(uint32(m.Entry.Flags))
+ buf.EncodeUint32(uint32(m.Entry.TunnelSrc.Af))
+ buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.TunnelDst.Af))
+ buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(m.Entry.TxTableID)
+ buf.EncodeUint32(m.Entry.Salt)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.Salt)
+ buf.EncodeUint64(m.SeqOutbound)
+ buf.EncodeUint64(m.LastSeqInbound)
+ buf.EncodeUint64(m.ReplayWindow)
+ buf.EncodeUint64(m.TotalDataSize)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSaDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Entry.SadID = buf.DecodeUint32()
+ m.Entry.Spi = buf.DecodeUint32()
+ m.Entry.Protocol = IpsecProto(buf.DecodeUint32())
+ m.Entry.CryptoAlgorithm = IpsecCryptoAlg(buf.DecodeUint32())
+ m.Entry.CryptoKey.Length = buf.DecodeUint8()
+ m.Entry.CryptoKey.Data = make([]byte, 128)
+ copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
+ m.Entry.IntegrityAlgorithm = IpsecIntegAlg(buf.DecodeUint32())
+ m.Entry.IntegrityKey.Length = buf.DecodeUint8()
+ m.Entry.IntegrityKey.Data = make([]byte, 128)
+ copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
+ m.Entry.Flags = IpsecSadFlags(buf.DecodeUint32())
+ m.Entry.TunnelSrc.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.TunnelDst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.TxTableID = buf.DecodeUint32()
+ m.Entry.Salt = buf.DecodeUint32()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Salt = buf.DecodeUint32()
+ m.SeqOutbound = buf.DecodeUint64()
+ m.LastSeqInbound = buf.DecodeUint64()
+ m.ReplayWindow = buf.DecodeUint64()
+ m.TotalDataSize = buf.DecodeUint64()
+ return nil
+}
+
+// IpsecSaDump defines message 'ipsec_sa_dump'.
+type IpsecSaDump struct {
+ SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
+}
+
+func (m *IpsecSaDump) Reset() { *m = IpsecSaDump{} }
+func (*IpsecSaDump) GetMessageName() string { return "ipsec_sa_dump" }
+func (*IpsecSaDump) GetCrcString() string { return "2076c2f4" }
+func (*IpsecSaDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecSaDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SaID
+ return size
+}
+func (m *IpsecSaDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SaID)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSaDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SaID = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecSadEntryAddDel defines message 'ipsec_sad_entry_add_del'.
+type IpsecSadEntryAddDel struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Entry IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
+}
+
+func (m *IpsecSadEntryAddDel) Reset() { *m = IpsecSadEntryAddDel{} }
+func (*IpsecSadEntryAddDel) GetMessageName() string { return "ipsec_sad_entry_add_del" }
+func (*IpsecSadEntryAddDel) GetCrcString() string { return "a25ab61e" }
+func (*IpsecSadEntryAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecSadEntryAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Entry.SadID
+ size += 4 // m.Entry.Spi
+ size += 4 // m.Entry.Protocol
+ size += 4 // m.Entry.CryptoAlgorithm
+ size += 1 // m.Entry.CryptoKey.Length
+ size += 1 * 128 // m.Entry.CryptoKey.Data
+ size += 4 // m.Entry.IntegrityAlgorithm
+ size += 1 // m.Entry.IntegrityKey.Length
+ size += 1 * 128 // m.Entry.IntegrityKey.Data
+ size += 4 // m.Entry.Flags
+ size += 4 // m.Entry.TunnelSrc.Af
+ size += 1 * 16 // m.Entry.TunnelSrc.Un
+ size += 4 // m.Entry.TunnelDst.Af
+ size += 1 * 16 // m.Entry.TunnelDst.Un
+ size += 4 // m.Entry.TxTableID
+ size += 4 // m.Entry.Salt
+ return size
+}
+func (m *IpsecSadEntryAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.Entry.SadID)
+ buf.EncodeUint32(m.Entry.Spi)
+ buf.EncodeUint32(uint32(m.Entry.Protocol))
+ buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
+ buf.EncodeUint8(m.Entry.CryptoKey.Length)
+ buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
+ buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
+ buf.EncodeUint8(m.Entry.IntegrityKey.Length)
+ buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
+ buf.EncodeUint32(uint32(m.Entry.Flags))
+ buf.EncodeUint32(uint32(m.Entry.TunnelSrc.Af))
+ buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.TunnelDst.Af))
+ buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(m.Entry.TxTableID)
+ buf.EncodeUint32(m.Entry.Salt)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSadEntryAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Entry.SadID = buf.DecodeUint32()
+ m.Entry.Spi = buf.DecodeUint32()
+ m.Entry.Protocol = IpsecProto(buf.DecodeUint32())
+ m.Entry.CryptoAlgorithm = IpsecCryptoAlg(buf.DecodeUint32())
+ m.Entry.CryptoKey.Length = buf.DecodeUint8()
+ m.Entry.CryptoKey.Data = make([]byte, 128)
+ copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
+ m.Entry.IntegrityAlgorithm = IpsecIntegAlg(buf.DecodeUint32())
+ m.Entry.IntegrityKey.Length = buf.DecodeUint8()
+ m.Entry.IntegrityKey.Data = make([]byte, 128)
+ copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
+ m.Entry.Flags = IpsecSadFlags(buf.DecodeUint32())
+ m.Entry.TunnelSrc.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.TunnelDst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.TxTableID = buf.DecodeUint32()
+ m.Entry.Salt = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecSadEntryAddDelReply defines message 'ipsec_sad_entry_add_del_reply'.
+type IpsecSadEntryAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
+}
+
+func (m *IpsecSadEntryAddDelReply) Reset() { *m = IpsecSadEntryAddDelReply{} }
+func (*IpsecSadEntryAddDelReply) GetMessageName() string { return "ipsec_sad_entry_add_del_reply" }
+func (*IpsecSadEntryAddDelReply) GetCrcString() string { return "9ffac24b" }
+func (*IpsecSadEntryAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecSadEntryAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.StatIndex
+ return size
+}
+func (m *IpsecSadEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.StatIndex = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecSelectBackend defines message 'ipsec_select_backend'.
+type IpsecSelectBackend struct {
+ Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
+ Index uint8 `binapi:"u8,name=index" json:"index,omitempty"`
+}
+
+func (m *IpsecSelectBackend) Reset() { *m = IpsecSelectBackend{} }
+func (*IpsecSelectBackend) GetMessageName() string { return "ipsec_select_backend" }
+func (*IpsecSelectBackend) GetCrcString() string { return "4fd24836" }
+func (*IpsecSelectBackend) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecSelectBackend) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Protocol
+ size += 1 // m.Index
+ return size
+}
+func (m *IpsecSelectBackend) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Protocol))
+ buf.EncodeUint8(m.Index)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSelectBackend) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Protocol = IpsecProto(buf.DecodeUint32())
+ m.Index = buf.DecodeUint8()
+ return nil
+}
+
+// IpsecSelectBackendReply defines message 'ipsec_select_backend_reply'.
+type IpsecSelectBackendReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IpsecSelectBackendReply) Reset() { *m = IpsecSelectBackendReply{} }
+func (*IpsecSelectBackendReply) GetMessageName() string { return "ipsec_select_backend_reply" }
+func (*IpsecSelectBackendReply) GetCrcString() string { return "e8d4e804" }
+func (*IpsecSelectBackendReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecSelectBackendReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IpsecSelectBackendReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IpsecSpdAddDel defines message 'ipsec_spd_add_del'.
+type IpsecSpdAddDel struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
+}
+
+func (m *IpsecSpdAddDel) Reset() { *m = IpsecSpdAddDel{} }
+func (*IpsecSpdAddDel) GetMessageName() string { return "ipsec_spd_add_del" }
+func (*IpsecSpdAddDel) GetCrcString() string { return "9ffdf5da" }
+func (*IpsecSpdAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecSpdAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.SpdID
+ return size
+}
+func (m *IpsecSpdAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.SpdID)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSpdAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.SpdID = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecSpdAddDelReply defines message 'ipsec_spd_add_del_reply'.
+type IpsecSpdAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IpsecSpdAddDelReply) Reset() { *m = IpsecSpdAddDelReply{} }
+func (*IpsecSpdAddDelReply) GetMessageName() string { return "ipsec_spd_add_del_reply" }
+func (*IpsecSpdAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecSpdAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IpsecSpdAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IpsecSpdDetails defines message 'ipsec_spd_details'.
+type IpsecSpdDetails struct {
+ Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
+}
+
+func (m *IpsecSpdDetails) Reset() { *m = IpsecSpdDetails{} }
+func (*IpsecSpdDetails) GetMessageName() string { return "ipsec_spd_details" }
+func (*IpsecSpdDetails) GetCrcString() string { return "021e2c20" }
+func (*IpsecSpdDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecSpdDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Entry.SpdID
+ size += 4 // m.Entry.Priority
+ size += 1 // m.Entry.IsOutbound
+ size += 4 // m.Entry.SaID
+ size += 4 // m.Entry.Policy
+ size += 1 // m.Entry.Protocol
+ size += 4 // m.Entry.RemoteAddressStart.Af
+ size += 1 * 16 // m.Entry.RemoteAddressStart.Un
+ size += 4 // m.Entry.RemoteAddressStop.Af
+ size += 1 * 16 // m.Entry.RemoteAddressStop.Un
+ size += 4 // m.Entry.LocalAddressStart.Af
+ size += 1 * 16 // m.Entry.LocalAddressStart.Un
+ size += 4 // m.Entry.LocalAddressStop.Af
+ size += 1 * 16 // m.Entry.LocalAddressStop.Un
+ size += 2 // m.Entry.RemotePortStart
+ size += 2 // m.Entry.RemotePortStop
+ size += 2 // m.Entry.LocalPortStart
+ size += 2 // m.Entry.LocalPortStop
+ return size
+}
+func (m *IpsecSpdDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Entry.SpdID)
+ buf.EncodeInt32(m.Entry.Priority)
+ buf.EncodeUint8(m.Entry.IsOutbound)
+ buf.EncodeUint32(m.Entry.SaID)
+ buf.EncodeUint32(uint32(m.Entry.Policy))
+ buf.EncodeUint8(m.Entry.Protocol)
+ buf.EncodeUint32(uint32(m.Entry.RemoteAddressStart.Af))
+ buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.RemoteAddressStop.Af))
+ buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.LocalAddressStart.Af))
+ buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.LocalAddressStop.Af))
+ 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 = buf.DecodeInt32()
+ m.Entry.IsOutbound = buf.DecodeUint8()
+ m.Entry.SaID = buf.DecodeUint32()
+ m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
+ m.Entry.Protocol = buf.DecodeUint8()
+ m.Entry.RemoteAddressStart.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.RemoteAddressStop.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.LocalAddressStart.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.LocalAddressStop.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.RemotePortStart = buf.DecodeUint16()
+ m.Entry.RemotePortStop = buf.DecodeUint16()
+ m.Entry.LocalPortStart = buf.DecodeUint16()
+ m.Entry.LocalPortStop = buf.DecodeUint16()
+ return nil
+}
+
+// IpsecSpdDump defines message 'ipsec_spd_dump'.
+type IpsecSpdDump struct {
+ SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
+ SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
+}
+
+func (m *IpsecSpdDump) Reset() { *m = IpsecSpdDump{} }
+func (*IpsecSpdDump) GetMessageName() string { return "ipsec_spd_dump" }
+func (*IpsecSpdDump) GetCrcString() string { return "afefbf7d" }
+func (*IpsecSpdDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecSpdDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SpdID
+ size += 4 // m.SaID
+ return size
+}
+func (m *IpsecSpdDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SpdID)
+ buf.EncodeUint32(m.SaID)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSpdDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SpdID = buf.DecodeUint32()
+ m.SaID = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecSpdEntryAddDel defines message 'ipsec_spd_entry_add_del'.
+type IpsecSpdEntryAddDel struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
+}
+
+func (m *IpsecSpdEntryAddDel) Reset() { *m = IpsecSpdEntryAddDel{} }
+func (*IpsecSpdEntryAddDel) GetMessageName() string { return "ipsec_spd_entry_add_del" }
+func (*IpsecSpdEntryAddDel) GetCrcString() string { return "db217840" }
+func (*IpsecSpdEntryAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecSpdEntryAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Entry.SpdID
+ size += 4 // m.Entry.Priority
+ size += 1 // m.Entry.IsOutbound
+ size += 4 // m.Entry.SaID
+ size += 4 // m.Entry.Policy
+ size += 1 // m.Entry.Protocol
+ size += 4 // m.Entry.RemoteAddressStart.Af
+ size += 1 * 16 // m.Entry.RemoteAddressStart.Un
+ size += 4 // m.Entry.RemoteAddressStop.Af
+ size += 1 * 16 // m.Entry.RemoteAddressStop.Un
+ size += 4 // m.Entry.LocalAddressStart.Af
+ size += 1 * 16 // m.Entry.LocalAddressStart.Un
+ size += 4 // m.Entry.LocalAddressStop.Af
+ size += 1 * 16 // m.Entry.LocalAddressStop.Un
+ size += 2 // m.Entry.RemotePortStart
+ size += 2 // m.Entry.RemotePortStop
+ size += 2 // m.Entry.LocalPortStart
+ size += 2 // m.Entry.LocalPortStop
+ return size
+}
+func (m *IpsecSpdEntryAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.Entry.SpdID)
+ buf.EncodeInt32(m.Entry.Priority)
+ buf.EncodeUint8(m.Entry.IsOutbound)
+ buf.EncodeUint32(m.Entry.SaID)
+ buf.EncodeUint32(uint32(m.Entry.Policy))
+ buf.EncodeUint8(m.Entry.Protocol)
+ buf.EncodeUint32(uint32(m.Entry.RemoteAddressStart.Af))
+ buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.RemoteAddressStop.Af))
+ buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.LocalAddressStart.Af))
+ buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.LocalAddressStop.Af))
+ 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.DecodeUint8()
+ m.Entry.SpdID = buf.DecodeUint32()
+ m.Entry.Priority = buf.DecodeInt32()
+ m.Entry.IsOutbound = buf.DecodeUint8()
+ m.Entry.SaID = buf.DecodeUint32()
+ m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
+ m.Entry.Protocol = buf.DecodeUint8()
+ m.Entry.RemoteAddressStart.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.RemoteAddressStop.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.LocalAddressStart.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.LocalAddressStop.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.RemotePortStart = buf.DecodeUint16()
+ m.Entry.RemotePortStop = buf.DecodeUint16()
+ m.Entry.LocalPortStart = buf.DecodeUint16()
+ m.Entry.LocalPortStop = buf.DecodeUint16()
+ return nil
+}
+
+// IpsecSpdEntryAddDelReply defines message 'ipsec_spd_entry_add_del_reply'.
+type IpsecSpdEntryAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
+}
+
+func (m *IpsecSpdEntryAddDelReply) Reset() { *m = IpsecSpdEntryAddDelReply{} }
+func (*IpsecSpdEntryAddDelReply) GetMessageName() string { return "ipsec_spd_entry_add_del_reply" }
+func (*IpsecSpdEntryAddDelReply) GetCrcString() string { return "9ffac24b" }
+func (*IpsecSpdEntryAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecSpdEntryAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.StatIndex
+ return size
+}
+func (m *IpsecSpdEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.StatIndex = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecSpdInterfaceDetails defines message 'ipsec_spd_interface_details'.
+type IpsecSpdInterfaceDetails struct {
+ SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IpsecSpdInterfaceDetails) Reset() { *m = IpsecSpdInterfaceDetails{} }
+func (*IpsecSpdInterfaceDetails) GetMessageName() string { return "ipsec_spd_interface_details" }
+func (*IpsecSpdInterfaceDetails) GetCrcString() string { return "2c54296d" }
+func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecSpdInterfaceDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SpdIndex
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IpsecSpdInterfaceDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SpdIndex)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSpdInterfaceDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SpdIndex = buf.DecodeUint32()
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecSpdInterfaceDump defines message 'ipsec_spd_interface_dump'.
+type IpsecSpdInterfaceDump struct {
+ SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
+ SpdIndexValid uint8 `binapi:"u8,name=spd_index_valid" json:"spd_index_valid,omitempty"`
+}
+
+func (m *IpsecSpdInterfaceDump) Reset() { *m = IpsecSpdInterfaceDump{} }
+func (*IpsecSpdInterfaceDump) GetMessageName() string { return "ipsec_spd_interface_dump" }
+func (*IpsecSpdInterfaceDump) GetCrcString() string { return "8971de19" }
+func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecSpdInterfaceDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SpdIndex
+ size += 1 // m.SpdIndexValid
+ return size
+}
+func (m *IpsecSpdInterfaceDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SpdIndex)
+ buf.EncodeUint8(m.SpdIndexValid)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSpdInterfaceDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SpdIndex = buf.DecodeUint32()
+ m.SpdIndexValid = buf.DecodeUint8()
+ return nil
+}
+
+// IpsecSpdsDetails defines message 'ipsec_spds_details'.
+type IpsecSpdsDetails struct {
+ SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
+ Npolicies uint32 `binapi:"u32,name=npolicies" json:"npolicies,omitempty"`
+}
+
+func (m *IpsecSpdsDetails) Reset() { *m = IpsecSpdsDetails{} }
+func (*IpsecSpdsDetails) GetMessageName() string { return "ipsec_spds_details" }
+func (*IpsecSpdsDetails) GetCrcString() string { return "a04bb254" }
+func (*IpsecSpdsDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecSpdsDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SpdID
+ size += 4 // m.Npolicies
+ return size
+}
+func (m *IpsecSpdsDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SpdID)
+ buf.EncodeUint32(m.Npolicies)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSpdsDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SpdID = buf.DecodeUint32()
+ m.Npolicies = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecSpdsDump defines message 'ipsec_spds_dump'.
+type IpsecSpdsDump struct{}
+
+func (m *IpsecSpdsDump) Reset() { *m = IpsecSpdsDump{} }
+func (*IpsecSpdsDump) GetMessageName() string { return "ipsec_spds_dump" }
+func (*IpsecSpdsDump) GetCrcString() string { return "51077d14" }
+func (*IpsecSpdsDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecSpdsDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *IpsecSpdsDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *IpsecSpdsDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// IpsecTunnelIfAddDel defines message 'ipsec_tunnel_if_add_del'.
+type IpsecTunnelIfAddDel struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Esn uint8 `binapi:"u8,name=esn" json:"esn,omitempty"`
+ AntiReplay uint8 `binapi:"u8,name=anti_replay" json:"anti_replay,omitempty"`
+ LocalIP Address `binapi:"address,name=local_ip" json:"local_ip,omitempty"`
+ RemoteIP Address `binapi:"address,name=remote_ip" json:"remote_ip,omitempty"`
+ LocalSpi uint32 `binapi:"u32,name=local_spi" json:"local_spi,omitempty"`
+ RemoteSpi uint32 `binapi:"u32,name=remote_spi" json:"remote_spi,omitempty"`
+ CryptoAlg uint8 `binapi:"u8,name=crypto_alg" json:"crypto_alg,omitempty"`
+ LocalCryptoKeyLen uint8 `binapi:"u8,name=local_crypto_key_len" json:"local_crypto_key_len,omitempty"`
+ LocalCryptoKey []byte `binapi:"u8[128],name=local_crypto_key" json:"local_crypto_key,omitempty"`
+ RemoteCryptoKeyLen uint8 `binapi:"u8,name=remote_crypto_key_len" json:"remote_crypto_key_len,omitempty"`
+ RemoteCryptoKey []byte `binapi:"u8[128],name=remote_crypto_key" json:"remote_crypto_key,omitempty"`
+ IntegAlg uint8 `binapi:"u8,name=integ_alg" json:"integ_alg,omitempty"`
+ LocalIntegKeyLen uint8 `binapi:"u8,name=local_integ_key_len" json:"local_integ_key_len,omitempty"`
+ LocalIntegKey []byte `binapi:"u8[128],name=local_integ_key" json:"local_integ_key,omitempty"`
+ RemoteIntegKeyLen uint8 `binapi:"u8,name=remote_integ_key_len" json:"remote_integ_key_len,omitempty"`
+ RemoteIntegKey []byte `binapi:"u8[128],name=remote_integ_key" json:"remote_integ_key,omitempty"`
+ Renumber uint8 `binapi:"u8,name=renumber" json:"renumber,omitempty"`
+ ShowInstance uint32 `binapi:"u32,name=show_instance" json:"show_instance,omitempty"`
+ UDPEncap uint8 `binapi:"u8,name=udp_encap" json:"udp_encap,omitempty"`
+ TxTableID uint32 `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"`
+ Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
+}
+
+func (m *IpsecTunnelIfAddDel) Reset() { *m = IpsecTunnelIfAddDel{} }
+func (*IpsecTunnelIfAddDel) GetMessageName() string { return "ipsec_tunnel_if_add_del" }
+func (*IpsecTunnelIfAddDel) GetCrcString() string { return "d5a98274" }
+func (*IpsecTunnelIfAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecTunnelIfAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Esn
+ size += 1 // m.AntiReplay
+ size += 4 // m.LocalIP.Af
+ size += 1 * 16 // m.LocalIP.Un
+ size += 4 // m.RemoteIP.Af
+ size += 1 * 16 // m.RemoteIP.Un
+ size += 4 // m.LocalSpi
+ size += 4 // m.RemoteSpi
+ size += 1 // m.CryptoAlg
+ size += 1 // m.LocalCryptoKeyLen
+ size += 1 * 128 // m.LocalCryptoKey
+ size += 1 // m.RemoteCryptoKeyLen
+ size += 1 * 128 // m.RemoteCryptoKey
+ size += 1 // m.IntegAlg
+ size += 1 // m.LocalIntegKeyLen
+ size += 1 * 128 // m.LocalIntegKey
+ size += 1 // m.RemoteIntegKeyLen
+ size += 1 * 128 // m.RemoteIntegKey
+ size += 1 // m.Renumber
+ size += 4 // m.ShowInstance
+ size += 1 // m.UDPEncap
+ size += 4 // m.TxTableID
+ size += 4 // m.Salt
+ return size
+}
+func (m *IpsecTunnelIfAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.Esn)
+ buf.EncodeUint8(m.AntiReplay)
+ buf.EncodeUint32(uint32(m.LocalIP.Af))
+ buf.EncodeBytes(m.LocalIP.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.RemoteIP.Af))
+ 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.EncodeUint8(m.Renumber)
+ buf.EncodeUint32(m.ShowInstance)
+ buf.EncodeUint8(m.UDPEncap)
+ buf.EncodeUint32(m.TxTableID)
+ buf.EncodeUint32(m.Salt)
+ return buf.Bytes(), nil
+}
+func (m *IpsecTunnelIfAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Esn = buf.DecodeUint8()
+ m.AntiReplay = buf.DecodeUint8()
+ m.LocalIP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LocalIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.RemoteIP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.RemoteIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.LocalSpi = buf.DecodeUint32()
+ m.RemoteSpi = buf.DecodeUint32()
+ m.CryptoAlg = buf.DecodeUint8()
+ m.LocalCryptoKeyLen = buf.DecodeUint8()
+ m.LocalCryptoKey = make([]byte, 128)
+ copy(m.LocalCryptoKey, buf.DecodeBytes(len(m.LocalCryptoKey)))
+ m.RemoteCryptoKeyLen = buf.DecodeUint8()
+ m.RemoteCryptoKey = make([]byte, 128)
+ copy(m.RemoteCryptoKey, buf.DecodeBytes(len(m.RemoteCryptoKey)))
+ m.IntegAlg = buf.DecodeUint8()
+ m.LocalIntegKeyLen = buf.DecodeUint8()
+ m.LocalIntegKey = make([]byte, 128)
+ copy(m.LocalIntegKey, buf.DecodeBytes(len(m.LocalIntegKey)))
+ m.RemoteIntegKeyLen = buf.DecodeUint8()
+ m.RemoteIntegKey = make([]byte, 128)
+ copy(m.RemoteIntegKey, buf.DecodeBytes(len(m.RemoteIntegKey)))
+ m.Renumber = buf.DecodeUint8()
+ m.ShowInstance = buf.DecodeUint32()
+ m.UDPEncap = buf.DecodeUint8()
+ m.TxTableID = buf.DecodeUint32()
+ m.Salt = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecTunnelIfAddDelReply defines message 'ipsec_tunnel_if_add_del_reply'.
+type IpsecTunnelIfAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IpsecTunnelIfAddDelReply) Reset() { *m = IpsecTunnelIfAddDelReply{} }
+func (*IpsecTunnelIfAddDelReply) GetMessageName() string { return "ipsec_tunnel_if_add_del_reply" }
+func (*IpsecTunnelIfAddDelReply) GetCrcString() string { return "fda5941f" }
+func (*IpsecTunnelIfAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecTunnelIfAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IpsecTunnelIfAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *IpsecTunnelIfAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// IpsecTunnelIfSetSa defines message 'ipsec_tunnel_if_set_sa'.
+type IpsecTunnelIfSetSa struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
+ IsOutbound uint8 `binapi:"u8,name=is_outbound" json:"is_outbound,omitempty"`
+}
+
+func (m *IpsecTunnelIfSetSa) Reset() { *m = IpsecTunnelIfSetSa{} }
+func (*IpsecTunnelIfSetSa) GetMessageName() string { return "ipsec_tunnel_if_set_sa" }
+func (*IpsecTunnelIfSetSa) GetCrcString() string { return "6ab567f2" }
+func (*IpsecTunnelIfSetSa) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecTunnelIfSetSa) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.SaID
+ size += 1 // m.IsOutbound
+ return size
+}
+func (m *IpsecTunnelIfSetSa) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.SaID)
+ buf.EncodeUint8(m.IsOutbound)
+ return buf.Bytes(), nil
+}
+func (m *IpsecTunnelIfSetSa) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.SaID = buf.DecodeUint32()
+ m.IsOutbound = buf.DecodeUint8()
+ return nil
+}
+
+// IpsecTunnelIfSetSaReply defines message 'ipsec_tunnel_if_set_sa_reply'.
+type IpsecTunnelIfSetSaReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IpsecTunnelIfSetSaReply) Reset() { *m = IpsecTunnelIfSetSaReply{} }
+func (*IpsecTunnelIfSetSaReply) GetMessageName() string { return "ipsec_tunnel_if_set_sa_reply" }
+func (*IpsecTunnelIfSetSaReply) GetCrcString() string { return "e8d4e804" }
+func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecTunnelIfSetSaReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IpsecTunnelIfSetSaReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IpsecTunnelProtectDel defines message 'ipsec_tunnel_protect_del'.
+type IpsecTunnelProtectDel struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IpsecTunnelProtectDel) Reset() { *m = IpsecTunnelProtectDel{} }
+func (*IpsecTunnelProtectDel) GetMessageName() string { return "ipsec_tunnel_protect_del" }
+func (*IpsecTunnelProtectDel) GetCrcString() string { return "f9e6675e" }
+func (*IpsecTunnelProtectDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecTunnelProtectDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IpsecTunnelProtectDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IpsecTunnelProtectDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// IpsecTunnelProtectDelReply defines message 'ipsec_tunnel_protect_del_reply'.
+type IpsecTunnelProtectDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IpsecTunnelProtectDelReply) Reset() { *m = IpsecTunnelProtectDelReply{} }
+func (*IpsecTunnelProtectDelReply) GetMessageName() string { return "ipsec_tunnel_protect_del_reply" }
+func (*IpsecTunnelProtectDelReply) GetCrcString() string { return "e8d4e804" }
+func (*IpsecTunnelProtectDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecTunnelProtectDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IpsecTunnelProtectDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// IpsecTunnelProtectDetails defines message 'ipsec_tunnel_protect_details'.
+type IpsecTunnelProtectDetails struct {
+ Tun IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tun" json:"tun,omitempty"`
+}
+
+func (m *IpsecTunnelProtectDetails) Reset() { *m = IpsecTunnelProtectDetails{} }
+func (*IpsecTunnelProtectDetails) GetMessageName() string { return "ipsec_tunnel_protect_details" }
+func (*IpsecTunnelProtectDetails) GetCrcString() string { return "7520eefe" }
+func (*IpsecTunnelProtectDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecTunnelProtectDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Tun.SwIfIndex
+ size += 4 // m.Tun.SaOut
+ size += 1 // m.Tun.NSaIn
+ size += 4 * len(m.Tun.SaIn) // m.Tun.SaIn
+ return size
+}
+func (m *IpsecTunnelProtectDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Tun.SwIfIndex))
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *IpsecTunnelProtectDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Tun.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tun.SaOut = buf.DecodeUint32()
+ m.Tun.NSaIn = buf.DecodeUint8()
+ m.Tun.SaIn = make([]uint32, m.Tun.NSaIn)
+ for i := 0; i < len(m.Tun.SaIn); i++ {
+ m.Tun.SaIn[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// IpsecTunnelProtectDump defines message 'ipsec_tunnel_protect_dump'.
+type IpsecTunnelProtectDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *IpsecTunnelProtectDump) Reset() { *m = IpsecTunnelProtectDump{} }
+func (*IpsecTunnelProtectDump) GetMessageName() string { return "ipsec_tunnel_protect_dump" }
+func (*IpsecTunnelProtectDump) GetCrcString() string { return "f9e6675e" }
+func (*IpsecTunnelProtectDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecTunnelProtectDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *IpsecTunnelProtectDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IpsecTunnelProtectDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// IpsecTunnelProtectUpdate defines message 'ipsec_tunnel_protect_update'.
+type IpsecTunnelProtectUpdate struct {
+ Tunnel IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tunnel" json:"tunnel,omitempty"`
+}
+
+func (m *IpsecTunnelProtectUpdate) Reset() { *m = IpsecTunnelProtectUpdate{} }
+func (*IpsecTunnelProtectUpdate) GetMessageName() string { return "ipsec_tunnel_protect_update" }
+func (*IpsecTunnelProtectUpdate) GetCrcString() string { return "eccbc177" }
+func (*IpsecTunnelProtectUpdate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IpsecTunnelProtectUpdate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Tunnel.SwIfIndex
+ size += 4 // m.Tunnel.SaOut
+ size += 1 // m.Tunnel.NSaIn
+ size += 4 * len(m.Tunnel.SaIn) // m.Tunnel.SaIn
+ return size
+}
+func (m *IpsecTunnelProtectUpdate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *IpsecTunnelProtectUpdate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Tunnel.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tunnel.SaOut = buf.DecodeUint32()
+ m.Tunnel.NSaIn = buf.DecodeUint8()
+ m.Tunnel.SaIn = make([]uint32, m.Tunnel.NSaIn)
+ for i := 0; i < len(m.Tunnel.SaIn); i++ {
+ m.Tunnel.SaIn[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// IpsecTunnelProtectUpdateReply defines message 'ipsec_tunnel_protect_update_reply'.
+type IpsecTunnelProtectUpdateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IpsecTunnelProtectUpdateReply) Reset() { *m = IpsecTunnelProtectUpdateReply{} }
+func (*IpsecTunnelProtectUpdateReply) GetMessageName() string {
+ return "ipsec_tunnel_protect_update_reply"
+}
+func (*IpsecTunnelProtectUpdateReply) GetCrcString() string { return "e8d4e804" }
+func (*IpsecTunnelProtectUpdateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IpsecTunnelProtectUpdateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IpsecTunnelProtectUpdateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_ipsec_binapi_init() }
+func file_ipsec_binapi_init() {
+ api.RegisterMessage((*IpsecBackendDetails)(nil), "ipsec_backend_details_7700751c")
+ api.RegisterMessage((*IpsecBackendDump)(nil), "ipsec_backend_dump_51077d14")
+ api.RegisterMessage((*IpsecInterfaceAddDelSpd)(nil), "ipsec_interface_add_del_spd_1e3b8286")
+ api.RegisterMessage((*IpsecInterfaceAddDelSpdReply)(nil), "ipsec_interface_add_del_spd_reply_e8d4e804")
+ api.RegisterMessage((*IpsecSaDetails)(nil), "ipsec_sa_details_9c8d829a")
+ api.RegisterMessage((*IpsecSaDump)(nil), "ipsec_sa_dump_2076c2f4")
+ api.RegisterMessage((*IpsecSadEntryAddDel)(nil), "ipsec_sad_entry_add_del_a25ab61e")
+ api.RegisterMessage((*IpsecSadEntryAddDelReply)(nil), "ipsec_sad_entry_add_del_reply_9ffac24b")
+ api.RegisterMessage((*IpsecSelectBackend)(nil), "ipsec_select_backend_4fd24836")
+ api.RegisterMessage((*IpsecSelectBackendReply)(nil), "ipsec_select_backend_reply_e8d4e804")
+ api.RegisterMessage((*IpsecSpdAddDel)(nil), "ipsec_spd_add_del_9ffdf5da")
+ api.RegisterMessage((*IpsecSpdAddDelReply)(nil), "ipsec_spd_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IpsecSpdDetails)(nil), "ipsec_spd_details_021e2c20")
+ api.RegisterMessage((*IpsecSpdDump)(nil), "ipsec_spd_dump_afefbf7d")
+ api.RegisterMessage((*IpsecSpdEntryAddDel)(nil), "ipsec_spd_entry_add_del_db217840")
+ api.RegisterMessage((*IpsecSpdEntryAddDelReply)(nil), "ipsec_spd_entry_add_del_reply_9ffac24b")
+ api.RegisterMessage((*IpsecSpdInterfaceDetails)(nil), "ipsec_spd_interface_details_2c54296d")
+ api.RegisterMessage((*IpsecSpdInterfaceDump)(nil), "ipsec_spd_interface_dump_8971de19")
+ api.RegisterMessage((*IpsecSpdsDetails)(nil), "ipsec_spds_details_a04bb254")
+ api.RegisterMessage((*IpsecSpdsDump)(nil), "ipsec_spds_dump_51077d14")
+ api.RegisterMessage((*IpsecTunnelIfAddDel)(nil), "ipsec_tunnel_if_add_del_d5a98274")
+ api.RegisterMessage((*IpsecTunnelIfAddDelReply)(nil), "ipsec_tunnel_if_add_del_reply_fda5941f")
+ api.RegisterMessage((*IpsecTunnelIfSetSa)(nil), "ipsec_tunnel_if_set_sa_6ab567f2")
+ api.RegisterMessage((*IpsecTunnelIfSetSaReply)(nil), "ipsec_tunnel_if_set_sa_reply_e8d4e804")
+ api.RegisterMessage((*IpsecTunnelProtectDel)(nil), "ipsec_tunnel_protect_del_f9e6675e")
+ api.RegisterMessage((*IpsecTunnelProtectDelReply)(nil), "ipsec_tunnel_protect_del_reply_e8d4e804")
+ api.RegisterMessage((*IpsecTunnelProtectDetails)(nil), "ipsec_tunnel_protect_details_7520eefe")
+ api.RegisterMessage((*IpsecTunnelProtectDump)(nil), "ipsec_tunnel_protect_dump_f9e6675e")
+ api.RegisterMessage((*IpsecTunnelProtectUpdate)(nil), "ipsec_tunnel_protect_update_eccbc177")
+ api.RegisterMessage((*IpsecTunnelProtectUpdateReply)(nil), "ipsec_tunnel_protect_update_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*IpsecBackendDetails)(nil),
+ (*IpsecBackendDump)(nil),
+ (*IpsecInterfaceAddDelSpd)(nil),
+ (*IpsecInterfaceAddDelSpdReply)(nil),
+ (*IpsecSaDetails)(nil),
+ (*IpsecSaDump)(nil),
+ (*IpsecSadEntryAddDel)(nil),
+ (*IpsecSadEntryAddDelReply)(nil),
+ (*IpsecSelectBackend)(nil),
+ (*IpsecSelectBackendReply)(nil),
+ (*IpsecSpdAddDel)(nil),
+ (*IpsecSpdAddDelReply)(nil),
+ (*IpsecSpdDetails)(nil),
+ (*IpsecSpdDump)(nil),
+ (*IpsecSpdEntryAddDel)(nil),
+ (*IpsecSpdEntryAddDelReply)(nil),
+ (*IpsecSpdInterfaceDetails)(nil),
+ (*IpsecSpdInterfaceDump)(nil),
+ (*IpsecSpdsDetails)(nil),
+ (*IpsecSpdsDump)(nil),
+ (*IpsecTunnelIfAddDel)(nil),
+ (*IpsecTunnelIfAddDelReply)(nil),
+ (*IpsecTunnelIfSetSa)(nil),
+ (*IpsecTunnelIfSetSaReply)(nil),
+ (*IpsecTunnelProtectDel)(nil),
+ (*IpsecTunnelProtectDelReply)(nil),
+ (*IpsecTunnelProtectDetails)(nil),
+ (*IpsecTunnelProtectDump)(nil),
+ (*IpsecTunnelProtectUpdate)(nil),
+ (*IpsecTunnelProtectUpdateReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/ipsec/ipsec_rpc.ba.go b/internal/testbinapi/binapi2001/ipsec/ipsec_rpc.ba.go
new file mode 100644
index 0000000..c14df44
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ipsec/ipsec_rpc.ba.go
@@ -0,0 +1,353 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package ipsec
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service ipsec.
+type RPCService interface {
+ IpsecBackendDump(ctx context.Context, in *IpsecBackendDump) (RPCService_IpsecBackendDumpClient, error)
+ IpsecInterfaceAddDelSpd(ctx context.Context, in *IpsecInterfaceAddDelSpd) (*IpsecInterfaceAddDelSpdReply, error)
+ IpsecSaDump(ctx context.Context, in *IpsecSaDump) (RPCService_IpsecSaDumpClient, error)
+ IpsecSadEntryAddDel(ctx context.Context, in *IpsecSadEntryAddDel) (*IpsecSadEntryAddDelReply, error)
+ IpsecSelectBackend(ctx context.Context, in *IpsecSelectBackend) (*IpsecSelectBackendReply, error)
+ IpsecSpdAddDel(ctx context.Context, in *IpsecSpdAddDel) (*IpsecSpdAddDelReply, error)
+ IpsecSpdDump(ctx context.Context, in *IpsecSpdDump) (RPCService_IpsecSpdDumpClient, error)
+ IpsecSpdEntryAddDel(ctx context.Context, in *IpsecSpdEntryAddDel) (*IpsecSpdEntryAddDelReply, error)
+ IpsecSpdInterfaceDump(ctx context.Context, in *IpsecSpdInterfaceDump) (RPCService_IpsecSpdInterfaceDumpClient, error)
+ IpsecSpdsDump(ctx context.Context, in *IpsecSpdsDump) (RPCService_IpsecSpdsDumpClient, error)
+ IpsecTunnelIfAddDel(ctx context.Context, in *IpsecTunnelIfAddDel) (*IpsecTunnelIfAddDelReply, error)
+ IpsecTunnelIfSetSa(ctx context.Context, in *IpsecTunnelIfSetSa) (*IpsecTunnelIfSetSaReply, error)
+ IpsecTunnelProtectDel(ctx context.Context, in *IpsecTunnelProtectDel) (*IpsecTunnelProtectDelReply, error)
+ IpsecTunnelProtectDump(ctx context.Context, in *IpsecTunnelProtectDump) (RPCService_IpsecTunnelProtectDumpClient, error)
+ IpsecTunnelProtectUpdate(ctx context.Context, in *IpsecTunnelProtectUpdate) (*IpsecTunnelProtectUpdateReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) IpsecBackendDump(ctx context.Context, in *IpsecBackendDump) (RPCService_IpsecBackendDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpsecBackendDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpsecBackendDumpClient interface {
+ Recv() (*IpsecBackendDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpsecBackendDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpsecBackendDumpClient) Recv() (*IpsecBackendDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpsecBackendDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IpsecInterfaceAddDelSpd(ctx context.Context, in *IpsecInterfaceAddDelSpd) (*IpsecInterfaceAddDelSpdReply, error) {
+ out := new(IpsecInterfaceAddDelSpdReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpsecSaDump(ctx context.Context, in *IpsecSaDump) (RPCService_IpsecSaDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpsecSaDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpsecSaDumpClient interface {
+ Recv() (*IpsecSaDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpsecSaDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpsecSaDumpClient) Recv() (*IpsecSaDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpsecSaDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IpsecSadEntryAddDel(ctx context.Context, in *IpsecSadEntryAddDel) (*IpsecSadEntryAddDelReply, error) {
+ out := new(IpsecSadEntryAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpsecSelectBackend(ctx context.Context, in *IpsecSelectBackend) (*IpsecSelectBackendReply, error) {
+ out := new(IpsecSelectBackendReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpsecSpdAddDel(ctx context.Context, in *IpsecSpdAddDel) (*IpsecSpdAddDelReply, error) {
+ out := new(IpsecSpdAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpsecSpdDump(ctx context.Context, in *IpsecSpdDump) (RPCService_IpsecSpdDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpsecSpdDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpsecSpdDumpClient interface {
+ Recv() (*IpsecSpdDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpsecSpdDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpsecSpdDumpClient) Recv() (*IpsecSpdDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpsecSpdDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IpsecSpdEntryAddDel(ctx context.Context, in *IpsecSpdEntryAddDel) (*IpsecSpdEntryAddDelReply, error) {
+ out := new(IpsecSpdEntryAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpsecSpdInterfaceDump(ctx context.Context, in *IpsecSpdInterfaceDump) (RPCService_IpsecSpdInterfaceDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpsecSpdInterfaceDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpsecSpdInterfaceDumpClient interface {
+ Recv() (*IpsecSpdInterfaceDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpsecSpdInterfaceDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpsecSpdInterfaceDumpClient) Recv() (*IpsecSpdInterfaceDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpsecSpdInterfaceDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IpsecSpdsDump(ctx context.Context, in *IpsecSpdsDump) (RPCService_IpsecSpdsDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpsecSpdsDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpsecSpdsDumpClient interface {
+ Recv() (*IpsecSpdsDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpsecSpdsDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpsecSpdsDumpClient) Recv() (*IpsecSpdsDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpsecSpdsDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IpsecTunnelIfAddDel(ctx context.Context, in *IpsecTunnelIfAddDel) (*IpsecTunnelIfAddDelReply, error) {
+ out := new(IpsecTunnelIfAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpsecTunnelIfSetSa(ctx context.Context, in *IpsecTunnelIfSetSa) (*IpsecTunnelIfSetSaReply, error) {
+ out := new(IpsecTunnelIfSetSaReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpsecTunnelProtectDel(ctx context.Context, in *IpsecTunnelProtectDel) (*IpsecTunnelProtectDelReply, error) {
+ out := new(IpsecTunnelProtectDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) IpsecTunnelProtectDump(ctx context.Context, in *IpsecTunnelProtectDump) (RPCService_IpsecTunnelProtectDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_IpsecTunnelProtectDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_IpsecTunnelProtectDumpClient interface {
+ Recv() (*IpsecTunnelProtectDetails, error)
+ api.Stream
+}
+
+type serviceClient_IpsecTunnelProtectDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_IpsecTunnelProtectDumpClient) Recv() (*IpsecTunnelProtectDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *IpsecTunnelProtectDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) IpsecTunnelProtectUpdate(ctx context.Context, in *IpsecTunnelProtectUpdate) (*IpsecTunnelProtectUpdateReply, error) {
+ out := new(IpsecTunnelProtectUpdateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/ipsec_types/ipsec_types.ba.go b/internal/testbinapi/binapi2001/ipsec_types/ipsec_types.ba.go
new file mode 100644
index 0000000..9123fc4
--- /dev/null
+++ b/internal/testbinapi/binapi2001/ipsec_types/ipsec_types.ba.go
@@ -0,0 +1,795 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/ipsec_types.api.json
+
+// Package ipsec_types contains generated bindings for API file ipsec_types.api.
+//
+// Contents:
+// 5 aliases
+// 8 enums
+// 8 structs
+// 1 union
+//
+package ipsec_types
+
+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
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IpsecCryptoAlg defines enum 'ipsec_crypto_alg'.
+type IpsecCryptoAlg uint32
+
+const (
+ IPSEC_API_CRYPTO_ALG_NONE IpsecCryptoAlg = 0
+ IPSEC_API_CRYPTO_ALG_AES_CBC_128 IpsecCryptoAlg = 1
+ IPSEC_API_CRYPTO_ALG_AES_CBC_192 IpsecCryptoAlg = 2
+ IPSEC_API_CRYPTO_ALG_AES_CBC_256 IpsecCryptoAlg = 3
+ IPSEC_API_CRYPTO_ALG_AES_CTR_128 IpsecCryptoAlg = 4
+ IPSEC_API_CRYPTO_ALG_AES_CTR_192 IpsecCryptoAlg = 5
+ IPSEC_API_CRYPTO_ALG_AES_CTR_256 IpsecCryptoAlg = 6
+ IPSEC_API_CRYPTO_ALG_AES_GCM_128 IpsecCryptoAlg = 7
+ IPSEC_API_CRYPTO_ALG_AES_GCM_192 IpsecCryptoAlg = 8
+ IPSEC_API_CRYPTO_ALG_AES_GCM_256 IpsecCryptoAlg = 9
+ IPSEC_API_CRYPTO_ALG_DES_CBC IpsecCryptoAlg = 10
+ IPSEC_API_CRYPTO_ALG_3DES_CBC IpsecCryptoAlg = 11
+)
+
+var (
+ IpsecCryptoAlg_name = map[uint32]string{
+ 0: "IPSEC_API_CRYPTO_ALG_NONE",
+ 1: "IPSEC_API_CRYPTO_ALG_AES_CBC_128",
+ 2: "IPSEC_API_CRYPTO_ALG_AES_CBC_192",
+ 3: "IPSEC_API_CRYPTO_ALG_AES_CBC_256",
+ 4: "IPSEC_API_CRYPTO_ALG_AES_CTR_128",
+ 5: "IPSEC_API_CRYPTO_ALG_AES_CTR_192",
+ 6: "IPSEC_API_CRYPTO_ALG_AES_CTR_256",
+ 7: "IPSEC_API_CRYPTO_ALG_AES_GCM_128",
+ 8: "IPSEC_API_CRYPTO_ALG_AES_GCM_192",
+ 9: "IPSEC_API_CRYPTO_ALG_AES_GCM_256",
+ 10: "IPSEC_API_CRYPTO_ALG_DES_CBC",
+ 11: "IPSEC_API_CRYPTO_ALG_3DES_CBC",
+ }
+ IpsecCryptoAlg_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IpsecCryptoAlg) String() string {
+ s, ok := IpsecCryptoAlg_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IpsecCryptoAlg(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IpsecIntegAlg defines enum 'ipsec_integ_alg'.
+type IpsecIntegAlg uint32
+
+const (
+ IPSEC_API_INTEG_ALG_NONE IpsecIntegAlg = 0
+ IPSEC_API_INTEG_ALG_MD5_96 IpsecIntegAlg = 1
+ IPSEC_API_INTEG_ALG_SHA1_96 IpsecIntegAlg = 2
+ IPSEC_API_INTEG_ALG_SHA_256_96 IpsecIntegAlg = 3
+ IPSEC_API_INTEG_ALG_SHA_256_128 IpsecIntegAlg = 4
+ IPSEC_API_INTEG_ALG_SHA_384_192 IpsecIntegAlg = 5
+ IPSEC_API_INTEG_ALG_SHA_512_256 IpsecIntegAlg = 6
+)
+
+var (
+ IpsecIntegAlg_name = map[uint32]string{
+ 0: "IPSEC_API_INTEG_ALG_NONE",
+ 1: "IPSEC_API_INTEG_ALG_MD5_96",
+ 2: "IPSEC_API_INTEG_ALG_SHA1_96",
+ 3: "IPSEC_API_INTEG_ALG_SHA_256_96",
+ 4: "IPSEC_API_INTEG_ALG_SHA_256_128",
+ 5: "IPSEC_API_INTEG_ALG_SHA_384_192",
+ 6: "IPSEC_API_INTEG_ALG_SHA_512_256",
+ }
+ IpsecIntegAlg_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IpsecIntegAlg) String() string {
+ s, ok := IpsecIntegAlg_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IpsecIntegAlg(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IpsecProto defines enum 'ipsec_proto'.
+type IpsecProto uint32
+
+const (
+ IPSEC_API_PROTO_ESP IpsecProto = 1
+ IPSEC_API_PROTO_AH IpsecProto = 2
+)
+
+var (
+ IpsecProto_name = map[uint32]string{
+ 1: "IPSEC_API_PROTO_ESP",
+ 2: "IPSEC_API_PROTO_AH",
+ }
+ IpsecProto_value = map[string]uint32{
+ "IPSEC_API_PROTO_ESP": 1,
+ "IPSEC_API_PROTO_AH": 2,
+ }
+)
+
+func (x IpsecProto) String() string {
+ s, ok := IpsecProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IpsecProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IpsecSadFlags defines enum 'ipsec_sad_flags'.
+type IpsecSadFlags uint32
+
+const (
+ IPSEC_API_SAD_FLAG_NONE IpsecSadFlags = 0
+ IPSEC_API_SAD_FLAG_USE_ESN IpsecSadFlags = 1
+ IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY IpsecSadFlags = 2
+ IPSEC_API_SAD_FLAG_IS_TUNNEL IpsecSadFlags = 4
+ IPSEC_API_SAD_FLAG_IS_TUNNEL_V6 IpsecSadFlags = 8
+ IPSEC_API_SAD_FLAG_UDP_ENCAP IpsecSadFlags = 16
+)
+
+var (
+ IpsecSadFlags_name = map[uint32]string{
+ 0: "IPSEC_API_SAD_FLAG_NONE",
+ 1: "IPSEC_API_SAD_FLAG_USE_ESN",
+ 2: "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY",
+ 4: "IPSEC_API_SAD_FLAG_IS_TUNNEL",
+ 8: "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6",
+ 16: "IPSEC_API_SAD_FLAG_UDP_ENCAP",
+ }
+ IpsecSadFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IpsecSadFlags) String() string {
+ s, ok := IpsecSadFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IpsecSadFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IpsecSadFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IpsecSadEntry defines type 'ipsec_sad_entry'.
+type IpsecSadEntry struct {
+ SadID uint32 `binapi:"u32,name=sad_id" json:"sad_id,omitempty"`
+ Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"`
+ Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
+ CryptoAlgorithm IpsecCryptoAlg `binapi:"ipsec_crypto_alg,name=crypto_algorithm" json:"crypto_algorithm,omitempty"`
+ CryptoKey Key `binapi:"key,name=crypto_key" json:"crypto_key,omitempty"`
+ IntegrityAlgorithm IpsecIntegAlg `binapi:"ipsec_integ_alg,name=integrity_algorithm" json:"integrity_algorithm,omitempty"`
+ IntegrityKey Key `binapi:"key,name=integrity_key" json:"integrity_key,omitempty"`
+ Flags IpsecSadFlags `binapi:"ipsec_sad_flags,name=flags" json:"flags,omitempty"`
+ TunnelSrc Address `binapi:"address,name=tunnel_src" json:"tunnel_src,omitempty"`
+ TunnelDst 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"`
+}
+
+// Key defines type 'key'.
+type Key struct {
+ Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
+ Data []byte `binapi:"u8[128],name=data" json:"data,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
diff --git a/internal/testbinapi/binapi2001/l2/l2.ba.go b/internal/testbinapi/binapi2001/l2/l2.ba.go
new file mode 100644
index 0000000..d4af668
--- /dev/null
+++ b/internal/testbinapi/binapi2001/l2/l2.ba.go
@@ -0,0 +1,3250 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/l2.api.json
+
+// Package l2 contains generated bindings for API file l2.api.
+//
+// Contents:
+// 7 aliases
+// 12 enums
+// 9 structs
+// 1 union
+// 54 messages
+//
+package l2
+
+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 = "l2"
+ APIVersion = "2.2.2"
+ VersionCrc = 0x2e148df3
+)
+
+// 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)) + ")"
+}
+
+// BdFlags defines enum 'bd_flags'.
+type BdFlags uint32
+
+const (
+ BRIDGE_API_FLAG_NONE BdFlags = 0
+ BRIDGE_API_FLAG_LEARN BdFlags = 1
+ BRIDGE_API_FLAG_FWD BdFlags = 2
+ BRIDGE_API_FLAG_FLOOD BdFlags = 4
+ BRIDGE_API_FLAG_UU_FLOOD BdFlags = 8
+ BRIDGE_API_FLAG_ARP_TERM BdFlags = 16
+ BRIDGE_API_FLAG_ARP_UFWD BdFlags = 32
+)
+
+var (
+ BdFlags_name = map[uint32]string{
+ 0: "BRIDGE_API_FLAG_NONE",
+ 1: "BRIDGE_API_FLAG_LEARN",
+ 2: "BRIDGE_API_FLAG_FWD",
+ 4: "BRIDGE_API_FLAG_FLOOD",
+ 8: "BRIDGE_API_FLAG_UU_FLOOD",
+ 16: "BRIDGE_API_FLAG_ARP_TERM",
+ 32: "BRIDGE_API_FLAG_ARP_UFWD",
+ }
+ BdFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x BdFlags) String() string {
+ s, ok := BdFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := BdFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "BdFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// L2PortType defines enum 'l2_port_type'.
+type L2PortType uint32
+
+const (
+ L2_API_PORT_TYPE_NORMAL L2PortType = 0
+ L2_API_PORT_TYPE_BVI L2PortType = 1
+ L2_API_PORT_TYPE_UU_FWD L2PortType = 2
+)
+
+var (
+ L2PortType_name = map[uint32]string{
+ 0: "L2_API_PORT_TYPE_NORMAL",
+ 1: "L2_API_PORT_TYPE_BVI",
+ 2: "L2_API_PORT_TYPE_UU_FWD",
+ }
+ L2PortType_value = map[string]uint32{
+ "L2_API_PORT_TYPE_NORMAL": 0,
+ "L2_API_PORT_TYPE_BVI": 1,
+ "L2_API_PORT_TYPE_UU_FWD": 2,
+ }
+)
+
+func (x L2PortType) String() string {
+ s, ok := L2PortType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "L2PortType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// BdIPMac defines type 'bd_ip_mac'.
+type BdIPMac struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ IP Address `binapi:"address,name=ip" json:"ip,omitempty"`
+ Mac MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
+}
+
+// BridgeDomainSwIf defines type 'bridge_domain_sw_if'.
+type BridgeDomainSwIf struct {
+ Context uint32 `binapi:"u32,name=context" json:"context,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Shg uint8 `binapi:"u8,name=shg" json:"shg,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// MacEntry defines type 'mac_entry'.
+type MacEntry struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ MacAddr []byte `binapi:"u8[6],name=mac_addr" json:"mac_addr,omitempty"`
+ Action uint8 `binapi:"u8,name=action" json:"action,omitempty"`
+ Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// BdIPMacAddDel defines message 'bd_ip_mac_add_del'.
+type BdIPMacAddDel struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Entry BdIPMac `binapi:"bd_ip_mac,name=entry" json:"entry,omitempty"`
+}
+
+func (m *BdIPMacAddDel) Reset() { *m = BdIPMacAddDel{} }
+func (*BdIPMacAddDel) GetMessageName() string { return "bd_ip_mac_add_del" }
+func (*BdIPMacAddDel) GetCrcString() string { return "25bf4063" }
+func (*BdIPMacAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BdIPMacAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Entry.BdID
+ size += 4 // m.Entry.IP.Af
+ size += 1 * 16 // m.Entry.IP.Un
+ size += 1 * 6 // m.Entry.Mac
+ return size
+}
+func (m *BdIPMacAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.Entry.BdID)
+ buf.EncodeUint32(uint32(m.Entry.IP.Af))
+ buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 16)
+ buf.EncodeBytes(m.Entry.Mac[:], 6)
+ return buf.Bytes(), nil
+}
+func (m *BdIPMacAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Entry.BdID = buf.DecodeUint32()
+ m.Entry.IP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ copy(m.Entry.Mac[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// BdIPMacAddDelReply defines message 'bd_ip_mac_add_del_reply'.
+type BdIPMacAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BdIPMacAddDelReply) Reset() { *m = BdIPMacAddDelReply{} }
+func (*BdIPMacAddDelReply) GetMessageName() string { return "bd_ip_mac_add_del_reply" }
+func (*BdIPMacAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*BdIPMacAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BdIPMacAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BdIPMacAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BdIPMacDetails defines message 'bd_ip_mac_details'.
+type BdIPMacDetails struct {
+ Entry BdIPMac `binapi:"bd_ip_mac,name=entry" json:"entry,omitempty"`
+}
+
+func (m *BdIPMacDetails) Reset() { *m = BdIPMacDetails{} }
+func (*BdIPMacDetails) GetMessageName() string { return "bd_ip_mac_details" }
+func (*BdIPMacDetails) GetCrcString() string { return "a52f8044" }
+func (*BdIPMacDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BdIPMacDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Entry.BdID
+ size += 4 // m.Entry.IP.Af
+ size += 1 * 16 // m.Entry.IP.Un
+ size += 1 * 6 // m.Entry.Mac
+ return size
+}
+func (m *BdIPMacDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Entry.BdID)
+ buf.EncodeUint32(uint32(m.Entry.IP.Af))
+ buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 16)
+ buf.EncodeBytes(m.Entry.Mac[:], 6)
+ return buf.Bytes(), nil
+}
+func (m *BdIPMacDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Entry.BdID = buf.DecodeUint32()
+ m.Entry.IP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ copy(m.Entry.Mac[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// BdIPMacDump defines message 'bd_ip_mac_dump'.
+type BdIPMacDump struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+}
+
+func (m *BdIPMacDump) Reset() { *m = BdIPMacDump{} }
+func (*BdIPMacDump) GetMessageName() string { return "bd_ip_mac_dump" }
+func (*BdIPMacDump) GetCrcString() string { return "c25fdce6" }
+func (*BdIPMacDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BdIPMacDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ return size
+}
+func (m *BdIPMacDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ return buf.Bytes(), nil
+}
+func (m *BdIPMacDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ return nil
+}
+
+// BdIPMacFlush defines message 'bd_ip_mac_flush'.
+type BdIPMacFlush struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+}
+
+func (m *BdIPMacFlush) Reset() { *m = BdIPMacFlush{} }
+func (*BdIPMacFlush) GetMessageName() string { return "bd_ip_mac_flush" }
+func (*BdIPMacFlush) GetCrcString() string { return "c25fdce6" }
+func (*BdIPMacFlush) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BdIPMacFlush) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ return size
+}
+func (m *BdIPMacFlush) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ return buf.Bytes(), nil
+}
+func (m *BdIPMacFlush) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ return nil
+}
+
+// BdIPMacFlushReply defines message 'bd_ip_mac_flush_reply'.
+type BdIPMacFlushReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BdIPMacFlushReply) Reset() { *m = BdIPMacFlushReply{} }
+func (*BdIPMacFlushReply) GetMessageName() string { return "bd_ip_mac_flush_reply" }
+func (*BdIPMacFlushReply) GetCrcString() string { return "e8d4e804" }
+func (*BdIPMacFlushReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BdIPMacFlushReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BdIPMacFlushReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BridgeDomainAddDel defines message 'bridge_domain_add_del'.
+type BridgeDomainAddDel struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ Flood uint8 `binapi:"u8,name=flood" json:"flood,omitempty"`
+ UuFlood uint8 `binapi:"u8,name=uu_flood" json:"uu_flood,omitempty"`
+ Forward uint8 `binapi:"u8,name=forward" json:"forward,omitempty"`
+ Learn uint8 `binapi:"u8,name=learn" json:"learn,omitempty"`
+ ArpTerm uint8 `binapi:"u8,name=arp_term" json:"arp_term,omitempty"`
+ ArpUfwd uint8 `binapi:"u8,name=arp_ufwd" json:"arp_ufwd,omitempty"`
+ MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"`
+ BdTag []byte `binapi:"u8[64],name=bd_tag" json:"bd_tag,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *BridgeDomainAddDel) Reset() { *m = BridgeDomainAddDel{} }
+func (*BridgeDomainAddDel) GetMessageName() string { return "bridge_domain_add_del" }
+func (*BridgeDomainAddDel) GetCrcString() string { return "c6360720" }
+func (*BridgeDomainAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BridgeDomainAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ size += 1 // m.Flood
+ size += 1 // m.UuFlood
+ size += 1 // m.Forward
+ size += 1 // m.Learn
+ size += 1 // m.ArpTerm
+ size += 1 // m.ArpUfwd
+ size += 1 // m.MacAge
+ size += 1 * 64 // m.BdTag
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *BridgeDomainAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ buf.EncodeUint8(m.Flood)
+ buf.EncodeUint8(m.UuFlood)
+ buf.EncodeUint8(m.Forward)
+ buf.EncodeUint8(m.Learn)
+ buf.EncodeUint8(m.ArpTerm)
+ buf.EncodeUint8(m.ArpUfwd)
+ buf.EncodeUint8(m.MacAge)
+ buf.EncodeBytes(m.BdTag, 64)
+ buf.EncodeUint8(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *BridgeDomainAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ m.Flood = buf.DecodeUint8()
+ m.UuFlood = buf.DecodeUint8()
+ m.Forward = buf.DecodeUint8()
+ m.Learn = buf.DecodeUint8()
+ m.ArpTerm = buf.DecodeUint8()
+ m.ArpUfwd = buf.DecodeUint8()
+ m.MacAge = buf.DecodeUint8()
+ m.BdTag = make([]byte, 64)
+ copy(m.BdTag, buf.DecodeBytes(len(m.BdTag)))
+ m.IsAdd = buf.DecodeUint8()
+ return nil
+}
+
+// BridgeDomainAddDelReply defines message 'bridge_domain_add_del_reply'.
+type BridgeDomainAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BridgeDomainAddDelReply) Reset() { *m = BridgeDomainAddDelReply{} }
+func (*BridgeDomainAddDelReply) GetMessageName() string { return "bridge_domain_add_del_reply" }
+func (*BridgeDomainAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*BridgeDomainAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BridgeDomainAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BridgeDomainAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BridgeDomainDetails defines message 'bridge_domain_details'.
+type BridgeDomainDetails struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ Flood uint8 `binapi:"u8,name=flood" json:"flood,omitempty"`
+ UuFlood uint8 `binapi:"u8,name=uu_flood" json:"uu_flood,omitempty"`
+ Forward uint8 `binapi:"u8,name=forward" json:"forward,omitempty"`
+ Learn uint8 `binapi:"u8,name=learn" json:"learn,omitempty"`
+ ArpTerm uint8 `binapi:"u8,name=arp_term" json:"arp_term,omitempty"`
+ ArpUfwd uint8 `binapi:"u8,name=arp_ufwd" json:"arp_ufwd,omitempty"`
+ MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"`
+ BdTag []byte `binapi:"u8[64],name=bd_tag" json:"bd_tag,omitempty"`
+ BviSwIfIndex uint32 `binapi:"u32,name=bvi_sw_if_index" json:"bvi_sw_if_index,omitempty"`
+ UuFwdSwIfIndex uint32 `binapi:"u32,name=uu_fwd_sw_if_index" json:"uu_fwd_sw_if_index,omitempty"`
+ NSwIfs uint32 `binapi:"u32,name=n_sw_ifs" json:"-"`
+ SwIfDetails []BridgeDomainSwIf `binapi:"bridge_domain_sw_if[n_sw_ifs],name=sw_if_details" json:"sw_if_details,omitempty"`
+}
+
+func (m *BridgeDomainDetails) Reset() { *m = BridgeDomainDetails{} }
+func (*BridgeDomainDetails) GetMessageName() string { return "bridge_domain_details" }
+func (*BridgeDomainDetails) GetCrcString() string { return "748c854a" }
+func (*BridgeDomainDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BridgeDomainDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ size += 1 // m.Flood
+ size += 1 // m.UuFlood
+ size += 1 // m.Forward
+ size += 1 // m.Learn
+ size += 1 // m.ArpTerm
+ size += 1 // m.ArpUfwd
+ size += 1 // m.MacAge
+ size += 1 * 64 // m.BdTag
+ size += 4 // m.BviSwIfIndex
+ size += 4 // m.UuFwdSwIfIndex
+ size += 4 // m.NSwIfs
+ for j1 := 0; j1 < len(m.SwIfDetails); j1++ {
+ var s1 BridgeDomainSwIf
+ _ = s1
+ if j1 < len(m.SwIfDetails) {
+ s1 = m.SwIfDetails[j1]
+ }
+ size += 4 // s1.Context
+ size += 4 // s1.SwIfIndex
+ size += 1 // s1.Shg
+ }
+ return size
+}
+func (m *BridgeDomainDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ buf.EncodeUint8(m.Flood)
+ buf.EncodeUint8(m.UuFlood)
+ buf.EncodeUint8(m.Forward)
+ buf.EncodeUint8(m.Learn)
+ buf.EncodeUint8(m.ArpTerm)
+ buf.EncodeUint8(m.ArpUfwd)
+ buf.EncodeUint8(m.MacAge)
+ buf.EncodeBytes(m.BdTag, 64)
+ buf.EncodeUint32(m.BviSwIfIndex)
+ buf.EncodeUint32(m.UuFwdSwIfIndex)
+ buf.EncodeUint32(uint32(len(m.SwIfDetails)))
+ for j0 := 0; j0 < len(m.SwIfDetails); j0++ {
+ var v0 BridgeDomainSwIf // SwIfDetails
+ if j0 < len(m.SwIfDetails) {
+ v0 = m.SwIfDetails[j0]
+ }
+ buf.EncodeUint32(v0.Context)
+ buf.EncodeUint32(v0.SwIfIndex)
+ buf.EncodeUint8(v0.Shg)
+ }
+ return buf.Bytes(), nil
+}
+func (m *BridgeDomainDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ m.Flood = buf.DecodeUint8()
+ m.UuFlood = buf.DecodeUint8()
+ m.Forward = buf.DecodeUint8()
+ m.Learn = buf.DecodeUint8()
+ m.ArpTerm = buf.DecodeUint8()
+ m.ArpUfwd = buf.DecodeUint8()
+ m.MacAge = buf.DecodeUint8()
+ m.BdTag = make([]byte, 64)
+ copy(m.BdTag, buf.DecodeBytes(len(m.BdTag)))
+ m.BviSwIfIndex = buf.DecodeUint32()
+ m.UuFwdSwIfIndex = buf.DecodeUint32()
+ m.NSwIfs = buf.DecodeUint32()
+ m.SwIfDetails = make([]BridgeDomainSwIf, m.NSwIfs)
+ for j0 := 0; j0 < len(m.SwIfDetails); j0++ {
+ m.SwIfDetails[j0].Context = buf.DecodeUint32()
+ m.SwIfDetails[j0].SwIfIndex = buf.DecodeUint32()
+ m.SwIfDetails[j0].Shg = buf.DecodeUint8()
+ }
+ return nil
+}
+
+// BridgeDomainDump defines message 'bridge_domain_dump'.
+type BridgeDomainDump struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+}
+
+func (m *BridgeDomainDump) Reset() { *m = BridgeDomainDump{} }
+func (*BridgeDomainDump) GetMessageName() string { return "bridge_domain_dump" }
+func (*BridgeDomainDump) GetCrcString() string { return "c25fdce6" }
+func (*BridgeDomainDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BridgeDomainDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ return size
+}
+func (m *BridgeDomainDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ return buf.Bytes(), nil
+}
+func (m *BridgeDomainDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ return nil
+}
+
+// BridgeDomainSetMacAge defines message 'bridge_domain_set_mac_age'.
+type BridgeDomainSetMacAge struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"`
+}
+
+func (m *BridgeDomainSetMacAge) Reset() { *m = BridgeDomainSetMacAge{} }
+func (*BridgeDomainSetMacAge) GetMessageName() string { return "bridge_domain_set_mac_age" }
+func (*BridgeDomainSetMacAge) GetCrcString() string { return "b537ad7b" }
+func (*BridgeDomainSetMacAge) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BridgeDomainSetMacAge) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ size += 1 // m.MacAge
+ return size
+}
+func (m *BridgeDomainSetMacAge) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ buf.EncodeUint8(m.MacAge)
+ return buf.Bytes(), nil
+}
+func (m *BridgeDomainSetMacAge) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ m.MacAge = buf.DecodeUint8()
+ return nil
+}
+
+// BridgeDomainSetMacAgeReply defines message 'bridge_domain_set_mac_age_reply'.
+type BridgeDomainSetMacAgeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BridgeDomainSetMacAgeReply) Reset() { *m = BridgeDomainSetMacAgeReply{} }
+func (*BridgeDomainSetMacAgeReply) GetMessageName() string { return "bridge_domain_set_mac_age_reply" }
+func (*BridgeDomainSetMacAgeReply) GetCrcString() string { return "e8d4e804" }
+func (*BridgeDomainSetMacAgeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BridgeDomainSetMacAgeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BridgeDomainSetMacAgeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BridgeFlags defines message 'bridge_flags'.
+type BridgeFlags struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ IsSet uint8 `binapi:"u8,name=is_set" json:"is_set,omitempty"`
+ Flags BdFlags `binapi:"bd_flags,name=flags" json:"flags,omitempty"`
+}
+
+func (m *BridgeFlags) Reset() { *m = BridgeFlags{} }
+func (*BridgeFlags) GetMessageName() string { return "bridge_flags" }
+func (*BridgeFlags) GetCrcString() string { return "2eb9b76c" }
+func (*BridgeFlags) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BridgeFlags) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ size += 1 // m.IsSet
+ size += 4 // m.Flags
+ return size
+}
+func (m *BridgeFlags) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ buf.EncodeUint8(m.IsSet)
+ buf.EncodeUint32(uint32(m.Flags))
+ return buf.Bytes(), nil
+}
+func (m *BridgeFlags) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ m.IsSet = buf.DecodeUint8()
+ m.Flags = BdFlags(buf.DecodeUint32())
+ return nil
+}
+
+// BridgeFlagsReply defines message 'bridge_flags_reply'.
+type BridgeFlagsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ ResultingFeatureBitmap uint32 `binapi:"u32,name=resulting_feature_bitmap" json:"resulting_feature_bitmap,omitempty"`
+}
+
+func (m *BridgeFlagsReply) Reset() { *m = BridgeFlagsReply{} }
+func (*BridgeFlagsReply) GetMessageName() string { return "bridge_flags_reply" }
+func (*BridgeFlagsReply) GetCrcString() string { return "29b2a2b3" }
+func (*BridgeFlagsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BridgeFlagsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.ResultingFeatureBitmap
+ return size
+}
+func (m *BridgeFlagsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.ResultingFeatureBitmap = buf.DecodeUint32()
+ return nil
+}
+
+// BviCreate defines message 'bvi_create'.
+type BviCreate struct {
+ Mac MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
+ UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
+}
+
+func (m *BviCreate) Reset() { *m = BviCreate{} }
+func (*BviCreate) GetMessageName() string { return "bvi_create" }
+func (*BviCreate) GetCrcString() string { return "f5398559" }
+func (*BviCreate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BviCreate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 6 // m.Mac
+ size += 4 // m.UserInstance
+ return size
+}
+func (m *BviCreate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Mac[:], 6)
+ buf.EncodeUint32(m.UserInstance)
+ return buf.Bytes(), nil
+}
+func (m *BviCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.Mac[:], buf.DecodeBytes(6))
+ m.UserInstance = buf.DecodeUint32()
+ return nil
+}
+
+// BviCreateReply defines message 'bvi_create_reply'.
+type BviCreateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *BviCreateReply) Reset() { *m = BviCreateReply{} }
+func (*BviCreateReply) GetMessageName() string { return "bvi_create_reply" }
+func (*BviCreateReply) GetCrcString() string { return "fda5941f" }
+func (*BviCreateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BviCreateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *BviCreateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *BviCreateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// BviDelete defines message 'bvi_delete'.
+type BviDelete struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *BviDelete) Reset() { *m = BviDelete{} }
+func (*BviDelete) GetMessageName() string { return "bvi_delete" }
+func (*BviDelete) GetCrcString() string { return "529cb13f" }
+func (*BviDelete) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BviDelete) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *BviDelete) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *BviDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// BviDeleteReply defines message 'bvi_delete_reply'.
+type BviDeleteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BviDeleteReply) Reset() { *m = BviDeleteReply{} }
+func (*BviDeleteReply) GetMessageName() string { return "bvi_delete_reply" }
+func (*BviDeleteReply) GetCrcString() string { return "e8d4e804" }
+func (*BviDeleteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BviDeleteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BviDeleteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2ArpTermEvent defines message 'l2_arp_term_event'.
+type L2ArpTermEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ IP Address `binapi:"address,name=ip" json:"ip,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Mac MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
+}
+
+func (m *L2ArpTermEvent) Reset() { *m = L2ArpTermEvent{} }
+func (*L2ArpTermEvent) GetMessageName() string { return "l2_arp_term_event" }
+func (*L2ArpTermEvent) GetCrcString() string { return "85ff71ea" }
+func (*L2ArpTermEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *L2ArpTermEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.IP.Af
+ size += 1 * 16 // m.IP.Un
+ size += 4 // m.SwIfIndex
+ size += 1 * 6 // m.Mac
+ return size
+}
+func (m *L2ArpTermEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PID)
+ buf.EncodeUint32(uint32(m.IP.Af))
+ buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBytes(m.Mac[:], 6)
+ return buf.Bytes(), nil
+}
+func (m *L2ArpTermEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.IP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.Mac[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// L2FibClearTable defines message 'l2_fib_clear_table'.
+type L2FibClearTable struct{}
+
+func (m *L2FibClearTable) Reset() { *m = L2FibClearTable{} }
+func (*L2FibClearTable) GetMessageName() string { return "l2_fib_clear_table" }
+func (*L2FibClearTable) GetCrcString() string { return "51077d14" }
+func (*L2FibClearTable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2FibClearTable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *L2FibClearTable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *L2FibClearTable) Unmarshal(b []byte) error {
+ return nil
+}
+
+// L2FibClearTableReply defines message 'l2_fib_clear_table_reply'.
+type L2FibClearTableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2FibClearTableReply) Reset() { *m = L2FibClearTableReply{} }
+func (*L2FibClearTableReply) GetMessageName() string { return "l2_fib_clear_table_reply" }
+func (*L2FibClearTableReply) GetCrcString() string { return "e8d4e804" }
+func (*L2FibClearTableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2FibClearTableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2FibClearTableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2FibTableDetails defines message 'l2_fib_table_details'.
+type L2FibTableDetails struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ Mac []byte `binapi:"u8[6],name=mac" json:"mac,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ StaticMac uint8 `binapi:"u8,name=static_mac" json:"static_mac,omitempty"`
+ FilterMac uint8 `binapi:"u8,name=filter_mac" json:"filter_mac,omitempty"`
+ BviMac uint8 `binapi:"u8,name=bvi_mac" json:"bvi_mac,omitempty"`
+}
+
+func (m *L2FibTableDetails) Reset() { *m = L2FibTableDetails{} }
+func (*L2FibTableDetails) GetMessageName() string { return "l2_fib_table_details" }
+func (*L2FibTableDetails) GetCrcString() string { return "c7392706" }
+func (*L2FibTableDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2FibTableDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ size += 1 * 6 // m.Mac
+ size += 4 // m.SwIfIndex
+ size += 1 // m.StaticMac
+ size += 1 // m.FilterMac
+ size += 1 // m.BviMac
+ return size
+}
+func (m *L2FibTableDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ buf.EncodeBytes(m.Mac, 6)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.StaticMac)
+ buf.EncodeUint8(m.FilterMac)
+ buf.EncodeUint8(m.BviMac)
+ return buf.Bytes(), nil
+}
+func (m *L2FibTableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ m.Mac = make([]byte, 6)
+ copy(m.Mac, buf.DecodeBytes(len(m.Mac)))
+ m.SwIfIndex = buf.DecodeUint32()
+ m.StaticMac = buf.DecodeUint8()
+ m.FilterMac = buf.DecodeUint8()
+ m.BviMac = buf.DecodeUint8()
+ return nil
+}
+
+// L2FibTableDump defines message 'l2_fib_table_dump'.
+type L2FibTableDump struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+}
+
+func (m *L2FibTableDump) Reset() { *m = L2FibTableDump{} }
+func (*L2FibTableDump) GetMessageName() string { return "l2_fib_table_dump" }
+func (*L2FibTableDump) GetCrcString() string { return "c25fdce6" }
+func (*L2FibTableDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2FibTableDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ return size
+}
+func (m *L2FibTableDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ return buf.Bytes(), nil
+}
+func (m *L2FibTableDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ return nil
+}
+
+// L2Flags defines message 'l2_flags'.
+type L2Flags struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsSet uint8 `binapi:"u8,name=is_set" json:"is_set,omitempty"`
+ FeatureBitmap uint32 `binapi:"u32,name=feature_bitmap" json:"feature_bitmap,omitempty"`
+}
+
+func (m *L2Flags) Reset() { *m = L2Flags{} }
+func (*L2Flags) GetMessageName() string { return "l2_flags" }
+func (*L2Flags) GetCrcString() string { return "0e889fb9" }
+func (*L2Flags) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2Flags) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsSet
+ size += 4 // m.FeatureBitmap
+ return size
+}
+func (m *L2Flags) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.IsSet)
+ buf.EncodeUint32(m.FeatureBitmap)
+ return buf.Bytes(), nil
+}
+func (m *L2Flags) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.IsSet = buf.DecodeUint8()
+ m.FeatureBitmap = buf.DecodeUint32()
+ return nil
+}
+
+// L2FlagsReply defines message 'l2_flags_reply'.
+type L2FlagsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ ResultingFeatureBitmap uint32 `binapi:"u32,name=resulting_feature_bitmap" json:"resulting_feature_bitmap,omitempty"`
+}
+
+func (m *L2FlagsReply) Reset() { *m = L2FlagsReply{} }
+func (*L2FlagsReply) GetMessageName() string { return "l2_flags_reply" }
+func (*L2FlagsReply) GetCrcString() string { return "29b2a2b3" }
+func (*L2FlagsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2FlagsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.ResultingFeatureBitmap
+ return size
+}
+func (m *L2FlagsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.ResultingFeatureBitmap = buf.DecodeUint32()
+ return nil
+}
+
+// L2InterfaceEfpFilter defines message 'l2_interface_efp_filter'.
+type L2InterfaceEfpFilter struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ EnableDisable uint8 `binapi:"u8,name=enable_disable" json:"enable_disable,omitempty"`
+}
+
+func (m *L2InterfaceEfpFilter) Reset() { *m = L2InterfaceEfpFilter{} }
+func (*L2InterfaceEfpFilter) GetMessageName() string { return "l2_interface_efp_filter" }
+func (*L2InterfaceEfpFilter) GetCrcString() string { return "69d24598" }
+func (*L2InterfaceEfpFilter) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2InterfaceEfpFilter) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.EnableDisable
+ return size
+}
+func (m *L2InterfaceEfpFilter) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.EnableDisable)
+ return buf.Bytes(), nil
+}
+func (m *L2InterfaceEfpFilter) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.EnableDisable = buf.DecodeUint8()
+ return nil
+}
+
+// L2InterfaceEfpFilterReply defines message 'l2_interface_efp_filter_reply'.
+type L2InterfaceEfpFilterReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2InterfaceEfpFilterReply) Reset() { *m = L2InterfaceEfpFilterReply{} }
+func (*L2InterfaceEfpFilterReply) GetMessageName() string { return "l2_interface_efp_filter_reply" }
+func (*L2InterfaceEfpFilterReply) GetCrcString() string { return "e8d4e804" }
+func (*L2InterfaceEfpFilterReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2InterfaceEfpFilterReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2InterfaceEfpFilterReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2InterfacePbbTagRewrite defines message 'l2_interface_pbb_tag_rewrite'.
+type L2InterfacePbbTagRewrite struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"`
+ OuterTag uint16 `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"`
+ BDmac []byte `binapi:"u8[6],name=b_dmac" json:"b_dmac,omitempty"`
+ BSmac []byte `binapi:"u8[6],name=b_smac" json:"b_smac,omitempty"`
+ BVlanid uint16 `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"`
+ ISid uint32 `binapi:"u32,name=i_sid" json:"i_sid,omitempty"`
+}
+
+func (m *L2InterfacePbbTagRewrite) Reset() { *m = L2InterfacePbbTagRewrite{} }
+func (*L2InterfacePbbTagRewrite) GetMessageName() string { return "l2_interface_pbb_tag_rewrite" }
+func (*L2InterfacePbbTagRewrite) GetCrcString() string { return "6cf815f9" }
+func (*L2InterfacePbbTagRewrite) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2InterfacePbbTagRewrite) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.VtrOp
+ size += 2 // m.OuterTag
+ size += 1 * 6 // m.BDmac
+ size += 1 * 6 // m.BSmac
+ size += 2 // m.BVlanid
+ size += 4 // m.ISid
+ return size
+}
+func (m *L2InterfacePbbTagRewrite) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.VtrOp)
+ buf.EncodeUint16(m.OuterTag)
+ buf.EncodeBytes(m.BDmac, 6)
+ buf.EncodeBytes(m.BSmac, 6)
+ buf.EncodeUint16(m.BVlanid)
+ buf.EncodeUint32(m.ISid)
+ return buf.Bytes(), nil
+}
+func (m *L2InterfacePbbTagRewrite) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.VtrOp = buf.DecodeUint32()
+ m.OuterTag = buf.DecodeUint16()
+ m.BDmac = make([]byte, 6)
+ copy(m.BDmac, buf.DecodeBytes(len(m.BDmac)))
+ m.BSmac = make([]byte, 6)
+ copy(m.BSmac, buf.DecodeBytes(len(m.BSmac)))
+ m.BVlanid = buf.DecodeUint16()
+ m.ISid = buf.DecodeUint32()
+ return nil
+}
+
+// L2InterfacePbbTagRewriteReply defines message 'l2_interface_pbb_tag_rewrite_reply'.
+type L2InterfacePbbTagRewriteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2InterfacePbbTagRewriteReply) Reset() { *m = L2InterfacePbbTagRewriteReply{} }
+func (*L2InterfacePbbTagRewriteReply) GetMessageName() string {
+ return "l2_interface_pbb_tag_rewrite_reply"
+}
+func (*L2InterfacePbbTagRewriteReply) GetCrcString() string { return "e8d4e804" }
+func (*L2InterfacePbbTagRewriteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2InterfacePbbTagRewriteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2InterfacePbbTagRewriteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2InterfaceVlanTagRewrite defines message 'l2_interface_vlan_tag_rewrite'.
+type L2InterfaceVlanTagRewrite struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"`
+ PushDot1q uint32 `binapi:"u32,name=push_dot1q" json:"push_dot1q,omitempty"`
+ Tag1 uint32 `binapi:"u32,name=tag1" json:"tag1,omitempty"`
+ Tag2 uint32 `binapi:"u32,name=tag2" json:"tag2,omitempty"`
+}
+
+func (m *L2InterfaceVlanTagRewrite) Reset() { *m = L2InterfaceVlanTagRewrite{} }
+func (*L2InterfaceVlanTagRewrite) GetMessageName() string { return "l2_interface_vlan_tag_rewrite" }
+func (*L2InterfaceVlanTagRewrite) GetCrcString() string { return "b90be6b4" }
+func (*L2InterfaceVlanTagRewrite) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2InterfaceVlanTagRewrite) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.VtrOp
+ size += 4 // m.PushDot1q
+ size += 4 // m.Tag1
+ size += 4 // m.Tag2
+ return size
+}
+func (m *L2InterfaceVlanTagRewrite) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.VtrOp = buf.DecodeUint32()
+ m.PushDot1q = buf.DecodeUint32()
+ m.Tag1 = buf.DecodeUint32()
+ m.Tag2 = buf.DecodeUint32()
+ return nil
+}
+
+// L2InterfaceVlanTagRewriteReply defines message 'l2_interface_vlan_tag_rewrite_reply'.
+type L2InterfaceVlanTagRewriteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2InterfaceVlanTagRewriteReply) Reset() { *m = L2InterfaceVlanTagRewriteReply{} }
+func (*L2InterfaceVlanTagRewriteReply) GetMessageName() string {
+ return "l2_interface_vlan_tag_rewrite_reply"
+}
+func (*L2InterfaceVlanTagRewriteReply) GetCrcString() string { return "e8d4e804" }
+func (*L2InterfaceVlanTagRewriteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2InterfaceVlanTagRewriteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2InterfaceVlanTagRewriteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2MacsEvent defines message 'l2_macs_event'.
+type L2MacsEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ NMacs uint32 `binapi:"u32,name=n_macs" json:"-"`
+ Mac []MacEntry `binapi:"mac_entry[n_macs],name=mac" json:"mac,omitempty"`
+}
+
+func (m *L2MacsEvent) Reset() { *m = L2MacsEvent{} }
+func (*L2MacsEvent) GetMessageName() string { return "l2_macs_event" }
+func (*L2MacsEvent) GetCrcString() string { return "afc74a60" }
+func (*L2MacsEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *L2MacsEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.NMacs
+ for j1 := 0; j1 < len(m.Mac); j1++ {
+ var s1 MacEntry
+ _ = s1
+ if j1 < len(m.Mac) {
+ s1 = m.Mac[j1]
+ }
+ size += 4 // s1.SwIfIndex
+ size += 1 * 6 // s1.MacAddr
+ size += 1 // s1.Action
+ size += 1 // s1.Flags
+ }
+ return size
+}
+func (m *L2MacsEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 // Mac
+ if j0 < len(m.Mac) {
+ v0 = m.Mac[j0]
+ }
+ buf.EncodeUint32(v0.SwIfIndex)
+ buf.EncodeBytes(v0.MacAddr, 6)
+ buf.EncodeUint8(v0.Action)
+ buf.EncodeUint8(v0.Flags)
+ }
+ return buf.Bytes(), nil
+}
+func (m *L2MacsEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.NMacs = buf.DecodeUint32()
+ m.Mac = make([]MacEntry, m.NMacs)
+ for j0 := 0; j0 < len(m.Mac); j0++ {
+ m.Mac[j0].SwIfIndex = buf.DecodeUint32()
+ m.Mac[j0].MacAddr = make([]byte, 6)
+ copy(m.Mac[j0].MacAddr, buf.DecodeBytes(len(m.Mac[j0].MacAddr)))
+ m.Mac[j0].Action = buf.DecodeUint8()
+ m.Mac[j0].Flags = buf.DecodeUint8()
+ }
+ return nil
+}
+
+// L2PatchAddDel defines message 'l2_patch_add_del'.
+type L2PatchAddDel struct {
+ RxSwIfIndex uint32 `binapi:"u32,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
+ TxSwIfIndex uint32 `binapi:"u32,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *L2PatchAddDel) Reset() { *m = L2PatchAddDel{} }
+func (*L2PatchAddDel) GetMessageName() string { return "l2_patch_add_del" }
+func (*L2PatchAddDel) GetCrcString() string { return "62506e63" }
+func (*L2PatchAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2PatchAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.RxSwIfIndex
+ size += 4 // m.TxSwIfIndex
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *L2PatchAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.RxSwIfIndex)
+ buf.EncodeUint32(m.TxSwIfIndex)
+ buf.EncodeUint8(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *L2PatchAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.RxSwIfIndex = buf.DecodeUint32()
+ m.TxSwIfIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeUint8()
+ return nil
+}
+
+// L2PatchAddDelReply defines message 'l2_patch_add_del_reply'.
+type L2PatchAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2PatchAddDelReply) Reset() { *m = L2PatchAddDelReply{} }
+func (*L2PatchAddDelReply) GetMessageName() string { return "l2_patch_add_del_reply" }
+func (*L2PatchAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*L2PatchAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2PatchAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2PatchAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2XconnectDetails defines message 'l2_xconnect_details'.
+type L2XconnectDetails struct {
+ RxSwIfIndex uint32 `binapi:"u32,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
+ TxSwIfIndex uint32 `binapi:"u32,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
+}
+
+func (m *L2XconnectDetails) Reset() { *m = L2XconnectDetails{} }
+func (*L2XconnectDetails) GetMessageName() string { return "l2_xconnect_details" }
+func (*L2XconnectDetails) GetCrcString() string { return "722e2378" }
+func (*L2XconnectDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2XconnectDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.RxSwIfIndex
+ size += 4 // m.TxSwIfIndex
+ return size
+}
+func (m *L2XconnectDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.RxSwIfIndex)
+ buf.EncodeUint32(m.TxSwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *L2XconnectDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.RxSwIfIndex = buf.DecodeUint32()
+ m.TxSwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// L2XconnectDump defines message 'l2_xconnect_dump'.
+type L2XconnectDump struct{}
+
+func (m *L2XconnectDump) Reset() { *m = L2XconnectDump{} }
+func (*L2XconnectDump) GetMessageName() string { return "l2_xconnect_dump" }
+func (*L2XconnectDump) GetCrcString() string { return "51077d14" }
+func (*L2XconnectDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2XconnectDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *L2XconnectDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *L2XconnectDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// L2fibAddDel defines message 'l2fib_add_del'.
+type L2fibAddDel struct {
+ Mac []byte `binapi:"u8[6],name=mac" json:"mac,omitempty"`
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ StaticMac uint8 `binapi:"u8,name=static_mac" json:"static_mac,omitempty"`
+ FilterMac uint8 `binapi:"u8,name=filter_mac" json:"filter_mac,omitempty"`
+ BviMac uint8 `binapi:"u8,name=bvi_mac" json:"bvi_mac,omitempty"`
+}
+
+func (m *L2fibAddDel) Reset() { *m = L2fibAddDel{} }
+func (*L2fibAddDel) GetMessageName() string { return "l2fib_add_del" }
+func (*L2fibAddDel) GetCrcString() string { return "34ced3eb" }
+func (*L2fibAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2fibAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 6 // m.Mac
+ size += 4 // m.BdID
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsAdd
+ size += 1 // m.StaticMac
+ size += 1 // m.FilterMac
+ size += 1 // m.BviMac
+ return size
+}
+func (m *L2fibAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Mac, 6)
+ buf.EncodeUint32(m.BdID)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.StaticMac)
+ buf.EncodeUint8(m.FilterMac)
+ buf.EncodeUint8(m.BviMac)
+ return buf.Bytes(), nil
+}
+func (m *L2fibAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Mac = make([]byte, 6)
+ copy(m.Mac, buf.DecodeBytes(len(m.Mac)))
+ m.BdID = buf.DecodeUint32()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeUint8()
+ m.StaticMac = buf.DecodeUint8()
+ m.FilterMac = buf.DecodeUint8()
+ m.BviMac = buf.DecodeUint8()
+ return nil
+}
+
+// L2fibAddDelReply defines message 'l2fib_add_del_reply'.
+type L2fibAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2fibAddDelReply) Reset() { *m = L2fibAddDelReply{} }
+func (*L2fibAddDelReply) GetMessageName() string { return "l2fib_add_del_reply" }
+func (*L2fibAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*L2fibAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2fibAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2fibAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2fibFlushAll defines message 'l2fib_flush_all'.
+type L2fibFlushAll struct{}
+
+func (m *L2fibFlushAll) Reset() { *m = L2fibFlushAll{} }
+func (*L2fibFlushAll) GetMessageName() string { return "l2fib_flush_all" }
+func (*L2fibFlushAll) GetCrcString() string { return "51077d14" }
+func (*L2fibFlushAll) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2fibFlushAll) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *L2fibFlushAll) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *L2fibFlushAll) Unmarshal(b []byte) error {
+ return nil
+}
+
+// L2fibFlushAllReply defines message 'l2fib_flush_all_reply'.
+type L2fibFlushAllReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2fibFlushAllReply) Reset() { *m = L2fibFlushAllReply{} }
+func (*L2fibFlushAllReply) GetMessageName() string { return "l2fib_flush_all_reply" }
+func (*L2fibFlushAllReply) GetCrcString() string { return "e8d4e804" }
+func (*L2fibFlushAllReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2fibFlushAllReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2fibFlushAllReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2fibFlushBd defines message 'l2fib_flush_bd'.
+type L2fibFlushBd struct {
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+}
+
+func (m *L2fibFlushBd) Reset() { *m = L2fibFlushBd{} }
+func (*L2fibFlushBd) GetMessageName() string { return "l2fib_flush_bd" }
+func (*L2fibFlushBd) GetCrcString() string { return "c25fdce6" }
+func (*L2fibFlushBd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2fibFlushBd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.BdID
+ return size
+}
+func (m *L2fibFlushBd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ return buf.Bytes(), nil
+}
+func (m *L2fibFlushBd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BdID = buf.DecodeUint32()
+ return nil
+}
+
+// L2fibFlushBdReply defines message 'l2fib_flush_bd_reply'.
+type L2fibFlushBdReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2fibFlushBdReply) Reset() { *m = L2fibFlushBdReply{} }
+func (*L2fibFlushBdReply) GetMessageName() string { return "l2fib_flush_bd_reply" }
+func (*L2fibFlushBdReply) GetCrcString() string { return "e8d4e804" }
+func (*L2fibFlushBdReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2fibFlushBdReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2fibFlushBdReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2fibFlushInt defines message 'l2fib_flush_int'.
+type L2fibFlushInt struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *L2fibFlushInt) Reset() { *m = L2fibFlushInt{} }
+func (*L2fibFlushInt) GetMessageName() string { return "l2fib_flush_int" }
+func (*L2fibFlushInt) GetCrcString() string { return "529cb13f" }
+func (*L2fibFlushInt) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2fibFlushInt) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *L2fibFlushInt) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *L2fibFlushInt) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// L2fibFlushIntReply defines message 'l2fib_flush_int_reply'.
+type L2fibFlushIntReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2fibFlushIntReply) Reset() { *m = L2fibFlushIntReply{} }
+func (*L2fibFlushIntReply) GetMessageName() string { return "l2fib_flush_int_reply" }
+func (*L2fibFlushIntReply) GetCrcString() string { return "e8d4e804" }
+func (*L2fibFlushIntReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2fibFlushIntReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2fibFlushIntReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetL2Bridge defines message 'sw_interface_set_l2_bridge'.
+type SwInterfaceSetL2Bridge struct {
+ RxSwIfIndex uint32 `binapi:"u32,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
+ BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
+ PortType L2PortType `binapi:"l2_port_type,name=port_type" json:"port_type,omitempty"`
+ Shg uint8 `binapi:"u8,name=shg" json:"shg,omitempty"`
+ Enable uint8 `binapi:"u8,name=enable" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetL2Bridge) Reset() { *m = SwInterfaceSetL2Bridge{} }
+func (*SwInterfaceSetL2Bridge) GetMessageName() string { return "sw_interface_set_l2_bridge" }
+func (*SwInterfaceSetL2Bridge) GetCrcString() string { return "5579f809" }
+func (*SwInterfaceSetL2Bridge) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetL2Bridge) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.RxSwIfIndex
+ size += 4 // m.BdID
+ size += 4 // m.PortType
+ size += 1 // m.Shg
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetL2Bridge) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.RxSwIfIndex)
+ buf.EncodeUint32(m.BdID)
+ buf.EncodeUint32(uint32(m.PortType))
+ buf.EncodeUint8(m.Shg)
+ buf.EncodeUint8(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetL2Bridge) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.RxSwIfIndex = buf.DecodeUint32()
+ m.BdID = buf.DecodeUint32()
+ m.PortType = L2PortType(buf.DecodeUint32())
+ m.Shg = buf.DecodeUint8()
+ m.Enable = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceSetL2BridgeReply defines message 'sw_interface_set_l2_bridge_reply'.
+type SwInterfaceSetL2BridgeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetL2BridgeReply) Reset() { *m = SwInterfaceSetL2BridgeReply{} }
+func (*SwInterfaceSetL2BridgeReply) GetMessageName() string {
+ return "sw_interface_set_l2_bridge_reply"
+}
+func (*SwInterfaceSetL2BridgeReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetL2BridgeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetL2BridgeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetL2BridgeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetL2Xconnect defines message 'sw_interface_set_l2_xconnect'.
+type SwInterfaceSetL2Xconnect struct {
+ RxSwIfIndex uint32 `binapi:"u32,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
+ TxSwIfIndex uint32 `binapi:"u32,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
+ Enable uint8 `binapi:"u8,name=enable" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetL2Xconnect) Reset() { *m = SwInterfaceSetL2Xconnect{} }
+func (*SwInterfaceSetL2Xconnect) GetMessageName() string { return "sw_interface_set_l2_xconnect" }
+func (*SwInterfaceSetL2Xconnect) GetCrcString() string { return "95de3988" }
+func (*SwInterfaceSetL2Xconnect) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetL2Xconnect) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.RxSwIfIndex
+ size += 4 // m.TxSwIfIndex
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetL2Xconnect) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.RxSwIfIndex)
+ buf.EncodeUint32(m.TxSwIfIndex)
+ buf.EncodeUint8(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetL2Xconnect) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.RxSwIfIndex = buf.DecodeUint32()
+ m.TxSwIfIndex = buf.DecodeUint32()
+ m.Enable = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceSetL2XconnectReply defines message 'sw_interface_set_l2_xconnect_reply'.
+type SwInterfaceSetL2XconnectReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetL2XconnectReply) Reset() { *m = SwInterfaceSetL2XconnectReply{} }
+func (*SwInterfaceSetL2XconnectReply) GetMessageName() string {
+ return "sw_interface_set_l2_xconnect_reply"
+}
+func (*SwInterfaceSetL2XconnectReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetL2XconnectReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetL2XconnectReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetL2XconnectReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetVpath defines message 'sw_interface_set_vpath'.
+type SwInterfaceSetVpath struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Enable uint8 `binapi:"u8,name=enable" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetVpath) Reset() { *m = SwInterfaceSetVpath{} }
+func (*SwInterfaceSetVpath) GetMessageName() string { return "sw_interface_set_vpath" }
+func (*SwInterfaceSetVpath) GetCrcString() string { return "a36fadc0" }
+func (*SwInterfaceSetVpath) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetVpath) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetVpath) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetVpath) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Enable = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceSetVpathReply defines message 'sw_interface_set_vpath_reply'.
+type SwInterfaceSetVpathReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetVpathReply) Reset() { *m = SwInterfaceSetVpathReply{} }
+func (*SwInterfaceSetVpathReply) GetMessageName() string { return "sw_interface_set_vpath_reply" }
+func (*SwInterfaceSetVpathReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetVpathReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetVpathReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetVpathReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// WantL2ArpTermEvents defines message 'want_l2_arp_term_events'.
+type WantL2ArpTermEvents struct {
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *WantL2ArpTermEvents) Reset() { *m = WantL2ArpTermEvents{} }
+func (*WantL2ArpTermEvents) GetMessageName() string { return "want_l2_arp_term_events" }
+func (*WantL2ArpTermEvents) GetCrcString() string { return "3ec6d6c2" }
+func (*WantL2ArpTermEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantL2ArpTermEvents) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ size += 4 // m.PID
+ return size
+}
+func (m *WantL2ArpTermEvents) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ buf.EncodeUint32(m.PID)
+ return buf.Bytes(), nil
+}
+func (m *WantL2ArpTermEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// WantL2ArpTermEventsReply defines message 'want_l2_arp_term_events_reply'.
+type WantL2ArpTermEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantL2ArpTermEventsReply) Reset() { *m = WantL2ArpTermEventsReply{} }
+func (*WantL2ArpTermEventsReply) GetMessageName() string { return "want_l2_arp_term_events_reply" }
+func (*WantL2ArpTermEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantL2ArpTermEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantL2ArpTermEventsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantL2ArpTermEventsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// WantL2MacsEvents defines message 'want_l2_macs_events'.
+type WantL2MacsEvents struct {
+ LearnLimit uint32 `binapi:"u32,name=learn_limit" json:"learn_limit,omitempty"`
+ ScanDelay uint8 `binapi:"u8,name=scan_delay" json:"scan_delay,omitempty"`
+ MaxMacsInEvent uint8 `binapi:"u8,name=max_macs_in_event" json:"max_macs_in_event,omitempty"`
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *WantL2MacsEvents) Reset() { *m = WantL2MacsEvents{} }
+func (*WantL2MacsEvents) GetMessageName() string { return "want_l2_macs_events" }
+func (*WantL2MacsEvents) GetCrcString() string { return "9aabdfde" }
+func (*WantL2MacsEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantL2MacsEvents) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.LearnLimit
+ size += 1 // m.ScanDelay
+ size += 1 // m.MaxMacsInEvent
+ size += 1 // m.EnableDisable
+ size += 4 // m.PID
+ return size
+}
+func (m *WantL2MacsEvents) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.LearnLimit)
+ buf.EncodeUint8(m.ScanDelay)
+ buf.EncodeUint8(m.MaxMacsInEvent)
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeUint32(m.PID)
+ return buf.Bytes(), nil
+}
+func (m *WantL2MacsEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.LearnLimit = buf.DecodeUint32()
+ m.ScanDelay = buf.DecodeUint8()
+ m.MaxMacsInEvent = buf.DecodeUint8()
+ m.EnableDisable = buf.DecodeBool()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// WantL2MacsEventsReply defines message 'want_l2_macs_events_reply'.
+type WantL2MacsEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantL2MacsEventsReply) Reset() { *m = WantL2MacsEventsReply{} }
+func (*WantL2MacsEventsReply) GetMessageName() string { return "want_l2_macs_events_reply" }
+func (*WantL2MacsEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantL2MacsEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantL2MacsEventsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantL2MacsEventsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_l2_binapi_init() }
+func file_l2_binapi_init() {
+ api.RegisterMessage((*BdIPMacAddDel)(nil), "bd_ip_mac_add_del_25bf4063")
+ api.RegisterMessage((*BdIPMacAddDelReply)(nil), "bd_ip_mac_add_del_reply_e8d4e804")
+ api.RegisterMessage((*BdIPMacDetails)(nil), "bd_ip_mac_details_a52f8044")
+ api.RegisterMessage((*BdIPMacDump)(nil), "bd_ip_mac_dump_c25fdce6")
+ api.RegisterMessage((*BdIPMacFlush)(nil), "bd_ip_mac_flush_c25fdce6")
+ api.RegisterMessage((*BdIPMacFlushReply)(nil), "bd_ip_mac_flush_reply_e8d4e804")
+ api.RegisterMessage((*BridgeDomainAddDel)(nil), "bridge_domain_add_del_c6360720")
+ api.RegisterMessage((*BridgeDomainAddDelReply)(nil), "bridge_domain_add_del_reply_e8d4e804")
+ api.RegisterMessage((*BridgeDomainDetails)(nil), "bridge_domain_details_748c854a")
+ api.RegisterMessage((*BridgeDomainDump)(nil), "bridge_domain_dump_c25fdce6")
+ api.RegisterMessage((*BridgeDomainSetMacAge)(nil), "bridge_domain_set_mac_age_b537ad7b")
+ api.RegisterMessage((*BridgeDomainSetMacAgeReply)(nil), "bridge_domain_set_mac_age_reply_e8d4e804")
+ api.RegisterMessage((*BridgeFlags)(nil), "bridge_flags_2eb9b76c")
+ api.RegisterMessage((*BridgeFlagsReply)(nil), "bridge_flags_reply_29b2a2b3")
+ api.RegisterMessage((*BviCreate)(nil), "bvi_create_f5398559")
+ api.RegisterMessage((*BviCreateReply)(nil), "bvi_create_reply_fda5941f")
+ api.RegisterMessage((*BviDelete)(nil), "bvi_delete_529cb13f")
+ api.RegisterMessage((*BviDeleteReply)(nil), "bvi_delete_reply_e8d4e804")
+ api.RegisterMessage((*L2ArpTermEvent)(nil), "l2_arp_term_event_85ff71ea")
+ api.RegisterMessage((*L2FibClearTable)(nil), "l2_fib_clear_table_51077d14")
+ api.RegisterMessage((*L2FibClearTableReply)(nil), "l2_fib_clear_table_reply_e8d4e804")
+ api.RegisterMessage((*L2FibTableDetails)(nil), "l2_fib_table_details_c7392706")
+ api.RegisterMessage((*L2FibTableDump)(nil), "l2_fib_table_dump_c25fdce6")
+ api.RegisterMessage((*L2Flags)(nil), "l2_flags_0e889fb9")
+ api.RegisterMessage((*L2FlagsReply)(nil), "l2_flags_reply_29b2a2b3")
+ api.RegisterMessage((*L2InterfaceEfpFilter)(nil), "l2_interface_efp_filter_69d24598")
+ api.RegisterMessage((*L2InterfaceEfpFilterReply)(nil), "l2_interface_efp_filter_reply_e8d4e804")
+ api.RegisterMessage((*L2InterfacePbbTagRewrite)(nil), "l2_interface_pbb_tag_rewrite_6cf815f9")
+ api.RegisterMessage((*L2InterfacePbbTagRewriteReply)(nil), "l2_interface_pbb_tag_rewrite_reply_e8d4e804")
+ api.RegisterMessage((*L2InterfaceVlanTagRewrite)(nil), "l2_interface_vlan_tag_rewrite_b90be6b4")
+ api.RegisterMessage((*L2InterfaceVlanTagRewriteReply)(nil), "l2_interface_vlan_tag_rewrite_reply_e8d4e804")
+ api.RegisterMessage((*L2MacsEvent)(nil), "l2_macs_event_afc74a60")
+ api.RegisterMessage((*L2PatchAddDel)(nil), "l2_patch_add_del_62506e63")
+ api.RegisterMessage((*L2PatchAddDelReply)(nil), "l2_patch_add_del_reply_e8d4e804")
+ api.RegisterMessage((*L2XconnectDetails)(nil), "l2_xconnect_details_722e2378")
+ api.RegisterMessage((*L2XconnectDump)(nil), "l2_xconnect_dump_51077d14")
+ api.RegisterMessage((*L2fibAddDel)(nil), "l2fib_add_del_34ced3eb")
+ api.RegisterMessage((*L2fibAddDelReply)(nil), "l2fib_add_del_reply_e8d4e804")
+ api.RegisterMessage((*L2fibFlushAll)(nil), "l2fib_flush_all_51077d14")
+ api.RegisterMessage((*L2fibFlushAllReply)(nil), "l2fib_flush_all_reply_e8d4e804")
+ api.RegisterMessage((*L2fibFlushBd)(nil), "l2fib_flush_bd_c25fdce6")
+ api.RegisterMessage((*L2fibFlushBdReply)(nil), "l2fib_flush_bd_reply_e8d4e804")
+ api.RegisterMessage((*L2fibFlushInt)(nil), "l2fib_flush_int_529cb13f")
+ api.RegisterMessage((*L2fibFlushIntReply)(nil), "l2fib_flush_int_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetL2Bridge)(nil), "sw_interface_set_l2_bridge_5579f809")
+ api.RegisterMessage((*SwInterfaceSetL2BridgeReply)(nil), "sw_interface_set_l2_bridge_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetL2Xconnect)(nil), "sw_interface_set_l2_xconnect_95de3988")
+ api.RegisterMessage((*SwInterfaceSetL2XconnectReply)(nil), "sw_interface_set_l2_xconnect_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetVpath)(nil), "sw_interface_set_vpath_a36fadc0")
+ api.RegisterMessage((*SwInterfaceSetVpathReply)(nil), "sw_interface_set_vpath_reply_e8d4e804")
+ api.RegisterMessage((*WantL2ArpTermEvents)(nil), "want_l2_arp_term_events_3ec6d6c2")
+ api.RegisterMessage((*WantL2ArpTermEventsReply)(nil), "want_l2_arp_term_events_reply_e8d4e804")
+ api.RegisterMessage((*WantL2MacsEvents)(nil), "want_l2_macs_events_9aabdfde")
+ api.RegisterMessage((*WantL2MacsEventsReply)(nil), "want_l2_macs_events_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*BdIPMacAddDel)(nil),
+ (*BdIPMacAddDelReply)(nil),
+ (*BdIPMacDetails)(nil),
+ (*BdIPMacDump)(nil),
+ (*BdIPMacFlush)(nil),
+ (*BdIPMacFlushReply)(nil),
+ (*BridgeDomainAddDel)(nil),
+ (*BridgeDomainAddDelReply)(nil),
+ (*BridgeDomainDetails)(nil),
+ (*BridgeDomainDump)(nil),
+ (*BridgeDomainSetMacAge)(nil),
+ (*BridgeDomainSetMacAgeReply)(nil),
+ (*BridgeFlags)(nil),
+ (*BridgeFlagsReply)(nil),
+ (*BviCreate)(nil),
+ (*BviCreateReply)(nil),
+ (*BviDelete)(nil),
+ (*BviDeleteReply)(nil),
+ (*L2ArpTermEvent)(nil),
+ (*L2FibClearTable)(nil),
+ (*L2FibClearTableReply)(nil),
+ (*L2FibTableDetails)(nil),
+ (*L2FibTableDump)(nil),
+ (*L2Flags)(nil),
+ (*L2FlagsReply)(nil),
+ (*L2InterfaceEfpFilter)(nil),
+ (*L2InterfaceEfpFilterReply)(nil),
+ (*L2InterfacePbbTagRewrite)(nil),
+ (*L2InterfacePbbTagRewriteReply)(nil),
+ (*L2InterfaceVlanTagRewrite)(nil),
+ (*L2InterfaceVlanTagRewriteReply)(nil),
+ (*L2MacsEvent)(nil),
+ (*L2PatchAddDel)(nil),
+ (*L2PatchAddDelReply)(nil),
+ (*L2XconnectDetails)(nil),
+ (*L2XconnectDump)(nil),
+ (*L2fibAddDel)(nil),
+ (*L2fibAddDelReply)(nil),
+ (*L2fibFlushAll)(nil),
+ (*L2fibFlushAllReply)(nil),
+ (*L2fibFlushBd)(nil),
+ (*L2fibFlushBdReply)(nil),
+ (*L2fibFlushInt)(nil),
+ (*L2fibFlushIntReply)(nil),
+ (*SwInterfaceSetL2Bridge)(nil),
+ (*SwInterfaceSetL2BridgeReply)(nil),
+ (*SwInterfaceSetL2Xconnect)(nil),
+ (*SwInterfaceSetL2XconnectReply)(nil),
+ (*SwInterfaceSetVpath)(nil),
+ (*SwInterfaceSetVpathReply)(nil),
+ (*WantL2ArpTermEvents)(nil),
+ (*WantL2ArpTermEventsReply)(nil),
+ (*WantL2MacsEvents)(nil),
+ (*WantL2MacsEventsReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/l2/l2_rpc.ba.go b/internal/testbinapi/binapi2001/l2/l2_rpc.ba.go
new file mode 100644
index 0000000..7f8f246
--- /dev/null
+++ b/internal/testbinapi/binapi2001/l2/l2_rpc.ba.go
@@ -0,0 +1,403 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package l2
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service l2.
+type RPCService interface {
+ BdIPMacAddDel(ctx context.Context, in *BdIPMacAddDel) (*BdIPMacAddDelReply, error)
+ BdIPMacDump(ctx context.Context, in *BdIPMacDump) (RPCService_BdIPMacDumpClient, error)
+ BdIPMacFlush(ctx context.Context, in *BdIPMacFlush) (*BdIPMacFlushReply, error)
+ BridgeDomainAddDel(ctx context.Context, in *BridgeDomainAddDel) (*BridgeDomainAddDelReply, error)
+ BridgeDomainDump(ctx context.Context, in *BridgeDomainDump) (RPCService_BridgeDomainDumpClient, error)
+ BridgeDomainSetMacAge(ctx context.Context, in *BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error)
+ BridgeFlags(ctx context.Context, in *BridgeFlags) (*BridgeFlagsReply, error)
+ BviCreate(ctx context.Context, in *BviCreate) (*BviCreateReply, error)
+ BviDelete(ctx context.Context, in *BviDelete) (*BviDeleteReply, error)
+ L2FibClearTable(ctx context.Context, in *L2FibClearTable) (*L2FibClearTableReply, error)
+ L2FibTableDump(ctx context.Context, in *L2FibTableDump) (RPCService_L2FibTableDumpClient, error)
+ L2Flags(ctx context.Context, in *L2Flags) (*L2FlagsReply, error)
+ L2InterfaceEfpFilter(ctx context.Context, in *L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error)
+ L2InterfacePbbTagRewrite(ctx context.Context, in *L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error)
+ L2InterfaceVlanTagRewrite(ctx context.Context, in *L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error)
+ L2PatchAddDel(ctx context.Context, in *L2PatchAddDel) (*L2PatchAddDelReply, error)
+ L2XconnectDump(ctx context.Context, in *L2XconnectDump) (RPCService_L2XconnectDumpClient, error)
+ L2fibAddDel(ctx context.Context, in *L2fibAddDel) (*L2fibAddDelReply, error)
+ L2fibFlushAll(ctx context.Context, in *L2fibFlushAll) (*L2fibFlushAllReply, error)
+ L2fibFlushBd(ctx context.Context, in *L2fibFlushBd) (*L2fibFlushBdReply, error)
+ L2fibFlushInt(ctx context.Context, in *L2fibFlushInt) (*L2fibFlushIntReply, error)
+ SwInterfaceSetL2Bridge(ctx context.Context, in *SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error)
+ SwInterfaceSetL2Xconnect(ctx context.Context, in *SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error)
+ SwInterfaceSetVpath(ctx context.Context, in *SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error)
+ WantL2ArpTermEvents(ctx context.Context, in *WantL2ArpTermEvents) (*WantL2ArpTermEventsReply, error)
+ WantL2MacsEvents(ctx context.Context, in *WantL2MacsEvents) (*WantL2MacsEventsReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) BdIPMacAddDel(ctx context.Context, in *BdIPMacAddDel) (*BdIPMacAddDelReply, error) {
+ out := new(BdIPMacAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BdIPMacDump(ctx context.Context, in *BdIPMacDump) (RPCService_BdIPMacDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BdIPMacDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BdIPMacDumpClient interface {
+ Recv() (*BdIPMacDetails, error)
+ api.Stream
+}
+
+type serviceClient_BdIPMacDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BdIPMacDumpClient) Recv() (*BdIPMacDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BdIPMacDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BdIPMacFlush(ctx context.Context, in *BdIPMacFlush) (*BdIPMacFlushReply, error) {
+ out := new(BdIPMacFlushReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BridgeDomainAddDel(ctx context.Context, in *BridgeDomainAddDel) (*BridgeDomainAddDelReply, error) {
+ out := new(BridgeDomainAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BridgeDomainDump(ctx context.Context, in *BridgeDomainDump) (RPCService_BridgeDomainDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BridgeDomainDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BridgeDomainDumpClient interface {
+ Recv() (*BridgeDomainDetails, error)
+ api.Stream
+}
+
+type serviceClient_BridgeDomainDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BridgeDomainDumpClient) Recv() (*BridgeDomainDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BridgeDomainDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BridgeDomainSetMacAge(ctx context.Context, in *BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error) {
+ out := new(BridgeDomainSetMacAgeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BridgeFlags(ctx context.Context, in *BridgeFlags) (*BridgeFlagsReply, error) {
+ out := new(BridgeFlagsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BviCreate(ctx context.Context, in *BviCreate) (*BviCreateReply, error) {
+ out := new(BviCreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BviDelete(ctx context.Context, in *BviDelete) (*BviDeleteReply, error) {
+ out := new(BviDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2FibClearTable(ctx context.Context, in *L2FibClearTable) (*L2FibClearTableReply, error) {
+ out := new(L2FibClearTableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2FibTableDump(ctx context.Context, in *L2FibTableDump) (RPCService_L2FibTableDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_L2FibTableDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_L2FibTableDumpClient interface {
+ Recv() (*L2FibTableDetails, error)
+ api.Stream
+}
+
+type serviceClient_L2FibTableDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_L2FibTableDumpClient) Recv() (*L2FibTableDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *L2FibTableDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) L2Flags(ctx context.Context, in *L2Flags) (*L2FlagsReply, error) {
+ out := new(L2FlagsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2InterfaceEfpFilter(ctx context.Context, in *L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error) {
+ out := new(L2InterfaceEfpFilterReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2InterfacePbbTagRewrite(ctx context.Context, in *L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error) {
+ out := new(L2InterfacePbbTagRewriteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2InterfaceVlanTagRewrite(ctx context.Context, in *L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error) {
+ out := new(L2InterfaceVlanTagRewriteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2PatchAddDel(ctx context.Context, in *L2PatchAddDel) (*L2PatchAddDelReply, error) {
+ out := new(L2PatchAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2XconnectDump(ctx context.Context, in *L2XconnectDump) (RPCService_L2XconnectDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_L2XconnectDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_L2XconnectDumpClient interface {
+ Recv() (*L2XconnectDetails, error)
+ api.Stream
+}
+
+type serviceClient_L2XconnectDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_L2XconnectDumpClient) Recv() (*L2XconnectDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *L2XconnectDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) L2fibAddDel(ctx context.Context, in *L2fibAddDel) (*L2fibAddDelReply, error) {
+ out := new(L2fibAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2fibFlushAll(ctx context.Context, in *L2fibFlushAll) (*L2fibFlushAllReply, error) {
+ out := new(L2fibFlushAllReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2fibFlushBd(ctx context.Context, in *L2fibFlushBd) (*L2fibFlushBdReply, error) {
+ out := new(L2fibFlushBdReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2fibFlushInt(ctx context.Context, in *L2fibFlushInt) (*L2fibFlushIntReply, error) {
+ out := new(L2fibFlushIntReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwInterfaceSetL2Bridge(ctx context.Context, in *SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error) {
+ out := new(SwInterfaceSetL2BridgeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwInterfaceSetL2Xconnect(ctx context.Context, in *SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error) {
+ out := new(SwInterfaceSetL2XconnectReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwInterfaceSetVpath(ctx context.Context, in *SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error) {
+ out := new(SwInterfaceSetVpathReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) WantL2ArpTermEvents(ctx context.Context, in *WantL2ArpTermEvents) (*WantL2ArpTermEventsReply, error) {
+ out := new(WantL2ArpTermEventsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) WantL2MacsEvents(ctx context.Context, in *WantL2MacsEvents) (*WantL2MacsEventsReply, error) {
+ out := new(WantL2MacsEventsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/l2e/l2e.ba.go b/internal/testbinapi/binapi2001/l2e/l2e.ba.go
new file mode 100644
index 0000000..02680bb
--- /dev/null
+++ b/internal/testbinapi/binapi2001/l2e/l2e.ba.go
@@ -0,0 +1,370 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/l2e.api.json
+
+// Package l2e contains generated bindings for API file l2e.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 2 messages
+//
+package l2e
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "l2e"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x541d3edd
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// L2Emulation defines message 'l2_emulation'.
+type L2Emulation struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *L2Emulation) Reset() { *m = L2Emulation{} }
+func (*L2Emulation) GetMessageName() string { return "l2_emulation" }
+func (*L2Emulation) GetCrcString() string { return "ae6cfcfb" }
+func (*L2Emulation) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2Emulation) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
+ return size
+}
+func (m *L2Emulation) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *L2Emulation) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// L2EmulationReply defines message 'l2_emulation_reply'.
+type L2EmulationReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2EmulationReply) Reset() { *m = L2EmulationReply{} }
+func (*L2EmulationReply) GetMessageName() string { return "l2_emulation_reply" }
+func (*L2EmulationReply) GetCrcString() string { return "e8d4e804" }
+func (*L2EmulationReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2EmulationReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2EmulationReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_l2e_binapi_init() }
+func file_l2e_binapi_init() {
+ api.RegisterMessage((*L2Emulation)(nil), "l2_emulation_ae6cfcfb")
+ api.RegisterMessage((*L2EmulationReply)(nil), "l2_emulation_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*L2Emulation)(nil),
+ (*L2EmulationReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/l2e/l2e_rpc.ba.go b/internal/testbinapi/binapi2001/l2e/l2e_rpc.ba.go
new file mode 100644
index 0000000..e589d28
--- /dev/null
+++ b/internal/testbinapi/binapi2001/l2e/l2e_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package l2e
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service l2e.
+type RPCService interface {
+ L2Emulation(ctx context.Context, in *L2Emulation) (*L2EmulationReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) L2Emulation(ctx context.Context, in *L2Emulation) (*L2EmulationReply, error) {
+ out := new(L2EmulationReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/l2tp/l2tp.ba.go b/internal/testbinapi/binapi2001/l2tp/l2tp.ba.go
new file mode 100644
index 0000000..402bb21
--- /dev/null
+++ b/internal/testbinapi/binapi2001/l2tp/l2tp.ba.go
@@ -0,0 +1,1365 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/l2tp.api.json
+
+// Package l2tp contains generated bindings for API file l2tp.api.
+//
+// Contents:
+// 7 aliases
+// 11 enums
+// 6 structs
+// 1 union
+// 10 messages
+//
+package l2tp
+
+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 = "l2tp"
+ APIVersion = "2.0.0"
+ VersionCrc = 0x1ecf7730
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// L2tLookupKey defines enum 'l2t_lookup_key'.
+type L2tLookupKey uint8
+
+const (
+ L2T_LOOKUP_KEY_API_SRC_ADDR L2tLookupKey = 0
+ L2T_LOOKUP_KEY_API_DST_ADDR L2tLookupKey = 1
+ L2T_LOOKUP_KEY_API_SESSION_ID L2tLookupKey = 2
+)
+
+var (
+ L2tLookupKey_name = map[uint8]string{
+ 0: "L2T_LOOKUP_KEY_API_SRC_ADDR",
+ 1: "L2T_LOOKUP_KEY_API_DST_ADDR",
+ 2: "L2T_LOOKUP_KEY_API_SESSION_ID",
+ }
+ L2tLookupKey_value = map[string]uint8{
+ "L2T_LOOKUP_KEY_API_SRC_ADDR": 0,
+ "L2T_LOOKUP_KEY_API_DST_ADDR": 1,
+ "L2T_LOOKUP_KEY_API_SESSION_ID": 2,
+ }
+)
+
+func (x L2tLookupKey) String() string {
+ s, ok := L2tLookupKey_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "L2tLookupKey(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// L2tpv3CreateTunnel defines message 'l2tpv3_create_tunnel'.
+type L2tpv3CreateTunnel struct {
+ ClientAddress Address `binapi:"address,name=client_address" json:"client_address,omitempty"`
+ OurAddress Address `binapi:"address,name=our_address" json:"our_address,omitempty"`
+ LocalSessionID uint32 `binapi:"u32,name=local_session_id" json:"local_session_id,omitempty"`
+ RemoteSessionID uint32 `binapi:"u32,name=remote_session_id" json:"remote_session_id,omitempty"`
+ LocalCookie uint64 `binapi:"u64,name=local_cookie" json:"local_cookie,omitempty"`
+ RemoteCookie uint64 `binapi:"u64,name=remote_cookie" json:"remote_cookie,omitempty"`
+ L2SublayerPresent bool `binapi:"bool,name=l2_sublayer_present" json:"l2_sublayer_present,omitempty"`
+ EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
+}
+
+func (m *L2tpv3CreateTunnel) Reset() { *m = L2tpv3CreateTunnel{} }
+func (*L2tpv3CreateTunnel) GetMessageName() string { return "l2tpv3_create_tunnel" }
+func (*L2tpv3CreateTunnel) GetCrcString() string { return "596892cb" }
+func (*L2tpv3CreateTunnel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2tpv3CreateTunnel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ClientAddress.Af
+ size += 1 * 16 // m.ClientAddress.Un
+ size += 4 // m.OurAddress.Af
+ size += 1 * 16 // m.OurAddress.Un
+ size += 4 // m.LocalSessionID
+ size += 4 // m.RemoteSessionID
+ size += 8 // m.LocalCookie
+ size += 8 // m.RemoteCookie
+ size += 1 // m.L2SublayerPresent
+ size += 4 // m.EncapVrfID
+ return size
+}
+func (m *L2tpv3CreateTunnel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.ClientAddress.Af))
+ buf.EncodeBytes(m.ClientAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.OurAddress.Af))
+ 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(m.EncapVrfID)
+ return buf.Bytes(), nil
+}
+func (m *L2tpv3CreateTunnel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ClientAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.ClientAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.OurAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.OurAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.LocalSessionID = buf.DecodeUint32()
+ m.RemoteSessionID = buf.DecodeUint32()
+ m.LocalCookie = buf.DecodeUint64()
+ m.RemoteCookie = buf.DecodeUint64()
+ m.L2SublayerPresent = buf.DecodeBool()
+ m.EncapVrfID = buf.DecodeUint32()
+ return nil
+}
+
+// L2tpv3CreateTunnelReply defines message 'l2tpv3_create_tunnel_reply'.
+type L2tpv3CreateTunnelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *L2tpv3CreateTunnelReply) Reset() { *m = L2tpv3CreateTunnelReply{} }
+func (*L2tpv3CreateTunnelReply) GetMessageName() string { return "l2tpv3_create_tunnel_reply" }
+func (*L2tpv3CreateTunnelReply) GetCrcString() string { return "5383d31f" }
+func (*L2tpv3CreateTunnelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2tpv3CreateTunnelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *L2tpv3CreateTunnelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// L2tpv3InterfaceEnableDisable defines message 'l2tpv3_interface_enable_disable'.
+type L2tpv3InterfaceEnableDisable struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *L2tpv3InterfaceEnableDisable) Reset() { *m = L2tpv3InterfaceEnableDisable{} }
+func (*L2tpv3InterfaceEnableDisable) GetMessageName() string {
+ return "l2tpv3_interface_enable_disable"
+}
+func (*L2tpv3InterfaceEnableDisable) GetCrcString() string { return "3865946c" }
+func (*L2tpv3InterfaceEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2tpv3InterfaceEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *L2tpv3InterfaceEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *L2tpv3InterfaceEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// L2tpv3InterfaceEnableDisableReply defines message 'l2tpv3_interface_enable_disable_reply'.
+type L2tpv3InterfaceEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2tpv3InterfaceEnableDisableReply) Reset() { *m = L2tpv3InterfaceEnableDisableReply{} }
+func (*L2tpv3InterfaceEnableDisableReply) GetMessageName() string {
+ return "l2tpv3_interface_enable_disable_reply"
+}
+func (*L2tpv3InterfaceEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*L2tpv3InterfaceEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2tpv3InterfaceEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2tpv3InterfaceEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2tpv3SetLookupKey defines message 'l2tpv3_set_lookup_key'.
+type L2tpv3SetLookupKey struct {
+ Key L2tLookupKey `binapi:"l2t_lookup_key,name=key" json:"key,omitempty"`
+}
+
+func (m *L2tpv3SetLookupKey) Reset() { *m = L2tpv3SetLookupKey{} }
+func (*L2tpv3SetLookupKey) GetMessageName() string { return "l2tpv3_set_lookup_key" }
+func (*L2tpv3SetLookupKey) GetCrcString() string { return "c9892c86" }
+func (*L2tpv3SetLookupKey) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2tpv3SetLookupKey) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Key
+ return size
+}
+func (m *L2tpv3SetLookupKey) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.Key))
+ return buf.Bytes(), nil
+}
+func (m *L2tpv3SetLookupKey) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Key = L2tLookupKey(buf.DecodeUint8())
+ return nil
+}
+
+// L2tpv3SetLookupKeyReply defines message 'l2tpv3_set_lookup_key_reply'.
+type L2tpv3SetLookupKeyReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2tpv3SetLookupKeyReply) Reset() { *m = L2tpv3SetLookupKeyReply{} }
+func (*L2tpv3SetLookupKeyReply) GetMessageName() string { return "l2tpv3_set_lookup_key_reply" }
+func (*L2tpv3SetLookupKeyReply) GetCrcString() string { return "e8d4e804" }
+func (*L2tpv3SetLookupKeyReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2tpv3SetLookupKeyReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2tpv3SetLookupKeyReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L2tpv3SetTunnelCookies defines message 'l2tpv3_set_tunnel_cookies'.
+type L2tpv3SetTunnelCookies struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ NewLocalCookie uint64 `binapi:"u64,name=new_local_cookie" json:"new_local_cookie,omitempty"`
+ NewRemoteCookie uint64 `binapi:"u64,name=new_remote_cookie" json:"new_remote_cookie,omitempty"`
+}
+
+func (m *L2tpv3SetTunnelCookies) Reset() { *m = L2tpv3SetTunnelCookies{} }
+func (*L2tpv3SetTunnelCookies) GetMessageName() string { return "l2tpv3_set_tunnel_cookies" }
+func (*L2tpv3SetTunnelCookies) GetCrcString() string { return "b3f4faf7" }
+func (*L2tpv3SetTunnelCookies) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L2tpv3SetTunnelCookies) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 8 // m.NewLocalCookie
+ size += 8 // m.NewRemoteCookie
+ return size
+}
+func (m *L2tpv3SetTunnelCookies) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint64(m.NewLocalCookie)
+ buf.EncodeUint64(m.NewRemoteCookie)
+ return buf.Bytes(), nil
+}
+func (m *L2tpv3SetTunnelCookies) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.NewLocalCookie = buf.DecodeUint64()
+ m.NewRemoteCookie = buf.DecodeUint64()
+ return nil
+}
+
+// L2tpv3SetTunnelCookiesReply defines message 'l2tpv3_set_tunnel_cookies_reply'.
+type L2tpv3SetTunnelCookiesReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L2tpv3SetTunnelCookiesReply) Reset() { *m = L2tpv3SetTunnelCookiesReply{} }
+func (*L2tpv3SetTunnelCookiesReply) GetMessageName() string { return "l2tpv3_set_tunnel_cookies_reply" }
+func (*L2tpv3SetTunnelCookiesReply) GetCrcString() string { return "e8d4e804" }
+func (*L2tpv3SetTunnelCookiesReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L2tpv3SetTunnelCookiesReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L2tpv3SetTunnelCookiesReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwIfL2tpv3TunnelDetails defines message 'sw_if_l2tpv3_tunnel_details'.
+type SwIfL2tpv3TunnelDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
+ ClientAddress Address `binapi:"address,name=client_address" json:"client_address,omitempty"`
+ OurAddress Address `binapi:"address,name=our_address" json:"our_address,omitempty"`
+ LocalSessionID uint32 `binapi:"u32,name=local_session_id" json:"local_session_id,omitempty"`
+ RemoteSessionID uint32 `binapi:"u32,name=remote_session_id" json:"remote_session_id,omitempty"`
+ LocalCookie []uint64 `binapi:"u64[2],name=local_cookie" json:"local_cookie,omitempty"`
+ RemoteCookie uint64 `binapi:"u64,name=remote_cookie" json:"remote_cookie,omitempty"`
+ L2SublayerPresent bool `binapi:"bool,name=l2_sublayer_present" json:"l2_sublayer_present,omitempty"`
+}
+
+func (m *SwIfL2tpv3TunnelDetails) Reset() { *m = SwIfL2tpv3TunnelDetails{} }
+func (*SwIfL2tpv3TunnelDetails) GetMessageName() string { return "sw_if_l2tpv3_tunnel_details" }
+func (*SwIfL2tpv3TunnelDetails) GetCrcString() string { return "1dab5c7e" }
+func (*SwIfL2tpv3TunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwIfL2tpv3TunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 64 // m.InterfaceName
+ size += 4 // m.ClientAddress.Af
+ size += 1 * 16 // m.ClientAddress.Un
+ size += 4 // m.OurAddress.Af
+ size += 1 * 16 // m.OurAddress.Un
+ size += 4 // m.LocalSessionID
+ size += 4 // m.RemoteSessionID
+ size += 8 * 2 // m.LocalCookie
+ size += 8 // m.RemoteCookie
+ size += 1 // m.L2SublayerPresent
+ return size
+}
+func (m *SwIfL2tpv3TunnelDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeString(m.InterfaceName, 64)
+ buf.EncodeUint32(uint32(m.ClientAddress.Af))
+ buf.EncodeBytes(m.ClientAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.OurAddress.Af))
+ 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(x)
+ }
+ buf.EncodeUint64(m.RemoteCookie)
+ buf.EncodeBool(m.L2SublayerPresent)
+ return buf.Bytes(), nil
+}
+func (m *SwIfL2tpv3TunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.InterfaceName = buf.DecodeString(64)
+ m.ClientAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.ClientAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.OurAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.OurAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.LocalSessionID = buf.DecodeUint32()
+ m.RemoteSessionID = buf.DecodeUint32()
+ m.LocalCookie = make([]uint64, 2)
+ for i := 0; i < len(m.LocalCookie); i++ {
+ m.LocalCookie[i] = buf.DecodeUint64()
+ }
+ m.RemoteCookie = buf.DecodeUint64()
+ m.L2SublayerPresent = buf.DecodeBool()
+ return nil
+}
+
+// SwIfL2tpv3TunnelDump defines message 'sw_if_l2tpv3_tunnel_dump'.
+type SwIfL2tpv3TunnelDump struct{}
+
+func (m *SwIfL2tpv3TunnelDump) Reset() { *m = SwIfL2tpv3TunnelDump{} }
+func (*SwIfL2tpv3TunnelDump) GetMessageName() string { return "sw_if_l2tpv3_tunnel_dump" }
+func (*SwIfL2tpv3TunnelDump) GetCrcString() string { return "51077d14" }
+func (*SwIfL2tpv3TunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwIfL2tpv3TunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *SwIfL2tpv3TunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *SwIfL2tpv3TunnelDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_l2tp_binapi_init() }
+func file_l2tp_binapi_init() {
+ api.RegisterMessage((*L2tpv3CreateTunnel)(nil), "l2tpv3_create_tunnel_596892cb")
+ api.RegisterMessage((*L2tpv3CreateTunnelReply)(nil), "l2tpv3_create_tunnel_reply_5383d31f")
+ api.RegisterMessage((*L2tpv3InterfaceEnableDisable)(nil), "l2tpv3_interface_enable_disable_3865946c")
+ api.RegisterMessage((*L2tpv3InterfaceEnableDisableReply)(nil), "l2tpv3_interface_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*L2tpv3SetLookupKey)(nil), "l2tpv3_set_lookup_key_c9892c86")
+ api.RegisterMessage((*L2tpv3SetLookupKeyReply)(nil), "l2tpv3_set_lookup_key_reply_e8d4e804")
+ api.RegisterMessage((*L2tpv3SetTunnelCookies)(nil), "l2tpv3_set_tunnel_cookies_b3f4faf7")
+ api.RegisterMessage((*L2tpv3SetTunnelCookiesReply)(nil), "l2tpv3_set_tunnel_cookies_reply_e8d4e804")
+ api.RegisterMessage((*SwIfL2tpv3TunnelDetails)(nil), "sw_if_l2tpv3_tunnel_details_1dab5c7e")
+ api.RegisterMessage((*SwIfL2tpv3TunnelDump)(nil), "sw_if_l2tpv3_tunnel_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*L2tpv3CreateTunnel)(nil),
+ (*L2tpv3CreateTunnelReply)(nil),
+ (*L2tpv3InterfaceEnableDisable)(nil),
+ (*L2tpv3InterfaceEnableDisableReply)(nil),
+ (*L2tpv3SetLookupKey)(nil),
+ (*L2tpv3SetLookupKeyReply)(nil),
+ (*L2tpv3SetTunnelCookies)(nil),
+ (*L2tpv3SetTunnelCookiesReply)(nil),
+ (*SwIfL2tpv3TunnelDetails)(nil),
+ (*SwIfL2tpv3TunnelDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/l2tp/l2tp_rpc.ba.go b/internal/testbinapi/binapi2001/l2tp/l2tp_rpc.ba.go
new file mode 100644
index 0000000..49db4ce
--- /dev/null
+++ b/internal/testbinapi/binapi2001/l2tp/l2tp_rpc.ba.go
@@ -0,0 +1,103 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package l2tp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service l2tp.
+type RPCService interface {
+ L2tpv3CreateTunnel(ctx context.Context, in *L2tpv3CreateTunnel) (*L2tpv3CreateTunnelReply, error)
+ L2tpv3InterfaceEnableDisable(ctx context.Context, in *L2tpv3InterfaceEnableDisable) (*L2tpv3InterfaceEnableDisableReply, error)
+ L2tpv3SetLookupKey(ctx context.Context, in *L2tpv3SetLookupKey) (*L2tpv3SetLookupKeyReply, error)
+ L2tpv3SetTunnelCookies(ctx context.Context, in *L2tpv3SetTunnelCookies) (*L2tpv3SetTunnelCookiesReply, error)
+ SwIfL2tpv3TunnelDump(ctx context.Context, in *SwIfL2tpv3TunnelDump) (RPCService_SwIfL2tpv3TunnelDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) L2tpv3CreateTunnel(ctx context.Context, in *L2tpv3CreateTunnel) (*L2tpv3CreateTunnelReply, error) {
+ out := new(L2tpv3CreateTunnelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2tpv3InterfaceEnableDisable(ctx context.Context, in *L2tpv3InterfaceEnableDisable) (*L2tpv3InterfaceEnableDisableReply, error) {
+ out := new(L2tpv3InterfaceEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2tpv3SetLookupKey(ctx context.Context, in *L2tpv3SetLookupKey) (*L2tpv3SetLookupKeyReply, error) {
+ out := new(L2tpv3SetLookupKeyReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L2tpv3SetTunnelCookies(ctx context.Context, in *L2tpv3SetTunnelCookies) (*L2tpv3SetTunnelCookiesReply, error) {
+ out := new(L2tpv3SetTunnelCookiesReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwIfL2tpv3TunnelDump(ctx context.Context, in *SwIfL2tpv3TunnelDump) (RPCService_SwIfL2tpv3TunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwIfL2tpv3TunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwIfL2tpv3TunnelDumpClient interface {
+ Recv() (*SwIfL2tpv3TunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_SwIfL2tpv3TunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwIfL2tpv3TunnelDumpClient) Recv() (*SwIfL2tpv3TunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwIfL2tpv3TunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/l3xc/l3xc.ba.go b/internal/testbinapi/binapi2001/l3xc/l3xc.ba.go
new file mode 100644
index 0000000..82948f2
--- /dev/null
+++ b/internal/testbinapi/binapi2001/l3xc/l3xc.ba.go
@@ -0,0 +1,1485 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/l3xc.api.json
+
+// Package l3xc contains generated bindings for API file l3xc.api.
+//
+// Contents:
+// 6 aliases
+// 13 enums
+// 10 structs
+// 1 union
+// 8 messages
+//
+package l3xc
+
+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 = "l3xc"
+ APIVersion = "1.0.1"
+ VersionCrc = 0x80b00c99
+)
+
+// 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<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// FibPathNhProto defines enum 'fib_path_nh_proto'.
+type FibPathNhProto uint32
+
+const (
+ FIB_API_PATH_NH_PROTO_IP4 FibPathNhProto = 0
+ FIB_API_PATH_NH_PROTO_IP6 FibPathNhProto = 1
+ FIB_API_PATH_NH_PROTO_MPLS FibPathNhProto = 2
+ FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
+ FIB_API_PATH_NH_PROTO_BIER FibPathNhProto = 4
+)
+
+var (
+ FibPathNhProto_name = map[uint32]string{
+ 0: "FIB_API_PATH_NH_PROTO_IP4",
+ 1: "FIB_API_PATH_NH_PROTO_IP6",
+ 2: "FIB_API_PATH_NH_PROTO_MPLS",
+ 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
+ 4: "FIB_API_PATH_NH_PROTO_BIER",
+ }
+ FibPathNhProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathNhProto) String() string {
+ s, ok := FibPathNhProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// FibPathType defines enum 'fib_path_type'.
+type FibPathType uint32
+
+const (
+ FIB_API_PATH_TYPE_NORMAL FibPathType = 0
+ FIB_API_PATH_TYPE_LOCAL FibPathType = 1
+ FIB_API_PATH_TYPE_DROP FibPathType = 2
+ FIB_API_PATH_TYPE_UDP_ENCAP FibPathType = 3
+ FIB_API_PATH_TYPE_BIER_IMP FibPathType = 4
+ FIB_API_PATH_TYPE_ICMP_UNREACH FibPathType = 5
+ FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
+ FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
+ FIB_API_PATH_TYPE_DVR FibPathType = 8
+ FIB_API_PATH_TYPE_INTERFACE_RX FibPathType = 9
+ FIB_API_PATH_TYPE_CLASSIFY FibPathType = 10
+)
+
+var (
+ FibPathType_name = map[uint32]string{
+ 0: "FIB_API_PATH_TYPE_NORMAL",
+ 1: "FIB_API_PATH_TYPE_LOCAL",
+ 2: "FIB_API_PATH_TYPE_DROP",
+ 3: "FIB_API_PATH_TYPE_UDP_ENCAP",
+ 4: "FIB_API_PATH_TYPE_BIER_IMP",
+ 5: "FIB_API_PATH_TYPE_ICMP_UNREACH",
+ 6: "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
+ 7: "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
+ 8: "FIB_API_PATH_TYPE_DVR",
+ 9: "FIB_API_PATH_TYPE_INTERFACE_RX",
+ 10: "FIB_API_PATH_TYPE_CLASSIFY",
+ }
+ FibPathType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathType) String() string {
+ s, ok := FibPathType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// FibMplsLabel defines type 'fib_mpls_label'.
+type FibMplsLabel struct {
+ IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
+ Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
+ TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
+ Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
+}
+
+// FibPath defines type 'fib_path'.
+type FibPath struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+ Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
+ Type FibPathType `binapi:"fib_path_type,name=type" json:"type,omitempty"`
+ Flags FibPathFlags `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
+ Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
+ Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
+ NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
+ LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
+}
+
+// FibPathNh defines type 'fib_path_nh'.
+type FibPathNh struct {
+ Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
+ ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
+ ObjID uint32 `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
+ ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// L3xc defines type 'l3xc'.
+type L3xc struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
+ NPaths uint8 `binapi:"u8,name=n_paths" json:"-"`
+ Paths []FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// L3xcDel defines message 'l3xc_del'.
+type L3xcDel struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
+}
+
+func (m *L3xcDel) Reset() { *m = L3xcDel{} }
+func (*L3xcDel) GetMessageName() string { return "l3xc_del" }
+func (*L3xcDel) GetCrcString() string { return "e7dbef91" }
+func (*L3xcDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L3xcDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIP6
+ return size
+}
+func (m *L3xcDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIP6)
+ return buf.Bytes(), nil
+}
+func (m *L3xcDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIP6 = buf.DecodeBool()
+ return nil
+}
+
+// L3xcDelReply defines message 'l3xc_del_reply'.
+type L3xcDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *L3xcDelReply) Reset() { *m = L3xcDelReply{} }
+func (*L3xcDelReply) GetMessageName() string { return "l3xc_del_reply" }
+func (*L3xcDelReply) GetCrcString() string { return "e8d4e804" }
+func (*L3xcDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L3xcDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *L3xcDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// L3xcDetails defines message 'l3xc_details'.
+type L3xcDetails struct {
+ L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
+}
+
+func (m *L3xcDetails) Reset() { *m = L3xcDetails{} }
+func (*L3xcDetails) GetMessageName() string { return "l3xc_details" }
+func (*L3xcDetails) GetCrcString() string { return "d4f69627" }
+func (*L3xcDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L3xcDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.L3xc.SwIfIndex
+ size += 1 // m.L3xc.IsIP6
+ size += 1 // m.L3xc.NPaths
+ for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.L3xc.Paths) {
+ s2 = m.L3xc.Paths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ 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 FibPath // Paths
+ if j1 < len(m.L3xc.Paths) {
+ v1 = m.L3xc.Paths[j1]
+ }
+ 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[:], 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++ {
+ 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 *L3xcDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.L3xc.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.L3xc.IsIP6 = buf.DecodeBool()
+ m.L3xc.NPaths = buf.DecodeUint8()
+ m.L3xc.Paths = make([]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()
+ m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
+ m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
+ m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
+ m.L3xc.Paths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.L3xc.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.L3xc.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// L3xcDump defines message 'l3xc_dump'.
+type L3xcDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *L3xcDump) Reset() { *m = L3xcDump{} }
+func (*L3xcDump) GetMessageName() string { return "l3xc_dump" }
+func (*L3xcDump) GetCrcString() string { return "f9e6675e" }
+func (*L3xcDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L3xcDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *L3xcDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *L3xcDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// L3xcPluginGetVersion defines message 'l3xc_plugin_get_version'.
+type L3xcPluginGetVersion struct{}
+
+func (m *L3xcPluginGetVersion) Reset() { *m = L3xcPluginGetVersion{} }
+func (*L3xcPluginGetVersion) GetMessageName() string { return "l3xc_plugin_get_version" }
+func (*L3xcPluginGetVersion) GetCrcString() string { return "51077d14" }
+func (*L3xcPluginGetVersion) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L3xcPluginGetVersion) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *L3xcPluginGetVersion) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *L3xcPluginGetVersion) Unmarshal(b []byte) error {
+ return nil
+}
+
+// L3xcPluginGetVersionReply defines message 'l3xc_plugin_get_version_reply'.
+type L3xcPluginGetVersionReply struct {
+ Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
+ Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
+}
+
+func (m *L3xcPluginGetVersionReply) Reset() { *m = L3xcPluginGetVersionReply{} }
+func (*L3xcPluginGetVersionReply) GetMessageName() string { return "l3xc_plugin_get_version_reply" }
+func (*L3xcPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
+func (*L3xcPluginGetVersionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L3xcPluginGetVersionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Major
+ size += 4 // m.Minor
+ return size
+}
+func (m *L3xcPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Major)
+ buf.EncodeUint32(m.Minor)
+ return buf.Bytes(), nil
+}
+func (m *L3xcPluginGetVersionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Major = buf.DecodeUint32()
+ m.Minor = buf.DecodeUint32()
+ return nil
+}
+
+// L3xcUpdate defines message 'l3xc_update'.
+type L3xcUpdate struct {
+ L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
+}
+
+func (m *L3xcUpdate) Reset() { *m = L3xcUpdate{} }
+func (*L3xcUpdate) GetMessageName() string { return "l3xc_update" }
+func (*L3xcUpdate) GetCrcString() string { return "0787b1d3" }
+func (*L3xcUpdate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *L3xcUpdate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.L3xc.SwIfIndex
+ size += 1 // m.L3xc.IsIP6
+ size += 1 // m.L3xc.NPaths
+ for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.L3xc.Paths) {
+ s2 = m.L3xc.Paths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ 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 FibPath // Paths
+ if j1 < len(m.L3xc.Paths) {
+ v1 = m.L3xc.Paths[j1]
+ }
+ 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[:], 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++ {
+ 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 *L3xcUpdate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.L3xc.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.L3xc.IsIP6 = buf.DecodeBool()
+ m.L3xc.NPaths = buf.DecodeUint8()
+ m.L3xc.Paths = make([]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()
+ m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
+ m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
+ m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
+ m.L3xc.Paths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.L3xc.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.L3xc.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// L3xcUpdateReply defines message 'l3xc_update_reply'.
+type L3xcUpdateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
+}
+
+func (m *L3xcUpdateReply) Reset() { *m = L3xcUpdateReply{} }
+func (*L3xcUpdateReply) GetMessageName() string { return "l3xc_update_reply" }
+func (*L3xcUpdateReply) GetCrcString() string { return "1992deab" }
+func (*L3xcUpdateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *L3xcUpdateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.StatsIndex
+ return size
+}
+func (m *L3xcUpdateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.StatsIndex = buf.DecodeUint32()
+ return nil
+}
+
+func init() { file_l3xc_binapi_init() }
+func file_l3xc_binapi_init() {
+ api.RegisterMessage((*L3xcDel)(nil), "l3xc_del_e7dbef91")
+ api.RegisterMessage((*L3xcDelReply)(nil), "l3xc_del_reply_e8d4e804")
+ api.RegisterMessage((*L3xcDetails)(nil), "l3xc_details_d4f69627")
+ api.RegisterMessage((*L3xcDump)(nil), "l3xc_dump_f9e6675e")
+ api.RegisterMessage((*L3xcPluginGetVersion)(nil), "l3xc_plugin_get_version_51077d14")
+ api.RegisterMessage((*L3xcPluginGetVersionReply)(nil), "l3xc_plugin_get_version_reply_9b32cf86")
+ api.RegisterMessage((*L3xcUpdate)(nil), "l3xc_update_0787b1d3")
+ api.RegisterMessage((*L3xcUpdateReply)(nil), "l3xc_update_reply_1992deab")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*L3xcDel)(nil),
+ (*L3xcDelReply)(nil),
+ (*L3xcDetails)(nil),
+ (*L3xcDump)(nil),
+ (*L3xcPluginGetVersion)(nil),
+ (*L3xcPluginGetVersionReply)(nil),
+ (*L3xcUpdate)(nil),
+ (*L3xcUpdateReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/l3xc/l3xc_rpc.ba.go b/internal/testbinapi/binapi2001/l3xc/l3xc_rpc.ba.go
new file mode 100644
index 0000000..b25727e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/l3xc/l3xc_rpc.ba.go
@@ -0,0 +1,93 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package l3xc
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service l3xc.
+type RPCService interface {
+ L3xcDel(ctx context.Context, in *L3xcDel) (*L3xcDelReply, error)
+ L3xcDump(ctx context.Context, in *L3xcDump) (RPCService_L3xcDumpClient, error)
+ L3xcPluginGetVersion(ctx context.Context, in *L3xcPluginGetVersion) (*L3xcPluginGetVersionReply, error)
+ L3xcUpdate(ctx context.Context, in *L3xcUpdate) (*L3xcUpdateReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) L3xcDel(ctx context.Context, in *L3xcDel) (*L3xcDelReply, error) {
+ out := new(L3xcDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L3xcDump(ctx context.Context, in *L3xcDump) (RPCService_L3xcDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_L3xcDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_L3xcDumpClient interface {
+ Recv() (*L3xcDetails, error)
+ api.Stream
+}
+
+type serviceClient_L3xcDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_L3xcDumpClient) Recv() (*L3xcDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *L3xcDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) L3xcPluginGetVersion(ctx context.Context, in *L3xcPluginGetVersion) (*L3xcPluginGetVersionReply, error) {
+ out := new(L3xcPluginGetVersionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) L3xcUpdate(ctx context.Context, in *L3xcUpdate) (*L3xcUpdateReply, error) {
+ out := new(L3xcUpdateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/lacp/lacp.ba.go b/internal/testbinapi/binapi2001/lacp/lacp.ba.go
new file mode 100644
index 0000000..a2b5a9e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lacp/lacp.ba.go
@@ -0,0 +1,463 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/lacp.api.json
+
+// Package lacp contains generated bindings for API file lacp.api.
+//
+// Contents:
+// 2 aliases
+// 6 enums
+// 2 messages
+//
+package lacp
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "net"
+ "strconv"
+)
+
+// 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 = "lacp"
+ APIVersion = "2.0.0"
+ VersionCrc = 0x930086a4
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// SwInterfaceLacpDetails defines message 'sw_interface_lacp_details'.
+type SwInterfaceLacpDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
+ RxState uint32 `binapi:"u32,name=rx_state" json:"rx_state,omitempty"`
+ TxState uint32 `binapi:"u32,name=tx_state" json:"tx_state,omitempty"`
+ MuxState uint32 `binapi:"u32,name=mux_state" json:"mux_state,omitempty"`
+ PtxState uint32 `binapi:"u32,name=ptx_state" json:"ptx_state,omitempty"`
+ BondInterfaceName string `binapi:"string[64],name=bond_interface_name" json:"bond_interface_name,omitempty"`
+ ActorSystemPriority uint16 `binapi:"u16,name=actor_system_priority" json:"actor_system_priority,omitempty"`
+ ActorSystem MacAddress `binapi:"mac_address,name=actor_system" json:"actor_system,omitempty"`
+ ActorKey uint16 `binapi:"u16,name=actor_key" json:"actor_key,omitempty"`
+ ActorPortPriority uint16 `binapi:"u16,name=actor_port_priority" json:"actor_port_priority,omitempty"`
+ ActorPortNumber uint16 `binapi:"u16,name=actor_port_number" json:"actor_port_number,omitempty"`
+ ActorState uint8 `binapi:"u8,name=actor_state" json:"actor_state,omitempty"`
+ PartnerSystemPriority uint16 `binapi:"u16,name=partner_system_priority" json:"partner_system_priority,omitempty"`
+ PartnerSystem MacAddress `binapi:"mac_address,name=partner_system" json:"partner_system,omitempty"`
+ PartnerKey uint16 `binapi:"u16,name=partner_key" json:"partner_key,omitempty"`
+ PartnerPortPriority uint16 `binapi:"u16,name=partner_port_priority" json:"partner_port_priority,omitempty"`
+ PartnerPortNumber uint16 `binapi:"u16,name=partner_port_number" json:"partner_port_number,omitempty"`
+ PartnerState uint8 `binapi:"u8,name=partner_state" json:"partner_state,omitempty"`
+}
+
+func (m *SwInterfaceLacpDetails) Reset() { *m = SwInterfaceLacpDetails{} }
+func (*SwInterfaceLacpDetails) GetMessageName() string { return "sw_interface_lacp_details" }
+func (*SwInterfaceLacpDetails) GetCrcString() string { return "745ae0ba" }
+func (*SwInterfaceLacpDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceLacpDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 64 // m.InterfaceName
+ size += 4 // m.RxState
+ size += 4 // m.TxState
+ size += 4 // m.MuxState
+ size += 4 // m.PtxState
+ size += 64 // m.BondInterfaceName
+ size += 2 // m.ActorSystemPriority
+ size += 1 * 6 // m.ActorSystem
+ size += 2 // m.ActorKey
+ size += 2 // m.ActorPortPriority
+ size += 2 // m.ActorPortNumber
+ size += 1 // m.ActorState
+ size += 2 // m.PartnerSystemPriority
+ size += 1 * 6 // m.PartnerSystem
+ size += 2 // m.PartnerKey
+ size += 2 // m.PartnerPortPriority
+ size += 2 // m.PartnerPortNumber
+ size += 1 // m.PartnerState
+ return size
+}
+func (m *SwInterfaceLacpDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeString(m.InterfaceName, 64)
+ buf.EncodeUint32(m.RxState)
+ buf.EncodeUint32(m.TxState)
+ buf.EncodeUint32(m.MuxState)
+ buf.EncodeUint32(m.PtxState)
+ buf.EncodeString(m.BondInterfaceName, 64)
+ buf.EncodeUint16(m.ActorSystemPriority)
+ buf.EncodeBytes(m.ActorSystem[:], 6)
+ 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(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 {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.InterfaceName = buf.DecodeString(64)
+ m.RxState = buf.DecodeUint32()
+ m.TxState = buf.DecodeUint32()
+ m.MuxState = buf.DecodeUint32()
+ m.PtxState = buf.DecodeUint32()
+ m.BondInterfaceName = buf.DecodeString(64)
+ m.ActorSystemPriority = buf.DecodeUint16()
+ copy(m.ActorSystem[:], buf.DecodeBytes(6))
+ m.ActorKey = buf.DecodeUint16()
+ m.ActorPortPriority = buf.DecodeUint16()
+ m.ActorPortNumber = buf.DecodeUint16()
+ m.ActorState = buf.DecodeUint8()
+ m.PartnerSystemPriority = buf.DecodeUint16()
+ copy(m.PartnerSystem[:], buf.DecodeBytes(6))
+ m.PartnerKey = buf.DecodeUint16()
+ m.PartnerPortPriority = buf.DecodeUint16()
+ m.PartnerPortNumber = buf.DecodeUint16()
+ m.PartnerState = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceLacpDump defines message 'sw_interface_lacp_dump'.
+type SwInterfaceLacpDump struct{}
+
+func (m *SwInterfaceLacpDump) Reset() { *m = SwInterfaceLacpDump{} }
+func (*SwInterfaceLacpDump) GetMessageName() string { return "sw_interface_lacp_dump" }
+func (*SwInterfaceLacpDump) GetCrcString() string { return "51077d14" }
+func (*SwInterfaceLacpDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceLacpDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *SwInterfaceLacpDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceLacpDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_lacp_binapi_init() }
+func file_lacp_binapi_init() {
+ api.RegisterMessage((*SwInterfaceLacpDetails)(nil), "sw_interface_lacp_details_745ae0ba")
+ api.RegisterMessage((*SwInterfaceLacpDump)(nil), "sw_interface_lacp_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SwInterfaceLacpDetails)(nil),
+ (*SwInterfaceLacpDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/lacp/lacp_rpc.ba.go b/internal/testbinapi/binapi2001/lacp/lacp_rpc.ba.go
new file mode 100644
index 0000000..f983ccb
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lacp/lacp_rpc.ba.go
@@ -0,0 +1,63 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package lacp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service lacp.
+type RPCService interface {
+ SwInterfaceLacpDump(ctx context.Context, in *SwInterfaceLacpDump) (RPCService_SwInterfaceLacpDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SwInterfaceLacpDump(ctx context.Context, in *SwInterfaceLacpDump) (RPCService_SwInterfaceLacpDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwInterfaceLacpDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwInterfaceLacpDumpClient interface {
+ Recv() (*SwInterfaceLacpDetails, error)
+ api.Stream
+}
+
+type serviceClient_SwInterfaceLacpDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwInterfaceLacpDumpClient) Recv() (*SwInterfaceLacpDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwInterfaceLacpDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/lb/lb.ba.go b/internal/testbinapi/binapi2001/lb/lb.ba.go
new file mode 100644
index 0000000..348a150
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lb/lb.ba.go
@@ -0,0 +1,1803 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/lb.api.json
+
+// Package lb contains generated bindings for API file lb.api.
+//
+// Contents:
+// 6 aliases
+// 15 enums
+// 7 structs
+// 1 union
+// 16 messages
+//
+package lb
+
+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 = "lb"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x76c36b4c
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbEncapType defines enum 'lb_encap_type'.
+type LbEncapType uint32
+
+const (
+ LB_API_ENCAP_TYPE_GRE4 LbEncapType = 0
+ LB_API_ENCAP_TYPE_GRE6 LbEncapType = 1
+ LB_API_ENCAP_TYPE_L3DSR LbEncapType = 2
+ LB_API_ENCAP_TYPE_NAT4 LbEncapType = 3
+ LB_API_ENCAP_TYPE_NAT6 LbEncapType = 4
+ LB_API_ENCAP_N_TYPES LbEncapType = 5
+)
+
+var (
+ LbEncapType_name = map[uint32]string{
+ 0: "LB_API_ENCAP_TYPE_GRE4",
+ 1: "LB_API_ENCAP_TYPE_GRE6",
+ 2: "LB_API_ENCAP_TYPE_L3DSR",
+ 3: "LB_API_ENCAP_TYPE_NAT4",
+ 4: "LB_API_ENCAP_TYPE_NAT6",
+ 5: "LB_API_ENCAP_N_TYPES",
+ }
+ LbEncapType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x LbEncapType) String() string {
+ s, ok := LbEncapType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbEncapType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbLkpTypeT defines enum 'lb_lkp_type_t'.
+type LbLkpTypeT uint32
+
+const (
+ LB_API_LKP_SAME_IP_PORT LbLkpTypeT = 0
+ LB_API_LKP_DIFF_IP_PORT LbLkpTypeT = 1
+ LB_API_LKP_ALL_PORT_IP LbLkpTypeT = 2
+ LB_API_LKP_N_TYPES LbLkpTypeT = 3
+)
+
+var (
+ LbLkpTypeT_name = map[uint32]string{
+ 0: "LB_API_LKP_SAME_IP_PORT",
+ 1: "LB_API_LKP_DIFF_IP_PORT",
+ 2: "LB_API_LKP_ALL_PORT_IP",
+ 3: "LB_API_LKP_N_TYPES",
+ }
+ LbLkpTypeT_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x LbLkpTypeT) String() string {
+ s, ok := LbLkpTypeT_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbLkpTypeT(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbNatProtocol defines enum 'lb_nat_protocol'.
+type LbNatProtocol uint32
+
+const (
+ LB_API_NAT_PROTOCOL_UDP LbNatProtocol = 6
+ LB_API_NAT_PROTOCOL_TCP LbNatProtocol = 23
+ LB_API_NAT_PROTOCOL_ANY LbNatProtocol = 4294967295
+)
+
+var (
+ LbNatProtocol_name = map[uint32]string{
+ 6: "LB_API_NAT_PROTOCOL_UDP",
+ 23: "LB_API_NAT_PROTOCOL_TCP",
+ 4294967295: "LB_API_NAT_PROTOCOL_ANY",
+ }
+ LbNatProtocol_value = map[string]uint32{
+ "LB_API_NAT_PROTOCOL_UDP": 6,
+ "LB_API_NAT_PROTOCOL_TCP": 23,
+ "LB_API_NAT_PROTOCOL_ANY": 4294967295,
+ }
+)
+
+func (x LbNatProtocol) String() string {
+ s, ok := LbNatProtocol_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbNatProtocol(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbSrvType defines enum 'lb_srv_type'.
+type LbSrvType uint32
+
+const (
+ LB_API_SRV_TYPE_CLUSTERIP LbSrvType = 0
+ LB_API_SRV_TYPE_NODEPORT LbSrvType = 1
+ LB_API_SRV_N_TYPES LbSrvType = 2
+)
+
+var (
+ LbSrvType_name = map[uint32]string{
+ 0: "LB_API_SRV_TYPE_CLUSTERIP",
+ 1: "LB_API_SRV_TYPE_NODEPORT",
+ 2: "LB_API_SRV_N_TYPES",
+ }
+ LbSrvType_value = map[string]uint32{
+ "LB_API_SRV_TYPE_CLUSTERIP": 0,
+ "LB_API_SRV_TYPE_NODEPORT": 1,
+ "LB_API_SRV_N_TYPES": 2,
+ }
+)
+
+func (x LbSrvType) String() string {
+ s, ok := LbSrvType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbSrvType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbVipType defines enum 'lb_vip_type'.
+type LbVipType uint32
+
+const (
+ LB_API_VIP_TYPE_IP6_GRE6 LbVipType = 0
+ LB_API_VIP_TYPE_IP6_GRE4 LbVipType = 1
+ LB_API_VIP_TYPE_IP4_GRE6 LbVipType = 2
+ LB_API_VIP_TYPE_IP4_GRE4 LbVipType = 3
+ LB_API_VIP_TYPE_IP4_L3DSR LbVipType = 4
+ LB_API_VIP_TYPE_IP4_NAT4 LbVipType = 5
+ LB_API_VIP_TYPE_IP6_NAT6 LbVipType = 6
+ LB_API_VIP_N_TYPES LbVipType = 7
+)
+
+var (
+ LbVipType_name = map[uint32]string{
+ 0: "LB_API_VIP_TYPE_IP6_GRE6",
+ 1: "LB_API_VIP_TYPE_IP6_GRE4",
+ 2: "LB_API_VIP_TYPE_IP4_GRE6",
+ 3: "LB_API_VIP_TYPE_IP4_GRE4",
+ 4: "LB_API_VIP_TYPE_IP4_L3DSR",
+ 5: "LB_API_VIP_TYPE_IP4_NAT4",
+ 6: "LB_API_VIP_TYPE_IP6_NAT6",
+ 7: "LB_API_VIP_N_TYPES",
+ }
+ LbVipType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x LbVipType) String() string {
+ s, ok := LbVipType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbVipType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// LbVip defines type 'lb_vip'.
+type LbVip struct {
+ Pfx AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
+ Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// LbAddDelAs defines message 'lb_add_del_as'.
+type LbAddDelAs struct {
+ Pfx AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ AsAddress Address `binapi:"address,name=as_address" json:"as_address,omitempty"`
+ IsDel bool `binapi:"bool,name=is_del" json:"is_del,omitempty"`
+ IsFlush bool `binapi:"bool,name=is_flush" json:"is_flush,omitempty"`
+}
+
+func (m *LbAddDelAs) Reset() { *m = LbAddDelAs{} }
+func (*LbAddDelAs) GetMessageName() string { return "lb_add_del_as" }
+func (*LbAddDelAs) GetCrcString() string { return "78628987" }
+func (*LbAddDelAs) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LbAddDelAs) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Pfx.Address.Af
+ size += 1 * 16 // m.Pfx.Address.Un
+ size += 1 // m.Pfx.Len
+ size += 1 // m.Protocol
+ size += 2 // m.Port
+ size += 4 // m.AsAddress.Af
+ size += 1 * 16 // m.AsAddress.Un
+ size += 1 // m.IsDel
+ size += 1 // m.IsFlush
+ return size
+}
+func (m *LbAddDelAs) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Pfx.Address.Af))
+ 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.AsAddress.Af))
+ buf.EncodeBytes(m.AsAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeBool(m.IsDel)
+ buf.EncodeBool(m.IsFlush)
+ return buf.Bytes(), nil
+}
+func (m *LbAddDelAs) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Pfx.Len = buf.DecodeUint8()
+ m.Protocol = buf.DecodeUint8()
+ m.Port = buf.DecodeUint16()
+ m.AsAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.AsAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.IsDel = buf.DecodeBool()
+ m.IsFlush = buf.DecodeBool()
+ return nil
+}
+
+// LbAddDelAsReply defines message 'lb_add_del_as_reply'.
+type LbAddDelAsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LbAddDelAsReply) Reset() { *m = LbAddDelAsReply{} }
+func (*LbAddDelAsReply) GetMessageName() string { return "lb_add_del_as_reply" }
+func (*LbAddDelAsReply) GetCrcString() string { return "e8d4e804" }
+func (*LbAddDelAsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LbAddDelAsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LbAddDelAsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LbAddDelIntfNat4 defines message 'lb_add_del_intf_nat4'.
+type LbAddDelIntfNat4 struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *LbAddDelIntfNat4) Reset() { *m = LbAddDelIntfNat4{} }
+func (*LbAddDelIntfNat4) GetMessageName() string { return "lb_add_del_intf_nat4" }
+func (*LbAddDelIntfNat4) GetCrcString() string { return "47d6e753" }
+func (*LbAddDelIntfNat4) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LbAddDelIntfNat4) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *LbAddDelIntfNat4) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *LbAddDelIntfNat4) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// LbAddDelIntfNat4Reply defines message 'lb_add_del_intf_nat4_reply'.
+type LbAddDelIntfNat4Reply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LbAddDelIntfNat4Reply) Reset() { *m = LbAddDelIntfNat4Reply{} }
+func (*LbAddDelIntfNat4Reply) GetMessageName() string { return "lb_add_del_intf_nat4_reply" }
+func (*LbAddDelIntfNat4Reply) GetCrcString() string { return "e8d4e804" }
+func (*LbAddDelIntfNat4Reply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LbAddDelIntfNat4Reply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LbAddDelIntfNat4Reply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LbAddDelIntfNat6 defines message 'lb_add_del_intf_nat6'.
+type LbAddDelIntfNat6 struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *LbAddDelIntfNat6) Reset() { *m = LbAddDelIntfNat6{} }
+func (*LbAddDelIntfNat6) GetMessageName() string { return "lb_add_del_intf_nat6" }
+func (*LbAddDelIntfNat6) GetCrcString() string { return "47d6e753" }
+func (*LbAddDelIntfNat6) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LbAddDelIntfNat6) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *LbAddDelIntfNat6) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *LbAddDelIntfNat6) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// LbAddDelIntfNat6Reply defines message 'lb_add_del_intf_nat6_reply'.
+type LbAddDelIntfNat6Reply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LbAddDelIntfNat6Reply) Reset() { *m = LbAddDelIntfNat6Reply{} }
+func (*LbAddDelIntfNat6Reply) GetMessageName() string { return "lb_add_del_intf_nat6_reply" }
+func (*LbAddDelIntfNat6Reply) GetCrcString() string { return "e8d4e804" }
+func (*LbAddDelIntfNat6Reply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LbAddDelIntfNat6Reply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LbAddDelIntfNat6Reply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LbAddDelVip defines message 'lb_add_del_vip'.
+type LbAddDelVip struct {
+ Pfx AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ Encap LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
+ Dscp uint8 `binapi:"u8,name=dscp" json:"dscp,omitempty"`
+ Type 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=1024" json:"new_flows_table_length,omitempty"`
+ IsDel bool `binapi:"bool,name=is_del" json:"is_del,omitempty"`
+}
+
+func (m *LbAddDelVip) Reset() { *m = LbAddDelVip{} }
+func (*LbAddDelVip) GetMessageName() string { return "lb_add_del_vip" }
+func (*LbAddDelVip) GetCrcString() string { return "d15b7ddc" }
+func (*LbAddDelVip) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LbAddDelVip) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Pfx.Address.Af
+ size += 1 * 16 // m.Pfx.Address.Un
+ size += 1 // m.Pfx.Len
+ size += 1 // m.Protocol
+ size += 2 // m.Port
+ size += 4 // m.Encap
+ size += 1 // m.Dscp
+ size += 4 // m.Type
+ size += 2 // m.TargetPort
+ size += 2 // m.NodePort
+ size += 4 // m.NewFlowsTableLength
+ size += 1 // m.IsDel
+ return size
+}
+func (m *LbAddDelVip) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Pfx.Address.Af))
+ 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(m.Dscp)
+ buf.EncodeUint32(uint32(m.Type))
+ buf.EncodeUint16(m.TargetPort)
+ buf.EncodeUint16(m.NodePort)
+ buf.EncodeUint32(m.NewFlowsTableLength)
+ buf.EncodeBool(m.IsDel)
+ return buf.Bytes(), nil
+}
+func (m *LbAddDelVip) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Pfx.Len = buf.DecodeUint8()
+ m.Protocol = buf.DecodeUint8()
+ m.Port = buf.DecodeUint16()
+ m.Encap = LbEncapType(buf.DecodeUint32())
+ m.Dscp = buf.DecodeUint8()
+ m.Type = LbSrvType(buf.DecodeUint32())
+ m.TargetPort = buf.DecodeUint16()
+ m.NodePort = buf.DecodeUint16()
+ m.NewFlowsTableLength = buf.DecodeUint32()
+ m.IsDel = buf.DecodeBool()
+ return nil
+}
+
+// LbAddDelVipReply defines message 'lb_add_del_vip_reply'.
+type LbAddDelVipReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LbAddDelVipReply) Reset() { *m = LbAddDelVipReply{} }
+func (*LbAddDelVipReply) GetMessageName() string { return "lb_add_del_vip_reply" }
+func (*LbAddDelVipReply) GetCrcString() string { return "e8d4e804" }
+func (*LbAddDelVipReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LbAddDelVipReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LbAddDelVipReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LbAsDetails defines message 'lb_as_details'.
+type LbAsDetails struct {
+ Vip LbVip `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
+ AppSrv Address `binapi:"address,name=app_srv" json:"app_srv,omitempty"`
+ Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"`
+ InUseSince uint32 `binapi:"u32,name=in_use_since" json:"in_use_since,omitempty"`
+}
+
+func (m *LbAsDetails) Reset() { *m = LbAsDetails{} }
+func (*LbAsDetails) GetMessageName() string { return "lb_as_details" }
+func (*LbAsDetails) GetCrcString() string { return "9c39f60e" }
+func (*LbAsDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LbAsDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vip.Pfx.Address.Af
+ size += 1 * 16 // m.Vip.Pfx.Address.Un
+ size += 1 // m.Vip.Pfx.Len
+ size += 4 // m.Vip.Protocol
+ size += 2 // m.Vip.Port
+ size += 4 // m.AppSrv.Af
+ size += 1 * 16 // m.AppSrv.Un
+ size += 1 // m.Flags
+ size += 4 // m.InUseSince
+ return size
+}
+func (m *LbAsDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Vip.Pfx.Address.Af))
+ buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.Vip.Pfx.Len)
+ buf.EncodeUint32(uint32(m.Vip.Protocol))
+ buf.EncodeUint16(m.Vip.Port)
+ buf.EncodeUint32(uint32(m.AppSrv.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Vip.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Vip.Pfx.Len = buf.DecodeUint8()
+ m.Vip.Protocol = IPProto(buf.DecodeUint32())
+ m.Vip.Port = buf.DecodeUint16()
+ m.AppSrv.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.AppSrv.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Flags = buf.DecodeUint8()
+ m.InUseSince = buf.DecodeUint32()
+ return nil
+}
+
+// LbAsDump defines message 'lb_as_dump'.
+type LbAsDump struct {
+ Pfx AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+}
+
+func (m *LbAsDump) Reset() { *m = LbAsDump{} }
+func (*LbAsDump) GetMessageName() string { return "lb_as_dump" }
+func (*LbAsDump) GetCrcString() string { return "1063f819" }
+func (*LbAsDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LbAsDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Pfx.Address.Af
+ size += 1 * 16 // m.Pfx.Address.Un
+ size += 1 // m.Pfx.Len
+ size += 1 // m.Protocol
+ size += 2 // m.Port
+ return size
+}
+func (m *LbAsDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Pfx.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Pfx.Len = buf.DecodeUint8()
+ m.Protocol = buf.DecodeUint8()
+ m.Port = buf.DecodeUint16()
+ return nil
+}
+
+// LbConf defines message 'lb_conf'.
+type LbConf struct {
+ IP4SrcAddress IP4Address `binapi:"ip4_address,name=ip4_src_address" json:"ip4_src_address,omitempty"`
+ IP6SrcAddress IP6Address `binapi:"ip6_address,name=ip6_src_address" json:"ip6_src_address,omitempty"`
+ StickyBucketsPerCore uint32 `binapi:"u32,name=sticky_buckets_per_core" json:"sticky_buckets_per_core,omitempty"`
+ FlowTimeout uint32 `binapi:"u32,name=flow_timeout" json:"flow_timeout,omitempty"`
+}
+
+func (m *LbConf) Reset() { *m = LbConf{} }
+func (*LbConf) GetMessageName() string { return "lb_conf" }
+func (*LbConf) GetCrcString() string { return "22ddb739" }
+func (*LbConf) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LbConf) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.IP4SrcAddress
+ size += 1 * 16 // m.IP6SrcAddress
+ size += 4 // m.StickyBucketsPerCore
+ size += 4 // m.FlowTimeout
+ return size
+}
+func (m *LbConf) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IP4SrcAddress[:], 4)
+ buf.EncodeBytes(m.IP6SrcAddress[:], 16)
+ buf.EncodeUint32(m.StickyBucketsPerCore)
+ buf.EncodeUint32(m.FlowTimeout)
+ return buf.Bytes(), nil
+}
+func (m *LbConf) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IP4SrcAddress[:], buf.DecodeBytes(4))
+ copy(m.IP6SrcAddress[:], buf.DecodeBytes(16))
+ m.StickyBucketsPerCore = buf.DecodeUint32()
+ m.FlowTimeout = buf.DecodeUint32()
+ return nil
+}
+
+// LbConfReply defines message 'lb_conf_reply'.
+type LbConfReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LbConfReply) Reset() { *m = LbConfReply{} }
+func (*LbConfReply) GetMessageName() string { return "lb_conf_reply" }
+func (*LbConfReply) GetCrcString() string { return "e8d4e804" }
+func (*LbConfReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LbConfReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LbConfReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LbFlushVip defines message 'lb_flush_vip'.
+type LbFlushVip struct {
+ Pfx AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+}
+
+func (m *LbFlushVip) Reset() { *m = LbFlushVip{} }
+func (*LbFlushVip) GetMessageName() string { return "lb_flush_vip" }
+func (*LbFlushVip) GetCrcString() string { return "1063f819" }
+func (*LbFlushVip) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LbFlushVip) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Pfx.Address.Af
+ size += 1 * 16 // m.Pfx.Address.Un
+ size += 1 // m.Pfx.Len
+ size += 1 // m.Protocol
+ size += 2 // m.Port
+ return size
+}
+func (m *LbFlushVip) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Pfx.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Pfx.Len = buf.DecodeUint8()
+ m.Protocol = buf.DecodeUint8()
+ m.Port = buf.DecodeUint16()
+ return nil
+}
+
+// LbFlushVipReply defines message 'lb_flush_vip_reply'.
+type LbFlushVipReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LbFlushVipReply) Reset() { *m = LbFlushVipReply{} }
+func (*LbFlushVipReply) GetMessageName() string { return "lb_flush_vip_reply" }
+func (*LbFlushVipReply) GetCrcString() string { return "e8d4e804" }
+func (*LbFlushVipReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LbFlushVipReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LbFlushVipReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LbVipDetails defines message 'lb_vip_details'.
+type LbVipDetails struct {
+ Vip LbVip `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
+ Encap LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
+ Dscp IPDscp `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
+ SrvType LbSrvType `binapi:"lb_srv_type,name=srv_type" json:"srv_type,omitempty"`
+ TargetPort uint16 `binapi:"u16,name=target_port" json:"target_port,omitempty"`
+ FlowTableLength uint16 `binapi:"u16,name=flow_table_length" json:"flow_table_length,omitempty"`
+}
+
+func (m *LbVipDetails) Reset() { *m = LbVipDetails{} }
+func (*LbVipDetails) GetMessageName() string { return "lb_vip_details" }
+func (*LbVipDetails) GetCrcString() string { return "08f39bed" }
+func (*LbVipDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LbVipDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vip.Pfx.Address.Af
+ size += 1 * 16 // m.Vip.Pfx.Address.Un
+ size += 1 // m.Vip.Pfx.Len
+ size += 4 // m.Vip.Protocol
+ size += 2 // m.Vip.Port
+ size += 4 // m.Encap
+ size += 1 // m.Dscp
+ size += 4 // m.SrvType
+ size += 2 // m.TargetPort
+ size += 2 // m.FlowTableLength
+ return size
+}
+func (m *LbVipDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Vip.Pfx.Address.Af))
+ buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.Vip.Pfx.Len)
+ buf.EncodeUint32(uint32(m.Vip.Protocol))
+ buf.EncodeUint16(m.Vip.Port)
+ buf.EncodeUint32(uint32(m.Encap))
+ buf.EncodeUint8(uint8(m.Dscp))
+ buf.EncodeUint32(uint32(m.SrvType))
+ buf.EncodeUint16(m.TargetPort)
+ buf.EncodeUint16(m.FlowTableLength)
+ return buf.Bytes(), nil
+}
+func (m *LbVipDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vip.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Vip.Pfx.Len = buf.DecodeUint8()
+ m.Vip.Protocol = IPProto(buf.DecodeUint32())
+ m.Vip.Port = buf.DecodeUint16()
+ m.Encap = LbEncapType(buf.DecodeUint32())
+ m.Dscp = IPDscp(buf.DecodeUint8())
+ m.SrvType = LbSrvType(buf.DecodeUint32())
+ m.TargetPort = buf.DecodeUint16()
+ m.FlowTableLength = buf.DecodeUint16()
+ return nil
+}
+
+// LbVipDump defines message 'lb_vip_dump'.
+type LbVipDump struct {
+ Pfx AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
+ PfxMatcher PrefixMatcher `binapi:"prefix_matcher,name=pfx_matcher" json:"pfx_matcher,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+}
+
+func (m *LbVipDump) Reset() { *m = LbVipDump{} }
+func (*LbVipDump) GetMessageName() string { return "lb_vip_dump" }
+func (*LbVipDump) GetCrcString() string { return "c7bcb124" }
+func (*LbVipDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LbVipDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Pfx.Address.Af
+ size += 1 * 16 // m.Pfx.Address.Un
+ size += 1 // m.Pfx.Len
+ size += 1 // m.PfxMatcher.Le
+ size += 1 // m.PfxMatcher.Ge
+ size += 1 // m.Protocol
+ size += 2 // m.Port
+ return size
+}
+func (m *LbVipDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Pfx.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Pfx.Len = buf.DecodeUint8()
+ m.PfxMatcher.Le = buf.DecodeUint8()
+ m.PfxMatcher.Ge = buf.DecodeUint8()
+ m.Protocol = buf.DecodeUint8()
+ m.Port = buf.DecodeUint16()
+ return nil
+}
+
+func init() { file_lb_binapi_init() }
+func file_lb_binapi_init() {
+ api.RegisterMessage((*LbAddDelAs)(nil), "lb_add_del_as_78628987")
+ api.RegisterMessage((*LbAddDelAsReply)(nil), "lb_add_del_as_reply_e8d4e804")
+ api.RegisterMessage((*LbAddDelIntfNat4)(nil), "lb_add_del_intf_nat4_47d6e753")
+ api.RegisterMessage((*LbAddDelIntfNat4Reply)(nil), "lb_add_del_intf_nat4_reply_e8d4e804")
+ api.RegisterMessage((*LbAddDelIntfNat6)(nil), "lb_add_del_intf_nat6_47d6e753")
+ api.RegisterMessage((*LbAddDelIntfNat6Reply)(nil), "lb_add_del_intf_nat6_reply_e8d4e804")
+ api.RegisterMessage((*LbAddDelVip)(nil), "lb_add_del_vip_d15b7ddc")
+ api.RegisterMessage((*LbAddDelVipReply)(nil), "lb_add_del_vip_reply_e8d4e804")
+ api.RegisterMessage((*LbAsDetails)(nil), "lb_as_details_9c39f60e")
+ api.RegisterMessage((*LbAsDump)(nil), "lb_as_dump_1063f819")
+ api.RegisterMessage((*LbConf)(nil), "lb_conf_22ddb739")
+ api.RegisterMessage((*LbConfReply)(nil), "lb_conf_reply_e8d4e804")
+ api.RegisterMessage((*LbFlushVip)(nil), "lb_flush_vip_1063f819")
+ api.RegisterMessage((*LbFlushVipReply)(nil), "lb_flush_vip_reply_e8d4e804")
+ api.RegisterMessage((*LbVipDetails)(nil), "lb_vip_details_08f39bed")
+ api.RegisterMessage((*LbVipDump)(nil), "lb_vip_dump_c7bcb124")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*LbAddDelAs)(nil),
+ (*LbAddDelAsReply)(nil),
+ (*LbAddDelIntfNat4)(nil),
+ (*LbAddDelIntfNat4Reply)(nil),
+ (*LbAddDelIntfNat6)(nil),
+ (*LbAddDelIntfNat6Reply)(nil),
+ (*LbAddDelVip)(nil),
+ (*LbAddDelVipReply)(nil),
+ (*LbAsDetails)(nil),
+ (*LbAsDump)(nil),
+ (*LbConf)(nil),
+ (*LbConfReply)(nil),
+ (*LbFlushVip)(nil),
+ (*LbFlushVipReply)(nil),
+ (*LbVipDetails)(nil),
+ (*LbVipDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/lb/lb_rpc.ba.go b/internal/testbinapi/binapi2001/lb/lb_rpc.ba.go
new file mode 100644
index 0000000..3375e9c
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lb/lb_rpc.ba.go
@@ -0,0 +1,163 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package lb
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service lb.
+type RPCService interface {
+ LbAddDelAs(ctx context.Context, in *LbAddDelAs) (*LbAddDelAsReply, error)
+ LbAddDelIntfNat4(ctx context.Context, in *LbAddDelIntfNat4) (*LbAddDelIntfNat4Reply, error)
+ LbAddDelIntfNat6(ctx context.Context, in *LbAddDelIntfNat6) (*LbAddDelIntfNat6Reply, error)
+ LbAddDelVip(ctx context.Context, in *LbAddDelVip) (*LbAddDelVipReply, error)
+ LbAsDump(ctx context.Context, in *LbAsDump) (RPCService_LbAsDumpClient, error)
+ LbConf(ctx context.Context, in *LbConf) (*LbConfReply, error)
+ LbFlushVip(ctx context.Context, in *LbFlushVip) (*LbFlushVipReply, error)
+ LbVipDump(ctx context.Context, in *LbVipDump) (RPCService_LbVipDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) LbAddDelAs(ctx context.Context, in *LbAddDelAs) (*LbAddDelAsReply, error) {
+ out := new(LbAddDelAsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LbAddDelIntfNat4(ctx context.Context, in *LbAddDelIntfNat4) (*LbAddDelIntfNat4Reply, error) {
+ out := new(LbAddDelIntfNat4Reply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LbAddDelIntfNat6(ctx context.Context, in *LbAddDelIntfNat6) (*LbAddDelIntfNat6Reply, error) {
+ out := new(LbAddDelIntfNat6Reply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LbAddDelVip(ctx context.Context, in *LbAddDelVip) (*LbAddDelVipReply, error) {
+ out := new(LbAddDelVipReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LbAsDump(ctx context.Context, in *LbAsDump) (RPCService_LbAsDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LbAsDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LbAsDumpClient interface {
+ Recv() (*LbAsDetails, error)
+ api.Stream
+}
+
+type serviceClient_LbAsDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LbAsDumpClient) Recv() (*LbAsDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LbAsDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) LbConf(ctx context.Context, in *LbConf) (*LbConfReply, error) {
+ out := new(LbConfReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LbFlushVip(ctx context.Context, in *LbFlushVip) (*LbFlushVipReply, error) {
+ out := new(LbFlushVipReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LbVipDump(ctx context.Context, in *LbVipDump) (RPCService_LbVipDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LbVipDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LbVipDumpClient interface {
+ Recv() (*LbVipDetails, error)
+ api.Stream
+}
+
+type serviceClient_LbVipDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LbVipDumpClient) Recv() (*LbVipDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LbVipDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/lb_types/lb_types.ba.go b/internal/testbinapi/binapi2001/lb_types/lb_types.ba.go
new file mode 100644
index 0000000..48aa105
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lb_types/lb_types.ba.go
@@ -0,0 +1,773 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/lb_types.api.json
+
+// Package lb_types contains generated bindings for API file lb_types.api.
+//
+// Contents:
+// 5 aliases
+// 9 enums
+// 7 structs
+// 1 union
+//
+package lb_types
+
+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
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbEncapType defines enum 'lb_encap_type'.
+type LbEncapType uint32
+
+const (
+ LB_API_ENCAP_TYPE_GRE4 LbEncapType = 0
+ LB_API_ENCAP_TYPE_GRE6 LbEncapType = 1
+ LB_API_ENCAP_TYPE_L3DSR LbEncapType = 2
+ LB_API_ENCAP_TYPE_NAT4 LbEncapType = 3
+ LB_API_ENCAP_TYPE_NAT6 LbEncapType = 4
+ LB_API_ENCAP_N_TYPES LbEncapType = 5
+)
+
+var (
+ LbEncapType_name = map[uint32]string{
+ 0: "LB_API_ENCAP_TYPE_GRE4",
+ 1: "LB_API_ENCAP_TYPE_GRE6",
+ 2: "LB_API_ENCAP_TYPE_L3DSR",
+ 3: "LB_API_ENCAP_TYPE_NAT4",
+ 4: "LB_API_ENCAP_TYPE_NAT6",
+ 5: "LB_API_ENCAP_N_TYPES",
+ }
+ LbEncapType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x LbEncapType) String() string {
+ s, ok := LbEncapType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbEncapType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbLkpTypeT defines enum 'lb_lkp_type_t'.
+type LbLkpTypeT uint32
+
+const (
+ LB_API_LKP_SAME_IP_PORT LbLkpTypeT = 0
+ LB_API_LKP_DIFF_IP_PORT LbLkpTypeT = 1
+ LB_API_LKP_ALL_PORT_IP LbLkpTypeT = 2
+ LB_API_LKP_N_TYPES LbLkpTypeT = 3
+)
+
+var (
+ LbLkpTypeT_name = map[uint32]string{
+ 0: "LB_API_LKP_SAME_IP_PORT",
+ 1: "LB_API_LKP_DIFF_IP_PORT",
+ 2: "LB_API_LKP_ALL_PORT_IP",
+ 3: "LB_API_LKP_N_TYPES",
+ }
+ LbLkpTypeT_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x LbLkpTypeT) String() string {
+ s, ok := LbLkpTypeT_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbLkpTypeT(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbNatProtocol defines enum 'lb_nat_protocol'.
+type LbNatProtocol uint32
+
+const (
+ LB_API_NAT_PROTOCOL_UDP LbNatProtocol = 6
+ LB_API_NAT_PROTOCOL_TCP LbNatProtocol = 23
+ LB_API_NAT_PROTOCOL_ANY LbNatProtocol = 4294967295
+)
+
+var (
+ LbNatProtocol_name = map[uint32]string{
+ 6: "LB_API_NAT_PROTOCOL_UDP",
+ 23: "LB_API_NAT_PROTOCOL_TCP",
+ 4294967295: "LB_API_NAT_PROTOCOL_ANY",
+ }
+ LbNatProtocol_value = map[string]uint32{
+ "LB_API_NAT_PROTOCOL_UDP": 6,
+ "LB_API_NAT_PROTOCOL_TCP": 23,
+ "LB_API_NAT_PROTOCOL_ANY": 4294967295,
+ }
+)
+
+func (x LbNatProtocol) String() string {
+ s, ok := LbNatProtocol_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbNatProtocol(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbSrvType defines enum 'lb_srv_type'.
+type LbSrvType uint32
+
+const (
+ LB_API_SRV_TYPE_CLUSTERIP LbSrvType = 0
+ LB_API_SRV_TYPE_NODEPORT LbSrvType = 1
+ LB_API_SRV_N_TYPES LbSrvType = 2
+)
+
+var (
+ LbSrvType_name = map[uint32]string{
+ 0: "LB_API_SRV_TYPE_CLUSTERIP",
+ 1: "LB_API_SRV_TYPE_NODEPORT",
+ 2: "LB_API_SRV_N_TYPES",
+ }
+ LbSrvType_value = map[string]uint32{
+ "LB_API_SRV_TYPE_CLUSTERIP": 0,
+ "LB_API_SRV_TYPE_NODEPORT": 1,
+ "LB_API_SRV_N_TYPES": 2,
+ }
+)
+
+func (x LbSrvType) String() string {
+ s, ok := LbSrvType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbSrvType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LbVipType defines enum 'lb_vip_type'.
+type LbVipType uint32
+
+const (
+ LB_API_VIP_TYPE_IP6_GRE6 LbVipType = 0
+ LB_API_VIP_TYPE_IP6_GRE4 LbVipType = 1
+ LB_API_VIP_TYPE_IP4_GRE6 LbVipType = 2
+ LB_API_VIP_TYPE_IP4_GRE4 LbVipType = 3
+ LB_API_VIP_TYPE_IP4_L3DSR LbVipType = 4
+ LB_API_VIP_TYPE_IP4_NAT4 LbVipType = 5
+ LB_API_VIP_TYPE_IP6_NAT6 LbVipType = 6
+ LB_API_VIP_N_TYPES LbVipType = 7
+)
+
+var (
+ LbVipType_name = map[uint32]string{
+ 0: "LB_API_VIP_TYPE_IP6_GRE6",
+ 1: "LB_API_VIP_TYPE_IP6_GRE4",
+ 2: "LB_API_VIP_TYPE_IP4_GRE6",
+ 3: "LB_API_VIP_TYPE_IP4_GRE4",
+ 4: "LB_API_VIP_TYPE_IP4_L3DSR",
+ 5: "LB_API_VIP_TYPE_IP4_NAT4",
+ 6: "LB_API_VIP_TYPE_IP6_NAT6",
+ 7: "LB_API_VIP_N_TYPES",
+ }
+ LbVipType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x LbVipType) String() string {
+ s, ok := LbVipType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LbVipType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// LbVip defines type 'lb_vip'.
+type LbVip struct {
+ Pfx AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
+ Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
diff --git a/internal/testbinapi/binapi2001/lisp/lisp.ba.go b/internal/testbinapi/binapi2001/lisp/lisp.ba.go
new file mode 100644
index 0000000..20a7d42
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lisp/lisp.ba.go
@@ -0,0 +1,2568 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/lisp.api.json
+
+// Package lisp contains generated bindings for API file lisp.api.
+//
+// Contents:
+// 3 structs
+// 60 messages
+//
+package lisp
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "lisp"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x681568f8
+)
+
+// LispAdjacency defines type 'lisp_adjacency'.
+type LispAdjacency struct {
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Reid []byte `binapi:"u8[16],name=reid" json:"reid,omitempty"`
+ Leid []byte `binapi:"u8[16],name=leid" json:"leid,omitempty"`
+ ReidPrefixLen uint8 `binapi:"u8,name=reid_prefix_len" json:"reid_prefix_len,omitempty"`
+ LeidPrefixLen uint8 `binapi:"u8,name=leid_prefix_len" json:"leid_prefix_len,omitempty"`
+}
+
+// LocalLocator defines type 'local_locator'.
+type LocalLocator struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+}
+
+// RemoteLocator defines type 'remote_locator'.
+type RemoteLocator struct {
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+ Addr []byte `binapi:"u8[16],name=addr" json:"addr,omitempty"`
+}
+
+// LispAddDelAdjacency defines message 'lisp_add_del_adjacency'.
+type LispAddDelAdjacency struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Reid []byte `binapi:"u8[16],name=reid" json:"reid,omitempty"`
+ Leid []byte `binapi:"u8[16],name=leid" json:"leid,omitempty"`
+ ReidLen uint8 `binapi:"u8,name=reid_len" json:"reid_len,omitempty"`
+ LeidLen uint8 `binapi:"u8,name=leid_len" json:"leid_len,omitempty"`
+}
+
+func (m *LispAddDelAdjacency) Reset() { *m = LispAddDelAdjacency{} }
+func (*LispAddDelAdjacency) GetMessageName() string { return "lisp_add_del_adjacency" }
+func (*LispAddDelAdjacency) GetCrcString() string { return "f047390d" }
+func (*LispAddDelAdjacency) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispAddDelAdjacency) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Vni
+ size += 1 // m.EidType
+ size += 1 * 16 // m.Reid
+ size += 1 * 16 // m.Leid
+ size += 1 // m.ReidLen
+ size += 1 // m.LeidLen
+ return size
+}
+func (m *LispAddDelAdjacency) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.Reid, 16)
+ buf.EncodeBytes(m.Leid, 16)
+ buf.EncodeUint8(m.ReidLen)
+ buf.EncodeUint8(m.LeidLen)
+ return buf.Bytes(), nil
+}
+func (m *LispAddDelAdjacency) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.EidType = buf.DecodeUint8()
+ m.Reid = make([]byte, 16)
+ copy(m.Reid, buf.DecodeBytes(len(m.Reid)))
+ m.Leid = make([]byte, 16)
+ copy(m.Leid, buf.DecodeBytes(len(m.Leid)))
+ m.ReidLen = buf.DecodeUint8()
+ m.LeidLen = buf.DecodeUint8()
+ return nil
+}
+
+// LispAddDelAdjacencyReply defines message 'lisp_add_del_adjacency_reply'.
+type LispAddDelAdjacencyReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispAddDelAdjacencyReply) Reset() { *m = LispAddDelAdjacencyReply{} }
+func (*LispAddDelAdjacencyReply) GetMessageName() string { return "lisp_add_del_adjacency_reply" }
+func (*LispAddDelAdjacencyReply) GetCrcString() string { return "e8d4e804" }
+func (*LispAddDelAdjacencyReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispAddDelAdjacencyReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispAddDelAdjacencyReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispAddDelLocalEid defines message 'lisp_add_del_local_eid'.
+type LispAddDelLocalEid struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Eid []byte `binapi:"u8[16],name=eid" json:"eid,omitempty"`
+ PrefixLen uint8 `binapi:"u8,name=prefix_len" json:"prefix_len,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ KeyID uint16 `binapi:"u16,name=key_id" json:"key_id,omitempty"`
+ Key []byte `binapi:"u8[64],name=key" json:"key,omitempty"`
+}
+
+func (m *LispAddDelLocalEid) Reset() { *m = LispAddDelLocalEid{} }
+func (*LispAddDelLocalEid) GetMessageName() string { return "lisp_add_del_local_eid" }
+func (*LispAddDelLocalEid) GetCrcString() string { return "e6d00717" }
+func (*LispAddDelLocalEid) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispAddDelLocalEid) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.EidType
+ size += 1 * 16 // m.Eid
+ size += 1 // m.PrefixLen
+ size += 1 * 64 // m.LocatorSetName
+ size += 4 // m.Vni
+ size += 2 // m.KeyID
+ size += 1 * 64 // m.Key
+ return size
+}
+func (m *LispAddDelLocalEid) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.Eid, 16)
+ buf.EncodeUint8(m.PrefixLen)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint16(m.KeyID)
+ buf.EncodeBytes(m.Key, 64)
+ return buf.Bytes(), nil
+}
+func (m *LispAddDelLocalEid) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.EidType = buf.DecodeUint8()
+ m.Eid = make([]byte, 16)
+ copy(m.Eid, buf.DecodeBytes(len(m.Eid)))
+ m.PrefixLen = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ m.Vni = buf.DecodeUint32()
+ m.KeyID = buf.DecodeUint16()
+ m.Key = make([]byte, 64)
+ copy(m.Key, buf.DecodeBytes(len(m.Key)))
+ return nil
+}
+
+// LispAddDelLocalEidReply defines message 'lisp_add_del_local_eid_reply'.
+type LispAddDelLocalEidReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispAddDelLocalEidReply) Reset() { *m = LispAddDelLocalEidReply{} }
+func (*LispAddDelLocalEidReply) GetMessageName() string { return "lisp_add_del_local_eid_reply" }
+func (*LispAddDelLocalEidReply) GetCrcString() string { return "e8d4e804" }
+func (*LispAddDelLocalEidReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispAddDelLocalEidReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispAddDelLocalEidReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispAddDelLocator defines message 'lisp_add_del_locator'.
+type LispAddDelLocator struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+}
+
+func (m *LispAddDelLocator) Reset() { *m = LispAddDelLocator{} }
+func (*LispAddDelLocator) GetMessageName() string { return "lisp_add_del_locator" }
+func (*LispAddDelLocator) GetCrcString() string { return "006a4240" }
+func (*LispAddDelLocator) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispAddDelLocator) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.LocatorSetName
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Priority
+ size += 1 // m.Weight
+ return size
+}
+func (m *LispAddDelLocator) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.Priority)
+ buf.EncodeUint8(m.Weight)
+ return buf.Bytes(), nil
+}
+func (m *LispAddDelLocator) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Priority = buf.DecodeUint8()
+ m.Weight = buf.DecodeUint8()
+ return nil
+}
+
+// LispAddDelLocatorReply defines message 'lisp_add_del_locator_reply'.
+type LispAddDelLocatorReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispAddDelLocatorReply) Reset() { *m = LispAddDelLocatorReply{} }
+func (*LispAddDelLocatorReply) GetMessageName() string { return "lisp_add_del_locator_reply" }
+func (*LispAddDelLocatorReply) GetCrcString() string { return "e8d4e804" }
+func (*LispAddDelLocatorReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispAddDelLocatorReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispAddDelLocatorReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispAddDelLocatorSet defines message 'lisp_add_del_locator_set'.
+type LispAddDelLocatorSet struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+ LocatorNum uint32 `binapi:"u32,name=locator_num" json:"-"`
+ Locators []LocalLocator `binapi:"local_locator[locator_num],name=locators" json:"locators,omitempty"`
+}
+
+func (m *LispAddDelLocatorSet) Reset() { *m = LispAddDelLocatorSet{} }
+func (*LispAddDelLocatorSet) GetMessageName() string { return "lisp_add_del_locator_set" }
+func (*LispAddDelLocatorSet) GetCrcString() string { return "06968e38" }
+func (*LispAddDelLocatorSet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispAddDelLocatorSet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.LocatorSetName
+ size += 4 // m.LocatorNum
+ for j1 := 0; j1 < len(m.Locators); j1++ {
+ var s1 LocalLocator
+ _ = s1
+ if j1 < len(m.Locators) {
+ s1 = m.Locators[j1]
+ }
+ size += 4 // s1.SwIfIndex
+ size += 1 // s1.Priority
+ size += 1 // s1.Weight
+ }
+ return size
+}
+func (m *LispAddDelLocatorSet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ buf.EncodeUint32(uint32(len(m.Locators)))
+ for j0 := 0; j0 < len(m.Locators); j0++ {
+ var v0 LocalLocator // Locators
+ if j0 < len(m.Locators) {
+ v0 = m.Locators[j0]
+ }
+ buf.EncodeUint32(v0.SwIfIndex)
+ buf.EncodeUint8(v0.Priority)
+ buf.EncodeUint8(v0.Weight)
+ }
+ return buf.Bytes(), nil
+}
+func (m *LispAddDelLocatorSet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ m.LocatorNum = buf.DecodeUint32()
+ m.Locators = make([]LocalLocator, m.LocatorNum)
+ for j0 := 0; j0 < len(m.Locators); j0++ {
+ m.Locators[j0].SwIfIndex = buf.DecodeUint32()
+ m.Locators[j0].Priority = buf.DecodeUint8()
+ m.Locators[j0].Weight = buf.DecodeUint8()
+ }
+ return nil
+}
+
+// LispAddDelLocatorSetReply defines message 'lisp_add_del_locator_set_reply'.
+type LispAddDelLocatorSetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ LsIndex uint32 `binapi:"u32,name=ls_index" json:"ls_index,omitempty"`
+}
+
+func (m *LispAddDelLocatorSetReply) Reset() { *m = LispAddDelLocatorSetReply{} }
+func (*LispAddDelLocatorSetReply) GetMessageName() string { return "lisp_add_del_locator_set_reply" }
+func (*LispAddDelLocatorSetReply) GetCrcString() string { return "b6666db4" }
+func (*LispAddDelLocatorSetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispAddDelLocatorSetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.LsIndex
+ return size
+}
+func (m *LispAddDelLocatorSetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.LsIndex = buf.DecodeUint32()
+ return nil
+}
+
+// LispAddDelMapRequestItrRlocs defines message 'lisp_add_del_map_request_itr_rlocs'.
+type LispAddDelMapRequestItrRlocs struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+}
+
+func (m *LispAddDelMapRequestItrRlocs) Reset() { *m = LispAddDelMapRequestItrRlocs{} }
+func (*LispAddDelMapRequestItrRlocs) GetMessageName() string {
+ return "lisp_add_del_map_request_itr_rlocs"
+}
+func (*LispAddDelMapRequestItrRlocs) GetCrcString() string { return "c7c6cb2f" }
+func (*LispAddDelMapRequestItrRlocs) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispAddDelMapRequestItrRlocs) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.LocatorSetName
+ return size
+}
+func (m *LispAddDelMapRequestItrRlocs) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ return buf.Bytes(), nil
+}
+func (m *LispAddDelMapRequestItrRlocs) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ return nil
+}
+
+// LispAddDelMapRequestItrRlocsReply defines message 'lisp_add_del_map_request_itr_rlocs_reply'.
+type LispAddDelMapRequestItrRlocsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispAddDelMapRequestItrRlocsReply) Reset() { *m = LispAddDelMapRequestItrRlocsReply{} }
+func (*LispAddDelMapRequestItrRlocsReply) GetMessageName() string {
+ return "lisp_add_del_map_request_itr_rlocs_reply"
+}
+func (*LispAddDelMapRequestItrRlocsReply) GetCrcString() string { return "e8d4e804" }
+func (*LispAddDelMapRequestItrRlocsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispAddDelMapRequestItrRlocsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispAddDelMapRequestItrRlocsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispAddDelMapResolver defines message 'lisp_add_del_map_resolver'.
+type LispAddDelMapResolver struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+}
+
+func (m *LispAddDelMapResolver) Reset() { *m = LispAddDelMapResolver{} }
+func (*LispAddDelMapResolver) GetMessageName() string { return "lisp_add_del_map_resolver" }
+func (*LispAddDelMapResolver) GetCrcString() string { return "0ebcd37d" }
+func (*LispAddDelMapResolver) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispAddDelMapResolver) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ return size
+}
+func (m *LispAddDelMapResolver) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *LispAddDelMapResolver) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ return nil
+}
+
+// LispAddDelMapResolverReply defines message 'lisp_add_del_map_resolver_reply'.
+type LispAddDelMapResolverReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispAddDelMapResolverReply) Reset() { *m = LispAddDelMapResolverReply{} }
+func (*LispAddDelMapResolverReply) GetMessageName() string { return "lisp_add_del_map_resolver_reply" }
+func (*LispAddDelMapResolverReply) GetCrcString() string { return "e8d4e804" }
+func (*LispAddDelMapResolverReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispAddDelMapResolverReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispAddDelMapResolverReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispAddDelMapServer defines message 'lisp_add_del_map_server'.
+type LispAddDelMapServer struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+}
+
+func (m *LispAddDelMapServer) Reset() { *m = LispAddDelMapServer{} }
+func (*LispAddDelMapServer) GetMessageName() string { return "lisp_add_del_map_server" }
+func (*LispAddDelMapServer) GetCrcString() string { return "0ebcd37d" }
+func (*LispAddDelMapServer) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispAddDelMapServer) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ return size
+}
+func (m *LispAddDelMapServer) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *LispAddDelMapServer) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ return nil
+}
+
+// LispAddDelMapServerReply defines message 'lisp_add_del_map_server_reply'.
+type LispAddDelMapServerReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispAddDelMapServerReply) Reset() { *m = LispAddDelMapServerReply{} }
+func (*LispAddDelMapServerReply) GetMessageName() string { return "lisp_add_del_map_server_reply" }
+func (*LispAddDelMapServerReply) GetCrcString() string { return "e8d4e804" }
+func (*LispAddDelMapServerReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispAddDelMapServerReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispAddDelMapServerReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispAddDelRemoteMapping defines message 'lisp_add_del_remote_mapping'.
+type LispAddDelRemoteMapping struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ IsSrcDst uint8 `binapi:"u8,name=is_src_dst" json:"is_src_dst,omitempty"`
+ DelAll uint8 `binapi:"u8,name=del_all" json:"del_all,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ Action uint8 `binapi:"u8,name=action" json:"action,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Eid []byte `binapi:"u8[16],name=eid" json:"eid,omitempty"`
+ EidLen uint8 `binapi:"u8,name=eid_len" json:"eid_len,omitempty"`
+ Seid []byte `binapi:"u8[16],name=seid" json:"seid,omitempty"`
+ SeidLen uint8 `binapi:"u8,name=seid_len" json:"seid_len,omitempty"`
+ RlocNum uint32 `binapi:"u32,name=rloc_num" json:"-"`
+ Rlocs []RemoteLocator `binapi:"remote_locator[rloc_num],name=rlocs" json:"rlocs,omitempty"`
+}
+
+func (m *LispAddDelRemoteMapping) Reset() { *m = LispAddDelRemoteMapping{} }
+func (*LispAddDelRemoteMapping) GetMessageName() string { return "lisp_add_del_remote_mapping" }
+func (*LispAddDelRemoteMapping) GetCrcString() string { return "b879c3a9" }
+func (*LispAddDelRemoteMapping) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispAddDelRemoteMapping) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.IsSrcDst
+ size += 1 // m.DelAll
+ size += 4 // m.Vni
+ size += 1 // m.Action
+ size += 1 // m.EidType
+ size += 1 * 16 // m.Eid
+ size += 1 // m.EidLen
+ size += 1 * 16 // m.Seid
+ size += 1 // m.SeidLen
+ size += 4 // m.RlocNum
+ for j1 := 0; j1 < len(m.Rlocs); j1++ {
+ var s1 RemoteLocator
+ _ = s1
+ if j1 < len(m.Rlocs) {
+ s1 = m.Rlocs[j1]
+ }
+ size += 1 // s1.IsIP4
+ size += 1 // s1.Priority
+ size += 1 // s1.Weight
+ size += 1 * 16 // s1.Addr
+ }
+ return size
+}
+func (m *LispAddDelRemoteMapping) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.IsSrcDst)
+ buf.EncodeUint8(m.DelAll)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.Action)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.Eid, 16)
+ buf.EncodeUint8(m.EidLen)
+ buf.EncodeBytes(m.Seid, 16)
+ buf.EncodeUint8(m.SeidLen)
+ buf.EncodeUint32(uint32(len(m.Rlocs)))
+ for j0 := 0; j0 < len(m.Rlocs); j0++ {
+ var v0 RemoteLocator // Rlocs
+ if j0 < len(m.Rlocs) {
+ v0 = m.Rlocs[j0]
+ }
+ buf.EncodeUint8(v0.IsIP4)
+ buf.EncodeUint8(v0.Priority)
+ buf.EncodeUint8(v0.Weight)
+ buf.EncodeBytes(v0.Addr, 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *LispAddDelRemoteMapping) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.IsSrcDst = buf.DecodeUint8()
+ m.DelAll = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.Action = buf.DecodeUint8()
+ m.EidType = buf.DecodeUint8()
+ m.Eid = make([]byte, 16)
+ copy(m.Eid, buf.DecodeBytes(len(m.Eid)))
+ m.EidLen = buf.DecodeUint8()
+ m.Seid = make([]byte, 16)
+ copy(m.Seid, buf.DecodeBytes(len(m.Seid)))
+ m.SeidLen = buf.DecodeUint8()
+ m.RlocNum = buf.DecodeUint32()
+ m.Rlocs = make([]RemoteLocator, m.RlocNum)
+ for j0 := 0; j0 < len(m.Rlocs); j0++ {
+ m.Rlocs[j0].IsIP4 = buf.DecodeUint8()
+ m.Rlocs[j0].Priority = buf.DecodeUint8()
+ m.Rlocs[j0].Weight = buf.DecodeUint8()
+ m.Rlocs[j0].Addr = make([]byte, 16)
+ copy(m.Rlocs[j0].Addr, buf.DecodeBytes(len(m.Rlocs[j0].Addr)))
+ }
+ return nil
+}
+
+// LispAddDelRemoteMappingReply defines message 'lisp_add_del_remote_mapping_reply'.
+type LispAddDelRemoteMappingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispAddDelRemoteMappingReply) Reset() { *m = LispAddDelRemoteMappingReply{} }
+func (*LispAddDelRemoteMappingReply) GetMessageName() string {
+ return "lisp_add_del_remote_mapping_reply"
+}
+func (*LispAddDelRemoteMappingReply) GetCrcString() string { return "e8d4e804" }
+func (*LispAddDelRemoteMappingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispAddDelRemoteMappingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispAddDelRemoteMappingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispAdjacenciesGet defines message 'lisp_adjacencies_get'.
+type LispAdjacenciesGet struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *LispAdjacenciesGet) Reset() { *m = LispAdjacenciesGet{} }
+func (*LispAdjacenciesGet) GetMessageName() string { return "lisp_adjacencies_get" }
+func (*LispAdjacenciesGet) GetCrcString() string { return "8d1f2fe9" }
+func (*LispAdjacenciesGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispAdjacenciesGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ return size
+}
+func (m *LispAdjacenciesGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *LispAdjacenciesGet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// LispAdjacenciesGetReply defines message 'lisp_adjacencies_get_reply'.
+type LispAdjacenciesGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ Adjacencies []LispAdjacency `binapi:"lisp_adjacency[count],name=adjacencies" json:"adjacencies,omitempty"`
+}
+
+func (m *LispAdjacenciesGetReply) Reset() { *m = LispAdjacenciesGetReply{} }
+func (*LispAdjacenciesGetReply) GetMessageName() string { return "lisp_adjacencies_get_reply" }
+func (*LispAdjacenciesGetReply) GetCrcString() string { return "ada0f464" }
+func (*LispAdjacenciesGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispAdjacenciesGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Count
+ for j1 := 0; j1 < len(m.Adjacencies); j1++ {
+ var s1 LispAdjacency
+ _ = s1
+ if j1 < len(m.Adjacencies) {
+ s1 = m.Adjacencies[j1]
+ }
+ size += 1 // s1.EidType
+ size += 1 * 16 // s1.Reid
+ size += 1 * 16 // s1.Leid
+ size += 1 // s1.ReidPrefixLen
+ size += 1 // s1.LeidPrefixLen
+ }
+ return size
+}
+func (m *LispAdjacenciesGetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 // Adjacencies
+ if j0 < len(m.Adjacencies) {
+ v0 = m.Adjacencies[j0]
+ }
+ buf.EncodeUint8(v0.EidType)
+ buf.EncodeBytes(v0.Reid, 16)
+ buf.EncodeBytes(v0.Leid, 16)
+ buf.EncodeUint8(v0.ReidPrefixLen)
+ buf.EncodeUint8(v0.LeidPrefixLen)
+ }
+ return buf.Bytes(), nil
+}
+func (m *LispAdjacenciesGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.Adjacencies = make([]LispAdjacency, m.Count)
+ for j0 := 0; j0 < len(m.Adjacencies); j0++ {
+ m.Adjacencies[j0].EidType = buf.DecodeUint8()
+ m.Adjacencies[j0].Reid = make([]byte, 16)
+ copy(m.Adjacencies[j0].Reid, buf.DecodeBytes(len(m.Adjacencies[j0].Reid)))
+ m.Adjacencies[j0].Leid = make([]byte, 16)
+ copy(m.Adjacencies[j0].Leid, buf.DecodeBytes(len(m.Adjacencies[j0].Leid)))
+ m.Adjacencies[j0].ReidPrefixLen = buf.DecodeUint8()
+ m.Adjacencies[j0].LeidPrefixLen = buf.DecodeUint8()
+ }
+ return nil
+}
+
+// LispEidTableAddDelMap defines message 'lisp_eid_table_add_del_map'.
+type LispEidTableAddDelMap struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"`
+ IsL2 uint8 `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
+}
+
+func (m *LispEidTableAddDelMap) Reset() { *m = LispEidTableAddDelMap{} }
+func (*LispEidTableAddDelMap) GetMessageName() string { return "lisp_eid_table_add_del_map" }
+func (*LispEidTableAddDelMap) GetCrcString() string { return "59e9975e" }
+func (*LispEidTableAddDelMap) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispEidTableAddDelMap) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Vni
+ size += 4 // m.DpTable
+ size += 1 // m.IsL2
+ return size
+}
+func (m *LispEidTableAddDelMap) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint32(m.DpTable)
+ buf.EncodeUint8(m.IsL2)
+ return buf.Bytes(), nil
+}
+func (m *LispEidTableAddDelMap) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.DpTable = buf.DecodeUint32()
+ m.IsL2 = buf.DecodeUint8()
+ return nil
+}
+
+// LispEidTableAddDelMapReply defines message 'lisp_eid_table_add_del_map_reply'.
+type LispEidTableAddDelMapReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispEidTableAddDelMapReply) Reset() { *m = LispEidTableAddDelMapReply{} }
+func (*LispEidTableAddDelMapReply) GetMessageName() string { return "lisp_eid_table_add_del_map_reply" }
+func (*LispEidTableAddDelMapReply) GetCrcString() string { return "e8d4e804" }
+func (*LispEidTableAddDelMapReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispEidTableAddDelMapReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispEidTableAddDelMapReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispEidTableDetails defines message 'lisp_eid_table_details'.
+type LispEidTableDetails struct {
+ LocatorSetIndex uint32 `binapi:"u32,name=locator_set_index" json:"locator_set_index,omitempty"`
+ Action uint8 `binapi:"u8,name=action" json:"action,omitempty"`
+ IsLocal uint8 `binapi:"u8,name=is_local" json:"is_local,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ IsSrcDst uint8 `binapi:"u8,name=is_src_dst" json:"is_src_dst,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ Eid []byte `binapi:"u8[16],name=eid" json:"eid,omitempty"`
+ EidPrefixLen uint8 `binapi:"u8,name=eid_prefix_len" json:"eid_prefix_len,omitempty"`
+ Seid []byte `binapi:"u8[16],name=seid" json:"seid,omitempty"`
+ SeidPrefixLen uint8 `binapi:"u8,name=seid_prefix_len" json:"seid_prefix_len,omitempty"`
+ TTL uint32 `binapi:"u32,name=ttl" json:"ttl,omitempty"`
+ Authoritative uint8 `binapi:"u8,name=authoritative" json:"authoritative,omitempty"`
+ KeyID uint16 `binapi:"u16,name=key_id" json:"key_id,omitempty"`
+ Key []byte `binapi:"u8[64],name=key" json:"key,omitempty"`
+}
+
+func (m *LispEidTableDetails) Reset() { *m = LispEidTableDetails{} }
+func (*LispEidTableDetails) GetMessageName() string { return "lisp_eid_table_details" }
+func (*LispEidTableDetails) GetCrcString() string { return "dcd9f414" }
+func (*LispEidTableDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispEidTableDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.LocatorSetIndex
+ size += 1 // m.Action
+ size += 1 // m.IsLocal
+ size += 1 // m.EidType
+ size += 1 // m.IsSrcDst
+ size += 4 // m.Vni
+ size += 1 * 16 // m.Eid
+ size += 1 // m.EidPrefixLen
+ size += 1 * 16 // m.Seid
+ size += 1 // m.SeidPrefixLen
+ size += 4 // m.TTL
+ size += 1 // m.Authoritative
+ size += 2 // m.KeyID
+ size += 1 * 64 // m.Key
+ return size
+}
+func (m *LispEidTableDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.LocatorSetIndex)
+ buf.EncodeUint8(m.Action)
+ buf.EncodeUint8(m.IsLocal)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeUint8(m.IsSrcDst)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeBytes(m.Eid, 16)
+ buf.EncodeUint8(m.EidPrefixLen)
+ buf.EncodeBytes(m.Seid, 16)
+ buf.EncodeUint8(m.SeidPrefixLen)
+ buf.EncodeUint32(m.TTL)
+ buf.EncodeUint8(m.Authoritative)
+ buf.EncodeUint16(m.KeyID)
+ buf.EncodeBytes(m.Key, 64)
+ return buf.Bytes(), nil
+}
+func (m *LispEidTableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.LocatorSetIndex = buf.DecodeUint32()
+ m.Action = buf.DecodeUint8()
+ m.IsLocal = buf.DecodeUint8()
+ m.EidType = buf.DecodeUint8()
+ m.IsSrcDst = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.Eid = make([]byte, 16)
+ copy(m.Eid, buf.DecodeBytes(len(m.Eid)))
+ m.EidPrefixLen = buf.DecodeUint8()
+ m.Seid = make([]byte, 16)
+ copy(m.Seid, buf.DecodeBytes(len(m.Seid)))
+ m.SeidPrefixLen = buf.DecodeUint8()
+ m.TTL = buf.DecodeUint32()
+ m.Authoritative = buf.DecodeUint8()
+ m.KeyID = buf.DecodeUint16()
+ m.Key = make([]byte, 64)
+ copy(m.Key, buf.DecodeBytes(len(m.Key)))
+ return nil
+}
+
+// LispEidTableDump defines message 'lisp_eid_table_dump'.
+type LispEidTableDump struct {
+ EidSet uint8 `binapi:"u8,name=eid_set" json:"eid_set,omitempty"`
+ PrefixLength uint8 `binapi:"u8,name=prefix_length" json:"prefix_length,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Eid []byte `binapi:"u8[16],name=eid" json:"eid,omitempty"`
+ Filter uint8 `binapi:"u8,name=filter" json:"filter,omitempty"`
+}
+
+func (m *LispEidTableDump) Reset() { *m = LispEidTableDump{} }
+func (*LispEidTableDump) GetMessageName() string { return "lisp_eid_table_dump" }
+func (*LispEidTableDump) GetCrcString() string { return "e0df64da" }
+func (*LispEidTableDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispEidTableDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EidSet
+ size += 1 // m.PrefixLength
+ size += 4 // m.Vni
+ size += 1 // m.EidType
+ size += 1 * 16 // m.Eid
+ size += 1 // m.Filter
+ return size
+}
+func (m *LispEidTableDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.EidSet)
+ buf.EncodeUint8(m.PrefixLength)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.Eid, 16)
+ buf.EncodeUint8(m.Filter)
+ return buf.Bytes(), nil
+}
+func (m *LispEidTableDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EidSet = buf.DecodeUint8()
+ m.PrefixLength = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.EidType = buf.DecodeUint8()
+ m.Eid = make([]byte, 16)
+ copy(m.Eid, buf.DecodeBytes(len(m.Eid)))
+ m.Filter = buf.DecodeUint8()
+ return nil
+}
+
+// LispEidTableMapDetails defines message 'lisp_eid_table_map_details'.
+type LispEidTableMapDetails struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"`
+}
+
+func (m *LispEidTableMapDetails) Reset() { *m = LispEidTableMapDetails{} }
+func (*LispEidTableMapDetails) GetMessageName() string { return "lisp_eid_table_map_details" }
+func (*LispEidTableMapDetails) GetCrcString() string { return "0b6859e2" }
+func (*LispEidTableMapDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispEidTableMapDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ size += 4 // m.DpTable
+ return size
+}
+func (m *LispEidTableMapDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint32(m.DpTable)
+ return buf.Bytes(), nil
+}
+func (m *LispEidTableMapDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ m.DpTable = buf.DecodeUint32()
+ return nil
+}
+
+// LispEidTableMapDump defines message 'lisp_eid_table_map_dump'.
+type LispEidTableMapDump struct {
+ IsL2 uint8 `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
+}
+
+func (m *LispEidTableMapDump) Reset() { *m = LispEidTableMapDump{} }
+func (*LispEidTableMapDump) GetMessageName() string { return "lisp_eid_table_map_dump" }
+func (*LispEidTableMapDump) GetCrcString() string { return "67c54650" }
+func (*LispEidTableMapDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispEidTableMapDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsL2
+ return size
+}
+func (m *LispEidTableMapDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsL2)
+ return buf.Bytes(), nil
+}
+func (m *LispEidTableMapDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsL2 = buf.DecodeUint8()
+ return nil
+}
+
+// LispEidTableVniDetails defines message 'lisp_eid_table_vni_details'.
+type LispEidTableVniDetails struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *LispEidTableVniDetails) Reset() { *m = LispEidTableVniDetails{} }
+func (*LispEidTableVniDetails) GetMessageName() string { return "lisp_eid_table_vni_details" }
+func (*LispEidTableVniDetails) GetCrcString() string { return "64abc01e" }
+func (*LispEidTableVniDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispEidTableVniDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ return size
+}
+func (m *LispEidTableVniDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *LispEidTableVniDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// LispEidTableVniDump defines message 'lisp_eid_table_vni_dump'.
+type LispEidTableVniDump struct{}
+
+func (m *LispEidTableVniDump) Reset() { *m = LispEidTableVniDump{} }
+func (*LispEidTableVniDump) GetMessageName() string { return "lisp_eid_table_vni_dump" }
+func (*LispEidTableVniDump) GetCrcString() string { return "51077d14" }
+func (*LispEidTableVniDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispEidTableVniDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *LispEidTableVniDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *LispEidTableVniDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// LispEnableDisable defines message 'lisp_enable_disable'.
+type LispEnableDisable struct {
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *LispEnableDisable) Reset() { *m = LispEnableDisable{} }
+func (*LispEnableDisable) GetMessageName() string { return "lisp_enable_disable" }
+func (*LispEnableDisable) GetCrcString() string { return "eb0e943b" }
+func (*LispEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEn
+ return size
+}
+func (m *LispEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *LispEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// LispEnableDisableReply defines message 'lisp_enable_disable_reply'.
+type LispEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispEnableDisableReply) Reset() { *m = LispEnableDisableReply{} }
+func (*LispEnableDisableReply) GetMessageName() string { return "lisp_enable_disable_reply" }
+func (*LispEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*LispEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispGetMapRequestItrRlocs defines message 'lisp_get_map_request_itr_rlocs'.
+type LispGetMapRequestItrRlocs struct{}
+
+func (m *LispGetMapRequestItrRlocs) Reset() { *m = LispGetMapRequestItrRlocs{} }
+func (*LispGetMapRequestItrRlocs) GetMessageName() string { return "lisp_get_map_request_itr_rlocs" }
+func (*LispGetMapRequestItrRlocs) GetCrcString() string { return "51077d14" }
+func (*LispGetMapRequestItrRlocs) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispGetMapRequestItrRlocs) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *LispGetMapRequestItrRlocs) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *LispGetMapRequestItrRlocs) Unmarshal(b []byte) error {
+ return nil
+}
+
+// LispGetMapRequestItrRlocsReply defines message 'lisp_get_map_request_itr_rlocs_reply'.
+type LispGetMapRequestItrRlocsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+}
+
+func (m *LispGetMapRequestItrRlocsReply) Reset() { *m = LispGetMapRequestItrRlocsReply{} }
+func (*LispGetMapRequestItrRlocsReply) GetMessageName() string {
+ return "lisp_get_map_request_itr_rlocs_reply"
+}
+func (*LispGetMapRequestItrRlocsReply) GetCrcString() string { return "9f56f6f7" }
+func (*LispGetMapRequestItrRlocsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispGetMapRequestItrRlocsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 64 // m.LocatorSetName
+ return size
+}
+func (m *LispGetMapRequestItrRlocsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ return buf.Bytes(), nil
+}
+func (m *LispGetMapRequestItrRlocsReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ return nil
+}
+
+// LispLocatorDetails defines message 'lisp_locator_details'.
+type LispLocatorDetails struct {
+ Local uint8 `binapi:"u8,name=local" json:"local,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+ Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+}
+
+func (m *LispLocatorDetails) Reset() { *m = LispLocatorDetails{} }
+func (*LispLocatorDetails) GetMessageName() string { return "lisp_locator_details" }
+func (*LispLocatorDetails) GetCrcString() string { return "b3988a30" }
+func (*LispLocatorDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispLocatorDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Local
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ size += 1 // m.Priority
+ size += 1 // m.Weight
+ return size
+}
+func (m *LispLocatorDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Local)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ buf.EncodeUint8(m.Priority)
+ buf.EncodeUint8(m.Weight)
+ return buf.Bytes(), nil
+}
+func (m *LispLocatorDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Local = buf.DecodeUint8()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ m.Priority = buf.DecodeUint8()
+ m.Weight = buf.DecodeUint8()
+ return nil
+}
+
+// LispLocatorDump defines message 'lisp_locator_dump'.
+type LispLocatorDump struct {
+ LsIndex uint32 `binapi:"u32,name=ls_index" json:"ls_index,omitempty"`
+ LsName []byte `binapi:"u8[64],name=ls_name" json:"ls_name,omitempty"`
+ IsIndexSet uint8 `binapi:"u8,name=is_index_set" json:"is_index_set,omitempty"`
+}
+
+func (m *LispLocatorDump) Reset() { *m = LispLocatorDump{} }
+func (*LispLocatorDump) GetMessageName() string { return "lisp_locator_dump" }
+func (*LispLocatorDump) GetCrcString() string { return "f27d5050" }
+func (*LispLocatorDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispLocatorDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.LsIndex
+ size += 1 * 64 // m.LsName
+ size += 1 // m.IsIndexSet
+ return size
+}
+func (m *LispLocatorDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.LsIndex)
+ buf.EncodeBytes(m.LsName, 64)
+ buf.EncodeUint8(m.IsIndexSet)
+ return buf.Bytes(), nil
+}
+func (m *LispLocatorDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.LsIndex = buf.DecodeUint32()
+ m.LsName = make([]byte, 64)
+ copy(m.LsName, buf.DecodeBytes(len(m.LsName)))
+ m.IsIndexSet = buf.DecodeUint8()
+ return nil
+}
+
+// LispLocatorSetDetails defines message 'lisp_locator_set_details'.
+type LispLocatorSetDetails struct {
+ LsIndex uint32 `binapi:"u32,name=ls_index" json:"ls_index,omitempty"`
+ LsName []byte `binapi:"u8[64],name=ls_name" json:"ls_name,omitempty"`
+}
+
+func (m *LispLocatorSetDetails) Reset() { *m = LispLocatorSetDetails{} }
+func (*LispLocatorSetDetails) GetMessageName() string { return "lisp_locator_set_details" }
+func (*LispLocatorSetDetails) GetCrcString() string { return "6b846882" }
+func (*LispLocatorSetDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispLocatorSetDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.LsIndex
+ size += 1 * 64 // m.LsName
+ return size
+}
+func (m *LispLocatorSetDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.LsIndex)
+ buf.EncodeBytes(m.LsName, 64)
+ return buf.Bytes(), nil
+}
+func (m *LispLocatorSetDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.LsIndex = buf.DecodeUint32()
+ m.LsName = make([]byte, 64)
+ copy(m.LsName, buf.DecodeBytes(len(m.LsName)))
+ return nil
+}
+
+// LispLocatorSetDump defines message 'lisp_locator_set_dump'.
+type LispLocatorSetDump struct {
+ Filter uint8 `binapi:"u8,name=filter" json:"filter,omitempty"`
+}
+
+func (m *LispLocatorSetDump) Reset() { *m = LispLocatorSetDump{} }
+func (*LispLocatorSetDump) GetMessageName() string { return "lisp_locator_set_dump" }
+func (*LispLocatorSetDump) GetCrcString() string { return "c79e8ab0" }
+func (*LispLocatorSetDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispLocatorSetDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Filter
+ return size
+}
+func (m *LispLocatorSetDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Filter)
+ return buf.Bytes(), nil
+}
+func (m *LispLocatorSetDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Filter = buf.DecodeUint8()
+ return nil
+}
+
+// LispMapRegisterEnableDisable defines message 'lisp_map_register_enable_disable'.
+type LispMapRegisterEnableDisable struct {
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+}
+
+func (m *LispMapRegisterEnableDisable) Reset() { *m = LispMapRegisterEnableDisable{} }
+func (*LispMapRegisterEnableDisable) GetMessageName() string {
+ return "lisp_map_register_enable_disable"
+}
+func (*LispMapRegisterEnableDisable) GetCrcString() string { return "294103d1" }
+func (*LispMapRegisterEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispMapRegisterEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEnabled
+ return size
+}
+func (m *LispMapRegisterEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEnabled)
+ return buf.Bytes(), nil
+}
+func (m *LispMapRegisterEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEnabled = buf.DecodeUint8()
+ return nil
+}
+
+// LispMapRegisterEnableDisableReply defines message 'lisp_map_register_enable_disable_reply'.
+type LispMapRegisterEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispMapRegisterEnableDisableReply) Reset() { *m = LispMapRegisterEnableDisableReply{} }
+func (*LispMapRegisterEnableDisableReply) GetMessageName() string {
+ return "lisp_map_register_enable_disable_reply"
+}
+func (*LispMapRegisterEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*LispMapRegisterEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispMapRegisterEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispMapRegisterEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispMapRequestMode defines message 'lisp_map_request_mode'.
+type LispMapRequestMode struct {
+ Mode uint8 `binapi:"u8,name=mode" json:"mode,omitempty"`
+}
+
+func (m *LispMapRequestMode) Reset() { *m = LispMapRequestMode{} }
+func (*LispMapRequestMode) GetMessageName() string { return "lisp_map_request_mode" }
+func (*LispMapRequestMode) GetCrcString() string { return "f3f93ce9" }
+func (*LispMapRequestMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispMapRequestMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Mode
+ return size
+}
+func (m *LispMapRequestMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Mode)
+ return buf.Bytes(), nil
+}
+func (m *LispMapRequestMode) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Mode = buf.DecodeUint8()
+ return nil
+}
+
+// LispMapRequestModeReply defines message 'lisp_map_request_mode_reply'.
+type LispMapRequestModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispMapRequestModeReply) Reset() { *m = LispMapRequestModeReply{} }
+func (*LispMapRequestModeReply) GetMessageName() string { return "lisp_map_request_mode_reply" }
+func (*LispMapRequestModeReply) GetCrcString() string { return "e8d4e804" }
+func (*LispMapRequestModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispMapRequestModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispMapRequestModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispMapResolverDetails defines message 'lisp_map_resolver_details'.
+type LispMapResolverDetails struct {
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+}
+
+func (m *LispMapResolverDetails) Reset() { *m = LispMapResolverDetails{} }
+func (*LispMapResolverDetails) GetMessageName() string { return "lisp_map_resolver_details" }
+func (*LispMapResolverDetails) GetCrcString() string { return "60a5f5ca" }
+func (*LispMapResolverDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispMapResolverDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ return size
+}
+func (m *LispMapResolverDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *LispMapResolverDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ return nil
+}
+
+// LispMapResolverDump defines message 'lisp_map_resolver_dump'.
+type LispMapResolverDump struct{}
+
+func (m *LispMapResolverDump) Reset() { *m = LispMapResolverDump{} }
+func (*LispMapResolverDump) GetMessageName() string { return "lisp_map_resolver_dump" }
+func (*LispMapResolverDump) GetCrcString() string { return "51077d14" }
+func (*LispMapResolverDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispMapResolverDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *LispMapResolverDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *LispMapResolverDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// LispMapServerDetails defines message 'lisp_map_server_details'.
+type LispMapServerDetails struct {
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+}
+
+func (m *LispMapServerDetails) Reset() { *m = LispMapServerDetails{} }
+func (*LispMapServerDetails) GetMessageName() string { return "lisp_map_server_details" }
+func (*LispMapServerDetails) GetCrcString() string { return "60a5f5ca" }
+func (*LispMapServerDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispMapServerDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ return size
+}
+func (m *LispMapServerDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *LispMapServerDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ return nil
+}
+
+// LispMapServerDump defines message 'lisp_map_server_dump'.
+type LispMapServerDump struct{}
+
+func (m *LispMapServerDump) Reset() { *m = LispMapServerDump{} }
+func (*LispMapServerDump) GetMessageName() string { return "lisp_map_server_dump" }
+func (*LispMapServerDump) GetCrcString() string { return "51077d14" }
+func (*LispMapServerDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispMapServerDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *LispMapServerDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *LispMapServerDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// LispPitrSetLocatorSet defines message 'lisp_pitr_set_locator_set'.
+type LispPitrSetLocatorSet struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ LsName []byte `binapi:"u8[64],name=ls_name" json:"ls_name,omitempty"`
+}
+
+func (m *LispPitrSetLocatorSet) Reset() { *m = LispPitrSetLocatorSet{} }
+func (*LispPitrSetLocatorSet) GetMessageName() string { return "lisp_pitr_set_locator_set" }
+func (*LispPitrSetLocatorSet) GetCrcString() string { return "7aa022dd" }
+func (*LispPitrSetLocatorSet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispPitrSetLocatorSet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.LsName
+ return size
+}
+func (m *LispPitrSetLocatorSet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.LsName, 64)
+ return buf.Bytes(), nil
+}
+func (m *LispPitrSetLocatorSet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.LsName = make([]byte, 64)
+ copy(m.LsName, buf.DecodeBytes(len(m.LsName)))
+ return nil
+}
+
+// LispPitrSetLocatorSetReply defines message 'lisp_pitr_set_locator_set_reply'.
+type LispPitrSetLocatorSetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispPitrSetLocatorSetReply) Reset() { *m = LispPitrSetLocatorSetReply{} }
+func (*LispPitrSetLocatorSetReply) GetMessageName() string { return "lisp_pitr_set_locator_set_reply" }
+func (*LispPitrSetLocatorSetReply) GetCrcString() string { return "e8d4e804" }
+func (*LispPitrSetLocatorSetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispPitrSetLocatorSetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispPitrSetLocatorSetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispRlocProbeEnableDisable defines message 'lisp_rloc_probe_enable_disable'.
+type LispRlocProbeEnableDisable struct {
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+}
+
+func (m *LispRlocProbeEnableDisable) Reset() { *m = LispRlocProbeEnableDisable{} }
+func (*LispRlocProbeEnableDisable) GetMessageName() string { return "lisp_rloc_probe_enable_disable" }
+func (*LispRlocProbeEnableDisable) GetCrcString() string { return "294103d1" }
+func (*LispRlocProbeEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispRlocProbeEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEnabled
+ return size
+}
+func (m *LispRlocProbeEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEnabled)
+ return buf.Bytes(), nil
+}
+func (m *LispRlocProbeEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEnabled = buf.DecodeUint8()
+ return nil
+}
+
+// LispRlocProbeEnableDisableReply defines message 'lisp_rloc_probe_enable_disable_reply'.
+type LispRlocProbeEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispRlocProbeEnableDisableReply) Reset() { *m = LispRlocProbeEnableDisableReply{} }
+func (*LispRlocProbeEnableDisableReply) GetMessageName() string {
+ return "lisp_rloc_probe_enable_disable_reply"
+}
+func (*LispRlocProbeEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*LispRlocProbeEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispRlocProbeEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispRlocProbeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// LispUsePetr defines message 'lisp_use_petr'.
+type LispUsePetr struct {
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ Address []byte `binapi:"u8[16],name=address" json:"address,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *LispUsePetr) Reset() { *m = LispUsePetr{} }
+func (*LispUsePetr) GetMessageName() string { return "lisp_use_petr" }
+func (*LispUsePetr) GetCrcString() string { return "6910787d" }
+func (*LispUsePetr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LispUsePetr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.Address
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *LispUsePetr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.Address, 16)
+ buf.EncodeUint8(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *LispUsePetr) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIP4 = buf.DecodeUint8()
+ m.Address = make([]byte, 16)
+ copy(m.Address, buf.DecodeBytes(len(m.Address)))
+ m.IsAdd = buf.DecodeUint8()
+ return nil
+}
+
+// LispUsePetrReply defines message 'lisp_use_petr_reply'.
+type LispUsePetrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LispUsePetrReply) Reset() { *m = LispUsePetrReply{} }
+func (*LispUsePetrReply) GetMessageName() string { return "lisp_use_petr_reply" }
+func (*LispUsePetrReply) GetCrcString() string { return "e8d4e804" }
+func (*LispUsePetrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LispUsePetrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LispUsePetrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// ShowLispMapRegisterState defines message 'show_lisp_map_register_state'.
+type ShowLispMapRegisterState struct{}
+
+func (m *ShowLispMapRegisterState) Reset() { *m = ShowLispMapRegisterState{} }
+func (*ShowLispMapRegisterState) GetMessageName() string { return "show_lisp_map_register_state" }
+func (*ShowLispMapRegisterState) GetCrcString() string { return "51077d14" }
+func (*ShowLispMapRegisterState) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowLispMapRegisterState) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowLispMapRegisterState) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispMapRegisterState) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowLispMapRegisterStateReply defines message 'show_lisp_map_register_state_reply'.
+type ShowLispMapRegisterStateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+}
+
+func (m *ShowLispMapRegisterStateReply) Reset() { *m = ShowLispMapRegisterStateReply{} }
+func (*ShowLispMapRegisterStateReply) GetMessageName() string {
+ return "show_lisp_map_register_state_reply"
+}
+func (*ShowLispMapRegisterStateReply) GetCrcString() string { return "14304fbc" }
+func (*ShowLispMapRegisterStateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowLispMapRegisterStateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IsEnabled
+ return size
+}
+func (m *ShowLispMapRegisterStateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.IsEnabled)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispMapRegisterStateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.IsEnabled = buf.DecodeUint8()
+ return nil
+}
+
+// ShowLispMapRequestMode defines message 'show_lisp_map_request_mode'.
+type ShowLispMapRequestMode struct{}
+
+func (m *ShowLispMapRequestMode) Reset() { *m = ShowLispMapRequestMode{} }
+func (*ShowLispMapRequestMode) GetMessageName() string { return "show_lisp_map_request_mode" }
+func (*ShowLispMapRequestMode) GetCrcString() string { return "51077d14" }
+func (*ShowLispMapRequestMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowLispMapRequestMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowLispMapRequestMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispMapRequestMode) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowLispMapRequestModeReply defines message 'show_lisp_map_request_mode_reply'.
+type ShowLispMapRequestModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Mode uint8 `binapi:"u8,name=mode" json:"mode,omitempty"`
+}
+
+func (m *ShowLispMapRequestModeReply) Reset() { *m = ShowLispMapRequestModeReply{} }
+func (*ShowLispMapRequestModeReply) GetMessageName() string {
+ return "show_lisp_map_request_mode_reply"
+}
+func (*ShowLispMapRequestModeReply) GetCrcString() string { return "d423107c" }
+func (*ShowLispMapRequestModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowLispMapRequestModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.Mode
+ return size
+}
+func (m *ShowLispMapRequestModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.Mode)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispMapRequestModeReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Mode = buf.DecodeUint8()
+ return nil
+}
+
+// ShowLispPitr defines message 'show_lisp_pitr'.
+type ShowLispPitr struct{}
+
+func (m *ShowLispPitr) Reset() { *m = ShowLispPitr{} }
+func (*ShowLispPitr) GetMessageName() string { return "show_lisp_pitr" }
+func (*ShowLispPitr) GetCrcString() string { return "51077d14" }
+func (*ShowLispPitr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowLispPitr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowLispPitr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispPitr) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowLispPitrReply defines message 'show_lisp_pitr_reply'.
+type ShowLispPitrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Status uint8 `binapi:"u8,name=status" json:"status,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+}
+
+func (m *ShowLispPitrReply) Reset() { *m = ShowLispPitrReply{} }
+func (*ShowLispPitrReply) GetMessageName() string { return "show_lisp_pitr_reply" }
+func (*ShowLispPitrReply) GetCrcString() string { return "dca512cc" }
+func (*ShowLispPitrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowLispPitrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.Status
+ size += 1 * 64 // m.LocatorSetName
+ return size
+}
+func (m *ShowLispPitrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.Status)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispPitrReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Status = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ return nil
+}
+
+// ShowLispRlocProbeState defines message 'show_lisp_rloc_probe_state'.
+type ShowLispRlocProbeState struct{}
+
+func (m *ShowLispRlocProbeState) Reset() { *m = ShowLispRlocProbeState{} }
+func (*ShowLispRlocProbeState) GetMessageName() string { return "show_lisp_rloc_probe_state" }
+func (*ShowLispRlocProbeState) GetCrcString() string { return "51077d14" }
+func (*ShowLispRlocProbeState) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowLispRlocProbeState) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowLispRlocProbeState) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispRlocProbeState) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowLispRlocProbeStateReply defines message 'show_lisp_rloc_probe_state_reply'.
+type ShowLispRlocProbeStateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+}
+
+func (m *ShowLispRlocProbeStateReply) Reset() { *m = ShowLispRlocProbeStateReply{} }
+func (*ShowLispRlocProbeStateReply) GetMessageName() string {
+ return "show_lisp_rloc_probe_state_reply"
+}
+func (*ShowLispRlocProbeStateReply) GetCrcString() string { return "14304fbc" }
+func (*ShowLispRlocProbeStateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowLispRlocProbeStateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IsEnabled
+ return size
+}
+func (m *ShowLispRlocProbeStateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.IsEnabled)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispRlocProbeStateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.IsEnabled = buf.DecodeUint8()
+ return nil
+}
+
+// ShowLispStatus defines message 'show_lisp_status'.
+type ShowLispStatus struct{}
+
+func (m *ShowLispStatus) Reset() { *m = ShowLispStatus{} }
+func (*ShowLispStatus) GetMessageName() string { return "show_lisp_status" }
+func (*ShowLispStatus) GetCrcString() string { return "51077d14" }
+func (*ShowLispStatus) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowLispStatus) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowLispStatus) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispStatus) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowLispStatusReply defines message 'show_lisp_status_reply'.
+type ShowLispStatusReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ FeatureStatus uint8 `binapi:"u8,name=feature_status" json:"feature_status,omitempty"`
+ GpeStatus uint8 `binapi:"u8,name=gpe_status" json:"gpe_status,omitempty"`
+}
+
+func (m *ShowLispStatusReply) Reset() { *m = ShowLispStatusReply{} }
+func (*ShowLispStatusReply) GetMessageName() string { return "show_lisp_status_reply" }
+func (*ShowLispStatusReply) GetCrcString() string { return "ddcf48ef" }
+func (*ShowLispStatusReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowLispStatusReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.FeatureStatus
+ size += 1 // m.GpeStatus
+ return size
+}
+func (m *ShowLispStatusReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.FeatureStatus)
+ buf.EncodeUint8(m.GpeStatus)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispStatusReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.FeatureStatus = buf.DecodeUint8()
+ m.GpeStatus = buf.DecodeUint8()
+ return nil
+}
+
+// ShowLispUsePetr defines message 'show_lisp_use_petr'.
+type ShowLispUsePetr struct{}
+
+func (m *ShowLispUsePetr) Reset() { *m = ShowLispUsePetr{} }
+func (*ShowLispUsePetr) GetMessageName() string { return "show_lisp_use_petr" }
+func (*ShowLispUsePetr) GetCrcString() string { return "51077d14" }
+func (*ShowLispUsePetr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowLispUsePetr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowLispUsePetr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispUsePetr) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowLispUsePetrReply defines message 'show_lisp_use_petr_reply'.
+type ShowLispUsePetrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Status uint8 `binapi:"u8,name=status" json:"status,omitempty"`
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ Address []byte `binapi:"u8[16],name=address" json:"address,omitempty"`
+}
+
+func (m *ShowLispUsePetrReply) Reset() { *m = ShowLispUsePetrReply{} }
+func (*ShowLispUsePetrReply) GetMessageName() string { return "show_lisp_use_petr_reply" }
+func (*ShowLispUsePetrReply) GetCrcString() string { return "1eb21916" }
+func (*ShowLispUsePetrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowLispUsePetrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.Status
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.Address
+ return size
+}
+func (m *ShowLispUsePetrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.Status)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.Address, 16)
+ return buf.Bytes(), nil
+}
+func (m *ShowLispUsePetrReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Status = buf.DecodeUint8()
+ m.IsIP4 = buf.DecodeUint8()
+ m.Address = make([]byte, 16)
+ copy(m.Address, buf.DecodeBytes(len(m.Address)))
+ return nil
+}
+
+func init() { file_lisp_binapi_init() }
+func file_lisp_binapi_init() {
+ api.RegisterMessage((*LispAddDelAdjacency)(nil), "lisp_add_del_adjacency_f047390d")
+ api.RegisterMessage((*LispAddDelAdjacencyReply)(nil), "lisp_add_del_adjacency_reply_e8d4e804")
+ api.RegisterMessage((*LispAddDelLocalEid)(nil), "lisp_add_del_local_eid_e6d00717")
+ api.RegisterMessage((*LispAddDelLocalEidReply)(nil), "lisp_add_del_local_eid_reply_e8d4e804")
+ api.RegisterMessage((*LispAddDelLocator)(nil), "lisp_add_del_locator_006a4240")
+ api.RegisterMessage((*LispAddDelLocatorReply)(nil), "lisp_add_del_locator_reply_e8d4e804")
+ api.RegisterMessage((*LispAddDelLocatorSet)(nil), "lisp_add_del_locator_set_06968e38")
+ api.RegisterMessage((*LispAddDelLocatorSetReply)(nil), "lisp_add_del_locator_set_reply_b6666db4")
+ api.RegisterMessage((*LispAddDelMapRequestItrRlocs)(nil), "lisp_add_del_map_request_itr_rlocs_c7c6cb2f")
+ api.RegisterMessage((*LispAddDelMapRequestItrRlocsReply)(nil), "lisp_add_del_map_request_itr_rlocs_reply_e8d4e804")
+ api.RegisterMessage((*LispAddDelMapResolver)(nil), "lisp_add_del_map_resolver_0ebcd37d")
+ api.RegisterMessage((*LispAddDelMapResolverReply)(nil), "lisp_add_del_map_resolver_reply_e8d4e804")
+ api.RegisterMessage((*LispAddDelMapServer)(nil), "lisp_add_del_map_server_0ebcd37d")
+ api.RegisterMessage((*LispAddDelMapServerReply)(nil), "lisp_add_del_map_server_reply_e8d4e804")
+ api.RegisterMessage((*LispAddDelRemoteMapping)(nil), "lisp_add_del_remote_mapping_b879c3a9")
+ api.RegisterMessage((*LispAddDelRemoteMappingReply)(nil), "lisp_add_del_remote_mapping_reply_e8d4e804")
+ api.RegisterMessage((*LispAdjacenciesGet)(nil), "lisp_adjacencies_get_8d1f2fe9")
+ api.RegisterMessage((*LispAdjacenciesGetReply)(nil), "lisp_adjacencies_get_reply_ada0f464")
+ api.RegisterMessage((*LispEidTableAddDelMap)(nil), "lisp_eid_table_add_del_map_59e9975e")
+ api.RegisterMessage((*LispEidTableAddDelMapReply)(nil), "lisp_eid_table_add_del_map_reply_e8d4e804")
+ api.RegisterMessage((*LispEidTableDetails)(nil), "lisp_eid_table_details_dcd9f414")
+ api.RegisterMessage((*LispEidTableDump)(nil), "lisp_eid_table_dump_e0df64da")
+ api.RegisterMessage((*LispEidTableMapDetails)(nil), "lisp_eid_table_map_details_0b6859e2")
+ api.RegisterMessage((*LispEidTableMapDump)(nil), "lisp_eid_table_map_dump_67c54650")
+ api.RegisterMessage((*LispEidTableVniDetails)(nil), "lisp_eid_table_vni_details_64abc01e")
+ api.RegisterMessage((*LispEidTableVniDump)(nil), "lisp_eid_table_vni_dump_51077d14")
+ api.RegisterMessage((*LispEnableDisable)(nil), "lisp_enable_disable_eb0e943b")
+ api.RegisterMessage((*LispEnableDisableReply)(nil), "lisp_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*LispGetMapRequestItrRlocs)(nil), "lisp_get_map_request_itr_rlocs_51077d14")
+ api.RegisterMessage((*LispGetMapRequestItrRlocsReply)(nil), "lisp_get_map_request_itr_rlocs_reply_9f56f6f7")
+ api.RegisterMessage((*LispLocatorDetails)(nil), "lisp_locator_details_b3988a30")
+ api.RegisterMessage((*LispLocatorDump)(nil), "lisp_locator_dump_f27d5050")
+ api.RegisterMessage((*LispLocatorSetDetails)(nil), "lisp_locator_set_details_6b846882")
+ api.RegisterMessage((*LispLocatorSetDump)(nil), "lisp_locator_set_dump_c79e8ab0")
+ api.RegisterMessage((*LispMapRegisterEnableDisable)(nil), "lisp_map_register_enable_disable_294103d1")
+ api.RegisterMessage((*LispMapRegisterEnableDisableReply)(nil), "lisp_map_register_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*LispMapRequestMode)(nil), "lisp_map_request_mode_f3f93ce9")
+ api.RegisterMessage((*LispMapRequestModeReply)(nil), "lisp_map_request_mode_reply_e8d4e804")
+ api.RegisterMessage((*LispMapResolverDetails)(nil), "lisp_map_resolver_details_60a5f5ca")
+ api.RegisterMessage((*LispMapResolverDump)(nil), "lisp_map_resolver_dump_51077d14")
+ api.RegisterMessage((*LispMapServerDetails)(nil), "lisp_map_server_details_60a5f5ca")
+ api.RegisterMessage((*LispMapServerDump)(nil), "lisp_map_server_dump_51077d14")
+ api.RegisterMessage((*LispPitrSetLocatorSet)(nil), "lisp_pitr_set_locator_set_7aa022dd")
+ api.RegisterMessage((*LispPitrSetLocatorSetReply)(nil), "lisp_pitr_set_locator_set_reply_e8d4e804")
+ api.RegisterMessage((*LispRlocProbeEnableDisable)(nil), "lisp_rloc_probe_enable_disable_294103d1")
+ api.RegisterMessage((*LispRlocProbeEnableDisableReply)(nil), "lisp_rloc_probe_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*LispUsePetr)(nil), "lisp_use_petr_6910787d")
+ api.RegisterMessage((*LispUsePetrReply)(nil), "lisp_use_petr_reply_e8d4e804")
+ api.RegisterMessage((*ShowLispMapRegisterState)(nil), "show_lisp_map_register_state_51077d14")
+ api.RegisterMessage((*ShowLispMapRegisterStateReply)(nil), "show_lisp_map_register_state_reply_14304fbc")
+ api.RegisterMessage((*ShowLispMapRequestMode)(nil), "show_lisp_map_request_mode_51077d14")
+ api.RegisterMessage((*ShowLispMapRequestModeReply)(nil), "show_lisp_map_request_mode_reply_d423107c")
+ api.RegisterMessage((*ShowLispPitr)(nil), "show_lisp_pitr_51077d14")
+ api.RegisterMessage((*ShowLispPitrReply)(nil), "show_lisp_pitr_reply_dca512cc")
+ api.RegisterMessage((*ShowLispRlocProbeState)(nil), "show_lisp_rloc_probe_state_51077d14")
+ api.RegisterMessage((*ShowLispRlocProbeStateReply)(nil), "show_lisp_rloc_probe_state_reply_14304fbc")
+ api.RegisterMessage((*ShowLispStatus)(nil), "show_lisp_status_51077d14")
+ api.RegisterMessage((*ShowLispStatusReply)(nil), "show_lisp_status_reply_ddcf48ef")
+ api.RegisterMessage((*ShowLispUsePetr)(nil), "show_lisp_use_petr_51077d14")
+ api.RegisterMessage((*ShowLispUsePetrReply)(nil), "show_lisp_use_petr_reply_1eb21916")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*LispAddDelAdjacency)(nil),
+ (*LispAddDelAdjacencyReply)(nil),
+ (*LispAddDelLocalEid)(nil),
+ (*LispAddDelLocalEidReply)(nil),
+ (*LispAddDelLocator)(nil),
+ (*LispAddDelLocatorReply)(nil),
+ (*LispAddDelLocatorSet)(nil),
+ (*LispAddDelLocatorSetReply)(nil),
+ (*LispAddDelMapRequestItrRlocs)(nil),
+ (*LispAddDelMapRequestItrRlocsReply)(nil),
+ (*LispAddDelMapResolver)(nil),
+ (*LispAddDelMapResolverReply)(nil),
+ (*LispAddDelMapServer)(nil),
+ (*LispAddDelMapServerReply)(nil),
+ (*LispAddDelRemoteMapping)(nil),
+ (*LispAddDelRemoteMappingReply)(nil),
+ (*LispAdjacenciesGet)(nil),
+ (*LispAdjacenciesGetReply)(nil),
+ (*LispEidTableAddDelMap)(nil),
+ (*LispEidTableAddDelMapReply)(nil),
+ (*LispEidTableDetails)(nil),
+ (*LispEidTableDump)(nil),
+ (*LispEidTableMapDetails)(nil),
+ (*LispEidTableMapDump)(nil),
+ (*LispEidTableVniDetails)(nil),
+ (*LispEidTableVniDump)(nil),
+ (*LispEnableDisable)(nil),
+ (*LispEnableDisableReply)(nil),
+ (*LispGetMapRequestItrRlocs)(nil),
+ (*LispGetMapRequestItrRlocsReply)(nil),
+ (*LispLocatorDetails)(nil),
+ (*LispLocatorDump)(nil),
+ (*LispLocatorSetDetails)(nil),
+ (*LispLocatorSetDump)(nil),
+ (*LispMapRegisterEnableDisable)(nil),
+ (*LispMapRegisterEnableDisableReply)(nil),
+ (*LispMapRequestMode)(nil),
+ (*LispMapRequestModeReply)(nil),
+ (*LispMapResolverDetails)(nil),
+ (*LispMapResolverDump)(nil),
+ (*LispMapServerDetails)(nil),
+ (*LispMapServerDump)(nil),
+ (*LispPitrSetLocatorSet)(nil),
+ (*LispPitrSetLocatorSetReply)(nil),
+ (*LispRlocProbeEnableDisable)(nil),
+ (*LispRlocProbeEnableDisableReply)(nil),
+ (*LispUsePetr)(nil),
+ (*LispUsePetrReply)(nil),
+ (*ShowLispMapRegisterState)(nil),
+ (*ShowLispMapRegisterStateReply)(nil),
+ (*ShowLispMapRequestMode)(nil),
+ (*ShowLispMapRequestModeReply)(nil),
+ (*ShowLispPitr)(nil),
+ (*ShowLispPitrReply)(nil),
+ (*ShowLispRlocProbeState)(nil),
+ (*ShowLispRlocProbeStateReply)(nil),
+ (*ShowLispStatus)(nil),
+ (*ShowLispStatusReply)(nil),
+ (*ShowLispUsePetr)(nil),
+ (*ShowLispUsePetrReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/lisp/lisp_rpc.ba.go b/internal/testbinapi/binapi2001/lisp/lisp_rpc.ba.go
new file mode 100644
index 0000000..a8fbddd
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lisp/lisp_rpc.ba.go
@@ -0,0 +1,533 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package lisp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service lisp.
+type RPCService interface {
+ LispAddDelAdjacency(ctx context.Context, in *LispAddDelAdjacency) (*LispAddDelAdjacencyReply, error)
+ LispAddDelLocalEid(ctx context.Context, in *LispAddDelLocalEid) (*LispAddDelLocalEidReply, error)
+ LispAddDelLocator(ctx context.Context, in *LispAddDelLocator) (*LispAddDelLocatorReply, error)
+ LispAddDelLocatorSet(ctx context.Context, in *LispAddDelLocatorSet) (*LispAddDelLocatorSetReply, error)
+ LispAddDelMapRequestItrRlocs(ctx context.Context, in *LispAddDelMapRequestItrRlocs) (*LispAddDelMapRequestItrRlocsReply, error)
+ LispAddDelMapResolver(ctx context.Context, in *LispAddDelMapResolver) (*LispAddDelMapResolverReply, error)
+ LispAddDelMapServer(ctx context.Context, in *LispAddDelMapServer) (*LispAddDelMapServerReply, error)
+ LispAddDelRemoteMapping(ctx context.Context, in *LispAddDelRemoteMapping) (*LispAddDelRemoteMappingReply, error)
+ LispAdjacenciesGet(ctx context.Context, in *LispAdjacenciesGet) (*LispAdjacenciesGetReply, error)
+ LispEidTableAddDelMap(ctx context.Context, in *LispEidTableAddDelMap) (*LispEidTableAddDelMapReply, error)
+ LispEidTableDump(ctx context.Context, in *LispEidTableDump) (RPCService_LispEidTableDumpClient, error)
+ LispEidTableMapDump(ctx context.Context, in *LispEidTableMapDump) (RPCService_LispEidTableMapDumpClient, error)
+ LispEidTableVniDump(ctx context.Context, in *LispEidTableVniDump) (RPCService_LispEidTableVniDumpClient, error)
+ LispEnableDisable(ctx context.Context, in *LispEnableDisable) (*LispEnableDisableReply, error)
+ LispGetMapRequestItrRlocs(ctx context.Context, in *LispGetMapRequestItrRlocs) (*LispGetMapRequestItrRlocsReply, error)
+ LispLocatorDump(ctx context.Context, in *LispLocatorDump) (RPCService_LispLocatorDumpClient, error)
+ LispLocatorSetDump(ctx context.Context, in *LispLocatorSetDump) (RPCService_LispLocatorSetDumpClient, error)
+ LispMapRegisterEnableDisable(ctx context.Context, in *LispMapRegisterEnableDisable) (*LispMapRegisterEnableDisableReply, error)
+ LispMapRequestMode(ctx context.Context, in *LispMapRequestMode) (*LispMapRequestModeReply, error)
+ LispMapResolverDump(ctx context.Context, in *LispMapResolverDump) (RPCService_LispMapResolverDumpClient, error)
+ LispMapServerDump(ctx context.Context, in *LispMapServerDump) (RPCService_LispMapServerDumpClient, error)
+ LispPitrSetLocatorSet(ctx context.Context, in *LispPitrSetLocatorSet) (*LispPitrSetLocatorSetReply, error)
+ LispRlocProbeEnableDisable(ctx context.Context, in *LispRlocProbeEnableDisable) (*LispRlocProbeEnableDisableReply, error)
+ LispUsePetr(ctx context.Context, in *LispUsePetr) (*LispUsePetrReply, error)
+ ShowLispMapRegisterState(ctx context.Context, in *ShowLispMapRegisterState) (*ShowLispMapRegisterStateReply, error)
+ ShowLispMapRequestMode(ctx context.Context, in *ShowLispMapRequestMode) (*ShowLispMapRequestModeReply, error)
+ ShowLispPitr(ctx context.Context, in *ShowLispPitr) (*ShowLispPitrReply, error)
+ ShowLispRlocProbeState(ctx context.Context, in *ShowLispRlocProbeState) (*ShowLispRlocProbeStateReply, error)
+ ShowLispStatus(ctx context.Context, in *ShowLispStatus) (*ShowLispStatusReply, error)
+ ShowLispUsePetr(ctx context.Context, in *ShowLispUsePetr) (*ShowLispUsePetrReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) LispAddDelAdjacency(ctx context.Context, in *LispAddDelAdjacency) (*LispAddDelAdjacencyReply, error) {
+ out := new(LispAddDelAdjacencyReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispAddDelLocalEid(ctx context.Context, in *LispAddDelLocalEid) (*LispAddDelLocalEidReply, error) {
+ out := new(LispAddDelLocalEidReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispAddDelLocator(ctx context.Context, in *LispAddDelLocator) (*LispAddDelLocatorReply, error) {
+ out := new(LispAddDelLocatorReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispAddDelLocatorSet(ctx context.Context, in *LispAddDelLocatorSet) (*LispAddDelLocatorSetReply, error) {
+ out := new(LispAddDelLocatorSetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispAddDelMapRequestItrRlocs(ctx context.Context, in *LispAddDelMapRequestItrRlocs) (*LispAddDelMapRequestItrRlocsReply, error) {
+ out := new(LispAddDelMapRequestItrRlocsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispAddDelMapResolver(ctx context.Context, in *LispAddDelMapResolver) (*LispAddDelMapResolverReply, error) {
+ out := new(LispAddDelMapResolverReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispAddDelMapServer(ctx context.Context, in *LispAddDelMapServer) (*LispAddDelMapServerReply, error) {
+ out := new(LispAddDelMapServerReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispAddDelRemoteMapping(ctx context.Context, in *LispAddDelRemoteMapping) (*LispAddDelRemoteMappingReply, error) {
+ out := new(LispAddDelRemoteMappingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispAdjacenciesGet(ctx context.Context, in *LispAdjacenciesGet) (*LispAdjacenciesGetReply, error) {
+ out := new(LispAdjacenciesGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispEidTableAddDelMap(ctx context.Context, in *LispEidTableAddDelMap) (*LispEidTableAddDelMapReply, error) {
+ out := new(LispEidTableAddDelMapReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispEidTableDump(ctx context.Context, in *LispEidTableDump) (RPCService_LispEidTableDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LispEidTableDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LispEidTableDumpClient interface {
+ Recv() (*LispEidTableDetails, error)
+ api.Stream
+}
+
+type serviceClient_LispEidTableDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LispEidTableDumpClient) Recv() (*LispEidTableDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LispEidTableDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) LispEidTableMapDump(ctx context.Context, in *LispEidTableMapDump) (RPCService_LispEidTableMapDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LispEidTableMapDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LispEidTableMapDumpClient interface {
+ Recv() (*LispEidTableMapDetails, error)
+ api.Stream
+}
+
+type serviceClient_LispEidTableMapDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LispEidTableMapDumpClient) Recv() (*LispEidTableMapDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LispEidTableMapDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) LispEidTableVniDump(ctx context.Context, in *LispEidTableVniDump) (RPCService_LispEidTableVniDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LispEidTableVniDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LispEidTableVniDumpClient interface {
+ Recv() (*LispEidTableVniDetails, error)
+ api.Stream
+}
+
+type serviceClient_LispEidTableVniDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LispEidTableVniDumpClient) Recv() (*LispEidTableVniDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LispEidTableVniDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) LispEnableDisable(ctx context.Context, in *LispEnableDisable) (*LispEnableDisableReply, error) {
+ out := new(LispEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispGetMapRequestItrRlocs(ctx context.Context, in *LispGetMapRequestItrRlocs) (*LispGetMapRequestItrRlocsReply, error) {
+ out := new(LispGetMapRequestItrRlocsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispLocatorDump(ctx context.Context, in *LispLocatorDump) (RPCService_LispLocatorDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LispLocatorDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LispLocatorDumpClient interface {
+ Recv() (*LispLocatorDetails, error)
+ api.Stream
+}
+
+type serviceClient_LispLocatorDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LispLocatorDumpClient) Recv() (*LispLocatorDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LispLocatorDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) LispLocatorSetDump(ctx context.Context, in *LispLocatorSetDump) (RPCService_LispLocatorSetDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LispLocatorSetDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LispLocatorSetDumpClient interface {
+ Recv() (*LispLocatorSetDetails, error)
+ api.Stream
+}
+
+type serviceClient_LispLocatorSetDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LispLocatorSetDumpClient) Recv() (*LispLocatorSetDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LispLocatorSetDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) LispMapRegisterEnableDisable(ctx context.Context, in *LispMapRegisterEnableDisable) (*LispMapRegisterEnableDisableReply, error) {
+ out := new(LispMapRegisterEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispMapRequestMode(ctx context.Context, in *LispMapRequestMode) (*LispMapRequestModeReply, error) {
+ out := new(LispMapRequestModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispMapResolverDump(ctx context.Context, in *LispMapResolverDump) (RPCService_LispMapResolverDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LispMapResolverDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LispMapResolverDumpClient interface {
+ Recv() (*LispMapResolverDetails, error)
+ api.Stream
+}
+
+type serviceClient_LispMapResolverDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LispMapResolverDumpClient) Recv() (*LispMapResolverDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LispMapResolverDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) LispMapServerDump(ctx context.Context, in *LispMapServerDump) (RPCService_LispMapServerDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LispMapServerDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LispMapServerDumpClient interface {
+ Recv() (*LispMapServerDetails, error)
+ api.Stream
+}
+
+type serviceClient_LispMapServerDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LispMapServerDumpClient) Recv() (*LispMapServerDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LispMapServerDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) LispPitrSetLocatorSet(ctx context.Context, in *LispPitrSetLocatorSet) (*LispPitrSetLocatorSetReply, error) {
+ out := new(LispPitrSetLocatorSetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispRlocProbeEnableDisable(ctx context.Context, in *LispRlocProbeEnableDisable) (*LispRlocProbeEnableDisableReply, error) {
+ out := new(LispRlocProbeEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) LispUsePetr(ctx context.Context, in *LispUsePetr) (*LispUsePetrReply, error) {
+ out := new(LispUsePetrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowLispMapRegisterState(ctx context.Context, in *ShowLispMapRegisterState) (*ShowLispMapRegisterStateReply, error) {
+ out := new(ShowLispMapRegisterStateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowLispMapRequestMode(ctx context.Context, in *ShowLispMapRequestMode) (*ShowLispMapRequestModeReply, error) {
+ out := new(ShowLispMapRequestModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowLispPitr(ctx context.Context, in *ShowLispPitr) (*ShowLispPitrReply, error) {
+ out := new(ShowLispPitrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowLispRlocProbeState(ctx context.Context, in *ShowLispRlocProbeState) (*ShowLispRlocProbeStateReply, error) {
+ out := new(ShowLispRlocProbeStateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowLispStatus(ctx context.Context, in *ShowLispStatus) (*ShowLispStatusReply, error) {
+ out := new(ShowLispStatusReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowLispUsePetr(ctx context.Context, in *ShowLispUsePetr) (*ShowLispUsePetrReply, error) {
+ out := new(ShowLispUsePetrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe.ba.go b/internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe.ba.go
new file mode 100644
index 0000000..3dd5ab6
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe.ba.go
@@ -0,0 +1,979 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/lisp_gpe.api.json
+
+// Package lisp_gpe contains generated bindings for API file lisp_gpe.api.
+//
+// Contents:
+// 3 structs
+// 20 messages
+//
+package lisp_gpe
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "lisp_gpe"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x9396c80c
+)
+
+// GpeFwdEntry defines type 'gpe_fwd_entry'.
+type GpeFwdEntry struct {
+ FwdEntryIndex uint32 `binapi:"u32,name=fwd_entry_index" json:"fwd_entry_index,omitempty"`
+ DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ LeidPrefixLen uint8 `binapi:"u8,name=leid_prefix_len" json:"leid_prefix_len,omitempty"`
+ ReidPrefixLen uint8 `binapi:"u8,name=reid_prefix_len" json:"reid_prefix_len,omitempty"`
+ Leid []byte `binapi:"u8[16],name=leid" json:"leid,omitempty"`
+ Reid []byte `binapi:"u8[16],name=reid" json:"reid,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ Action uint8 `binapi:"u8,name=action" json:"action,omitempty"`
+}
+
+// GpeLocator defines type 'gpe_locator'.
+type GpeLocator struct {
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+ Addr []byte `binapi:"u8[16],name=addr" json:"addr,omitempty"`
+}
+
+// GpeNativeFwdRpath defines type 'gpe_native_fwd_rpath'.
+type GpeNativeFwdRpath struct {
+ FibIndex uint32 `binapi:"u32,name=fib_index" json:"fib_index,omitempty"`
+ NhSwIfIndex uint32 `binapi:"u32,name=nh_sw_if_index" json:"nh_sw_if_index,omitempty"`
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ NhAddr []byte `binapi:"u8[16],name=nh_addr" json:"nh_addr,omitempty"`
+}
+
+// GpeAddDelFwdEntry defines message 'gpe_add_del_fwd_entry'.
+type GpeAddDelFwdEntry struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ RmtEid []byte `binapi:"u8[16],name=rmt_eid" json:"rmt_eid,omitempty"`
+ LclEid []byte `binapi:"u8[16],name=lcl_eid" json:"lcl_eid,omitempty"`
+ RmtLen uint8 `binapi:"u8,name=rmt_len" json:"rmt_len,omitempty"`
+ LclLen uint8 `binapi:"u8,name=lcl_len" json:"lcl_len,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"`
+ Action uint8 `binapi:"u8,name=action" json:"action,omitempty"`
+ LocNum uint32 `binapi:"u32,name=loc_num" json:"-"`
+ Locs []GpeLocator `binapi:"gpe_locator[loc_num],name=locs" json:"locs,omitempty"`
+}
+
+func (m *GpeAddDelFwdEntry) Reset() { *m = GpeAddDelFwdEntry{} }
+func (*GpeAddDelFwdEntry) GetMessageName() string { return "gpe_add_del_fwd_entry" }
+func (*GpeAddDelFwdEntry) GetCrcString() string { return "afbf857a" }
+func (*GpeAddDelFwdEntry) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeAddDelFwdEntry) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.EidType
+ size += 1 * 16 // m.RmtEid
+ size += 1 * 16 // m.LclEid
+ size += 1 // m.RmtLen
+ size += 1 // m.LclLen
+ size += 4 // m.Vni
+ size += 4 // m.DpTable
+ size += 1 // m.Action
+ size += 4 // m.LocNum
+ for j1 := 0; j1 < len(m.Locs); j1++ {
+ var s1 GpeLocator
+ _ = s1
+ if j1 < len(m.Locs) {
+ s1 = m.Locs[j1]
+ }
+ size += 1 // s1.IsIP4
+ size += 1 // s1.Weight
+ size += 1 * 16 // s1.Addr
+ }
+ return size
+}
+func (m *GpeAddDelFwdEntry) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.RmtEid, 16)
+ buf.EncodeBytes(m.LclEid, 16)
+ buf.EncodeUint8(m.RmtLen)
+ buf.EncodeUint8(m.LclLen)
+ 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 // Locs
+ if j0 < len(m.Locs) {
+ v0 = m.Locs[j0]
+ }
+ buf.EncodeUint8(v0.IsIP4)
+ buf.EncodeUint8(v0.Weight)
+ buf.EncodeBytes(v0.Addr, 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *GpeAddDelFwdEntry) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.EidType = buf.DecodeUint8()
+ m.RmtEid = make([]byte, 16)
+ copy(m.RmtEid, buf.DecodeBytes(len(m.RmtEid)))
+ m.LclEid = make([]byte, 16)
+ copy(m.LclEid, buf.DecodeBytes(len(m.LclEid)))
+ m.RmtLen = buf.DecodeUint8()
+ m.LclLen = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.DpTable = buf.DecodeUint32()
+ m.Action = buf.DecodeUint8()
+ m.LocNum = buf.DecodeUint32()
+ m.Locs = make([]GpeLocator, m.LocNum)
+ for j0 := 0; j0 < len(m.Locs); j0++ {
+ m.Locs[j0].IsIP4 = buf.DecodeUint8()
+ m.Locs[j0].Weight = buf.DecodeUint8()
+ m.Locs[j0].Addr = make([]byte, 16)
+ copy(m.Locs[j0].Addr, buf.DecodeBytes(len(m.Locs[j0].Addr)))
+ }
+ return nil
+}
+
+// GpeAddDelFwdEntryReply defines message 'gpe_add_del_fwd_entry_reply'.
+type GpeAddDelFwdEntryReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ FwdEntryIndex uint32 `binapi:"u32,name=fwd_entry_index" json:"fwd_entry_index,omitempty"`
+}
+
+func (m *GpeAddDelFwdEntryReply) Reset() { *m = GpeAddDelFwdEntryReply{} }
+func (*GpeAddDelFwdEntryReply) GetMessageName() string { return "gpe_add_del_fwd_entry_reply" }
+func (*GpeAddDelFwdEntryReply) GetCrcString() string { return "efe5f176" }
+func (*GpeAddDelFwdEntryReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeAddDelFwdEntryReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.FwdEntryIndex
+ return size
+}
+func (m *GpeAddDelFwdEntryReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.FwdEntryIndex = buf.DecodeUint32()
+ return nil
+}
+
+// GpeAddDelIface defines message 'gpe_add_del_iface'.
+type GpeAddDelIface struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ IsL2 uint8 `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
+ DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *GpeAddDelIface) Reset() { *m = GpeAddDelIface{} }
+func (*GpeAddDelIface) GetMessageName() string { return "gpe_add_del_iface" }
+func (*GpeAddDelIface) GetCrcString() string { return "42d6b533" }
+func (*GpeAddDelIface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeAddDelIface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.IsL2
+ size += 4 // m.DpTable
+ size += 4 // m.Vni
+ return size
+}
+func (m *GpeAddDelIface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.IsL2)
+ buf.EncodeUint32(m.DpTable)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *GpeAddDelIface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.IsL2 = buf.DecodeUint8()
+ m.DpTable = buf.DecodeUint32()
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// GpeAddDelIfaceReply defines message 'gpe_add_del_iface_reply'.
+type GpeAddDelIfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GpeAddDelIfaceReply) Reset() { *m = GpeAddDelIfaceReply{} }
+func (*GpeAddDelIfaceReply) GetMessageName() string { return "gpe_add_del_iface_reply" }
+func (*GpeAddDelIfaceReply) GetCrcString() string { return "e8d4e804" }
+func (*GpeAddDelIfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeAddDelIfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GpeAddDelIfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GpeAddDelNativeFwdRpath defines message 'gpe_add_del_native_fwd_rpath'.
+type GpeAddDelNativeFwdRpath struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ NhSwIfIndex uint32 `binapi:"u32,name=nh_sw_if_index" json:"nh_sw_if_index,omitempty"`
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ NhAddr []byte `binapi:"u8[16],name=nh_addr" json:"nh_addr,omitempty"`
+}
+
+func (m *GpeAddDelNativeFwdRpath) Reset() { *m = GpeAddDelNativeFwdRpath{} }
+func (*GpeAddDelNativeFwdRpath) GetMessageName() string { return "gpe_add_del_native_fwd_rpath" }
+func (*GpeAddDelNativeFwdRpath) GetCrcString() string { return "bfc42b8f" }
+func (*GpeAddDelNativeFwdRpath) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeAddDelNativeFwdRpath) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.TableID
+ size += 4 // m.NhSwIfIndex
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.NhAddr
+ return size
+}
+func (m *GpeAddDelNativeFwdRpath) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeUint32(m.NhSwIfIndex)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.NhAddr, 16)
+ return buf.Bytes(), nil
+}
+func (m *GpeAddDelNativeFwdRpath) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.TableID = buf.DecodeUint32()
+ m.NhSwIfIndex = buf.DecodeUint32()
+ m.IsIP4 = buf.DecodeUint8()
+ m.NhAddr = make([]byte, 16)
+ copy(m.NhAddr, buf.DecodeBytes(len(m.NhAddr)))
+ return nil
+}
+
+// GpeAddDelNativeFwdRpathReply defines message 'gpe_add_del_native_fwd_rpath_reply'.
+type GpeAddDelNativeFwdRpathReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GpeAddDelNativeFwdRpathReply) Reset() { *m = GpeAddDelNativeFwdRpathReply{} }
+func (*GpeAddDelNativeFwdRpathReply) GetMessageName() string {
+ return "gpe_add_del_native_fwd_rpath_reply"
+}
+func (*GpeAddDelNativeFwdRpathReply) GetCrcString() string { return "e8d4e804" }
+func (*GpeAddDelNativeFwdRpathReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeAddDelNativeFwdRpathReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GpeAddDelNativeFwdRpathReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GpeEnableDisable defines message 'gpe_enable_disable'.
+type GpeEnableDisable struct {
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *GpeEnableDisable) Reset() { *m = GpeEnableDisable{} }
+func (*GpeEnableDisable) GetMessageName() string { return "gpe_enable_disable" }
+func (*GpeEnableDisable) GetCrcString() string { return "eb0e943b" }
+func (*GpeEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEn
+ return size
+}
+func (m *GpeEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *GpeEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// GpeEnableDisableReply defines message 'gpe_enable_disable_reply'.
+type GpeEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GpeEnableDisableReply) Reset() { *m = GpeEnableDisableReply{} }
+func (*GpeEnableDisableReply) GetMessageName() string { return "gpe_enable_disable_reply" }
+func (*GpeEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*GpeEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GpeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// GpeFwdEntriesGet defines message 'gpe_fwd_entries_get'.
+type GpeFwdEntriesGet struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *GpeFwdEntriesGet) Reset() { *m = GpeFwdEntriesGet{} }
+func (*GpeFwdEntriesGet) GetMessageName() string { return "gpe_fwd_entries_get" }
+func (*GpeFwdEntriesGet) GetCrcString() string { return "8d1f2fe9" }
+func (*GpeFwdEntriesGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeFwdEntriesGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ return size
+}
+func (m *GpeFwdEntriesGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *GpeFwdEntriesGet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// GpeFwdEntriesGetReply defines message 'gpe_fwd_entries_get_reply'.
+type GpeFwdEntriesGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ Entries []GpeFwdEntry `binapi:"gpe_fwd_entry[count],name=entries" json:"entries,omitempty"`
+}
+
+func (m *GpeFwdEntriesGetReply) Reset() { *m = GpeFwdEntriesGetReply{} }
+func (*GpeFwdEntriesGetReply) GetMessageName() string { return "gpe_fwd_entries_get_reply" }
+func (*GpeFwdEntriesGetReply) GetCrcString() string { return "07b02c34" }
+func (*GpeFwdEntriesGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeFwdEntriesGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Count
+ for j1 := 0; j1 < len(m.Entries); j1++ {
+ var s1 GpeFwdEntry
+ _ = s1
+ if j1 < len(m.Entries) {
+ s1 = m.Entries[j1]
+ }
+ size += 4 // s1.FwdEntryIndex
+ size += 4 // s1.DpTable
+ size += 1 // s1.EidType
+ size += 1 // s1.LeidPrefixLen
+ size += 1 // s1.ReidPrefixLen
+ size += 1 * 16 // s1.Leid
+ size += 1 * 16 // s1.Reid
+ size += 4 // s1.Vni
+ size += 1 // s1.Action
+ }
+ return size
+}
+func (m *GpeFwdEntriesGetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 // Entries
+ if j0 < len(m.Entries) {
+ v0 = m.Entries[j0]
+ }
+ buf.EncodeUint32(v0.FwdEntryIndex)
+ buf.EncodeUint32(v0.DpTable)
+ buf.EncodeUint8(v0.EidType)
+ buf.EncodeUint8(v0.LeidPrefixLen)
+ buf.EncodeUint8(v0.ReidPrefixLen)
+ buf.EncodeBytes(v0.Leid, 16)
+ buf.EncodeBytes(v0.Reid, 16)
+ 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 = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ 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()
+ m.Entries[j0].EidType = buf.DecodeUint8()
+ m.Entries[j0].LeidPrefixLen = buf.DecodeUint8()
+ m.Entries[j0].ReidPrefixLen = buf.DecodeUint8()
+ m.Entries[j0].Leid = make([]byte, 16)
+ copy(m.Entries[j0].Leid, buf.DecodeBytes(len(m.Entries[j0].Leid)))
+ m.Entries[j0].Reid = make([]byte, 16)
+ copy(m.Entries[j0].Reid, buf.DecodeBytes(len(m.Entries[j0].Reid)))
+ m.Entries[j0].Vni = buf.DecodeUint32()
+ m.Entries[j0].Action = buf.DecodeUint8()
+ }
+ return nil
+}
+
+// GpeFwdEntryPathDetails defines message 'gpe_fwd_entry_path_details'.
+type GpeFwdEntryPathDetails struct {
+ LclLoc GpeLocator `binapi:"gpe_locator,name=lcl_loc" json:"lcl_loc,omitempty"`
+ RmtLoc GpeLocator `binapi:"gpe_locator,name=rmt_loc" json:"rmt_loc,omitempty"`
+}
+
+func (m *GpeFwdEntryPathDetails) Reset() { *m = GpeFwdEntryPathDetails{} }
+func (*GpeFwdEntryPathDetails) GetMessageName() string { return "gpe_fwd_entry_path_details" }
+func (*GpeFwdEntryPathDetails) GetCrcString() string { return "a9bdc1f1" }
+func (*GpeFwdEntryPathDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeFwdEntryPathDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.LclLoc.IsIP4
+ size += 1 // m.LclLoc.Weight
+ size += 1 * 16 // m.LclLoc.Addr
+ size += 1 // m.RmtLoc.IsIP4
+ size += 1 // m.RmtLoc.Weight
+ size += 1 * 16 // m.RmtLoc.Addr
+ return size
+}
+func (m *GpeFwdEntryPathDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.LclLoc.IsIP4)
+ buf.EncodeUint8(m.LclLoc.Weight)
+ buf.EncodeBytes(m.LclLoc.Addr, 16)
+ buf.EncodeUint8(m.RmtLoc.IsIP4)
+ buf.EncodeUint8(m.RmtLoc.Weight)
+ buf.EncodeBytes(m.RmtLoc.Addr, 16)
+ return buf.Bytes(), nil
+}
+func (m *GpeFwdEntryPathDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.LclLoc.IsIP4 = buf.DecodeUint8()
+ m.LclLoc.Weight = buf.DecodeUint8()
+ m.LclLoc.Addr = make([]byte, 16)
+ copy(m.LclLoc.Addr, buf.DecodeBytes(len(m.LclLoc.Addr)))
+ m.RmtLoc.IsIP4 = buf.DecodeUint8()
+ m.RmtLoc.Weight = buf.DecodeUint8()
+ m.RmtLoc.Addr = make([]byte, 16)
+ copy(m.RmtLoc.Addr, buf.DecodeBytes(len(m.RmtLoc.Addr)))
+ return nil
+}
+
+// GpeFwdEntryPathDump defines message 'gpe_fwd_entry_path_dump'.
+type GpeFwdEntryPathDump struct {
+ FwdEntryIndex uint32 `binapi:"u32,name=fwd_entry_index" json:"fwd_entry_index,omitempty"`
+}
+
+func (m *GpeFwdEntryPathDump) Reset() { *m = GpeFwdEntryPathDump{} }
+func (*GpeFwdEntryPathDump) GetMessageName() string { return "gpe_fwd_entry_path_dump" }
+func (*GpeFwdEntryPathDump) GetCrcString() string { return "39bce980" }
+func (*GpeFwdEntryPathDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeFwdEntryPathDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.FwdEntryIndex
+ return size
+}
+func (m *GpeFwdEntryPathDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.FwdEntryIndex)
+ return buf.Bytes(), nil
+}
+func (m *GpeFwdEntryPathDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.FwdEntryIndex = buf.DecodeUint32()
+ return nil
+}
+
+// GpeFwdEntryVnisGet defines message 'gpe_fwd_entry_vnis_get'.
+type GpeFwdEntryVnisGet struct{}
+
+func (m *GpeFwdEntryVnisGet) Reset() { *m = GpeFwdEntryVnisGet{} }
+func (*GpeFwdEntryVnisGet) GetMessageName() string { return "gpe_fwd_entry_vnis_get" }
+func (*GpeFwdEntryVnisGet) GetCrcString() string { return "51077d14" }
+func (*GpeFwdEntryVnisGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeFwdEntryVnisGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GpeFwdEntryVnisGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GpeFwdEntryVnisGet) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GpeFwdEntryVnisGetReply defines message 'gpe_fwd_entry_vnis_get_reply'.
+type GpeFwdEntryVnisGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ Vnis []uint32 `binapi:"u32[count],name=vnis" json:"vnis,omitempty"`
+}
+
+func (m *GpeFwdEntryVnisGetReply) Reset() { *m = GpeFwdEntryVnisGetReply{} }
+func (*GpeFwdEntryVnisGetReply) GetMessageName() string { return "gpe_fwd_entry_vnis_get_reply" }
+func (*GpeFwdEntryVnisGetReply) GetCrcString() string { return "aa70da20" }
+func (*GpeFwdEntryVnisGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeFwdEntryVnisGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *GpeFwdEntryVnisGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.Vnis = make([]uint32, m.Count)
+ for i := 0; i < len(m.Vnis); i++ {
+ m.Vnis[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// GpeGetEncapMode defines message 'gpe_get_encap_mode'.
+type GpeGetEncapMode struct{}
+
+func (m *GpeGetEncapMode) Reset() { *m = GpeGetEncapMode{} }
+func (*GpeGetEncapMode) GetMessageName() string { return "gpe_get_encap_mode" }
+func (*GpeGetEncapMode) GetCrcString() string { return "51077d14" }
+func (*GpeGetEncapMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeGetEncapMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *GpeGetEncapMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *GpeGetEncapMode) Unmarshal(b []byte) error {
+ return nil
+}
+
+// GpeGetEncapModeReply defines message 'gpe_get_encap_mode_reply'.
+type GpeGetEncapModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ EncapMode uint8 `binapi:"u8,name=encap_mode" json:"encap_mode,omitempty"`
+}
+
+func (m *GpeGetEncapModeReply) Reset() { *m = GpeGetEncapModeReply{} }
+func (*GpeGetEncapModeReply) GetMessageName() string { return "gpe_get_encap_mode_reply" }
+func (*GpeGetEncapModeReply) GetCrcString() string { return "36e3f7ca" }
+func (*GpeGetEncapModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeGetEncapModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.EncapMode
+ return size
+}
+func (m *GpeGetEncapModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.EncapMode = buf.DecodeUint8()
+ return nil
+}
+
+// GpeNativeFwdRpathsGet defines message 'gpe_native_fwd_rpaths_get'.
+type GpeNativeFwdRpathsGet struct {
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+}
+
+func (m *GpeNativeFwdRpathsGet) Reset() { *m = GpeNativeFwdRpathsGet{} }
+func (*GpeNativeFwdRpathsGet) GetMessageName() string { return "gpe_native_fwd_rpaths_get" }
+func (*GpeNativeFwdRpathsGet) GetCrcString() string { return "c5e0d91b" }
+func (*GpeNativeFwdRpathsGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeNativeFwdRpathsGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIP4
+ return size
+}
+func (m *GpeNativeFwdRpathsGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIP4)
+ return buf.Bytes(), nil
+}
+func (m *GpeNativeFwdRpathsGet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIP4 = buf.DecodeUint8()
+ return nil
+}
+
+// GpeNativeFwdRpathsGetReply defines message 'gpe_native_fwd_rpaths_get_reply'.
+type GpeNativeFwdRpathsGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ Entries []GpeNativeFwdRpath `binapi:"gpe_native_fwd_rpath[count],name=entries" json:"entries,omitempty"`
+}
+
+func (m *GpeNativeFwdRpathsGetReply) Reset() { *m = GpeNativeFwdRpathsGetReply{} }
+func (*GpeNativeFwdRpathsGetReply) GetMessageName() string { return "gpe_native_fwd_rpaths_get_reply" }
+func (*GpeNativeFwdRpathsGetReply) GetCrcString() string { return "1e4536e3" }
+func (*GpeNativeFwdRpathsGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeNativeFwdRpathsGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Count
+ for j1 := 0; j1 < len(m.Entries); j1++ {
+ var s1 GpeNativeFwdRpath
+ _ = s1
+ if j1 < len(m.Entries) {
+ s1 = m.Entries[j1]
+ }
+ size += 4 // s1.FibIndex
+ size += 4 // s1.NhSwIfIndex
+ size += 1 // s1.IsIP4
+ size += 1 * 16 // s1.NhAddr
+ }
+ return size
+}
+func (m *GpeNativeFwdRpathsGetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 // Entries
+ if j0 < len(m.Entries) {
+ v0 = m.Entries[j0]
+ }
+ buf.EncodeUint32(v0.FibIndex)
+ buf.EncodeUint32(v0.NhSwIfIndex)
+ buf.EncodeUint8(v0.IsIP4)
+ buf.EncodeBytes(v0.NhAddr, 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *GpeNativeFwdRpathsGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.Entries = make([]GpeNativeFwdRpath, m.Count)
+ for j0 := 0; j0 < len(m.Entries); j0++ {
+ m.Entries[j0].FibIndex = buf.DecodeUint32()
+ m.Entries[j0].NhSwIfIndex = buf.DecodeUint32()
+ m.Entries[j0].IsIP4 = buf.DecodeUint8()
+ m.Entries[j0].NhAddr = make([]byte, 16)
+ copy(m.Entries[j0].NhAddr, buf.DecodeBytes(len(m.Entries[j0].NhAddr)))
+ }
+ return nil
+}
+
+// GpeSetEncapMode defines message 'gpe_set_encap_mode'.
+type GpeSetEncapMode struct {
+ Mode uint8 `binapi:"u8,name=mode" json:"mode,omitempty"`
+}
+
+func (m *GpeSetEncapMode) Reset() { *m = GpeSetEncapMode{} }
+func (*GpeSetEncapMode) GetMessageName() string { return "gpe_set_encap_mode" }
+func (*GpeSetEncapMode) GetCrcString() string { return "f3f93ce9" }
+func (*GpeSetEncapMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *GpeSetEncapMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Mode
+ return size
+}
+func (m *GpeSetEncapMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Mode)
+ return buf.Bytes(), nil
+}
+func (m *GpeSetEncapMode) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Mode = buf.DecodeUint8()
+ return nil
+}
+
+// GpeSetEncapModeReply defines message 'gpe_set_encap_mode_reply'.
+type GpeSetEncapModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *GpeSetEncapModeReply) Reset() { *m = GpeSetEncapModeReply{} }
+func (*GpeSetEncapModeReply) GetMessageName() string { return "gpe_set_encap_mode_reply" }
+func (*GpeSetEncapModeReply) GetCrcString() string { return "e8d4e804" }
+func (*GpeSetEncapModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *GpeSetEncapModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *GpeSetEncapModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_lisp_gpe_binapi_init() }
+func file_lisp_gpe_binapi_init() {
+ api.RegisterMessage((*GpeAddDelFwdEntry)(nil), "gpe_add_del_fwd_entry_afbf857a")
+ api.RegisterMessage((*GpeAddDelFwdEntryReply)(nil), "gpe_add_del_fwd_entry_reply_efe5f176")
+ api.RegisterMessage((*GpeAddDelIface)(nil), "gpe_add_del_iface_42d6b533")
+ api.RegisterMessage((*GpeAddDelIfaceReply)(nil), "gpe_add_del_iface_reply_e8d4e804")
+ api.RegisterMessage((*GpeAddDelNativeFwdRpath)(nil), "gpe_add_del_native_fwd_rpath_bfc42b8f")
+ api.RegisterMessage((*GpeAddDelNativeFwdRpathReply)(nil), "gpe_add_del_native_fwd_rpath_reply_e8d4e804")
+ api.RegisterMessage((*GpeEnableDisable)(nil), "gpe_enable_disable_eb0e943b")
+ api.RegisterMessage((*GpeEnableDisableReply)(nil), "gpe_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*GpeFwdEntriesGet)(nil), "gpe_fwd_entries_get_8d1f2fe9")
+ api.RegisterMessage((*GpeFwdEntriesGetReply)(nil), "gpe_fwd_entries_get_reply_07b02c34")
+ api.RegisterMessage((*GpeFwdEntryPathDetails)(nil), "gpe_fwd_entry_path_details_a9bdc1f1")
+ api.RegisterMessage((*GpeFwdEntryPathDump)(nil), "gpe_fwd_entry_path_dump_39bce980")
+ api.RegisterMessage((*GpeFwdEntryVnisGet)(nil), "gpe_fwd_entry_vnis_get_51077d14")
+ api.RegisterMessage((*GpeFwdEntryVnisGetReply)(nil), "gpe_fwd_entry_vnis_get_reply_aa70da20")
+ api.RegisterMessage((*GpeGetEncapMode)(nil), "gpe_get_encap_mode_51077d14")
+ api.RegisterMessage((*GpeGetEncapModeReply)(nil), "gpe_get_encap_mode_reply_36e3f7ca")
+ api.RegisterMessage((*GpeNativeFwdRpathsGet)(nil), "gpe_native_fwd_rpaths_get_c5e0d91b")
+ api.RegisterMessage((*GpeNativeFwdRpathsGetReply)(nil), "gpe_native_fwd_rpaths_get_reply_1e4536e3")
+ api.RegisterMessage((*GpeSetEncapMode)(nil), "gpe_set_encap_mode_f3f93ce9")
+ api.RegisterMessage((*GpeSetEncapModeReply)(nil), "gpe_set_encap_mode_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*GpeAddDelFwdEntry)(nil),
+ (*GpeAddDelFwdEntryReply)(nil),
+ (*GpeAddDelIface)(nil),
+ (*GpeAddDelIfaceReply)(nil),
+ (*GpeAddDelNativeFwdRpath)(nil),
+ (*GpeAddDelNativeFwdRpathReply)(nil),
+ (*GpeEnableDisable)(nil),
+ (*GpeEnableDisableReply)(nil),
+ (*GpeFwdEntriesGet)(nil),
+ (*GpeFwdEntriesGetReply)(nil),
+ (*GpeFwdEntryPathDetails)(nil),
+ (*GpeFwdEntryPathDump)(nil),
+ (*GpeFwdEntryVnisGet)(nil),
+ (*GpeFwdEntryVnisGetReply)(nil),
+ (*GpeGetEncapMode)(nil),
+ (*GpeGetEncapModeReply)(nil),
+ (*GpeNativeFwdRpathsGet)(nil),
+ (*GpeNativeFwdRpathsGetReply)(nil),
+ (*GpeSetEncapMode)(nil),
+ (*GpeSetEncapModeReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe_rpc.ba.go b/internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe_rpc.ba.go
new file mode 100644
index 0000000..e81bf7c
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lisp_gpe/lisp_gpe_rpc.ba.go
@@ -0,0 +1,153 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package lisp_gpe
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service lisp_gpe.
+type RPCService interface {
+ GpeAddDelFwdEntry(ctx context.Context, in *GpeAddDelFwdEntry) (*GpeAddDelFwdEntryReply, error)
+ GpeAddDelIface(ctx context.Context, in *GpeAddDelIface) (*GpeAddDelIfaceReply, error)
+ GpeAddDelNativeFwdRpath(ctx context.Context, in *GpeAddDelNativeFwdRpath) (*GpeAddDelNativeFwdRpathReply, error)
+ GpeEnableDisable(ctx context.Context, in *GpeEnableDisable) (*GpeEnableDisableReply, error)
+ GpeFwdEntriesGet(ctx context.Context, in *GpeFwdEntriesGet) (*GpeFwdEntriesGetReply, error)
+ GpeFwdEntryPathDump(ctx context.Context, in *GpeFwdEntryPathDump) (RPCService_GpeFwdEntryPathDumpClient, error)
+ GpeFwdEntryVnisGet(ctx context.Context, in *GpeFwdEntryVnisGet) (*GpeFwdEntryVnisGetReply, error)
+ GpeGetEncapMode(ctx context.Context, in *GpeGetEncapMode) (*GpeGetEncapModeReply, error)
+ GpeNativeFwdRpathsGet(ctx context.Context, in *GpeNativeFwdRpathsGet) (*GpeNativeFwdRpathsGetReply, error)
+ GpeSetEncapMode(ctx context.Context, in *GpeSetEncapMode) (*GpeSetEncapModeReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) GpeAddDelFwdEntry(ctx context.Context, in *GpeAddDelFwdEntry) (*GpeAddDelFwdEntryReply, error) {
+ out := new(GpeAddDelFwdEntryReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GpeAddDelIface(ctx context.Context, in *GpeAddDelIface) (*GpeAddDelIfaceReply, error) {
+ out := new(GpeAddDelIfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GpeAddDelNativeFwdRpath(ctx context.Context, in *GpeAddDelNativeFwdRpath) (*GpeAddDelNativeFwdRpathReply, error) {
+ out := new(GpeAddDelNativeFwdRpathReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GpeEnableDisable(ctx context.Context, in *GpeEnableDisable) (*GpeEnableDisableReply, error) {
+ out := new(GpeEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GpeFwdEntriesGet(ctx context.Context, in *GpeFwdEntriesGet) (*GpeFwdEntriesGetReply, error) {
+ out := new(GpeFwdEntriesGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GpeFwdEntryPathDump(ctx context.Context, in *GpeFwdEntryPathDump) (RPCService_GpeFwdEntryPathDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_GpeFwdEntryPathDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_GpeFwdEntryPathDumpClient interface {
+ Recv() (*GpeFwdEntryPathDetails, error)
+ api.Stream
+}
+
+type serviceClient_GpeFwdEntryPathDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_GpeFwdEntryPathDumpClient) Recv() (*GpeFwdEntryPathDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *GpeFwdEntryPathDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) GpeFwdEntryVnisGet(ctx context.Context, in *GpeFwdEntryVnisGet) (*GpeFwdEntryVnisGetReply, error) {
+ out := new(GpeFwdEntryVnisGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GpeGetEncapMode(ctx context.Context, in *GpeGetEncapMode) (*GpeGetEncapModeReply, error) {
+ out := new(GpeGetEncapModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GpeNativeFwdRpathsGet(ctx context.Context, in *GpeNativeFwdRpathsGet) (*GpeNativeFwdRpathsGetReply, error) {
+ out := new(GpeNativeFwdRpathsGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) GpeSetEncapMode(ctx context.Context, in *GpeSetEncapMode) (*GpeSetEncapModeReply, error) {
+ out := new(GpeSetEncapModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/lldp/lldp.ba.go b/internal/testbinapi/binapi2001/lldp/lldp.ba.go
new file mode 100644
index 0000000..767087e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lldp/lldp.ba.go
@@ -0,0 +1,212 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/lldp.api.json
+
+// Package lldp contains generated bindings for API file lldp.api.
+//
+// Contents:
+// 4 messages
+//
+package lldp
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "lldp"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xabb21dd0
+)
+
+// LldpConfig defines message 'lldp_config'.
+type LldpConfig struct {
+ SystemName []byte `binapi:"u8[256],name=system_name" json:"system_name,omitempty"`
+ TxHold uint32 `binapi:"u32,name=tx_hold" json:"tx_hold,omitempty"`
+ TxInterval uint32 `binapi:"u32,name=tx_interval" json:"tx_interval,omitempty"`
+}
+
+func (m *LldpConfig) Reset() { *m = LldpConfig{} }
+func (*LldpConfig) GetMessageName() string { return "lldp_config" }
+func (*LldpConfig) GetCrcString() string { return "2410286f" }
+func (*LldpConfig) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *LldpConfig) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 256 // m.SystemName
+ size += 4 // m.TxHold
+ size += 4 // m.TxInterval
+ return size
+}
+func (m *LldpConfig) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.SystemName, 256)
+ buf.EncodeUint32(m.TxHold)
+ buf.EncodeUint32(m.TxInterval)
+ return buf.Bytes(), nil
+}
+func (m *LldpConfig) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SystemName = make([]byte, 256)
+ copy(m.SystemName, buf.DecodeBytes(len(m.SystemName)))
+ m.TxHold = buf.DecodeUint32()
+ m.TxInterval = buf.DecodeUint32()
+ return nil
+}
+
+// LldpConfigReply defines message 'lldp_config_reply'.
+type LldpConfigReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *LldpConfigReply) Reset() { *m = LldpConfigReply{} }
+func (*LldpConfigReply) GetMessageName() string { return "lldp_config_reply" }
+func (*LldpConfigReply) GetCrcString() string { return "e8d4e804" }
+func (*LldpConfigReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *LldpConfigReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *LldpConfigReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceSetLldp defines message 'sw_interface_set_lldp'.
+type SwInterfaceSetLldp struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ PortDesc []byte `binapi:"u8[256],name=port_desc" json:"port_desc,omitempty"`
+ MgmtIP4 []byte `binapi:"u8[4],name=mgmt_ip4" json:"mgmt_ip4,omitempty"`
+ MgmtIP6 []byte `binapi:"u8[16],name=mgmt_ip6" json:"mgmt_ip6,omitempty"`
+ MgmtOid []byte `binapi:"u8[128],name=mgmt_oid" json:"mgmt_oid,omitempty"`
+ Enable uint8 `binapi:"u8,name=enable" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetLldp) Reset() { *m = SwInterfaceSetLldp{} }
+func (*SwInterfaceSetLldp) GetMessageName() string { return "sw_interface_set_lldp" }
+func (*SwInterfaceSetLldp) GetCrcString() string { return "2d85d156" }
+func (*SwInterfaceSetLldp) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetLldp) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 * 256 // m.PortDesc
+ size += 1 * 4 // m.MgmtIP4
+ size += 1 * 16 // m.MgmtIP6
+ size += 1 * 128 // m.MgmtOid
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetLldp) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeBytes(m.PortDesc, 256)
+ buf.EncodeBytes(m.MgmtIP4, 4)
+ buf.EncodeBytes(m.MgmtIP6, 16)
+ buf.EncodeBytes(m.MgmtOid, 128)
+ buf.EncodeUint8(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetLldp) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.PortDesc = make([]byte, 256)
+ copy(m.PortDesc, buf.DecodeBytes(len(m.PortDesc)))
+ m.MgmtIP4 = make([]byte, 4)
+ copy(m.MgmtIP4, buf.DecodeBytes(len(m.MgmtIP4)))
+ m.MgmtIP6 = make([]byte, 16)
+ copy(m.MgmtIP6, buf.DecodeBytes(len(m.MgmtIP6)))
+ m.MgmtOid = make([]byte, 128)
+ copy(m.MgmtOid, buf.DecodeBytes(len(m.MgmtOid)))
+ m.Enable = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceSetLldpReply defines message 'sw_interface_set_lldp_reply'.
+type SwInterfaceSetLldpReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetLldpReply) Reset() { *m = SwInterfaceSetLldpReply{} }
+func (*SwInterfaceSetLldpReply) GetMessageName() string { return "sw_interface_set_lldp_reply" }
+func (*SwInterfaceSetLldpReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetLldpReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetLldpReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetLldpReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_lldp_binapi_init() }
+func file_lldp_binapi_init() {
+ api.RegisterMessage((*LldpConfig)(nil), "lldp_config_2410286f")
+ api.RegisterMessage((*LldpConfigReply)(nil), "lldp_config_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceSetLldp)(nil), "sw_interface_set_lldp_2d85d156")
+ api.RegisterMessage((*SwInterfaceSetLldpReply)(nil), "sw_interface_set_lldp_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*LldpConfig)(nil),
+ (*LldpConfigReply)(nil),
+ (*SwInterfaceSetLldp)(nil),
+ (*SwInterfaceSetLldpReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/lldp/lldp_rpc.ba.go b/internal/testbinapi/binapi2001/lldp/lldp_rpc.ba.go
new file mode 100644
index 0000000..9d5eb85
--- /dev/null
+++ b/internal/testbinapi/binapi2001/lldp/lldp_rpc.ba.go
@@ -0,0 +1,40 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package lldp
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service lldp.
+type RPCService interface {
+ LldpConfig(ctx context.Context, in *LldpConfig) (*LldpConfigReply, error)
+ SwInterfaceSetLldp(ctx context.Context, in *SwInterfaceSetLldp) (*SwInterfaceSetLldpReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) LldpConfig(ctx context.Context, in *LldpConfig) (*LldpConfigReply, error) {
+ out := new(LldpConfigReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwInterfaceSetLldp(ctx context.Context, in *SwInterfaceSetLldp) (*SwInterfaceSetLldpReply, error) {
+ out := new(SwInterfaceSetLldpReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/mactime/mactime.ba.go b/internal/testbinapi/binapi2001/mactime/mactime.ba.go
new file mode 100644
index 0000000..2824cf2
--- /dev/null
+++ b/internal/testbinapi/binapi2001/mactime/mactime.ba.go
@@ -0,0 +1,695 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/mactime.api.json
+
+// Package mactime contains generated bindings for API file mactime.api.
+//
+// Contents:
+// 2 aliases
+// 6 enums
+// 2 structs
+// 7 messages
+//
+package mactime
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "net"
+ "strconv"
+)
+
+// 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 = "mactime"
+ APIVersion = "2.0.0"
+ VersionCrc = 0xd32f01e0
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// MactimeTimeRange defines type 'mactime_time_range'.
+type MactimeTimeRange struct {
+ Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
+ End float64 `binapi:"f64,name=end" json:"end,omitempty"`
+}
+
+// TimeRange defines type 'time_range'.
+type TimeRange struct {
+ Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
+ End float64 `binapi:"f64,name=end" json:"end,omitempty"`
+}
+
+// MactimeAddDelRange defines message 'mactime_add_del_range'.
+type MactimeAddDelRange struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Drop bool `binapi:"bool,name=drop" json:"drop,omitempty"`
+ Allow bool `binapi:"bool,name=allow" json:"allow,omitempty"`
+ AllowQuota uint8 `binapi:"u8,name=allow_quota" json:"allow_quota,omitempty"`
+ NoUDP10001 bool `binapi:"bool,name=no_udp_10001" json:"no_udp_10001,omitempty"`
+ DataQuota uint64 `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ DeviceName string `binapi:"string[64],name=device_name" json:"device_name,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ Ranges []TimeRange `binapi:"time_range[count],name=ranges" json:"ranges,omitempty"`
+}
+
+func (m *MactimeAddDelRange) Reset() { *m = MactimeAddDelRange{} }
+func (*MactimeAddDelRange) GetMessageName() string { return "mactime_add_del_range" }
+func (*MactimeAddDelRange) GetCrcString() string { return "101858ef" }
+func (*MactimeAddDelRange) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MactimeAddDelRange) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Drop
+ size += 1 // m.Allow
+ size += 1 // m.AllowQuota
+ size += 1 // m.NoUDP10001
+ size += 8 // m.DataQuota
+ size += 1 * 6 // m.MacAddress
+ size += 64 // m.DeviceName
+ size += 4 // m.Count
+ for j1 := 0; j1 < len(m.Ranges); j1++ {
+ var s1 TimeRange
+ _ = s1
+ if j1 < len(m.Ranges) {
+ s1 = m.Ranges[j1]
+ }
+ size += 8 // s1.Start
+ size += 8 // s1.End
+ }
+ return size
+}
+func (m *MactimeAddDelRange) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.Drop)
+ buf.EncodeBool(m.Allow)
+ buf.EncodeUint8(m.AllowQuota)
+ buf.EncodeBool(m.NoUDP10001)
+ 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 // Ranges
+ if j0 < len(m.Ranges) {
+ v0 = m.Ranges[j0]
+ }
+ buf.EncodeFloat64(v0.Start)
+ buf.EncodeFloat64(v0.End)
+ }
+ return buf.Bytes(), nil
+}
+func (m *MactimeAddDelRange) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Drop = buf.DecodeBool()
+ m.Allow = buf.DecodeBool()
+ m.AllowQuota = buf.DecodeUint8()
+ m.NoUDP10001 = buf.DecodeBool()
+ m.DataQuota = buf.DecodeUint64()
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ m.DeviceName = buf.DecodeString(64)
+ m.Count = buf.DecodeUint32()
+ m.Ranges = make([]TimeRange, m.Count)
+ for j0 := 0; j0 < len(m.Ranges); j0++ {
+ m.Ranges[j0].Start = buf.DecodeFloat64()
+ m.Ranges[j0].End = buf.DecodeFloat64()
+ }
+ return nil
+}
+
+// MactimeAddDelRangeReply defines message 'mactime_add_del_range_reply'.
+type MactimeAddDelRangeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MactimeAddDelRangeReply) Reset() { *m = MactimeAddDelRangeReply{} }
+func (*MactimeAddDelRangeReply) GetMessageName() string { return "mactime_add_del_range_reply" }
+func (*MactimeAddDelRangeReply) GetCrcString() string { return "e8d4e804" }
+func (*MactimeAddDelRangeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MactimeAddDelRangeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MactimeAddDelRangeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MactimeDetails defines message 'mactime_details'.
+type MactimeDetails struct {
+ PoolIndex uint32 `binapi:"u32,name=pool_index" json:"pool_index,omitempty"`
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ DataQuota uint64 `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
+ DataUsedInRange uint64 `binapi:"u64,name=data_used_in_range" json:"data_used_in_range,omitempty"`
+ Flags uint32 `binapi:"u32,name=flags" json:"flags,omitempty"`
+ DeviceName string `binapi:"string[64],name=device_name" json:"device_name,omitempty"`
+ Nranges uint32 `binapi:"u32,name=nranges" json:"-"`
+ Ranges []MactimeTimeRange `binapi:"mactime_time_range[nranges],name=ranges" json:"ranges,omitempty"`
+}
+
+func (m *MactimeDetails) Reset() { *m = MactimeDetails{} }
+func (*MactimeDetails) GetMessageName() string { return "mactime_details" }
+func (*MactimeDetails) GetCrcString() string { return "44921c06" }
+func (*MactimeDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MactimeDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PoolIndex
+ size += 1 * 6 // m.MacAddress
+ size += 8 // m.DataQuota
+ size += 8 // m.DataUsedInRange
+ size += 4 // m.Flags
+ size += 64 // m.DeviceName
+ size += 4 // m.Nranges
+ for j1 := 0; j1 < len(m.Ranges); j1++ {
+ var s1 MactimeTimeRange
+ _ = s1
+ if j1 < len(m.Ranges) {
+ s1 = m.Ranges[j1]
+ }
+ size += 8 // s1.Start
+ size += 8 // s1.End
+ }
+ return size
+}
+func (m *MactimeDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PoolIndex)
+ buf.EncodeBytes(m.MacAddress[:], 6)
+ 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 // Ranges
+ if j0 < len(m.Ranges) {
+ v0 = m.Ranges[j0]
+ }
+ buf.EncodeFloat64(v0.Start)
+ buf.EncodeFloat64(v0.End)
+ }
+ return buf.Bytes(), nil
+}
+func (m *MactimeDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PoolIndex = buf.DecodeUint32()
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ m.DataQuota = buf.DecodeUint64()
+ m.DataUsedInRange = buf.DecodeUint64()
+ m.Flags = buf.DecodeUint32()
+ m.DeviceName = buf.DecodeString(64)
+ m.Nranges = buf.DecodeUint32()
+ m.Ranges = make([]MactimeTimeRange, m.Nranges)
+ for j0 := 0; j0 < len(m.Ranges); j0++ {
+ m.Ranges[j0].Start = buf.DecodeFloat64()
+ m.Ranges[j0].End = buf.DecodeFloat64()
+ }
+ return nil
+}
+
+// MactimeDump defines message 'mactime_dump'.
+type MactimeDump struct {
+ MyTableEpoch uint32 `binapi:"u32,name=my_table_epoch" json:"my_table_epoch,omitempty"`
+}
+
+func (m *MactimeDump) Reset() { *m = MactimeDump{} }
+func (*MactimeDump) GetMessageName() string { return "mactime_dump" }
+func (*MactimeDump) GetCrcString() string { return "8f454e23" }
+func (*MactimeDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MactimeDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.MyTableEpoch
+ return size
+}
+func (m *MactimeDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.MyTableEpoch)
+ return buf.Bytes(), nil
+}
+func (m *MactimeDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MyTableEpoch = buf.DecodeUint32()
+ return nil
+}
+
+// MactimeDumpReply defines message 'mactime_dump_reply'.
+type MactimeDumpReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ TableEpoch uint32 `binapi:"u32,name=table_epoch" json:"table_epoch,omitempty"`
+}
+
+func (m *MactimeDumpReply) Reset() { *m = MactimeDumpReply{} }
+func (*MactimeDumpReply) GetMessageName() string { return "mactime_dump_reply" }
+func (*MactimeDumpReply) GetCrcString() string { return "49bcc753" }
+func (*MactimeDumpReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MactimeDumpReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.TableEpoch
+ return size
+}
+func (m *MactimeDumpReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.TableEpoch = buf.DecodeUint32()
+ return nil
+}
+
+// MactimeEnableDisable defines message 'mactime_enable_disable'.
+type MactimeEnableDisable struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *MactimeEnableDisable) Reset() { *m = MactimeEnableDisable{} }
+func (*MactimeEnableDisable) GetMessageName() string { return "mactime_enable_disable" }
+func (*MactimeEnableDisable) GetCrcString() string { return "3865946c" }
+func (*MactimeEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MactimeEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *MactimeEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *MactimeEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// MactimeEnableDisableReply defines message 'mactime_enable_disable_reply'.
+type MactimeEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MactimeEnableDisableReply) Reset() { *m = MactimeEnableDisableReply{} }
+func (*MactimeEnableDisableReply) GetMessageName() string { return "mactime_enable_disable_reply" }
+func (*MactimeEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*MactimeEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MactimeEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MactimeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_mactime_binapi_init() }
+func file_mactime_binapi_init() {
+ api.RegisterMessage((*MactimeAddDelRange)(nil), "mactime_add_del_range_101858ef")
+ api.RegisterMessage((*MactimeAddDelRangeReply)(nil), "mactime_add_del_range_reply_e8d4e804")
+ api.RegisterMessage((*MactimeDetails)(nil), "mactime_details_44921c06")
+ api.RegisterMessage((*MactimeDump)(nil), "mactime_dump_8f454e23")
+ api.RegisterMessage((*MactimeDumpReply)(nil), "mactime_dump_reply_49bcc753")
+ api.RegisterMessage((*MactimeEnableDisable)(nil), "mactime_enable_disable_3865946c")
+ api.RegisterMessage((*MactimeEnableDisableReply)(nil), "mactime_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*MactimeAddDelRange)(nil),
+ (*MactimeAddDelRangeReply)(nil),
+ (*MactimeDetails)(nil),
+ (*MactimeDump)(nil),
+ (*MactimeDumpReply)(nil),
+ (*MactimeEnableDisable)(nil),
+ (*MactimeEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/mactime/mactime_rpc.ba.go b/internal/testbinapi/binapi2001/mactime/mactime_rpc.ba.go
new file mode 100644
index 0000000..4e17e54
--- /dev/null
+++ b/internal/testbinapi/binapi2001/mactime/mactime_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package mactime
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service mactime.
+type RPCService interface {
+ MactimeAddDelRange(ctx context.Context, in *MactimeAddDelRange) (*MactimeAddDelRangeReply, error)
+ MactimeDump(ctx context.Context, in *MactimeDump) (RPCService_MactimeDumpClient, error)
+ MactimeEnableDisable(ctx context.Context, in *MactimeEnableDisable) (*MactimeEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) MactimeAddDelRange(ctx context.Context, in *MactimeAddDelRange) (*MactimeAddDelRangeReply, error) {
+ out := new(MactimeAddDelRangeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MactimeDump(ctx context.Context, in *MactimeDump) (RPCService_MactimeDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_MactimeDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_MactimeDumpClient interface {
+ Recv() (*MactimeDetails, error)
+ api.Stream
+}
+
+type serviceClient_MactimeDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MactimeDumpClient) Recv() (*MactimeDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *MactimeDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) MactimeEnableDisable(ctx context.Context, in *MactimeEnableDisable) (*MactimeEnableDisableReply, error) {
+ out := new(MactimeEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/map/map.ba.go b/internal/testbinapi/binapi2001/map/map.ba.go
new file mode 100644
index 0000000..3e132ad
--- /dev/null
+++ b/internal/testbinapi/binapi2001/map/map.ba.go
@@ -0,0 +1,2133 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/map.api.json
+
+// Package maps contains generated bindings for API file map.api.
+//
+// Contents:
+// 6 aliases
+// 10 enums
+// 6 structs
+// 1 union
+// 30 messages
+//
+package maps
+
+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 = "map"
+ APIVersion = "4.1.1"
+ VersionCrc = 0x42c84657
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// MapAddDelRule defines message 'map_add_del_rule'.
+type MapAddDelRule struct {
+ Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ IP6Dst IP6Address `binapi:"ip6_address,name=ip6_dst" json:"ip6_dst,omitempty"`
+ Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"`
+}
+
+func (m *MapAddDelRule) Reset() { *m = MapAddDelRule{} }
+func (*MapAddDelRule) GetMessageName() string { return "map_add_del_rule" }
+func (*MapAddDelRule) GetCrcString() string { return "c65b32f7" }
+func (*MapAddDelRule) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapAddDelRule) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Index
+ size += 1 // m.IsAdd
+ size += 1 * 16 // m.IP6Dst
+ size += 2 // m.Psid
+ return size
+}
+func (m *MapAddDelRule) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Index)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBytes(m.IP6Dst[:], 16)
+ buf.EncodeUint16(m.Psid)
+ return buf.Bytes(), nil
+}
+func (m *MapAddDelRule) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Index = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ copy(m.IP6Dst[:], buf.DecodeBytes(16))
+ m.Psid = buf.DecodeUint16()
+ return nil
+}
+
+// MapAddDelRuleReply defines message 'map_add_del_rule_reply'.
+type MapAddDelRuleReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapAddDelRuleReply) Reset() { *m = MapAddDelRuleReply{} }
+func (*MapAddDelRuleReply) GetMessageName() string { return "map_add_del_rule_reply" }
+func (*MapAddDelRuleReply) GetCrcString() string { return "e8d4e804" }
+func (*MapAddDelRuleReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapAddDelRuleReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapAddDelRuleReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapAddDomain defines message 'map_add_domain'.
+type MapAddDomain struct {
+ IP6Prefix IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"`
+ IP4Prefix IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"`
+ IP6Src IP6Prefix `binapi:"ip6_prefix,name=ip6_src" json:"ip6_src,omitempty"`
+ 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" json:"mtu,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *MapAddDomain) Reset() { *m = MapAddDomain{} }
+func (*MapAddDomain) GetMessageName() string { return "map_add_domain" }
+func (*MapAddDomain) GetCrcString() string { return "7a5a18c9" }
+func (*MapAddDomain) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapAddDomain) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 16 // m.IP6Prefix.Address
+ size += 1 // m.IP6Prefix.Len
+ size += 1 * 4 // m.IP4Prefix.Address
+ size += 1 // m.IP4Prefix.Len
+ size += 1 * 16 // m.IP6Src.Address
+ size += 1 // m.IP6Src.Len
+ size += 1 // m.EaBitsLen
+ size += 1 // m.PsidOffset
+ size += 1 // m.PsidLength
+ size += 2 // m.Mtu
+ size += 64 // m.Tag
+ return size
+}
+func (m *MapAddDomain) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IP6Prefix.Address[:], 16)
+ buf.EncodeUint8(m.IP6Prefix.Len)
+ buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
+ buf.EncodeUint8(m.IP4Prefix.Len)
+ buf.EncodeBytes(m.IP6Src.Address[:], 16)
+ 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
+}
+func (m *MapAddDomain) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16))
+ m.IP6Prefix.Len = buf.DecodeUint8()
+ copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4))
+ m.IP4Prefix.Len = buf.DecodeUint8()
+ copy(m.IP6Src.Address[:], buf.DecodeBytes(16))
+ m.IP6Src.Len = buf.DecodeUint8()
+ m.EaBitsLen = buf.DecodeUint8()
+ m.PsidOffset = buf.DecodeUint8()
+ m.PsidLength = buf.DecodeUint8()
+ m.Mtu = buf.DecodeUint16()
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// MapAddDomainReply defines message 'map_add_domain_reply'.
+type MapAddDomainReply struct {
+ Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapAddDomainReply) Reset() { *m = MapAddDomainReply{} }
+func (*MapAddDomainReply) GetMessageName() string { return "map_add_domain_reply" }
+func (*MapAddDomainReply) GetCrcString() string { return "3e6d4e2c" }
+func (*MapAddDomainReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapAddDomainReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Index
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapAddDomainReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapDelDomain defines message 'map_del_domain'.
+type MapDelDomain struct {
+ Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
+}
+
+func (m *MapDelDomain) Reset() { *m = MapDelDomain{} }
+func (*MapDelDomain) GetMessageName() string { return "map_del_domain" }
+func (*MapDelDomain) GetCrcString() string { return "8ac76db6" }
+func (*MapDelDomain) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapDelDomain) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Index
+ return size
+}
+func (m *MapDelDomain) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Index)
+ return buf.Bytes(), nil
+}
+func (m *MapDelDomain) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Index = buf.DecodeUint32()
+ return nil
+}
+
+// MapDelDomainReply defines message 'map_del_domain_reply'.
+type MapDelDomainReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapDelDomainReply) Reset() { *m = MapDelDomainReply{} }
+func (*MapDelDomainReply) GetMessageName() string { return "map_del_domain_reply" }
+func (*MapDelDomainReply) GetCrcString() string { return "e8d4e804" }
+func (*MapDelDomainReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapDelDomainReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapDelDomainReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapDomainDetails defines message 'map_domain_details'.
+type MapDomainDetails struct {
+ DomainIndex uint32 `binapi:"u32,name=domain_index" json:"domain_index,omitempty"`
+ IP6Prefix IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"`
+ IP4Prefix IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"`
+ IP6Src IP6Prefix `binapi:"ip6_prefix,name=ip6_src" json:"ip6_src,omitempty"`
+ 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"`
+ Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"`
+ Mtu uint16 `binapi:"u16,name=mtu" json:"mtu,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *MapDomainDetails) Reset() { *m = MapDomainDetails{} }
+func (*MapDomainDetails) GetMessageName() string { return "map_domain_details" }
+func (*MapDomainDetails) GetCrcString() string { return "fc1859dd" }
+func (*MapDomainDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapDomainDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.DomainIndex
+ size += 1 * 16 // m.IP6Prefix.Address
+ size += 1 // m.IP6Prefix.Len
+ size += 1 * 4 // m.IP4Prefix.Address
+ size += 1 // m.IP4Prefix.Len
+ size += 1 * 16 // m.IP6Src.Address
+ size += 1 // m.IP6Src.Len
+ size += 1 // m.EaBitsLen
+ size += 1 // m.PsidOffset
+ size += 1 // m.PsidLength
+ size += 1 // m.Flags
+ size += 2 // m.Mtu
+ size += 64 // m.Tag
+ return size
+}
+func (m *MapDomainDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.DomainIndex)
+ buf.EncodeBytes(m.IP6Prefix.Address[:], 16)
+ buf.EncodeUint8(m.IP6Prefix.Len)
+ buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
+ buf.EncodeUint8(m.IP4Prefix.Len)
+ buf.EncodeBytes(m.IP6Src.Address[:], 16)
+ 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
+}
+func (m *MapDomainDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.DomainIndex = buf.DecodeUint32()
+ copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16))
+ m.IP6Prefix.Len = buf.DecodeUint8()
+ copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4))
+ m.IP4Prefix.Len = buf.DecodeUint8()
+ copy(m.IP6Src.Address[:], buf.DecodeBytes(16))
+ m.IP6Src.Len = buf.DecodeUint8()
+ m.EaBitsLen = buf.DecodeUint8()
+ m.PsidOffset = buf.DecodeUint8()
+ m.PsidLength = buf.DecodeUint8()
+ m.Flags = buf.DecodeUint8()
+ m.Mtu = buf.DecodeUint16()
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// MapDomainDump defines message 'map_domain_dump'.
+type MapDomainDump struct{}
+
+func (m *MapDomainDump) Reset() { *m = MapDomainDump{} }
+func (*MapDomainDump) GetMessageName() string { return "map_domain_dump" }
+func (*MapDomainDump) GetCrcString() string { return "51077d14" }
+func (*MapDomainDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapDomainDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *MapDomainDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *MapDomainDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// MapIfEnableDisable defines message 'map_if_enable_disable'.
+type MapIfEnableDisable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsEnable bool `binapi:"bool,name=is_enable" json:"is_enable,omitempty"`
+ IsTranslation bool `binapi:"bool,name=is_translation" json:"is_translation,omitempty"`
+}
+
+func (m *MapIfEnableDisable) Reset() { *m = MapIfEnableDisable{} }
+func (*MapIfEnableDisable) GetMessageName() string { return "map_if_enable_disable" }
+func (*MapIfEnableDisable) GetCrcString() string { return "59bb32f4" }
+func (*MapIfEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapIfEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsEnable
+ size += 1 // m.IsTranslation
+ return size
+}
+func (m *MapIfEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsEnable)
+ buf.EncodeBool(m.IsTranslation)
+ return buf.Bytes(), nil
+}
+func (m *MapIfEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsEnable = buf.DecodeBool()
+ m.IsTranslation = buf.DecodeBool()
+ return nil
+}
+
+// MapIfEnableDisableReply defines message 'map_if_enable_disable_reply'.
+type MapIfEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapIfEnableDisableReply) Reset() { *m = MapIfEnableDisableReply{} }
+func (*MapIfEnableDisableReply) GetMessageName() string { return "map_if_enable_disable_reply" }
+func (*MapIfEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*MapIfEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapIfEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapIfEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapParamAddDelPreResolve defines message 'map_param_add_del_pre_resolve'.
+type MapParamAddDelPreResolve struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ IP4NhAddress IP4Address `binapi:"ip4_address,name=ip4_nh_address" json:"ip4_nh_address,omitempty"`
+ IP6NhAddress IP6Address `binapi:"ip6_address,name=ip6_nh_address" json:"ip6_nh_address,omitempty"`
+}
+
+func (m *MapParamAddDelPreResolve) Reset() { *m = MapParamAddDelPreResolve{} }
+func (*MapParamAddDelPreResolve) GetMessageName() string { return "map_param_add_del_pre_resolve" }
+func (*MapParamAddDelPreResolve) GetCrcString() string { return "17008c66" }
+func (*MapParamAddDelPreResolve) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapParamAddDelPreResolve) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 4 // m.IP4NhAddress
+ size += 1 * 16 // m.IP6NhAddress
+ return size
+}
+func (m *MapParamAddDelPreResolve) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBytes(m.IP4NhAddress[:], 4)
+ buf.EncodeBytes(m.IP6NhAddress[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *MapParamAddDelPreResolve) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ copy(m.IP4NhAddress[:], buf.DecodeBytes(4))
+ copy(m.IP6NhAddress[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// MapParamAddDelPreResolveReply defines message 'map_param_add_del_pre_resolve_reply'.
+type MapParamAddDelPreResolveReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapParamAddDelPreResolveReply) Reset() { *m = MapParamAddDelPreResolveReply{} }
+func (*MapParamAddDelPreResolveReply) GetMessageName() string {
+ return "map_param_add_del_pre_resolve_reply"
+}
+func (*MapParamAddDelPreResolveReply) GetCrcString() string { return "e8d4e804" }
+func (*MapParamAddDelPreResolveReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapParamAddDelPreResolveReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapParamAddDelPreResolveReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapParamGet defines message 'map_param_get'.
+type MapParamGet struct{}
+
+func (m *MapParamGet) Reset() { *m = MapParamGet{} }
+func (*MapParamGet) GetMessageName() string { return "map_param_get" }
+func (*MapParamGet) GetCrcString() string { return "51077d14" }
+func (*MapParamGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapParamGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *MapParamGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *MapParamGet) Unmarshal(b []byte) error {
+ return nil
+}
+
+// MapParamGetReply defines message 'map_param_get_reply'.
+type MapParamGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ FragInner uint8 `binapi:"u8,name=frag_inner" json:"frag_inner,omitempty"`
+ FragIgnoreDf uint8 `binapi:"u8,name=frag_ignore_df" json:"frag_ignore_df,omitempty"`
+ ICMPIP4ErrRelaySrc IP4Address `binapi:"ip4_address,name=icmp_ip4_err_relay_src" json:"icmp_ip4_err_relay_src,omitempty"`
+ ICMP6EnableUnreachable bool `binapi:"bool,name=icmp6_enable_unreachable" json:"icmp6_enable_unreachable,omitempty"`
+ IP4NhAddress IP4Address `binapi:"ip4_address,name=ip4_nh_address" json:"ip4_nh_address,omitempty"`
+ IP6NhAddress IP6Address `binapi:"ip6_address,name=ip6_nh_address" json:"ip6_nh_address,omitempty"`
+ IP4LifetimeMs uint16 `binapi:"u16,name=ip4_lifetime_ms" json:"ip4_lifetime_ms,omitempty"`
+ IP4PoolSize uint16 `binapi:"u16,name=ip4_pool_size" json:"ip4_pool_size,omitempty"`
+ IP4Buffers uint32 `binapi:"u32,name=ip4_buffers" json:"ip4_buffers,omitempty"`
+ IP4HtRatio float64 `binapi:"f64,name=ip4_ht_ratio" json:"ip4_ht_ratio,omitempty"`
+ SecCheckEnable bool `binapi:"bool,name=sec_check_enable" json:"sec_check_enable,omitempty"`
+ SecCheckFragments bool `binapi:"bool,name=sec_check_fragments" json:"sec_check_fragments,omitempty"`
+ TcCopy bool `binapi:"bool,name=tc_copy" json:"tc_copy,omitempty"`
+ TcClass uint8 `binapi:"u8,name=tc_class" json:"tc_class,omitempty"`
+}
+
+func (m *MapParamGetReply) Reset() { *m = MapParamGetReply{} }
+func (*MapParamGetReply) GetMessageName() string { return "map_param_get_reply" }
+func (*MapParamGetReply) GetCrcString() string { return "28092156" }
+func (*MapParamGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapParamGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.FragInner
+ size += 1 // m.FragIgnoreDf
+ size += 1 * 4 // m.ICMPIP4ErrRelaySrc
+ size += 1 // m.ICMP6EnableUnreachable
+ size += 1 * 4 // m.IP4NhAddress
+ size += 1 * 16 // m.IP6NhAddress
+ size += 2 // m.IP4LifetimeMs
+ size += 2 // m.IP4PoolSize
+ size += 4 // m.IP4Buffers
+ size += 8 // m.IP4HtRatio
+ size += 1 // m.SecCheckEnable
+ size += 1 // m.SecCheckFragments
+ size += 1 // m.TcCopy
+ size += 1 // m.TcClass
+ return size
+}
+func (m *MapParamGetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(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(m.TcClass)
+ return buf.Bytes(), nil
+}
+func (m *MapParamGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.FragInner = buf.DecodeUint8()
+ m.FragIgnoreDf = buf.DecodeUint8()
+ copy(m.ICMPIP4ErrRelaySrc[:], buf.DecodeBytes(4))
+ m.ICMP6EnableUnreachable = buf.DecodeBool()
+ copy(m.IP4NhAddress[:], buf.DecodeBytes(4))
+ copy(m.IP6NhAddress[:], buf.DecodeBytes(16))
+ m.IP4LifetimeMs = buf.DecodeUint16()
+ m.IP4PoolSize = buf.DecodeUint16()
+ m.IP4Buffers = buf.DecodeUint32()
+ m.IP4HtRatio = buf.DecodeFloat64()
+ m.SecCheckEnable = buf.DecodeBool()
+ m.SecCheckFragments = buf.DecodeBool()
+ m.TcCopy = buf.DecodeBool()
+ m.TcClass = buf.DecodeUint8()
+ return nil
+}
+
+// MapParamSetFragmentation defines message 'map_param_set_fragmentation'.
+type MapParamSetFragmentation struct {
+ Inner bool `binapi:"bool,name=inner" json:"inner,omitempty"`
+ IgnoreDf bool `binapi:"bool,name=ignore_df" json:"ignore_df,omitempty"`
+}
+
+func (m *MapParamSetFragmentation) Reset() { *m = MapParamSetFragmentation{} }
+func (*MapParamSetFragmentation) GetMessageName() string { return "map_param_set_fragmentation" }
+func (*MapParamSetFragmentation) GetCrcString() string { return "9ff54d90" }
+func (*MapParamSetFragmentation) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapParamSetFragmentation) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Inner
+ size += 1 // m.IgnoreDf
+ return size
+}
+func (m *MapParamSetFragmentation) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Inner)
+ buf.EncodeBool(m.IgnoreDf)
+ return buf.Bytes(), nil
+}
+func (m *MapParamSetFragmentation) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Inner = buf.DecodeBool()
+ m.IgnoreDf = buf.DecodeBool()
+ return nil
+}
+
+// MapParamSetFragmentationReply defines message 'map_param_set_fragmentation_reply'.
+type MapParamSetFragmentationReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapParamSetFragmentationReply) Reset() { *m = MapParamSetFragmentationReply{} }
+func (*MapParamSetFragmentationReply) GetMessageName() string {
+ return "map_param_set_fragmentation_reply"
+}
+func (*MapParamSetFragmentationReply) GetCrcString() string { return "e8d4e804" }
+func (*MapParamSetFragmentationReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapParamSetFragmentationReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapParamSetFragmentationReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapParamSetICMP defines message 'map_param_set_icmp'.
+type MapParamSetICMP struct {
+ IP4ErrRelaySrc IP4Address `binapi:"ip4_address,name=ip4_err_relay_src" json:"ip4_err_relay_src,omitempty"`
+}
+
+func (m *MapParamSetICMP) Reset() { *m = MapParamSetICMP{} }
+func (*MapParamSetICMP) GetMessageName() string { return "map_param_set_icmp" }
+func (*MapParamSetICMP) GetCrcString() string { return "58210cbf" }
+func (*MapParamSetICMP) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapParamSetICMP) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.IP4ErrRelaySrc
+ return size
+}
+func (m *MapParamSetICMP) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IP4ErrRelaySrc[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *MapParamSetICMP) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IP4ErrRelaySrc[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// MapParamSetICMP6 defines message 'map_param_set_icmp6'.
+type MapParamSetICMP6 struct {
+ EnableUnreachable bool `binapi:"bool,name=enable_unreachable" json:"enable_unreachable,omitempty"`
+}
+
+func (m *MapParamSetICMP6) Reset() { *m = MapParamSetICMP6{} }
+func (*MapParamSetICMP6) GetMessageName() string { return "map_param_set_icmp6" }
+func (*MapParamSetICMP6) GetCrcString() string { return "5d01f8c1" }
+func (*MapParamSetICMP6) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapParamSetICMP6) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableUnreachable
+ return size
+}
+func (m *MapParamSetICMP6) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableUnreachable)
+ return buf.Bytes(), nil
+}
+func (m *MapParamSetICMP6) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableUnreachable = buf.DecodeBool()
+ return nil
+}
+
+// MapParamSetICMP6Reply defines message 'map_param_set_icmp6_reply'.
+type MapParamSetICMP6Reply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapParamSetICMP6Reply) Reset() { *m = MapParamSetICMP6Reply{} }
+func (*MapParamSetICMP6Reply) GetMessageName() string { return "map_param_set_icmp6_reply" }
+func (*MapParamSetICMP6Reply) GetCrcString() string { return "e8d4e804" }
+func (*MapParamSetICMP6Reply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapParamSetICMP6Reply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapParamSetICMP6Reply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapParamSetICMPReply defines message 'map_param_set_icmp_reply'.
+type MapParamSetICMPReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapParamSetICMPReply) Reset() { *m = MapParamSetICMPReply{} }
+func (*MapParamSetICMPReply) GetMessageName() string { return "map_param_set_icmp_reply" }
+func (*MapParamSetICMPReply) GetCrcString() string { return "e8d4e804" }
+func (*MapParamSetICMPReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapParamSetICMPReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapParamSetICMPReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapParamSetSecurityCheck defines message 'map_param_set_security_check'.
+type MapParamSetSecurityCheck struct {
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+ Fragments bool `binapi:"bool,name=fragments" json:"fragments,omitempty"`
+}
+
+func (m *MapParamSetSecurityCheck) Reset() { *m = MapParamSetSecurityCheck{} }
+func (*MapParamSetSecurityCheck) GetMessageName() string { return "map_param_set_security_check" }
+func (*MapParamSetSecurityCheck) GetCrcString() string { return "6abe9836" }
+func (*MapParamSetSecurityCheck) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapParamSetSecurityCheck) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ size += 1 // m.Fragments
+ return size
+}
+func (m *MapParamSetSecurityCheck) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ buf.EncodeBool(m.Fragments)
+ return buf.Bytes(), nil
+}
+func (m *MapParamSetSecurityCheck) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ m.Fragments = buf.DecodeBool()
+ return nil
+}
+
+// MapParamSetSecurityCheckReply defines message 'map_param_set_security_check_reply'.
+type MapParamSetSecurityCheckReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapParamSetSecurityCheckReply) Reset() { *m = MapParamSetSecurityCheckReply{} }
+func (*MapParamSetSecurityCheckReply) GetMessageName() string {
+ return "map_param_set_security_check_reply"
+}
+func (*MapParamSetSecurityCheckReply) GetCrcString() string { return "e8d4e804" }
+func (*MapParamSetSecurityCheckReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapParamSetSecurityCheckReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapParamSetSecurityCheckReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapParamSetTCP defines message 'map_param_set_tcp'.
+type MapParamSetTCP struct {
+ TCPMss uint16 `binapi:"u16,name=tcp_mss" json:"tcp_mss,omitempty"`
+}
+
+func (m *MapParamSetTCP) Reset() { *m = MapParamSetTCP{} }
+func (*MapParamSetTCP) GetMessageName() string { return "map_param_set_tcp" }
+func (*MapParamSetTCP) GetCrcString() string { return "87a825d9" }
+func (*MapParamSetTCP) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapParamSetTCP) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.TCPMss
+ return size
+}
+func (m *MapParamSetTCP) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.TCPMss)
+ return buf.Bytes(), nil
+}
+func (m *MapParamSetTCP) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TCPMss = buf.DecodeUint16()
+ return nil
+}
+
+// MapParamSetTCPReply defines message 'map_param_set_tcp_reply'.
+type MapParamSetTCPReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapParamSetTCPReply) Reset() { *m = MapParamSetTCPReply{} }
+func (*MapParamSetTCPReply) GetMessageName() string { return "map_param_set_tcp_reply" }
+func (*MapParamSetTCPReply) GetCrcString() string { return "e8d4e804" }
+func (*MapParamSetTCPReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapParamSetTCPReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapParamSetTCPReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapParamSetTrafficClass defines message 'map_param_set_traffic_class'.
+type MapParamSetTrafficClass struct {
+ Copy bool `binapi:"bool,name=copy" json:"copy,omitempty"`
+ TcClass uint8 `binapi:"u8,name=tc_class" json:"tc_class,omitempty"`
+}
+
+func (m *MapParamSetTrafficClass) Reset() { *m = MapParamSetTrafficClass{} }
+func (*MapParamSetTrafficClass) GetMessageName() string { return "map_param_set_traffic_class" }
+func (*MapParamSetTrafficClass) GetCrcString() string { return "9cac455c" }
+func (*MapParamSetTrafficClass) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapParamSetTrafficClass) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Copy
+ size += 1 // m.TcClass
+ return size
+}
+func (m *MapParamSetTrafficClass) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Copy)
+ buf.EncodeUint8(m.TcClass)
+ return buf.Bytes(), nil
+}
+func (m *MapParamSetTrafficClass) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Copy = buf.DecodeBool()
+ m.TcClass = buf.DecodeUint8()
+ return nil
+}
+
+// MapParamSetTrafficClassReply defines message 'map_param_set_traffic_class_reply'.
+type MapParamSetTrafficClassReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapParamSetTrafficClassReply) Reset() { *m = MapParamSetTrafficClassReply{} }
+func (*MapParamSetTrafficClassReply) GetMessageName() string {
+ return "map_param_set_traffic_class_reply"
+}
+func (*MapParamSetTrafficClassReply) GetCrcString() string { return "e8d4e804" }
+func (*MapParamSetTrafficClassReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapParamSetTrafficClassReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapParamSetTrafficClassReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MapRuleDetails defines message 'map_rule_details'.
+type MapRuleDetails struct {
+ IP6Dst IP6Address `binapi:"ip6_address,name=ip6_dst" json:"ip6_dst,omitempty"`
+ Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"`
+}
+
+func (m *MapRuleDetails) Reset() { *m = MapRuleDetails{} }
+func (*MapRuleDetails) GetMessageName() string { return "map_rule_details" }
+func (*MapRuleDetails) GetCrcString() string { return "c7cbeea5" }
+func (*MapRuleDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapRuleDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 16 // m.IP6Dst
+ size += 2 // m.Psid
+ return size
+}
+func (m *MapRuleDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IP6Dst[:], 16)
+ buf.EncodeUint16(m.Psid)
+ return buf.Bytes(), nil
+}
+func (m *MapRuleDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IP6Dst[:], buf.DecodeBytes(16))
+ m.Psid = buf.DecodeUint16()
+ return nil
+}
+
+// MapRuleDump defines message 'map_rule_dump'.
+type MapRuleDump struct {
+ DomainIndex uint32 `binapi:"u32,name=domain_index" json:"domain_index,omitempty"`
+}
+
+func (m *MapRuleDump) Reset() { *m = MapRuleDump{} }
+func (*MapRuleDump) GetMessageName() string { return "map_rule_dump" }
+func (*MapRuleDump) GetCrcString() string { return "e43e6ff6" }
+func (*MapRuleDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapRuleDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.DomainIndex
+ return size
+}
+func (m *MapRuleDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.DomainIndex)
+ return buf.Bytes(), nil
+}
+func (m *MapRuleDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.DomainIndex = buf.DecodeUint32()
+ return nil
+}
+
+// MapSummaryStats defines message 'map_summary_stats'.
+type MapSummaryStats struct{}
+
+func (m *MapSummaryStats) Reset() { *m = MapSummaryStats{} }
+func (*MapSummaryStats) GetMessageName() string { return "map_summary_stats" }
+func (*MapSummaryStats) GetCrcString() string { return "51077d14" }
+func (*MapSummaryStats) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapSummaryStats) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *MapSummaryStats) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *MapSummaryStats) Unmarshal(b []byte) error {
+ return nil
+}
+
+// MapSummaryStatsReply defines message 'map_summary_stats_reply'.
+type MapSummaryStatsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ TotalBindings uint64 `binapi:"u64,name=total_bindings" json:"total_bindings,omitempty"`
+ TotalPkts []uint64 `binapi:"u64[2],name=total_pkts" json:"total_pkts,omitempty"`
+ TotalBytes []uint64 `binapi:"u64[2],name=total_bytes" json:"total_bytes,omitempty"`
+ TotalIP4Fragments uint64 `binapi:"u64,name=total_ip4_fragments" json:"total_ip4_fragments,omitempty"`
+ TotalSecurityCheck []uint64 `binapi:"u64[2],name=total_security_check" json:"total_security_check,omitempty"`
+}
+
+func (m *MapSummaryStatsReply) Reset() { *m = MapSummaryStatsReply{} }
+func (*MapSummaryStatsReply) GetMessageName() string { return "map_summary_stats_reply" }
+func (*MapSummaryStatsReply) GetCrcString() string { return "0e4ace0e" }
+func (*MapSummaryStatsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapSummaryStatsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 8 // m.TotalBindings
+ size += 8 * 2 // m.TotalPkts
+ size += 8 * 2 // m.TotalBytes
+ size += 8 // m.TotalIP4Fragments
+ size += 8 * 2 // m.TotalSecurityCheck
+ return size
+}
+func (m *MapSummaryStatsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(x)
+ }
+ for i := 0; i < 2; i++ {
+ var x uint64
+ if i < len(m.TotalBytes) {
+ x = uint64(m.TotalBytes[i])
+ }
+ buf.EncodeUint64(x)
+ }
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *MapSummaryStatsReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.TotalBindings = buf.DecodeUint64()
+ m.TotalPkts = make([]uint64, 2)
+ for i := 0; i < len(m.TotalPkts); i++ {
+ m.TotalPkts[i] = buf.DecodeUint64()
+ }
+ m.TotalBytes = make([]uint64, 2)
+ for i := 0; i < len(m.TotalBytes); i++ {
+ m.TotalBytes[i] = buf.DecodeUint64()
+ }
+ m.TotalIP4Fragments = buf.DecodeUint64()
+ m.TotalSecurityCheck = make([]uint64, 2)
+ for i := 0; i < len(m.TotalSecurityCheck); i++ {
+ m.TotalSecurityCheck[i] = buf.DecodeUint64()
+ }
+ return nil
+}
+
+func init() { file_maps_binapi_init() }
+func file_maps_binapi_init() {
+ api.RegisterMessage((*MapAddDelRule)(nil), "map_add_del_rule_c65b32f7")
+ api.RegisterMessage((*MapAddDelRuleReply)(nil), "map_add_del_rule_reply_e8d4e804")
+ api.RegisterMessage((*MapAddDomain)(nil), "map_add_domain_7a5a18c9")
+ api.RegisterMessage((*MapAddDomainReply)(nil), "map_add_domain_reply_3e6d4e2c")
+ api.RegisterMessage((*MapDelDomain)(nil), "map_del_domain_8ac76db6")
+ api.RegisterMessage((*MapDelDomainReply)(nil), "map_del_domain_reply_e8d4e804")
+ api.RegisterMessage((*MapDomainDetails)(nil), "map_domain_details_fc1859dd")
+ api.RegisterMessage((*MapDomainDump)(nil), "map_domain_dump_51077d14")
+ api.RegisterMessage((*MapIfEnableDisable)(nil), "map_if_enable_disable_59bb32f4")
+ api.RegisterMessage((*MapIfEnableDisableReply)(nil), "map_if_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*MapParamAddDelPreResolve)(nil), "map_param_add_del_pre_resolve_17008c66")
+ api.RegisterMessage((*MapParamAddDelPreResolveReply)(nil), "map_param_add_del_pre_resolve_reply_e8d4e804")
+ api.RegisterMessage((*MapParamGet)(nil), "map_param_get_51077d14")
+ api.RegisterMessage((*MapParamGetReply)(nil), "map_param_get_reply_28092156")
+ api.RegisterMessage((*MapParamSetFragmentation)(nil), "map_param_set_fragmentation_9ff54d90")
+ api.RegisterMessage((*MapParamSetFragmentationReply)(nil), "map_param_set_fragmentation_reply_e8d4e804")
+ api.RegisterMessage((*MapParamSetICMP)(nil), "map_param_set_icmp_58210cbf")
+ api.RegisterMessage((*MapParamSetICMP6)(nil), "map_param_set_icmp6_5d01f8c1")
+ api.RegisterMessage((*MapParamSetICMP6Reply)(nil), "map_param_set_icmp6_reply_e8d4e804")
+ api.RegisterMessage((*MapParamSetICMPReply)(nil), "map_param_set_icmp_reply_e8d4e804")
+ api.RegisterMessage((*MapParamSetSecurityCheck)(nil), "map_param_set_security_check_6abe9836")
+ api.RegisterMessage((*MapParamSetSecurityCheckReply)(nil), "map_param_set_security_check_reply_e8d4e804")
+ api.RegisterMessage((*MapParamSetTCP)(nil), "map_param_set_tcp_87a825d9")
+ api.RegisterMessage((*MapParamSetTCPReply)(nil), "map_param_set_tcp_reply_e8d4e804")
+ api.RegisterMessage((*MapParamSetTrafficClass)(nil), "map_param_set_traffic_class_9cac455c")
+ api.RegisterMessage((*MapParamSetTrafficClassReply)(nil), "map_param_set_traffic_class_reply_e8d4e804")
+ api.RegisterMessage((*MapRuleDetails)(nil), "map_rule_details_c7cbeea5")
+ api.RegisterMessage((*MapRuleDump)(nil), "map_rule_dump_e43e6ff6")
+ api.RegisterMessage((*MapSummaryStats)(nil), "map_summary_stats_51077d14")
+ api.RegisterMessage((*MapSummaryStatsReply)(nil), "map_summary_stats_reply_0e4ace0e")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*MapAddDelRule)(nil),
+ (*MapAddDelRuleReply)(nil),
+ (*MapAddDomain)(nil),
+ (*MapAddDomainReply)(nil),
+ (*MapDelDomain)(nil),
+ (*MapDelDomainReply)(nil),
+ (*MapDomainDetails)(nil),
+ (*MapDomainDump)(nil),
+ (*MapIfEnableDisable)(nil),
+ (*MapIfEnableDisableReply)(nil),
+ (*MapParamAddDelPreResolve)(nil),
+ (*MapParamAddDelPreResolveReply)(nil),
+ (*MapParamGet)(nil),
+ (*MapParamGetReply)(nil),
+ (*MapParamSetFragmentation)(nil),
+ (*MapParamSetFragmentationReply)(nil),
+ (*MapParamSetICMP)(nil),
+ (*MapParamSetICMP6)(nil),
+ (*MapParamSetICMP6Reply)(nil),
+ (*MapParamSetICMPReply)(nil),
+ (*MapParamSetSecurityCheck)(nil),
+ (*MapParamSetSecurityCheckReply)(nil),
+ (*MapParamSetTCP)(nil),
+ (*MapParamSetTCPReply)(nil),
+ (*MapParamSetTrafficClass)(nil),
+ (*MapParamSetTrafficClassReply)(nil),
+ (*MapRuleDetails)(nil),
+ (*MapRuleDump)(nil),
+ (*MapSummaryStats)(nil),
+ (*MapSummaryStatsReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/map/map_rpc.ba.go b/internal/testbinapi/binapi2001/map/map_rpc.ba.go
new file mode 100644
index 0000000..2aa851c
--- /dev/null
+++ b/internal/testbinapi/binapi2001/map/map_rpc.ba.go
@@ -0,0 +1,233 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package maps
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service map.
+type RPCService interface {
+ MapAddDelRule(ctx context.Context, in *MapAddDelRule) (*MapAddDelRuleReply, error)
+ MapAddDomain(ctx context.Context, in *MapAddDomain) (*MapAddDomainReply, error)
+ MapDelDomain(ctx context.Context, in *MapDelDomain) (*MapDelDomainReply, error)
+ MapDomainDump(ctx context.Context, in *MapDomainDump) (RPCService_MapDomainDumpClient, error)
+ MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error)
+ MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error)
+ MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error)
+ MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error)
+ MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error)
+ MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error)
+ MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error)
+ MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error)
+ MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error)
+ MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error)
+ MapSummaryStats(ctx context.Context, in *MapSummaryStats) (*MapSummaryStatsReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) MapAddDelRule(ctx context.Context, in *MapAddDelRule) (*MapAddDelRuleReply, error) {
+ out := new(MapAddDelRuleReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapAddDomain(ctx context.Context, in *MapAddDomain) (*MapAddDomainReply, error) {
+ out := new(MapAddDomainReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapDelDomain(ctx context.Context, in *MapDelDomain) (*MapDelDomainReply, error) {
+ out := new(MapDelDomainReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapDomainDump(ctx context.Context, in *MapDomainDump) (RPCService_MapDomainDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_MapDomainDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_MapDomainDumpClient interface {
+ Recv() (*MapDomainDetails, error)
+ api.Stream
+}
+
+type serviceClient_MapDomainDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MapDomainDumpClient) Recv() (*MapDomainDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *MapDomainDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error) {
+ out := new(MapIfEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error) {
+ out := new(MapParamAddDelPreResolveReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error) {
+ out := new(MapParamGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error) {
+ out := new(MapParamSetFragmentationReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error) {
+ out := new(MapParamSetICMPReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error) {
+ out := new(MapParamSetICMP6Reply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error) {
+ out := new(MapParamSetSecurityCheckReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error) {
+ out := new(MapParamSetTCPReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error) {
+ out := new(MapParamSetTrafficClassReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_MapRuleDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_MapRuleDumpClient interface {
+ Recv() (*MapRuleDetails, error)
+ api.Stream
+}
+
+type serviceClient_MapRuleDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MapRuleDumpClient) Recv() (*MapRuleDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *MapRuleDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) MapSummaryStats(ctx context.Context, in *MapSummaryStats) (*MapSummaryStatsReply, error) {
+ out := new(MapSummaryStatsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/mdata/mdata.ba.go b/internal/testbinapi/binapi2001/mdata/mdata.ba.go
new file mode 100644
index 0000000..3a79b3e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/mdata/mdata.ba.go
@@ -0,0 +1,366 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/mdata.api.json
+
+// Package mdata contains generated bindings for API file mdata.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 2 messages
+//
+package mdata
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "mdata"
+ APIVersion = "0.1.0"
+ VersionCrc = 0x68055b0c
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// MdataEnableDisable defines message 'mdata_enable_disable'.
+type MdataEnableDisable struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+}
+
+func (m *MdataEnableDisable) Reset() { *m = MdataEnableDisable{} }
+func (*MdataEnableDisable) GetMessageName() string { return "mdata_enable_disable" }
+func (*MdataEnableDisable) GetCrcString() string { return "2e7b47df" }
+func (*MdataEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MdataEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ return size
+}
+func (m *MdataEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ return buf.Bytes(), nil
+}
+func (m *MdataEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ return nil
+}
+
+// MdataEnableDisableReply defines message 'mdata_enable_disable_reply'.
+type MdataEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MdataEnableDisableReply) Reset() { *m = MdataEnableDisableReply{} }
+func (*MdataEnableDisableReply) GetMessageName() string { return "mdata_enable_disable_reply" }
+func (*MdataEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*MdataEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MdataEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MdataEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_mdata_binapi_init() }
+func file_mdata_binapi_init() {
+ api.RegisterMessage((*MdataEnableDisable)(nil), "mdata_enable_disable_2e7b47df")
+ api.RegisterMessage((*MdataEnableDisableReply)(nil), "mdata_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*MdataEnableDisable)(nil),
+ (*MdataEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/mdata/mdata_rpc.ba.go b/internal/testbinapi/binapi2001/mdata/mdata_rpc.ba.go
new file mode 100644
index 0000000..08e05d5
--- /dev/null
+++ b/internal/testbinapi/binapi2001/mdata/mdata_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package mdata
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service mdata.
+type RPCService interface {
+ MdataEnableDisable(ctx context.Context, in *MdataEnableDisable) (*MdataEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) MdataEnableDisable(ctx context.Context, in *MdataEnableDisable) (*MdataEnableDisableReply, error) {
+ out := new(MdataEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/memclnt/memclnt.ba.go b/internal/testbinapi/binapi2001/memclnt/memclnt.ba.go
index 0b251ce..4c6edf8 100644
--- a/internal/testbinapi/binapi2001/memclnt/memclnt.ba.go
+++ b/internal/testbinapi/binapi2001/memclnt/memclnt.ba.go
@@ -1,400 +1,266 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.4.0-dev
-// VPP: 20.01-45~g7a071e370~b63
-// source: /usr/share/vpp/api/core/memclnt.api.json
-
-/*
-Package memclnt contains generated code for VPP binary API defined by memclnt.api (version 2.1.0).
-
-It consists of:
- 22 messages
- 2 types
-*/
+// VPP: 20.01
+// source: .vppapi/core/memclnt.api.json
+
+// Package memclnt contains generated bindings for API file memclnt.api.
+//
+// Contents:
+// 2 structs
+// 22 messages
+//
package memclnt
import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "math"
- "strconv"
-
api "git.fd.io/govpp.git/api"
codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
)
// 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 // please upgrade the GoVPP api package
+const _ = api.GoVppAPIPackageIsVersion2
const (
- // ModuleName is the name of this module.
- ModuleName = "memclnt"
- // APIVersion is the API version of this module.
+ APIFile = "memclnt"
APIVersion = "2.1.0"
- // VersionCrc is the CRC of this module.
VersionCrc = 0x8d3dd881
)
-// MessageTableEntry represents VPP binary API type 'message_table_entry'.
+// MessageTableEntry defines type 'message_table_entry'.
type MessageTableEntry struct {
Index uint16 `binapi:"u16,name=index" json:"index,omitempty"`
- Name string `binapi:"string[64],name=name" json:"name,omitempty" struc:"[64]byte"`
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
}
-func (*MessageTableEntry) GetTypeName() string { return "message_table_entry" }
-
-// ModuleVersion represents VPP binary API type 'module_version'.
+// ModuleVersion defines type 'module_version'.
type ModuleVersion struct {
Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
Patch uint32 `binapi:"u32,name=patch" json:"patch,omitempty"`
- Name string `binapi:"string[64],name=name" json:"name,omitempty" struc:"[64]byte"`
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
}
-func (*ModuleVersion) GetTypeName() string { return "module_version" }
-
-// APIVersions represents VPP binary API message 'api_versions'.
+// APIVersions defines message 'api_versions'.
type APIVersions struct{}
-func (m *APIVersions) Reset() { *m = APIVersions{} }
-func (*APIVersions) GetMessageName() string { return "api_versions" }
-func (*APIVersions) GetCrcString() string { return "51077d14" }
-func (*APIVersions) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *APIVersions) Reset() { *m = APIVersions{} }
+func (*APIVersions) GetMessageName() string { return "api_versions" }
+func (*APIVersions) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *APIVersions) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *APIVersions) Unmarshal(b []byte) error {
return nil
}
-// APIVersionsReply represents VPP binary API message 'api_versions_reply'.
+// APIVersionsReply defines message 'api_versions_reply'.
type APIVersionsReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=APIVersions"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
APIVersions []ModuleVersion `binapi:"module_version[count],name=api_versions" json:"api_versions,omitempty"`
}
-func (m *APIVersionsReply) Reset() { *m = APIVersionsReply{} }
-func (*APIVersionsReply) GetMessageName() string { return "api_versions_reply" }
-func (*APIVersionsReply) GetCrcString() string { return "5f0d99d6" }
-func (*APIVersionsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *APIVersionsReply) Reset() { *m = APIVersionsReply{} }
+func (*APIVersionsReply) GetMessageName() string { return "api_versions_reply" }
+func (*APIVersionsReply) GetCrcString() string { return "5f0d99d6" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.Count
- size += 4
- // field[1] m.APIVersions
+ size += 4 // m.Retval
+ size += 4 // m.Count
for j1 := 0; j1 < len(m.APIVersions); j1++ {
var s1 ModuleVersion
_ = s1
if j1 < len(m.APIVersions) {
s1 = m.APIVersions[j1]
}
- // field[2] s1.Major
- size += 4
- // field[2] s1.Minor
- size += 4
- // field[2] s1.Patch
- size += 4
- // field[2] s1.Name
- size += 64
+ size += 4 // s1.Major
+ size += 4 // s1.Minor
+ size += 4 // s1.Patch
+ size += 64 // s1.Name
}
return size
}
func (m *APIVersionsReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.APIVersions)))
- pos += 4
- // field[1] m.APIVersions
- for j1 := 0; j1 < len(m.APIVersions); j1++ {
- var v1 ModuleVersion
- if j1 < len(m.APIVersions) {
- v1 = m.APIVersions[j1]
- }
- // field[2] v1.Major
- o.PutUint32(buf[pos:pos+4], uint32(v1.Major))
- pos += 4
- // field[2] v1.Minor
- o.PutUint32(buf[pos:pos+4], uint32(v1.Minor))
- pos += 4
- // field[2] v1.Patch
- o.PutUint32(buf[pos:pos+4], uint32(v1.Patch))
- pos += 4
- // field[2] v1.Name
- copy(buf[pos:pos+64], v1.Name)
- pos += 64
- }
- return buf, nil
-}
-func (m *APIVersionsReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.APIVersions
- m.APIVersions = make([]ModuleVersion, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.APIVersions[j1].Major
- m.APIVersions[j1].Major = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.APIVersions[j1].Minor
- m.APIVersions[j1].Minor = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.APIVersions[j1].Patch
- m.APIVersions[j1].Patch = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.APIVersions[j1].Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.APIVersions[j1].Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
+ b = make([]byte, m.Size())
+ }
+ 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 // APIVersions
+ if j0 < len(m.APIVersions) {
+ v0 = m.APIVersions[j0]
}
+ 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 = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ 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()
+ m.APIVersions[j0].Patch = buf.DecodeUint32()
+ m.APIVersions[j0].Name = buf.DecodeString(64)
}
return nil
}
-// GetFirstMsgID represents VPP binary API message 'get_first_msg_id'.
+// GetFirstMsgID defines message 'get_first_msg_id'.
type GetFirstMsgID struct {
- Name string `binapi:"string[64],name=name" json:"name,omitempty" struc:"[64]byte"`
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
}
-func (m *GetFirstMsgID) Reset() { *m = GetFirstMsgID{} }
-func (*GetFirstMsgID) GetMessageName() string { return "get_first_msg_id" }
-func (*GetFirstMsgID) GetCrcString() string { return "ebf79a66" }
-func (*GetFirstMsgID) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *GetFirstMsgID) Reset() { *m = GetFirstMsgID{} }
+func (*GetFirstMsgID) GetMessageName() string { return "get_first_msg_id" }
+func (*GetFirstMsgID) GetCrcString() string { return "ebf79a66" }
+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
- // field[1] m.Name
- size += 64
+ size += 64 // m.Name
return size
}
func (m *GetFirstMsgID) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Name
- copy(buf[pos:pos+64], m.Name)
- pos += 64
- return buf, nil
-}
-func (m *GetFirstMsgID) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *GetFirstMsgID) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
return nil
}
-// GetFirstMsgIDReply represents VPP binary API message 'get_first_msg_id_reply'.
+// GetFirstMsgIDReply defines message 'get_first_msg_id_reply'.
type GetFirstMsgIDReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
FirstMsgID uint16 `binapi:"u16,name=first_msg_id" json:"first_msg_id,omitempty"`
}
-func (m *GetFirstMsgIDReply) Reset() { *m = GetFirstMsgIDReply{} }
-func (*GetFirstMsgIDReply) GetMessageName() string { return "get_first_msg_id_reply" }
-func (*GetFirstMsgIDReply) GetCrcString() string { return "7d337472" }
-func (*GetFirstMsgIDReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *GetFirstMsgIDReply) Reset() { *m = GetFirstMsgIDReply{} }
+func (*GetFirstMsgIDReply) GetMessageName() string { return "get_first_msg_id_reply" }
+func (*GetFirstMsgIDReply) GetCrcString() string { return "7d337472" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.FirstMsgID
- size += 2
+ size += 4 // m.Retval
+ size += 2 // m.FirstMsgID
return size
}
func (m *GetFirstMsgIDReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.FirstMsgID
- o.PutUint16(buf[pos:pos+2], uint16(m.FirstMsgID))
- pos += 2
- return buf, nil
-}
-func (m *GetFirstMsgIDReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.FirstMsgID
- m.FirstMsgID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ 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 = buf.DecodeInt32()
+ m.FirstMsgID = buf.DecodeUint16()
return nil
}
-// MemclntCreate represents VPP binary API message 'memclnt_create'.
+// MemclntCreate defines message 'memclnt_create'.
type MemclntCreate struct {
CtxQuota int32 `binapi:"i32,name=ctx_quota" json:"ctx_quota,omitempty"`
InputQueue uint64 `binapi:"u64,name=input_queue" json:"input_queue,omitempty"`
- Name string `binapi:"string[64],name=name" json:"name,omitempty" struc:"[64]byte"`
- APIVersions []uint32 `binapi:"u32[8],name=api_versions" json:"api_versions,omitempty" struc:"[8]uint32"`
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ APIVersions []uint32 `binapi:"u32[8],name=api_versions" json:"api_versions,omitempty"`
}
-func (m *MemclntCreate) Reset() { *m = MemclntCreate{} }
-func (*MemclntCreate) GetMessageName() string { return "memclnt_create" }
-func (*MemclntCreate) GetCrcString() string { return "9c5e1c2f" }
-func (*MemclntCreate) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MemclntCreate) Reset() { *m = MemclntCreate{} }
+func (*MemclntCreate) GetMessageName() string { return "memclnt_create" }
+func (*MemclntCreate) GetCrcString() string { return "9c5e1c2f" }
+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
- // field[1] m.CtxQuota
- size += 4
- // field[1] m.InputQueue
- size += 8
- // field[1] m.Name
- size += 64
- // field[1] m.APIVersions
- size += 32
+ size += 4 // m.CtxQuota
+ size += 8 // m.InputQueue
+ size += 64 // m.Name
+ size += 4 * 8 // m.APIVersions
return size
}
func (m *MemclntCreate) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.CtxQuota
- o.PutUint32(buf[pos:pos+4], uint32(m.CtxQuota))
- pos += 4
- // field[1] m.InputQueue
- o.PutUint64(buf[pos:pos+8], uint64(m.InputQueue))
- pos += 8
- // field[1] m.Name
- copy(buf[pos:pos+64], m.Name)
- pos += 64
- // field[1] m.APIVersions
+ 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])
}
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
+ buf.EncodeUint32(x)
}
- return buf, nil
-}
-func (m *MemclntCreate) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.CtxQuota
- m.CtxQuota = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.InputQueue
- m.InputQueue = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- // field[1] m.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.APIVersions
+ return buf.Bytes(), nil
+}
+func (m *MemclntCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.CtxQuota = buf.DecodeInt32()
+ m.InputQueue = buf.DecodeUint64()
+ m.Name = buf.DecodeString(64)
m.APIVersions = make([]uint32, 8)
for i := 0; i < len(m.APIVersions); i++ {
- m.APIVersions[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ m.APIVersions[i] = buf.DecodeUint32()
}
return nil
}
-// MemclntCreateReply represents VPP binary API message 'memclnt_create_reply'.
+// MemclntCreateReply defines message 'memclnt_create_reply'.
type MemclntCreateReply struct {
Response int32 `binapi:"i32,name=response" json:"response,omitempty"`
Handle uint64 `binapi:"u64,name=handle" json:"handle,omitempty"`
@@ -402,1012 +268,678 @@ type MemclntCreateReply struct {
MessageTable uint64 `binapi:"u64,name=message_table" json:"message_table,omitempty"`
}
-func (m *MemclntCreateReply) Reset() { *m = MemclntCreateReply{} }
-func (*MemclntCreateReply) GetMessageName() string { return "memclnt_create_reply" }
-func (*MemclntCreateReply) GetCrcString() string { return "42ec4560" }
-func (*MemclntCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MemclntCreateReply) Reset() { *m = MemclntCreateReply{} }
+func (*MemclntCreateReply) GetMessageName() string { return "memclnt_create_reply" }
+func (*MemclntCreateReply) GetCrcString() string { return "42ec4560" }
+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
- // field[1] m.Response
- size += 4
- // field[1] m.Handle
- size += 8
- // field[1] m.Index
- size += 4
- // field[1] m.MessageTable
- size += 8
+ size += 4 // m.Response
+ size += 8 // m.Handle
+ size += 4 // m.Index
+ size += 8 // m.MessageTable
return size
}
func (m *MemclntCreateReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Response
- o.PutUint32(buf[pos:pos+4], uint32(m.Response))
- pos += 4
- // field[1] m.Handle
- o.PutUint64(buf[pos:pos+8], uint64(m.Handle))
- pos += 8
- // field[1] m.Index
- o.PutUint32(buf[pos:pos+4], uint32(m.Index))
- pos += 4
- // field[1] m.MessageTable
- o.PutUint64(buf[pos:pos+8], uint64(m.MessageTable))
- pos += 8
- return buf, nil
-}
-func (m *MemclntCreateReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Response
- m.Response = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Handle
- m.Handle = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- // field[1] m.Index
- m.Index = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MessageTable
- m.MessageTable = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.Handle = buf.DecodeUint64()
+ m.Index = buf.DecodeUint32()
+ m.MessageTable = buf.DecodeUint64()
return nil
}
-// MemclntDelete represents VPP binary API message 'memclnt_delete'.
+// MemclntDelete defines message 'memclnt_delete'.
type MemclntDelete struct {
Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
Handle uint64 `binapi:"u64,name=handle" json:"handle,omitempty"`
DoCleanup bool `binapi:"bool,name=do_cleanup" json:"do_cleanup,omitempty"`
}
-func (m *MemclntDelete) Reset() { *m = MemclntDelete{} }
-func (*MemclntDelete) GetMessageName() string { return "memclnt_delete" }
-func (*MemclntDelete) GetCrcString() string { return "7e1c04e3" }
-func (*MemclntDelete) GetMessageType() api.MessageType { return api.OtherMessage }
+func (m *MemclntDelete) Reset() { *m = MemclntDelete{} }
+func (*MemclntDelete) GetMessageName() string { return "memclnt_delete" }
+func (*MemclntDelete) GetCrcString() string { return "7e1c04e3" }
+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
- // field[1] m.Index
- size += 4
- // field[1] m.Handle
- size += 8
- // field[1] m.DoCleanup
- size += 1
+ size += 4 // m.Index
+ size += 8 // m.Handle
+ size += 1 // m.DoCleanup
return size
}
func (m *MemclntDelete) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Index
- o.PutUint32(buf[pos:pos+4], uint32(m.Index))
- pos += 4
- // field[1] m.Handle
- o.PutUint64(buf[pos:pos+8], uint64(m.Handle))
- pos += 8
- // field[1] m.DoCleanup
- if m.DoCleanup {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *MemclntDelete) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Index
- m.Index = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Handle
- m.Handle = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- // field[1] m.DoCleanup
- m.DoCleanup = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Index)
+ buf.EncodeUint64(m.Handle)
+ buf.EncodeBool(m.DoCleanup)
+ return buf.Bytes(), nil
+}
+func (m *MemclntDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Index = buf.DecodeUint32()
+ m.Handle = buf.DecodeUint64()
+ m.DoCleanup = buf.DecodeBool()
return nil
}
-// MemclntDeleteReply represents VPP binary API message 'memclnt_delete_reply'.
+// MemclntDeleteReply defines message 'memclnt_delete_reply'.
type MemclntDeleteReply struct {
Response int32 `binapi:"i32,name=response" json:"response,omitempty"`
Handle uint64 `binapi:"u64,name=handle" json:"handle,omitempty"`
}
-func (m *MemclntDeleteReply) Reset() { *m = MemclntDeleteReply{} }
-func (*MemclntDeleteReply) GetMessageName() string { return "memclnt_delete_reply" }
-func (*MemclntDeleteReply) GetCrcString() string { return "3d3b6312" }
-func (*MemclntDeleteReply) GetMessageType() api.MessageType { return api.OtherMessage }
+func (m *MemclntDeleteReply) Reset() { *m = MemclntDeleteReply{} }
+func (*MemclntDeleteReply) GetMessageName() string { return "memclnt_delete_reply" }
+func (*MemclntDeleteReply) GetCrcString() string { return "3d3b6312" }
+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
- // field[1] m.Response
- size += 4
- // field[1] m.Handle
- size += 8
+ size += 4 // m.Response
+ size += 8 // m.Handle
return size
}
func (m *MemclntDeleteReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Response
- o.PutUint32(buf[pos:pos+4], uint32(m.Response))
- pos += 4
- // field[1] m.Handle
- o.PutUint64(buf[pos:pos+8], uint64(m.Handle))
- pos += 8
- return buf, nil
-}
-func (m *MemclntDeleteReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Response
- m.Response = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Handle
- m.Handle = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
+ 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 = buf.DecodeInt32()
+ m.Handle = buf.DecodeUint64()
return nil
}
-// MemclntKeepalive represents VPP binary API message 'memclnt_keepalive'.
+// MemclntKeepalive defines message 'memclnt_keepalive'.
type MemclntKeepalive struct{}
-func (m *MemclntKeepalive) Reset() { *m = MemclntKeepalive{} }
-func (*MemclntKeepalive) GetMessageName() string { return "memclnt_keepalive" }
-func (*MemclntKeepalive) GetCrcString() string { return "51077d14" }
-func (*MemclntKeepalive) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MemclntKeepalive) Reset() { *m = MemclntKeepalive{} }
+func (*MemclntKeepalive) GetMessageName() string { return "memclnt_keepalive" }
+func (*MemclntKeepalive) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *MemclntKeepalive) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *MemclntKeepalive) Unmarshal(b []byte) error {
return nil
}
-// MemclntKeepaliveReply represents VPP binary API message 'memclnt_keepalive_reply'.
+// MemclntKeepaliveReply defines message 'memclnt_keepalive_reply'.
type MemclntKeepaliveReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *MemclntKeepaliveReply) Reset() { *m = MemclntKeepaliveReply{} }
-func (*MemclntKeepaliveReply) GetMessageName() string { return "memclnt_keepalive_reply" }
-func (*MemclntKeepaliveReply) GetCrcString() string { return "e8d4e804" }
-func (*MemclntKeepaliveReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MemclntKeepaliveReply) Reset() { *m = MemclntKeepaliveReply{} }
+func (*MemclntKeepaliveReply) GetMessageName() string { return "memclnt_keepalive_reply" }
+func (*MemclntKeepaliveReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *MemclntKeepaliveReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *MemclntKeepaliveReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// MemclntReadTimeout represents VPP binary API message 'memclnt_read_timeout'.
+// MemclntReadTimeout defines message 'memclnt_read_timeout'.
type MemclntReadTimeout struct {
Dummy uint8 `binapi:"u8,name=dummy" json:"dummy,omitempty"`
}
-func (m *MemclntReadTimeout) Reset() { *m = MemclntReadTimeout{} }
-func (*MemclntReadTimeout) GetMessageName() string { return "memclnt_read_timeout" }
-func (*MemclntReadTimeout) GetCrcString() string { return "c3a3a452" }
-func (*MemclntReadTimeout) GetMessageType() api.MessageType { return api.OtherMessage }
+func (m *MemclntReadTimeout) Reset() { *m = MemclntReadTimeout{} }
+func (*MemclntReadTimeout) GetMessageName() string { return "memclnt_read_timeout" }
+func (*MemclntReadTimeout) GetCrcString() string { return "c3a3a452" }
+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
- // field[1] m.Dummy
- size += 1
+ size += 1 // m.Dummy
return size
}
func (m *MemclntReadTimeout) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Dummy
- buf[pos] = uint8(m.Dummy)
- pos += 1
- return buf, nil
-}
-func (m *MemclntReadTimeout) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Dummy
- m.Dummy = uint8(tmp[pos])
- pos += 1
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Dummy)
+ return buf.Bytes(), nil
+}
+func (m *MemclntReadTimeout) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Dummy = buf.DecodeUint8()
return nil
}
-// MemclntRxThreadSuspend represents VPP binary API message 'memclnt_rx_thread_suspend'.
+// MemclntRxThreadSuspend defines message 'memclnt_rx_thread_suspend'.
type MemclntRxThreadSuspend struct {
Dummy uint8 `binapi:"u8,name=dummy" json:"dummy,omitempty"`
}
-func (m *MemclntRxThreadSuspend) Reset() { *m = MemclntRxThreadSuspend{} }
-func (*MemclntRxThreadSuspend) GetMessageName() string { return "memclnt_rx_thread_suspend" }
-func (*MemclntRxThreadSuspend) GetCrcString() string { return "c3a3a452" }
-func (*MemclntRxThreadSuspend) GetMessageType() api.MessageType { return api.OtherMessage }
+func (m *MemclntRxThreadSuspend) Reset() { *m = MemclntRxThreadSuspend{} }
+func (*MemclntRxThreadSuspend) GetMessageName() string { return "memclnt_rx_thread_suspend" }
+func (*MemclntRxThreadSuspend) GetCrcString() string { return "c3a3a452" }
+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
- // field[1] m.Dummy
- size += 1
+ size += 1 // m.Dummy
return size
}
func (m *MemclntRxThreadSuspend) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Dummy
- buf[pos] = uint8(m.Dummy)
- pos += 1
- return buf, nil
-}
-func (m *MemclntRxThreadSuspend) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Dummy
- m.Dummy = uint8(tmp[pos])
- pos += 1
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Dummy)
+ return buf.Bytes(), nil
+}
+func (m *MemclntRxThreadSuspend) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Dummy = buf.DecodeUint8()
return nil
}
-// RPCCall represents VPP binary API message 'rpc_call'.
+// RPCCall defines message 'rpc_call'.
type RPCCall struct {
Function uint64 `binapi:"u64,name=function" json:"function,omitempty"`
Multicast uint8 `binapi:"u8,name=multicast" json:"multicast,omitempty"`
NeedBarrierSync uint8 `binapi:"u8,name=need_barrier_sync" json:"need_barrier_sync,omitempty"`
SendReply uint8 `binapi:"u8,name=send_reply" json:"send_reply,omitempty"`
- DataLen uint32 `binapi:"u32,name=data_len" json:"data_len,omitempty" struc:"sizeof=Data"`
+ DataLen uint32 `binapi:"u32,name=data_len" json:"-"`
Data []byte `binapi:"u8[data_len],name=data" json:"data,omitempty"`
}
-func (m *RPCCall) Reset() { *m = RPCCall{} }
-func (*RPCCall) GetMessageName() string { return "rpc_call" }
-func (*RPCCall) GetCrcString() string { return "7e8a2c95" }
-func (*RPCCall) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *RPCCall) Reset() { *m = RPCCall{} }
+func (*RPCCall) GetMessageName() string { return "rpc_call" }
+func (*RPCCall) GetCrcString() string { return "7e8a2c95" }
+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
- // field[1] m.Function
- size += 8
- // field[1] m.Multicast
- size += 1
- // field[1] m.NeedBarrierSync
- size += 1
- // field[1] m.SendReply
- size += 1
- // field[1] m.DataLen
- size += 4
- // field[1] m.Data
- size += 1 * len(m.Data)
+ size += 8 // m.Function
+ size += 1 // m.Multicast
+ size += 1 // m.NeedBarrierSync
+ size += 1 // m.SendReply
+ size += 4 // m.DataLen
+ size += 1 * len(m.Data) // m.Data
return size
}
func (m *RPCCall) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Function
- o.PutUint64(buf[pos:pos+8], uint64(m.Function))
- pos += 8
- // field[1] m.Multicast
- buf[pos] = uint8(m.Multicast)
- pos += 1
- // field[1] m.NeedBarrierSync
- buf[pos] = uint8(m.NeedBarrierSync)
- pos += 1
- // field[1] m.SendReply
- buf[pos] = uint8(m.SendReply)
- pos += 1
- // field[1] m.DataLen
- o.PutUint32(buf[pos:pos+4], uint32(len(m.Data)))
- pos += 4
- // field[1] m.Data
- for i := 0; i < len(m.Data); i++ {
- var x uint8
- if i < len(m.Data) {
- x = uint8(m.Data[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *RPCCall) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Function
- m.Function = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- // field[1] m.Multicast
- m.Multicast = uint8(tmp[pos])
- pos += 1
- // field[1] m.NeedBarrierSync
- m.NeedBarrierSync = uint8(tmp[pos])
- pos += 1
- // field[1] m.SendReply
- m.SendReply = uint8(tmp[pos])
- pos += 1
- // field[1] m.DataLen
- m.DataLen = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Data
- m.Data = make([]uint8, m.DataLen)
- for i := 0; i < len(m.Data); i++ {
- m.Data[i] = uint8(tmp[pos])
- pos += 1
- }
+ b = make([]byte, m.Size())
+ }
+ 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)
+ return buf.Bytes(), nil
+}
+func (m *RPCCall) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Function = buf.DecodeUint64()
+ m.Multicast = buf.DecodeUint8()
+ m.NeedBarrierSync = buf.DecodeUint8()
+ m.SendReply = buf.DecodeUint8()
+ m.DataLen = buf.DecodeUint32()
+ m.Data = make([]byte, m.DataLen)
+ copy(m.Data, buf.DecodeBytes(len(m.Data)))
return nil
}
-// RPCCallReply represents VPP binary API message 'rpc_call_reply'.
+// RPCCallReply defines message 'rpc_call_reply'.
type RPCCallReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *RPCCallReply) Reset() { *m = RPCCallReply{} }
-func (*RPCCallReply) GetMessageName() string { return "rpc_call_reply" }
-func (*RPCCallReply) GetCrcString() string { return "e8d4e804" }
-func (*RPCCallReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *RPCCallReply) Reset() { *m = RPCCallReply{} }
+func (*RPCCallReply) GetMessageName() string { return "rpc_call_reply" }
+func (*RPCCallReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *RPCCallReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *RPCCallReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// RxThreadExit represents VPP binary API message 'rx_thread_exit'.
+// RxThreadExit defines message 'rx_thread_exit'.
type RxThreadExit struct {
Dummy uint8 `binapi:"u8,name=dummy" json:"dummy,omitempty"`
}
-func (m *RxThreadExit) Reset() { *m = RxThreadExit{} }
-func (*RxThreadExit) GetMessageName() string { return "rx_thread_exit" }
-func (*RxThreadExit) GetCrcString() string { return "c3a3a452" }
-func (*RxThreadExit) GetMessageType() api.MessageType { return api.OtherMessage }
+func (m *RxThreadExit) Reset() { *m = RxThreadExit{} }
+func (*RxThreadExit) GetMessageName() string { return "rx_thread_exit" }
+func (*RxThreadExit) GetCrcString() string { return "c3a3a452" }
+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
- // field[1] m.Dummy
- size += 1
+ size += 1 // m.Dummy
return size
}
func (m *RxThreadExit) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Dummy
- buf[pos] = uint8(m.Dummy)
- pos += 1
- return buf, nil
-}
-func (m *RxThreadExit) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Dummy
- m.Dummy = uint8(tmp[pos])
- pos += 1
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Dummy)
+ return buf.Bytes(), nil
+}
+func (m *RxThreadExit) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Dummy = buf.DecodeUint8()
return nil
}
-// SockInitShm represents VPP binary API message 'sock_init_shm'.
+// SockInitShm defines message 'sock_init_shm'.
type SockInitShm struct {
RequestedSize uint32 `binapi:"u32,name=requested_size" json:"requested_size,omitempty"`
- Nitems uint8 `binapi:"u8,name=nitems" json:"nitems,omitempty" struc:"sizeof=Configs"`
+ Nitems uint8 `binapi:"u8,name=nitems" json:"-"`
Configs []uint64 `binapi:"u64[nitems],name=configs" json:"configs,omitempty"`
}
-func (m *SockInitShm) Reset() { *m = SockInitShm{} }
-func (*SockInitShm) GetMessageName() string { return "sock_init_shm" }
-func (*SockInitShm) GetCrcString() string { return "51646d92" }
-func (*SockInitShm) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SockInitShm) Reset() { *m = SockInitShm{} }
+func (*SockInitShm) GetMessageName() string { return "sock_init_shm" }
+func (*SockInitShm) GetCrcString() string { return "51646d92" }
+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
- // field[1] m.RequestedSize
- size += 4
- // field[1] m.Nitems
- size += 1
- // field[1] m.Configs
- size += 8 * len(m.Configs)
+ 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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.RequestedSize
- o.PutUint32(buf[pos:pos+4], uint32(m.RequestedSize))
- pos += 4
- // field[1] m.Nitems
- buf[pos] = uint8(len(m.Configs))
- pos += 1
- // field[1] m.Configs
+ 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])
}
- o.PutUint64(buf[pos:pos+8], uint64(x))
- pos += 8
+ buf.EncodeUint64(x)
}
- return buf, nil
-}
-func (m *SockInitShm) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.RequestedSize
- m.RequestedSize = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Nitems
- m.Nitems = uint8(tmp[pos])
- pos += 1
- // field[1] m.Configs
+ return buf.Bytes(), nil
+}
+func (m *SockInitShm) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.RequestedSize = buf.DecodeUint32()
+ m.Nitems = buf.DecodeUint8()
m.Configs = make([]uint64, m.Nitems)
for i := 0; i < len(m.Configs); i++ {
- m.Configs[i] = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
+ m.Configs[i] = buf.DecodeUint64()
}
return nil
}
-// SockInitShmReply represents VPP binary API message 'sock_init_shm_reply'.
+// SockInitShmReply defines message 'sock_init_shm_reply'.
type SockInitShmReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SockInitShmReply) Reset() { *m = SockInitShmReply{} }
-func (*SockInitShmReply) GetMessageName() string { return "sock_init_shm_reply" }
-func (*SockInitShmReply) GetCrcString() string { return "e8d4e804" }
-func (*SockInitShmReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SockInitShmReply) Reset() { *m = SockInitShmReply{} }
+func (*SockInitShmReply) GetMessageName() string { return "sock_init_shm_reply" }
+func (*SockInitShmReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SockInitShmReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SockInitShmReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// SockclntCreate represents VPP binary API message 'sockclnt_create'.
+// SockclntCreate defines message 'sockclnt_create'.
type SockclntCreate struct {
- Name string `binapi:"string[64],name=name" json:"name,omitempty" struc:"[64]byte"`
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
}
-func (m *SockclntCreate) Reset() { *m = SockclntCreate{} }
-func (*SockclntCreate) GetMessageName() string { return "sockclnt_create" }
-func (*SockclntCreate) GetCrcString() string { return "455fb9c4" }
-func (*SockclntCreate) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SockclntCreate) Reset() { *m = SockclntCreate{} }
+func (*SockclntCreate) GetMessageName() string { return "sockclnt_create" }
+func (*SockclntCreate) GetCrcString() string { return "455fb9c4" }
+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
- // field[1] m.Name
- size += 64
+ size += 64 // m.Name
return size
}
func (m *SockclntCreate) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Name
- copy(buf[pos:pos+64], m.Name)
- pos += 64
- return buf, nil
-}
-func (m *SockclntCreate) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *SockclntCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
return nil
}
-// SockclntCreateReply represents VPP binary API message 'sockclnt_create_reply'.
+// SockclntCreateReply defines message 'sockclnt_create_reply'.
type SockclntCreateReply struct {
Response int32 `binapi:"i32,name=response" json:"response,omitempty"`
Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
- Count uint16 `binapi:"u16,name=count" json:"count,omitempty" struc:"sizeof=MessageTable"`
+ Count uint16 `binapi:"u16,name=count" json:"-"`
MessageTable []MessageTableEntry `binapi:"message_table_entry[count],name=message_table" json:"message_table,omitempty"`
}
-func (m *SockclntCreateReply) Reset() { *m = SockclntCreateReply{} }
-func (*SockclntCreateReply) GetMessageName() string { return "sockclnt_create_reply" }
-func (*SockclntCreateReply) GetCrcString() string { return "35166268" }
-func (*SockclntCreateReply) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SockclntCreateReply) Reset() { *m = SockclntCreateReply{} }
+func (*SockclntCreateReply) GetMessageName() string { return "sockclnt_create_reply" }
+func (*SockclntCreateReply) GetCrcString() string { return "35166268" }
+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
- // field[1] m.Response
- size += 4
- // field[1] m.Index
- size += 4
- // field[1] m.Count
- size += 2
- // field[1] m.MessageTable
+ size += 4 // m.Response
+ size += 4 // m.Index
+ size += 2 // m.Count
for j1 := 0; j1 < len(m.MessageTable); j1++ {
var s1 MessageTableEntry
_ = s1
if j1 < len(m.MessageTable) {
s1 = m.MessageTable[j1]
}
- // field[2] s1.Index
- size += 2
- // field[2] s1.Name
- size += 64
+ size += 2 // s1.Index
+ size += 64 // s1.Name
}
return size
}
func (m *SockclntCreateReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Response
- o.PutUint32(buf[pos:pos+4], uint32(m.Response))
- pos += 4
- // field[1] m.Index
- o.PutUint32(buf[pos:pos+4], uint32(m.Index))
- pos += 4
- // field[1] m.Count
- o.PutUint16(buf[pos:pos+2], uint16(len(m.MessageTable)))
- pos += 2
- // field[1] m.MessageTable
- for j1 := 0; j1 < len(m.MessageTable); j1++ {
- var v1 MessageTableEntry
- if j1 < len(m.MessageTable) {
- v1 = m.MessageTable[j1]
+ b = make([]byte, m.Size())
+ }
+ 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 // MessageTable
+ if j0 < len(m.MessageTable) {
+ v0 = m.MessageTable[j0]
}
- // field[2] v1.Index
- o.PutUint16(buf[pos:pos+2], uint16(v1.Index))
- pos += 2
- // field[2] v1.Name
- copy(buf[pos:pos+64], v1.Name)
- pos += 64
+ buf.EncodeUint16(v0.Index)
+ buf.EncodeString(v0.Name, 64)
}
- return buf, nil
-}
-func (m *SockclntCreateReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Response
- m.Response = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Index
- m.Index = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.MessageTable
- m.MessageTable = make([]MessageTableEntry, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.MessageTable[j1].Index
- m.MessageTable[j1].Index = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.MessageTable[j1].Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.MessageTable[j1].Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ return buf.Bytes(), nil
+}
+func (m *SockclntCreateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Response = buf.DecodeInt32()
+ m.Index = buf.DecodeUint32()
+ m.Count = buf.DecodeUint16()
+ 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)
}
return nil
}
-// SockclntDelete represents VPP binary API message 'sockclnt_delete'.
+// SockclntDelete defines message 'sockclnt_delete'.
type SockclntDelete struct {
Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
}
-func (m *SockclntDelete) Reset() { *m = SockclntDelete{} }
-func (*SockclntDelete) GetMessageName() string { return "sockclnt_delete" }
-func (*SockclntDelete) GetCrcString() string { return "8ac76db6" }
-func (*SockclntDelete) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SockclntDelete) Reset() { *m = SockclntDelete{} }
+func (*SockclntDelete) GetMessageName() string { return "sockclnt_delete" }
+func (*SockclntDelete) GetCrcString() string { return "8ac76db6" }
+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
- // field[1] m.Index
- size += 4
+ size += 4 // m.Index
return size
}
func (m *SockclntDelete) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Index
- o.PutUint32(buf[pos:pos+4], uint32(m.Index))
- pos += 4
- return buf, nil
-}
-func (m *SockclntDelete) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Index
- m.Index = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Index)
+ return buf.Bytes(), nil
+}
+func (m *SockclntDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Index = buf.DecodeUint32()
return nil
}
-// SockclntDeleteReply represents VPP binary API message 'sockclnt_delete_reply'.
+// SockclntDeleteReply defines message 'sockclnt_delete_reply'.
type SockclntDeleteReply struct {
Response int32 `binapi:"i32,name=response" json:"response,omitempty"`
}
-func (m *SockclntDeleteReply) Reset() { *m = SockclntDeleteReply{} }
-func (*SockclntDeleteReply) GetMessageName() string { return "sockclnt_delete_reply" }
-func (*SockclntDeleteReply) GetCrcString() string { return "8f38b1ee" }
-func (*SockclntDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SockclntDeleteReply) Reset() { *m = SockclntDeleteReply{} }
+func (*SockclntDeleteReply) GetMessageName() string { return "sockclnt_delete_reply" }
+func (*SockclntDeleteReply) GetCrcString() string { return "8f38b1ee" }
+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
- // field[1] m.Response
- size += 4
+ size += 4 // m.Response
return size
}
func (m *SockclntDeleteReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Response
- o.PutUint32(buf[pos:pos+4], uint32(m.Response))
- pos += 4
- return buf, nil
-}
-func (m *SockclntDeleteReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Response
- m.Response = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// TracePluginMsgIds represents VPP binary API message 'trace_plugin_msg_ids'.
+// TracePluginMsgIds defines message 'trace_plugin_msg_ids'.
type TracePluginMsgIds struct {
- PluginName string `binapi:"string[128],name=plugin_name" json:"plugin_name,omitempty" struc:"[128]byte"`
+ PluginName string `binapi:"string[128],name=plugin_name" json:"plugin_name,omitempty"`
FirstMsgID uint16 `binapi:"u16,name=first_msg_id" json:"first_msg_id,omitempty"`
LastMsgID uint16 `binapi:"u16,name=last_msg_id" json:"last_msg_id,omitempty"`
}
-func (m *TracePluginMsgIds) Reset() { *m = TracePluginMsgIds{} }
-func (*TracePluginMsgIds) GetMessageName() string { return "trace_plugin_msg_ids" }
-func (*TracePluginMsgIds) GetCrcString() string { return "f476d3ce" }
-func (*TracePluginMsgIds) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *TracePluginMsgIds) Reset() { *m = TracePluginMsgIds{} }
+func (*TracePluginMsgIds) GetMessageName() string { return "trace_plugin_msg_ids" }
+func (*TracePluginMsgIds) GetCrcString() string { return "f476d3ce" }
+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
- // field[1] m.PluginName
- size += 128
- // field[1] m.FirstMsgID
- size += 2
- // field[1] m.LastMsgID
- size += 2
+ size += 128 // m.PluginName
+ size += 2 // m.FirstMsgID
+ size += 2 // m.LastMsgID
return size
}
func (m *TracePluginMsgIds) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.PluginName
- copy(buf[pos:pos+128], m.PluginName)
- pos += 128
- // field[1] m.FirstMsgID
- o.PutUint16(buf[pos:pos+2], uint16(m.FirstMsgID))
- pos += 2
- // field[1] m.LastMsgID
- o.PutUint16(buf[pos:pos+2], uint16(m.LastMsgID))
- pos += 2
- return buf, nil
-}
-func (m *TracePluginMsgIds) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.PluginName
- {
- nul := bytes.Index(tmp[pos:pos+128], []byte{0x00})
- m.PluginName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 128
- }
- // field[1] m.FirstMsgID
- m.FirstMsgID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.LastMsgID
- m.LastMsgID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.PluginName, 128)
+ buf.EncodeUint16(m.FirstMsgID)
+ buf.EncodeUint16(m.LastMsgID)
+ return buf.Bytes(), nil
+}
+func (m *TracePluginMsgIds) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PluginName = buf.DecodeString(128)
+ m.FirstMsgID = buf.DecodeUint16()
+ m.LastMsgID = buf.DecodeUint16()
return nil
}
func init() { file_memclnt_binapi_init() }
func file_memclnt_binapi_init() {
- api.RegisterMessage((*APIVersions)(nil), "memclnt.APIVersions")
- api.RegisterMessage((*APIVersionsReply)(nil), "memclnt.APIVersionsReply")
- api.RegisterMessage((*GetFirstMsgID)(nil), "memclnt.GetFirstMsgID")
- api.RegisterMessage((*GetFirstMsgIDReply)(nil), "memclnt.GetFirstMsgIDReply")
- api.RegisterMessage((*MemclntCreate)(nil), "memclnt.MemclntCreate")
- api.RegisterMessage((*MemclntCreateReply)(nil), "memclnt.MemclntCreateReply")
- api.RegisterMessage((*MemclntDelete)(nil), "memclnt.MemclntDelete")
- api.RegisterMessage((*MemclntDeleteReply)(nil), "memclnt.MemclntDeleteReply")
- api.RegisterMessage((*MemclntKeepalive)(nil), "memclnt.MemclntKeepalive")
- api.RegisterMessage((*MemclntKeepaliveReply)(nil), "memclnt.MemclntKeepaliveReply")
- api.RegisterMessage((*MemclntReadTimeout)(nil), "memclnt.MemclntReadTimeout")
- api.RegisterMessage((*MemclntRxThreadSuspend)(nil), "memclnt.MemclntRxThreadSuspend")
- api.RegisterMessage((*RPCCall)(nil), "memclnt.RPCCall")
- api.RegisterMessage((*RPCCallReply)(nil), "memclnt.RPCCallReply")
- api.RegisterMessage((*RxThreadExit)(nil), "memclnt.RxThreadExit")
- api.RegisterMessage((*SockInitShm)(nil), "memclnt.SockInitShm")
- api.RegisterMessage((*SockInitShmReply)(nil), "memclnt.SockInitShmReply")
- api.RegisterMessage((*SockclntCreate)(nil), "memclnt.SockclntCreate")
- api.RegisterMessage((*SockclntCreateReply)(nil), "memclnt.SockclntCreateReply")
- api.RegisterMessage((*SockclntDelete)(nil), "memclnt.SockclntDelete")
- api.RegisterMessage((*SockclntDeleteReply)(nil), "memclnt.SockclntDeleteReply")
- api.RegisterMessage((*TracePluginMsgIds)(nil), "memclnt.TracePluginMsgIds")
+ api.RegisterMessage((*APIVersions)(nil), "api_versions_51077d14")
+ api.RegisterMessage((*APIVersionsReply)(nil), "api_versions_reply_5f0d99d6")
+ api.RegisterMessage((*GetFirstMsgID)(nil), "get_first_msg_id_ebf79a66")
+ api.RegisterMessage((*GetFirstMsgIDReply)(nil), "get_first_msg_id_reply_7d337472")
+ api.RegisterMessage((*MemclntCreate)(nil), "memclnt_create_9c5e1c2f")
+ api.RegisterMessage((*MemclntCreateReply)(nil), "memclnt_create_reply_42ec4560")
+ api.RegisterMessage((*MemclntDelete)(nil), "memclnt_delete_7e1c04e3")
+ api.RegisterMessage((*MemclntDeleteReply)(nil), "memclnt_delete_reply_3d3b6312")
+ api.RegisterMessage((*MemclntKeepalive)(nil), "memclnt_keepalive_51077d14")
+ api.RegisterMessage((*MemclntKeepaliveReply)(nil), "memclnt_keepalive_reply_e8d4e804")
+ api.RegisterMessage((*MemclntReadTimeout)(nil), "memclnt_read_timeout_c3a3a452")
+ api.RegisterMessage((*MemclntRxThreadSuspend)(nil), "memclnt_rx_thread_suspend_c3a3a452")
+ api.RegisterMessage((*RPCCall)(nil), "rpc_call_7e8a2c95")
+ api.RegisterMessage((*RPCCallReply)(nil), "rpc_call_reply_e8d4e804")
+ api.RegisterMessage((*RxThreadExit)(nil), "rx_thread_exit_c3a3a452")
+ api.RegisterMessage((*SockInitShm)(nil), "sock_init_shm_51646d92")
+ api.RegisterMessage((*SockInitShmReply)(nil), "sock_init_shm_reply_e8d4e804")
+ api.RegisterMessage((*SockclntCreate)(nil), "sockclnt_create_455fb9c4")
+ api.RegisterMessage((*SockclntCreateReply)(nil), "sockclnt_create_reply_35166268")
+ api.RegisterMessage((*SockclntDelete)(nil), "sockclnt_delete_8ac76db6")
+ api.RegisterMessage((*SockclntDeleteReply)(nil), "sockclnt_delete_reply_8f38b1ee")
+ api.RegisterMessage((*TracePluginMsgIds)(nil), "trace_plugin_msg_ids_f476d3ce")
}
// Messages returns list of all messages in this module.
@@ -1437,14 +969,3 @@ func AllMessages() []api.Message {
(*TracePluginMsgIds)(nil),
}
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
diff --git a/internal/testbinapi/binapi2001/memclnt/memclnt_rpc.ba.go b/internal/testbinapi/binapi2001/memclnt/memclnt_rpc.ba.go
index 05dfc28..ec60156 100644
--- a/internal/testbinapi/binapi2001/memclnt/memclnt_rpc.ba.go
+++ b/internal/testbinapi/binapi2001/memclnt/memclnt_rpc.ba.go
@@ -4,12 +4,10 @@ package memclnt
import (
"context"
- "io"
-
api "git.fd.io/govpp.git/api"
)
-// RPCService represents RPC service API for memclnt module.
+// RPCService defines RPC service memclnt.
type RPCService interface {
APIVersions(ctx context.Context, in *APIVersions) (*APIVersionsReply, error)
GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*GetFirstMsgIDReply, error)
@@ -27,16 +25,16 @@ type RPCService interface {
}
type serviceClient struct {
- ch api.Channel
+ conn api.Connection
}
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
}
func (c *serviceClient) APIVersions(ctx context.Context, in *APIVersions) (*APIVersionsReply, error) {
out := new(APIVersionsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -45,7 +43,7 @@ func (c *serviceClient) APIVersions(ctx context.Context, in *APIVersions) (*APIV
func (c *serviceClient) GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*GetFirstMsgIDReply, error) {
out := new(GetFirstMsgIDReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -54,7 +52,7 @@ func (c *serviceClient) GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*
func (c *serviceClient) MemclntCreate(ctx context.Context, in *MemclntCreate) (*MemclntCreateReply, error) {
out := new(MemclntCreateReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -63,7 +61,7 @@ func (c *serviceClient) MemclntCreate(ctx context.Context, in *MemclntCreate) (*
func (c *serviceClient) MemclntDelete(ctx context.Context, in *MemclntDelete) (*MemclntDeleteReply, error) {
out := new(MemclntDeleteReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -72,7 +70,7 @@ func (c *serviceClient) MemclntDelete(ctx context.Context, in *MemclntDelete) (*
func (c *serviceClient) MemclntKeepalive(ctx context.Context, in *MemclntKeepalive) (*MemclntKeepaliveReply, error) {
out := new(MemclntKeepaliveReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -80,18 +78,32 @@ func (c *serviceClient) MemclntKeepalive(ctx context.Context, in *MemclntKeepali
}
func (c *serviceClient) MemclntReadTimeout(ctx context.Context, in *MemclntReadTimeout) error {
- c.ch.SendRequest(in)
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return err
+ }
+ err = stream.SendMsg(in)
+ if err != nil {
+ return err
+ }
return nil
}
func (c *serviceClient) MemclntRxThreadSuspend(ctx context.Context, in *MemclntRxThreadSuspend) error {
- c.ch.SendRequest(in)
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return err
+ }
+ err = stream.SendMsg(in)
+ if err != nil {
+ return err
+ }
return nil
}
func (c *serviceClient) RPCCall(ctx context.Context, in *RPCCall) (*RPCCallReply, error) {
out := new(RPCCallReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -99,13 +111,20 @@ func (c *serviceClient) RPCCall(ctx context.Context, in *RPCCall) (*RPCCallReply
}
func (c *serviceClient) RxThreadExit(ctx context.Context, in *RxThreadExit) error {
- c.ch.SendRequest(in)
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return err
+ }
+ err = stream.SendMsg(in)
+ if err != nil {
+ return err
+ }
return nil
}
func (c *serviceClient) SockInitShm(ctx context.Context, in *SockInitShm) (*SockInitShmReply, error) {
out := new(SockInitShmReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -114,7 +133,7 @@ func (c *serviceClient) SockInitShm(ctx context.Context, in *SockInitShm) (*Sock
func (c *serviceClient) SockclntCreate(ctx context.Context, in *SockclntCreate) (*SockclntCreateReply, error) {
out := new(SockclntCreateReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -123,7 +142,7 @@ func (c *serviceClient) SockclntCreate(ctx context.Context, in *SockclntCreate)
func (c *serviceClient) SockclntDelete(ctx context.Context, in *SockclntDelete) (*SockclntDeleteReply, error) {
out := new(SockclntDeleteReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -131,11 +150,13 @@ func (c *serviceClient) SockclntDelete(ctx context.Context, in *SockclntDelete)
}
func (c *serviceClient) TracePluginMsgIds(ctx context.Context, in *TracePluginMsgIds) error {
- c.ch.SendRequest(in)
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return err
+ }
+ err = stream.SendMsg(in)
+ if err != nil {
+ return err
+ }
return nil
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/internal/testbinapi/binapi2001/memif/memif.ba.go b/internal/testbinapi/binapi2001/memif/memif.ba.go
index 4964117..d3a0963 100644
--- a/internal/testbinapi/binapi2001/memif/memif.ba.go
+++ b/internal/testbinapi/binapi2001/memif/memif.ba.go
@@ -1,48 +1,38 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.4.0-dev
-// VPP: 20.01-45~g7a071e370~b63
-// source: /usr/share/vpp/api/plugins/memif.api.json
-
-/*
-Package memif contains generated code for VPP binary API defined by memif.api (version 3.0.0).
-
-It consists of:
- 2 aliases
- 8 enums
- 10 messages
-*/
+// VPP: 20.01
+// source: .vppapi/plugins/memif.api.json
+
+// Package memif contains generated bindings for API file memif.api.
+//
+// Contents:
+// 2 aliases
+// 8 enums
+// 10 messages
+//
package memif
import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "math"
- "strconv"
-
api "git.fd.io/govpp.git/api"
codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
+ "net"
+ "strconv"
)
// 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 // please upgrade the GoVPP api package
+const _ = api.GoVppAPIPackageIsVersion2
const (
- // ModuleName is the name of this module.
- ModuleName = "memif"
- // APIVersion is the API version of this module.
+ APIFile = "memif"
APIVersion = "3.0.0"
- // VersionCrc is the CRC of this module.
VersionCrc = 0x88dc56c9
)
-// IfStatusFlags represents VPP binary API enum 'if_status_flags'.
+// IfStatusFlags defines enum 'if_status_flags'.
type IfStatusFlags uint32
const (
@@ -66,10 +56,29 @@ func (x IfStatusFlags) String() string {
if ok {
return s
}
- return "IfStatusFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// IfType represents VPP binary API enum 'if_type'.
+// IfType defines enum 'if_type'.
type IfType uint32
const (
@@ -102,7 +111,7 @@ func (x IfType) String() string {
return "IfType(" + strconv.Itoa(int(x)) + ")"
}
-// LinkDuplex represents VPP binary API enum 'link_duplex'.
+// LinkDuplex defines enum 'link_duplex'.
type LinkDuplex uint32
const (
@@ -132,7 +141,7 @@ func (x LinkDuplex) String() string {
return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
}
-// MemifMode represents VPP binary API enum 'memif_mode'.
+// MemifMode defines enum 'memif_mode'.
type MemifMode uint32
const (
@@ -162,7 +171,7 @@ func (x MemifMode) String() string {
return "MemifMode(" + strconv.Itoa(int(x)) + ")"
}
-// MemifRole represents VPP binary API enum 'memif_role'.
+// MemifRole defines enum 'memif_role'.
type MemifRole uint32
const (
@@ -189,7 +198,7 @@ func (x MemifRole) String() string {
return "MemifRole(" + strconv.Itoa(int(x)) + ")"
}
-// MtuProto represents VPP binary API enum 'mtu_proto'.
+// MtuProto defines enum 'mtu_proto'.
type MtuProto uint32
const (
@@ -225,7 +234,7 @@ func (x MtuProto) String() string {
return "MtuProto(" + strconv.Itoa(int(x)) + ")"
}
-// RxMode represents VPP binary API enum 'rx_mode'.
+// RxMode defines enum 'rx_mode'.
type RxMode uint32
const (
@@ -261,7 +270,7 @@ func (x RxMode) String() string {
return "RxMode(" + strconv.Itoa(int(x)) + ")"
}
-// SubIfFlags represents VPP binary API enum 'sub_if_flags'.
+// SubIfFlags defines enum 'sub_if_flags'.
type SubIfFlags uint32
const (
@@ -309,16 +318,62 @@ func (x SubIfFlags) String() string {
if ok {
return s
}
- return "SubIfFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// InterfaceIndex represents VPP binary API alias 'interface_index'.
+// InterfaceIndex defines alias 'interface_index'.
type InterfaceIndex uint32
-// MacAddress represents VPP binary API alias 'mac_address'.
+// MacAddress defines alias 'mac_address'.
type MacAddress [6]uint8
-// MemifCreate represents VPP binary API message 'memif_create'.
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// MemifCreate defines message 'memif_create'.
type MemifCreate struct {
Role MemifRole `binapi:"memif_role,name=role" json:"role,omitempty"`
Mode MemifMode `binapi:"memif_mode,name=mode" json:"mode,omitempty"`
@@ -330,291 +385,171 @@ type MemifCreate struct {
BufferSize uint16 `binapi:"u16,name=buffer_size" json:"buffer_size,omitempty"`
NoZeroCopy bool `binapi:"bool,name=no_zero_copy" json:"no_zero_copy,omitempty"`
HwAddr MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
- Secret string `binapi:"string[24],name=secret" json:"secret,omitempty" struc:"[24]byte"`
+ Secret string `binapi:"string[24],name=secret" json:"secret,omitempty"`
}
-func (m *MemifCreate) Reset() { *m = MemifCreate{} }
-func (*MemifCreate) GetMessageName() string { return "memif_create" }
-func (*MemifCreate) GetCrcString() string { return "b1b25061" }
-func (*MemifCreate) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MemifCreate) Reset() { *m = MemifCreate{} }
+func (*MemifCreate) GetMessageName() string { return "memif_create" }
+func (*MemifCreate) GetCrcString() string { return "b1b25061" }
+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
- // field[1] m.Role
- size += 4
- // field[1] m.Mode
- size += 4
- // field[1] m.RxQueues
- size += 1
- // field[1] m.TxQueues
- size += 1
- // field[1] m.ID
- size += 4
- // field[1] m.SocketID
- size += 4
- // field[1] m.RingSize
- size += 4
- // field[1] m.BufferSize
- size += 2
- // field[1] m.NoZeroCopy
- size += 1
- // field[1] m.HwAddr
- size += 6
- // field[1] m.Secret
- size += 24
+ size += 4 // m.Role
+ size += 4 // m.Mode
+ size += 1 // m.RxQueues
+ size += 1 // m.TxQueues
+ size += 4 // m.ID
+ size += 4 // m.SocketID
+ size += 4 // m.RingSize
+ size += 2 // m.BufferSize
+ size += 1 // m.NoZeroCopy
+ size += 1 * 6 // m.HwAddr
+ size += 24 // m.Secret
return size
}
func (m *MemifCreate) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Role
- o.PutUint32(buf[pos:pos+4], uint32(m.Role))
- pos += 4
- // field[1] m.Mode
- o.PutUint32(buf[pos:pos+4], uint32(m.Mode))
- pos += 4
- // field[1] m.RxQueues
- buf[pos] = uint8(m.RxQueues)
- pos += 1
- // field[1] m.TxQueues
- buf[pos] = uint8(m.TxQueues)
- pos += 1
- // field[1] m.ID
- o.PutUint32(buf[pos:pos+4], uint32(m.ID))
- pos += 4
- // field[1] m.SocketID
- o.PutUint32(buf[pos:pos+4], uint32(m.SocketID))
- pos += 4
- // field[1] m.RingSize
- o.PutUint32(buf[pos:pos+4], uint32(m.RingSize))
- pos += 4
- // field[1] m.BufferSize
- o.PutUint16(buf[pos:pos+2], uint16(m.BufferSize))
- pos += 2
- // field[1] m.NoZeroCopy
- if m.NoZeroCopy {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.HwAddr
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.HwAddr) {
- x = uint8(m.HwAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Secret
- copy(buf[pos:pos+24], m.Secret)
- pos += 24
- return buf, nil
-}
-func (m *MemifCreate) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Role
- m.Role = MemifRole(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mode
- m.Mode = MemifMode(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.RxQueues
- m.RxQueues = uint8(tmp[pos])
- pos += 1
- // field[1] m.TxQueues
- m.TxQueues = uint8(tmp[pos])
- pos += 1
- // field[1] m.ID
- m.ID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SocketID
- m.SocketID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.RingSize
- m.RingSize = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.BufferSize
- m.BufferSize = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.NoZeroCopy
- m.NoZeroCopy = tmp[pos] != 0
- pos += 1
- // field[1] m.HwAddr
- for i := 0; i < len(m.HwAddr); i++ {
- m.HwAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Secret
- {
- nul := bytes.Index(tmp[pos:pos+24], []byte{0x00})
- m.Secret = codec.DecodeString(tmp[pos : pos+nul])
- pos += 24
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Role))
+ buf.EncodeUint32(uint32(m.Mode))
+ 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)
+ return buf.Bytes(), nil
+}
+func (m *MemifCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Role = MemifRole(buf.DecodeUint32())
+ m.Mode = MemifMode(buf.DecodeUint32())
+ m.RxQueues = buf.DecodeUint8()
+ m.TxQueues = buf.DecodeUint8()
+ m.ID = buf.DecodeUint32()
+ m.SocketID = buf.DecodeUint32()
+ m.RingSize = buf.DecodeUint32()
+ m.BufferSize = buf.DecodeUint16()
+ m.NoZeroCopy = buf.DecodeBool()
+ copy(m.HwAddr[:], buf.DecodeBytes(6))
+ m.Secret = buf.DecodeString(24)
return nil
}
-// MemifCreateReply represents VPP binary API message 'memif_create_reply'.
+// MemifCreateReply defines message 'memif_create_reply'.
type MemifCreateReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
-func (m *MemifCreateReply) Reset() { *m = MemifCreateReply{} }
-func (*MemifCreateReply) GetMessageName() string { return "memif_create_reply" }
-func (*MemifCreateReply) GetCrcString() string { return "5383d31f" }
-func (*MemifCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MemifCreateReply) Reset() { *m = MemifCreateReply{} }
+func (*MemifCreateReply) GetMessageName() string { return "memif_create_reply" }
+func (*MemifCreateReply) GetCrcString() string { return "5383d31f" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
return size
}
func (m *MemifCreateReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *MemifCreateReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
return nil
}
-// MemifDelete represents VPP binary API message 'memif_delete'.
+// MemifDelete defines message 'memif_delete'.
type MemifDelete struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
-func (m *MemifDelete) Reset() { *m = MemifDelete{} }
-func (*MemifDelete) GetMessageName() string { return "memif_delete" }
-func (*MemifDelete) GetCrcString() string { return "f9e6675e" }
-func (*MemifDelete) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MemifDelete) Reset() { *m = MemifDelete{} }
+func (*MemifDelete) GetMessageName() string { return "memif_delete" }
+func (*MemifDelete) GetCrcString() string { return "f9e6675e" }
+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
- // field[1] m.SwIfIndex
- size += 4
+ size += 4 // m.SwIfIndex
return size
}
func (m *MemifDelete) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *MemifDelete) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *MemifDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
return nil
}
-// MemifDeleteReply represents VPP binary API message 'memif_delete_reply'.
+// MemifDeleteReply defines message 'memif_delete_reply'.
type MemifDeleteReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *MemifDeleteReply) Reset() { *m = MemifDeleteReply{} }
-func (*MemifDeleteReply) GetMessageName() string { return "memif_delete_reply" }
-func (*MemifDeleteReply) GetCrcString() string { return "e8d4e804" }
-func (*MemifDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MemifDeleteReply) Reset() { *m = MemifDeleteReply{} }
+func (*MemifDeleteReply) GetMessageName() string { return "memif_delete_reply" }
+func (*MemifDeleteReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *MemifDeleteReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *MemifDeleteReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// MemifDetails represents VPP binary API message 'memif_details'.
+// MemifDetails defines message 'memif_details'.
type MemifDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
HwAddr MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
@@ -626,249 +561,136 @@ type MemifDetails struct {
RingSize uint32 `binapi:"u32,name=ring_size" json:"ring_size,omitempty"`
BufferSize uint16 `binapi:"u16,name=buffer_size" json:"buffer_size,omitempty"`
Flags IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
- IfName string `binapi:"string[64],name=if_name" json:"if_name,omitempty" struc:"[64]byte"`
+ IfName string `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
}
-func (m *MemifDetails) Reset() { *m = MemifDetails{} }
-func (*MemifDetails) GetMessageName() string { return "memif_details" }
-func (*MemifDetails) GetCrcString() string { return "d0382c4c" }
-func (*MemifDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MemifDetails) Reset() { *m = MemifDetails{} }
+func (*MemifDetails) GetMessageName() string { return "memif_details" }
+func (*MemifDetails) GetCrcString() string { return "d0382c4c" }
+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
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.HwAddr
- size += 6
- // field[1] m.ID
- size += 4
- // field[1] m.Role
- size += 4
- // field[1] m.Mode
- size += 4
- // field[1] m.ZeroCopy
- size += 1
- // field[1] m.SocketID
- size += 4
- // field[1] m.RingSize
- size += 4
- // field[1] m.BufferSize
- size += 2
- // field[1] m.Flags
- size += 4
- // field[1] m.IfName
- size += 64
+ size += 4 // m.SwIfIndex
+ size += 1 * 6 // m.HwAddr
+ size += 4 // m.ID
+ size += 4 // m.Role
+ size += 4 // m.Mode
+ size += 1 // m.ZeroCopy
+ size += 4 // m.SocketID
+ size += 4 // m.RingSize
+ size += 2 // m.BufferSize
+ size += 4 // m.Flags
+ size += 64 // m.IfName
return size
}
func (m *MemifDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.HwAddr
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.HwAddr) {
- x = uint8(m.HwAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.ID
- o.PutUint32(buf[pos:pos+4], uint32(m.ID))
- pos += 4
- // field[1] m.Role
- o.PutUint32(buf[pos:pos+4], uint32(m.Role))
- pos += 4
- // field[1] m.Mode
- o.PutUint32(buf[pos:pos+4], uint32(m.Mode))
- pos += 4
- // field[1] m.ZeroCopy
- if m.ZeroCopy {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.SocketID
- o.PutUint32(buf[pos:pos+4], uint32(m.SocketID))
- pos += 4
- // field[1] m.RingSize
- o.PutUint32(buf[pos:pos+4], uint32(m.RingSize))
- pos += 4
- // field[1] m.BufferSize
- o.PutUint16(buf[pos:pos+2], uint16(m.BufferSize))
- pos += 2
- // field[1] m.Flags
- o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
- pos += 4
- // field[1] m.IfName
- copy(buf[pos:pos+64], m.IfName)
- pos += 64
- return buf, nil
-}
-func (m *MemifDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.HwAddr
- for i := 0; i < len(m.HwAddr); i++ {
- m.HwAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.ID
- m.ID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Role
- m.Role = MemifRole(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mode
- m.Mode = MemifMode(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ZeroCopy
- m.ZeroCopy = tmp[pos] != 0
- pos += 1
- // field[1] m.SocketID
- m.SocketID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.RingSize
- m.RingSize = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.BufferSize
- m.BufferSize = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.Flags
- m.Flags = IfStatusFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IfName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.IfName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBytes(m.HwAddr[:], 6)
+ buf.EncodeUint32(m.ID)
+ buf.EncodeUint32(uint32(m.Role))
+ buf.EncodeUint32(uint32(m.Mode))
+ buf.EncodeBool(m.ZeroCopy)
+ 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
+}
+func (m *MemifDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.HwAddr[:], buf.DecodeBytes(6))
+ m.ID = buf.DecodeUint32()
+ m.Role = MemifRole(buf.DecodeUint32())
+ m.Mode = MemifMode(buf.DecodeUint32())
+ m.ZeroCopy = buf.DecodeBool()
+ m.SocketID = buf.DecodeUint32()
+ m.RingSize = buf.DecodeUint32()
+ m.BufferSize = buf.DecodeUint16()
+ m.Flags = IfStatusFlags(buf.DecodeUint32())
+ m.IfName = buf.DecodeString(64)
return nil
}
-// MemifDump represents VPP binary API message 'memif_dump'.
+// MemifDump defines message 'memif_dump'.
type MemifDump struct{}
-func (m *MemifDump) Reset() { *m = MemifDump{} }
-func (*MemifDump) GetMessageName() string { return "memif_dump" }
-func (*MemifDump) GetCrcString() string { return "51077d14" }
-func (*MemifDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MemifDump) Reset() { *m = MemifDump{} }
+func (*MemifDump) GetMessageName() string { return "memif_dump" }
+func (*MemifDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *MemifDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *MemifDump) Unmarshal(b []byte) error {
return nil
}
-// MemifSocketFilenameAddDel represents VPP binary API message 'memif_socket_filename_add_del'.
+// MemifSocketFilenameAddDel defines message 'memif_socket_filename_add_del'.
type MemifSocketFilenameAddDel struct {
IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
- SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty" struc:"[108]byte"`
+ SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty"`
}
-func (m *MemifSocketFilenameAddDel) Reset() { *m = MemifSocketFilenameAddDel{} }
-func (*MemifSocketFilenameAddDel) GetMessageName() string { return "memif_socket_filename_add_del" }
-func (*MemifSocketFilenameAddDel) GetCrcString() string { return "a2ce1a10" }
-func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MemifSocketFilenameAddDel) Reset() { *m = MemifSocketFilenameAddDel{} }
+func (*MemifSocketFilenameAddDel) GetMessageName() string { return "memif_socket_filename_add_del" }
+func (*MemifSocketFilenameAddDel) GetCrcString() string { return "a2ce1a10" }
+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
- // field[1] m.IsAdd
- size += 1
- // field[1] m.SocketID
- size += 4
- // field[1] m.SocketFilename
- size += 108
+ size += 1 // m.IsAdd
+ size += 4 // m.SocketID
+ size += 108 // m.SocketFilename
return size
}
func (m *MemifSocketFilenameAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.SocketID
- o.PutUint32(buf[pos:pos+4], uint32(m.SocketID))
- pos += 4
- // field[1] m.SocketFilename
- copy(buf[pos:pos+108], m.SocketFilename)
- pos += 108
- return buf, nil
-}
-func (m *MemifSocketFilenameAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.SocketID
- m.SocketID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SocketFilename
- {
- nul := bytes.Index(tmp[pos:pos+108], []byte{0x00})
- m.SocketFilename = codec.DecodeString(tmp[pos : pos+nul])
- pos += 108
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(m.SocketID)
+ buf.EncodeString(m.SocketFilename, 108)
+ return buf.Bytes(), nil
+}
+func (m *MemifSocketFilenameAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SocketID = buf.DecodeUint32()
+ m.SocketFilename = buf.DecodeString(108)
return nil
}
-// MemifSocketFilenameAddDelReply represents VPP binary API message 'memif_socket_filename_add_del_reply'.
+// MemifSocketFilenameAddDelReply defines message 'memif_socket_filename_add_del_reply'.
type MemifSocketFilenameAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -877,151 +699,108 @@ func (m *MemifSocketFilenameAddDelReply) Reset() { *m = MemifSocketFilenameAddDe
func (*MemifSocketFilenameAddDelReply) GetMessageName() string {
return "memif_socket_filename_add_del_reply"
}
-func (*MemifSocketFilenameAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*MemifSocketFilenameAddDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *MemifSocketFilenameAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *MemifSocketFilenameAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// MemifSocketFilenameDetails represents VPP binary API message 'memif_socket_filename_details'.
+// MemifSocketFilenameDetails defines message 'memif_socket_filename_details'.
type MemifSocketFilenameDetails struct {
SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
- SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty" struc:"[108]byte"`
+ SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty"`
}
-func (m *MemifSocketFilenameDetails) Reset() { *m = MemifSocketFilenameDetails{} }
-func (*MemifSocketFilenameDetails) GetMessageName() string { return "memif_socket_filename_details" }
-func (*MemifSocketFilenameDetails) GetCrcString() string { return "7ff326f7" }
-func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MemifSocketFilenameDetails) Reset() { *m = MemifSocketFilenameDetails{} }
+func (*MemifSocketFilenameDetails) GetMessageName() string { return "memif_socket_filename_details" }
+func (*MemifSocketFilenameDetails) GetCrcString() string { return "7ff326f7" }
+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
- // field[1] m.SocketID
- size += 4
- // field[1] m.SocketFilename
- size += 108
+ size += 4 // m.SocketID
+ size += 108 // m.SocketFilename
return size
}
func (m *MemifSocketFilenameDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SocketID
- o.PutUint32(buf[pos:pos+4], uint32(m.SocketID))
- pos += 4
- // field[1] m.SocketFilename
- copy(buf[pos:pos+108], m.SocketFilename)
- pos += 108
- return buf, nil
-}
-func (m *MemifSocketFilenameDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SocketID
- m.SocketID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SocketFilename
- {
- nul := bytes.Index(tmp[pos:pos+108], []byte{0x00})
- m.SocketFilename = codec.DecodeString(tmp[pos : pos+nul])
- pos += 108
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SocketID)
+ buf.EncodeString(m.SocketFilename, 108)
+ return buf.Bytes(), nil
+}
+func (m *MemifSocketFilenameDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SocketID = buf.DecodeUint32()
+ m.SocketFilename = buf.DecodeString(108)
return nil
}
-// MemifSocketFilenameDump represents VPP binary API message 'memif_socket_filename_dump'.
+// MemifSocketFilenameDump defines message 'memif_socket_filename_dump'.
type MemifSocketFilenameDump struct{}
-func (m *MemifSocketFilenameDump) Reset() { *m = MemifSocketFilenameDump{} }
-func (*MemifSocketFilenameDump) GetMessageName() string { return "memif_socket_filename_dump" }
-func (*MemifSocketFilenameDump) GetCrcString() string { return "51077d14" }
-func (*MemifSocketFilenameDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MemifSocketFilenameDump) Reset() { *m = MemifSocketFilenameDump{} }
+func (*MemifSocketFilenameDump) GetMessageName() string { return "memif_socket_filename_dump" }
+func (*MemifSocketFilenameDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *MemifSocketFilenameDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *MemifSocketFilenameDump) Unmarshal(b []byte) error {
return nil
}
func init() { file_memif_binapi_init() }
func file_memif_binapi_init() {
- api.RegisterMessage((*MemifCreate)(nil), "memif.MemifCreate")
- api.RegisterMessage((*MemifCreateReply)(nil), "memif.MemifCreateReply")
- api.RegisterMessage((*MemifDelete)(nil), "memif.MemifDelete")
- api.RegisterMessage((*MemifDeleteReply)(nil), "memif.MemifDeleteReply")
- api.RegisterMessage((*MemifDetails)(nil), "memif.MemifDetails")
- api.RegisterMessage((*MemifDump)(nil), "memif.MemifDump")
- api.RegisterMessage((*MemifSocketFilenameAddDel)(nil), "memif.MemifSocketFilenameAddDel")
- api.RegisterMessage((*MemifSocketFilenameAddDelReply)(nil), "memif.MemifSocketFilenameAddDelReply")
- api.RegisterMessage((*MemifSocketFilenameDetails)(nil), "memif.MemifSocketFilenameDetails")
- api.RegisterMessage((*MemifSocketFilenameDump)(nil), "memif.MemifSocketFilenameDump")
+ api.RegisterMessage((*MemifCreate)(nil), "memif_create_b1b25061")
+ api.RegisterMessage((*MemifCreateReply)(nil), "memif_create_reply_5383d31f")
+ api.RegisterMessage((*MemifDelete)(nil), "memif_delete_f9e6675e")
+ api.RegisterMessage((*MemifDeleteReply)(nil), "memif_delete_reply_e8d4e804")
+ api.RegisterMessage((*MemifDetails)(nil), "memif_details_d0382c4c")
+ api.RegisterMessage((*MemifDump)(nil), "memif_dump_51077d14")
+ api.RegisterMessage((*MemifSocketFilenameAddDel)(nil), "memif_socket_filename_add_del_a2ce1a10")
+ api.RegisterMessage((*MemifSocketFilenameAddDelReply)(nil), "memif_socket_filename_add_del_reply_e8d4e804")
+ api.RegisterMessage((*MemifSocketFilenameDetails)(nil), "memif_socket_filename_details_7ff326f7")
+ api.RegisterMessage((*MemifSocketFilenameDump)(nil), "memif_socket_filename_dump_51077d14")
}
// Messages returns list of all messages in this module.
@@ -1039,14 +818,3 @@ func AllMessages() []api.Message {
(*MemifSocketFilenameDump)(nil),
}
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
diff --git a/internal/testbinapi/binapi2001/memif/memif_rpc.ba.go b/internal/testbinapi/binapi2001/memif/memif_rpc.ba.go
index 8eda8f1..8e6c7bc 100644
--- a/internal/testbinapi/binapi2001/memif/memif_rpc.ba.go
+++ b/internal/testbinapi/binapi2001/memif/memif_rpc.ba.go
@@ -4,108 +4,130 @@ package memif
import (
"context"
- "io"
-
+ "fmt"
api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
)
-// RPCService represents RPC service API for memif module.
+// RPCService defines RPC service memif.
type RPCService interface {
- DumpMemif(ctx context.Context, in *MemifDump) (RPCService_DumpMemifClient, error)
- DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_DumpMemifSocketFilenameClient, error)
MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error)
MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error)
+ MemifDump(ctx context.Context, in *MemifDump) (RPCService_MemifDumpClient, error)
MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error)
+ MemifSocketFilenameDump(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_MemifSocketFilenameDumpClient, error)
}
type serviceClient struct {
- ch api.Channel
+ conn api.Connection
}
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
}
-func (c *serviceClient) DumpMemif(ctx context.Context, in *MemifDump) (RPCService_DumpMemifClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMemifClient{stream}
- return x, nil
-}
-
-type RPCService_DumpMemifClient interface {
- Recv() (*MemifDetails, error)
+func (c *serviceClient) MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error) {
+ out := new(MemifCreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-type serviceClient_DumpMemifClient struct {
- api.MultiRequestCtx
+func (c *serviceClient) MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error) {
+ out := new(MemifDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-func (c *serviceClient_DumpMemifClient) Recv() (*MemifDetails, error) {
- m := new(MemifDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) MemifDump(ctx context.Context, in *MemifDump) (RPCService_MemifDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
+ x := &serviceClient_MemifDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
}
- return m, nil
-}
-
-func (c *serviceClient) DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_DumpMemifSocketFilenameClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMemifSocketFilenameClient{stream}
return x, nil
}
-type RPCService_DumpMemifSocketFilenameClient interface {
- Recv() (*MemifSocketFilenameDetails, error)
+type RPCService_MemifDumpClient interface {
+ Recv() (*MemifDetails, error)
+ api.Stream
}
-type serviceClient_DumpMemifSocketFilenameClient struct {
- api.MultiRequestCtx
+type serviceClient_MemifDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpMemifSocketFilenameClient) Recv() (*MemifSocketFilenameDetails, error) {
- m := new(MemifSocketFilenameDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_MemifDumpClient) Recv() (*MemifDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *MemifDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
}
-func (c *serviceClient) MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error) {
- out := new(MemifCreateReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+func (c *serviceClient) MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error) {
+ out := new(MemifSocketFilenameAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
-func (c *serviceClient) MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error) {
- out := new(MemifDeleteReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+func (c *serviceClient) MemifSocketFilenameDump(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_MemifSocketFilenameDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- return out, nil
+ x := &serviceClient_MemifSocketFilenameDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
}
-func (c *serviceClient) MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error) {
- out := new(MemifSocketFilenameAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+type RPCService_MemifSocketFilenameDumpClient interface {
+ Recv() (*MemifSocketFilenameDetails, error)
+ api.Stream
+}
+
+type serviceClient_MemifSocketFilenameDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MemifSocketFilenameDumpClient) Recv() (*MemifSocketFilenameDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- return out, nil
+ switch m := msg.(type) {
+ case *MemifSocketFilenameDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/internal/testbinapi/binapi2001/mfib_types/mfib_types.ba.go b/internal/testbinapi/binapi2001/mfib_types/mfib_types.ba.go
new file mode 100644
index 0000000..2283f8b
--- /dev/null
+++ b/internal/testbinapi/binapi2001/mfib_types/mfib_types.ba.go
@@ -0,0 +1,826 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/mfib_types.api.json
+
+// Package mfib_types contains generated bindings for API file mfib_types.api.
+//
+// Contents:
+// 5 aliases
+// 8 enums
+// 10 structs
+// 1 union
+//
+package mfib_types
+
+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
+
+// 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<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// FibPathNhProto defines enum 'fib_path_nh_proto'.
+type FibPathNhProto uint32
+
+const (
+ FIB_API_PATH_NH_PROTO_IP4 FibPathNhProto = 0
+ FIB_API_PATH_NH_PROTO_IP6 FibPathNhProto = 1
+ FIB_API_PATH_NH_PROTO_MPLS FibPathNhProto = 2
+ FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
+ FIB_API_PATH_NH_PROTO_BIER FibPathNhProto = 4
+)
+
+var (
+ FibPathNhProto_name = map[uint32]string{
+ 0: "FIB_API_PATH_NH_PROTO_IP4",
+ 1: "FIB_API_PATH_NH_PROTO_IP6",
+ 2: "FIB_API_PATH_NH_PROTO_MPLS",
+ 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
+ 4: "FIB_API_PATH_NH_PROTO_BIER",
+ }
+ FibPathNhProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathNhProto) String() string {
+ s, ok := FibPathNhProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// FibPathType defines enum 'fib_path_type'.
+type FibPathType uint32
+
+const (
+ FIB_API_PATH_TYPE_NORMAL FibPathType = 0
+ FIB_API_PATH_TYPE_LOCAL FibPathType = 1
+ FIB_API_PATH_TYPE_DROP FibPathType = 2
+ FIB_API_PATH_TYPE_UDP_ENCAP FibPathType = 3
+ FIB_API_PATH_TYPE_BIER_IMP FibPathType = 4
+ FIB_API_PATH_TYPE_ICMP_UNREACH FibPathType = 5
+ FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
+ FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
+ FIB_API_PATH_TYPE_DVR FibPathType = 8
+ FIB_API_PATH_TYPE_INTERFACE_RX FibPathType = 9
+ FIB_API_PATH_TYPE_CLASSIFY FibPathType = 10
+)
+
+var (
+ FibPathType_name = map[uint32]string{
+ 0: "FIB_API_PATH_TYPE_NORMAL",
+ 1: "FIB_API_PATH_TYPE_LOCAL",
+ 2: "FIB_API_PATH_TYPE_DROP",
+ 3: "FIB_API_PATH_TYPE_UDP_ENCAP",
+ 4: "FIB_API_PATH_TYPE_BIER_IMP",
+ 5: "FIB_API_PATH_TYPE_ICMP_UNREACH",
+ 6: "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
+ 7: "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
+ 8: "FIB_API_PATH_TYPE_DVR",
+ 9: "FIB_API_PATH_TYPE_INTERFACE_RX",
+ 10: "FIB_API_PATH_TYPE_CLASSIFY",
+ }
+ FibPathType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathType) String() string {
+ s, ok := FibPathType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MfibItfFlags defines enum 'mfib_itf_flags'.
+type MfibItfFlags uint32
+
+const (
+ MFIB_API_ITF_FLAG_NONE MfibItfFlags = 0
+ MFIB_API_ITF_FLAG_NEGATE_SIGNAL MfibItfFlags = 1
+ MFIB_API_ITF_FLAG_ACCEPT MfibItfFlags = 2
+ MFIB_API_ITF_FLAG_FORWARD MfibItfFlags = 4
+ MFIB_API_ITF_FLAG_SIGNAL_PRESENT MfibItfFlags = 8
+ MFIB_API_ITF_FLAG_DONT_PRESERVE MfibItfFlags = 16
+)
+
+var (
+ MfibItfFlags_name = map[uint32]string{
+ 0: "MFIB_API_ITF_FLAG_NONE",
+ 1: "MFIB_API_ITF_FLAG_NEGATE_SIGNAL",
+ 2: "MFIB_API_ITF_FLAG_ACCEPT",
+ 4: "MFIB_API_ITF_FLAG_FORWARD",
+ 8: "MFIB_API_ITF_FLAG_SIGNAL_PRESENT",
+ 16: "MFIB_API_ITF_FLAG_DONT_PRESERVE",
+ }
+ MfibItfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MfibItfFlags) String() string {
+ s, ok := MfibItfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := MfibItfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "MfibItfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// FibMplsLabel defines type 'fib_mpls_label'.
+type FibMplsLabel struct {
+ IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
+ Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
+ TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
+ Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
+}
+
+// FibPath defines type 'fib_path'.
+type FibPath struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+ Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
+ Type FibPathType `binapi:"fib_path_type,name=type" json:"type,omitempty"`
+ Flags FibPathFlags `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
+ Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
+ Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
+ NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
+ LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
+}
+
+// FibPathNh defines type 'fib_path_nh'.
+type FibPathNh struct {
+ Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
+ ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
+ ObjID uint32 `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
+ ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// MfibPath defines type 'mfib_path'.
+type MfibPath struct {
+ ItfFlags MfibItfFlags `binapi:"mfib_itf_flags,name=itf_flags" json:"itf_flags,omitempty"`
+ Path FibPath `binapi:"fib_path,name=path" json:"path,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
diff --git a/internal/testbinapi/binapi2001/mpls/mpls.ba.go b/internal/testbinapi/binapi2001/mpls/mpls.ba.go
new file mode 100644
index 0000000..11ab34b
--- /dev/null
+++ b/internal/testbinapi/binapi2001/mpls/mpls.ba.go
@@ -0,0 +1,2025 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/mpls.api.json
+
+// Package mpls contains generated bindings for API file mpls.api.
+//
+// Contents:
+// 6 aliases
+// 13 enums
+// 12 structs
+// 1 union
+// 16 messages
+//
+package mpls
+
+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 = "mpls"
+ APIVersion = "1.1.1"
+ VersionCrc = 0xfe593e14
+)
+
+// 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<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// FibPathNhProto defines enum 'fib_path_nh_proto'.
+type FibPathNhProto uint32
+
+const (
+ FIB_API_PATH_NH_PROTO_IP4 FibPathNhProto = 0
+ FIB_API_PATH_NH_PROTO_IP6 FibPathNhProto = 1
+ FIB_API_PATH_NH_PROTO_MPLS FibPathNhProto = 2
+ FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
+ FIB_API_PATH_NH_PROTO_BIER FibPathNhProto = 4
+)
+
+var (
+ FibPathNhProto_name = map[uint32]string{
+ 0: "FIB_API_PATH_NH_PROTO_IP4",
+ 1: "FIB_API_PATH_NH_PROTO_IP6",
+ 2: "FIB_API_PATH_NH_PROTO_MPLS",
+ 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
+ 4: "FIB_API_PATH_NH_PROTO_BIER",
+ }
+ FibPathNhProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathNhProto) String() string {
+ s, ok := FibPathNhProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// FibPathType defines enum 'fib_path_type'.
+type FibPathType uint32
+
+const (
+ FIB_API_PATH_TYPE_NORMAL FibPathType = 0
+ FIB_API_PATH_TYPE_LOCAL FibPathType = 1
+ FIB_API_PATH_TYPE_DROP FibPathType = 2
+ FIB_API_PATH_TYPE_UDP_ENCAP FibPathType = 3
+ FIB_API_PATH_TYPE_BIER_IMP FibPathType = 4
+ FIB_API_PATH_TYPE_ICMP_UNREACH FibPathType = 5
+ FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
+ FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
+ FIB_API_PATH_TYPE_DVR FibPathType = 8
+ FIB_API_PATH_TYPE_INTERFACE_RX FibPathType = 9
+ FIB_API_PATH_TYPE_CLASSIFY FibPathType = 10
+)
+
+var (
+ FibPathType_name = map[uint32]string{
+ 0: "FIB_API_PATH_TYPE_NORMAL",
+ 1: "FIB_API_PATH_TYPE_LOCAL",
+ 2: "FIB_API_PATH_TYPE_DROP",
+ 3: "FIB_API_PATH_TYPE_UDP_ENCAP",
+ 4: "FIB_API_PATH_TYPE_BIER_IMP",
+ 5: "FIB_API_PATH_TYPE_ICMP_UNREACH",
+ 6: "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
+ 7: "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
+ 8: "FIB_API_PATH_TYPE_DVR",
+ 9: "FIB_API_PATH_TYPE_INTERFACE_RX",
+ 10: "FIB_API_PATH_TYPE_CLASSIFY",
+ }
+ FibPathType_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x FibPathType) String() string {
+ s, ok := FibPathType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "FibPathType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// FibMplsLabel defines type 'fib_mpls_label'.
+type FibMplsLabel struct {
+ IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
+ Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
+ TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
+ Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
+}
+
+// FibPath defines type 'fib_path'.
+type FibPath struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+ Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
+ Type FibPathType `binapi:"fib_path_type,name=type" json:"type,omitempty"`
+ Flags FibPathFlags `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
+ Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
+ Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
+ NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
+ LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
+}
+
+// FibPathNh defines type 'fib_path_nh'.
+type FibPathNh struct {
+ Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
+ ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
+ ObjID uint32 `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
+ ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// MplsRoute defines type 'mpls_route'.
+type MplsRoute struct {
+ MrTableID uint32 `binapi:"u32,name=mr_table_id" json:"mr_table_id,omitempty"`
+ MrLabel uint32 `binapi:"u32,name=mr_label" json:"mr_label,omitempty"`
+ MrEos uint8 `binapi:"u8,name=mr_eos" json:"mr_eos,omitempty"`
+ MrEosProto uint8 `binapi:"u8,name=mr_eos_proto" json:"mr_eos_proto,omitempty"`
+ MrIsMulticast bool `binapi:"bool,name=mr_is_multicast" json:"mr_is_multicast,omitempty"`
+ MrNPaths uint8 `binapi:"u8,name=mr_n_paths" json:"-"`
+ MrPaths []FibPath `binapi:"fib_path[mr_n_paths],name=mr_paths" json:"mr_paths,omitempty"`
+}
+
+// MplsTable defines type 'mpls_table'.
+type MplsTable struct {
+ MtTableID uint32 `binapi:"u32,name=mt_table_id" json:"mt_table_id,omitempty"`
+ MtName string `binapi:"string[64],name=mt_name" json:"mt_name,omitempty"`
+}
+
+// MplsTunnel defines type 'mpls_tunnel'.
+type MplsTunnel struct {
+ MtSwIfIndex InterfaceIndex `binapi:"interface_index,name=mt_sw_if_index" json:"mt_sw_if_index,omitempty"`
+ MtTunnelIndex uint32 `binapi:"u32,name=mt_tunnel_index" json:"mt_tunnel_index,omitempty"`
+ MtL2Only bool `binapi:"bool,name=mt_l2_only" json:"mt_l2_only,omitempty"`
+ MtIsMulticast bool `binapi:"bool,name=mt_is_multicast" json:"mt_is_multicast,omitempty"`
+ MtNPaths uint8 `binapi:"u8,name=mt_n_paths" json:"-"`
+ MtPaths []FibPath `binapi:"fib_path[mt_n_paths],name=mt_paths" json:"mt_paths,omitempty"`
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// MplsIPBindUnbind defines message 'mpls_ip_bind_unbind'.
+type MplsIPBindUnbind struct {
+ MbMplsTableID uint32 `binapi:"u32,name=mb_mpls_table_id" json:"mb_mpls_table_id,omitempty"`
+ MbLabel uint32 `binapi:"u32,name=mb_label" json:"mb_label,omitempty"`
+ MbIPTableID uint32 `binapi:"u32,name=mb_ip_table_id" json:"mb_ip_table_id,omitempty"`
+ MbIsBind bool `binapi:"bool,name=mb_is_bind" json:"mb_is_bind,omitempty"`
+ MbPrefix Prefix `binapi:"prefix,name=mb_prefix" json:"mb_prefix,omitempty"`
+}
+
+func (m *MplsIPBindUnbind) Reset() { *m = MplsIPBindUnbind{} }
+func (*MplsIPBindUnbind) GetMessageName() string { return "mpls_ip_bind_unbind" }
+func (*MplsIPBindUnbind) GetCrcString() string { return "48249a27" }
+func (*MplsIPBindUnbind) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MplsIPBindUnbind) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.MbMplsTableID
+ size += 4 // m.MbLabel
+ size += 4 // m.MbIPTableID
+ size += 1 // m.MbIsBind
+ size += 4 // m.MbPrefix.Address.Af
+ size += 1 * 16 // m.MbPrefix.Address.Un
+ size += 1 // m.MbPrefix.Len
+ return size
+}
+func (m *MplsIPBindUnbind) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.MbMplsTableID)
+ buf.EncodeUint32(m.MbLabel)
+ buf.EncodeUint32(m.MbIPTableID)
+ buf.EncodeBool(m.MbIsBind)
+ buf.EncodeUint32(uint32(m.MbPrefix.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.MbMplsTableID = buf.DecodeUint32()
+ m.MbLabel = buf.DecodeUint32()
+ m.MbIPTableID = buf.DecodeUint32()
+ m.MbIsBind = buf.DecodeBool()
+ m.MbPrefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.MbPrefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.MbPrefix.Len = buf.DecodeUint8()
+ return nil
+}
+
+// MplsIPBindUnbindReply defines message 'mpls_ip_bind_unbind_reply'.
+type MplsIPBindUnbindReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MplsIPBindUnbindReply) Reset() { *m = MplsIPBindUnbindReply{} }
+func (*MplsIPBindUnbindReply) GetMessageName() string { return "mpls_ip_bind_unbind_reply" }
+func (*MplsIPBindUnbindReply) GetCrcString() string { return "e8d4e804" }
+func (*MplsIPBindUnbindReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MplsIPBindUnbindReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MplsIPBindUnbindReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MplsRouteAddDel defines message 'mpls_route_add_del'.
+type MplsRouteAddDel struct {
+ MrIsAdd bool `binapi:"bool,name=mr_is_add" json:"mr_is_add,omitempty"`
+ MrIsMultipath bool `binapi:"bool,name=mr_is_multipath" json:"mr_is_multipath,omitempty"`
+ MrRoute MplsRoute `binapi:"mpls_route,name=mr_route" json:"mr_route,omitempty"`
+}
+
+func (m *MplsRouteAddDel) Reset() { *m = MplsRouteAddDel{} }
+func (*MplsRouteAddDel) GetMessageName() string { return "mpls_route_add_del" }
+func (*MplsRouteAddDel) GetCrcString() string { return "343cff54" }
+func (*MplsRouteAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MplsRouteAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.MrIsAdd
+ size += 1 // m.MrIsMultipath
+ size += 4 // m.MrRoute.MrTableID
+ size += 4 // m.MrRoute.MrLabel
+ size += 1 // m.MrRoute.MrEos
+ size += 1 // m.MrRoute.MrEosProto
+ size += 1 // m.MrRoute.MrIsMulticast
+ size += 1 // m.MrRoute.MrNPaths
+ for j2 := 0; j2 < len(m.MrRoute.MrPaths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.MrRoute.MrPaths) {
+ s2 = m.MrRoute.MrPaths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.MrIsAdd)
+ buf.EncodeBool(m.MrIsMultipath)
+ 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 FibPath // MrPaths
+ if j1 < len(m.MrRoute.MrPaths) {
+ v1 = m.MrRoute.MrPaths[j1]
+ }
+ 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[:], 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++ {
+ 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 *MplsRouteAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MrIsAdd = buf.DecodeBool()
+ m.MrIsMultipath = buf.DecodeBool()
+ m.MrRoute.MrTableID = buf.DecodeUint32()
+ m.MrRoute.MrLabel = buf.DecodeUint32()
+ m.MrRoute.MrEos = buf.DecodeUint8()
+ m.MrRoute.MrEosProto = buf.DecodeUint8()
+ m.MrRoute.MrIsMulticast = buf.DecodeBool()
+ m.MrRoute.MrNPaths = buf.DecodeUint8()
+ m.MrRoute.MrPaths = make([]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()
+ m.MrRoute.MrPaths[j1].RpfID = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].Weight = buf.DecodeUint8()
+ m.MrRoute.MrPaths[j1].Preference = buf.DecodeUint8()
+ m.MrRoute.MrPaths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.MrRoute.MrPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.MrRoute.MrPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.MrRoute.MrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.MrRoute.MrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.MrRoute.MrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.MrRoute.MrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.MrRoute.MrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// MplsRouteAddDelReply defines message 'mpls_route_add_del_reply'.
+type MplsRouteAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
+}
+
+func (m *MplsRouteAddDelReply) Reset() { *m = MplsRouteAddDelReply{} }
+func (*MplsRouteAddDelReply) GetMessageName() string { return "mpls_route_add_del_reply" }
+func (*MplsRouteAddDelReply) GetCrcString() string { return "1992deab" }
+func (*MplsRouteAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MplsRouteAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.StatsIndex
+ return size
+}
+func (m *MplsRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.StatsIndex = buf.DecodeUint32()
+ return nil
+}
+
+// MplsRouteDetails defines message 'mpls_route_details'.
+type MplsRouteDetails struct {
+ MrRoute MplsRoute `binapi:"mpls_route,name=mr_route" json:"mr_route,omitempty"`
+}
+
+func (m *MplsRouteDetails) Reset() { *m = MplsRouteDetails{} }
+func (*MplsRouteDetails) GetMessageName() string { return "mpls_route_details" }
+func (*MplsRouteDetails) GetCrcString() string { return "d0ac384c" }
+func (*MplsRouteDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MplsRouteDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.MrRoute.MrTableID
+ size += 4 // m.MrRoute.MrLabel
+ size += 1 // m.MrRoute.MrEos
+ size += 1 // m.MrRoute.MrEosProto
+ size += 1 // m.MrRoute.MrIsMulticast
+ size += 1 // m.MrRoute.MrNPaths
+ for j2 := 0; j2 < len(m.MrRoute.MrPaths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.MrRoute.MrPaths) {
+ s2 = m.MrRoute.MrPaths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 FibPath // MrPaths
+ if j1 < len(m.MrRoute.MrPaths) {
+ v1 = m.MrRoute.MrPaths[j1]
+ }
+ 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[:], 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++ {
+ 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 *MplsRouteDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MrRoute.MrTableID = buf.DecodeUint32()
+ m.MrRoute.MrLabel = buf.DecodeUint32()
+ m.MrRoute.MrEos = buf.DecodeUint8()
+ m.MrRoute.MrEosProto = buf.DecodeUint8()
+ m.MrRoute.MrIsMulticast = buf.DecodeBool()
+ m.MrRoute.MrNPaths = buf.DecodeUint8()
+ m.MrRoute.MrPaths = make([]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()
+ m.MrRoute.MrPaths[j1].RpfID = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].Weight = buf.DecodeUint8()
+ m.MrRoute.MrPaths[j1].Preference = buf.DecodeUint8()
+ m.MrRoute.MrPaths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.MrRoute.MrPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.MrRoute.MrPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.MrRoute.MrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.MrRoute.MrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.MrRoute.MrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.MrRoute.MrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.MrRoute.MrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.MrRoute.MrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// MplsRouteDump defines message 'mpls_route_dump'.
+type MplsRouteDump struct {
+ Table MplsTable `binapi:"mpls_table,name=table" json:"table,omitempty"`
+}
+
+func (m *MplsRouteDump) Reset() { *m = MplsRouteDump{} }
+func (*MplsRouteDump) GetMessageName() string { return "mpls_route_dump" }
+func (*MplsRouteDump) GetCrcString() string { return "935fdefa" }
+func (*MplsRouteDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MplsRouteDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Table.MtTableID
+ size += 64 // m.Table.MtName
+ return size
+}
+func (m *MplsRouteDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.MtTableID)
+ buf.EncodeString(m.Table.MtName, 64)
+ return buf.Bytes(), nil
+}
+func (m *MplsRouteDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.MtTableID = buf.DecodeUint32()
+ m.Table.MtName = buf.DecodeString(64)
+ return nil
+}
+
+// MplsTableAddDel defines message 'mpls_table_add_del'.
+type MplsTableAddDel struct {
+ MtIsAdd bool `binapi:"bool,name=mt_is_add,default=true" json:"mt_is_add,omitempty"`
+ MtTable MplsTable `binapi:"mpls_table,name=mt_table" json:"mt_table,omitempty"`
+}
+
+func (m *MplsTableAddDel) Reset() { *m = MplsTableAddDel{} }
+func (*MplsTableAddDel) GetMessageName() string { return "mpls_table_add_del" }
+func (*MplsTableAddDel) GetCrcString() string { return "57817512" }
+func (*MplsTableAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MplsTableAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.MtIsAdd
+ size += 4 // m.MtTable.MtTableID
+ size += 64 // m.MtTable.MtName
+ return size
+}
+func (m *MplsTableAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.MtIsAdd)
+ buf.EncodeUint32(m.MtTable.MtTableID)
+ buf.EncodeString(m.MtTable.MtName, 64)
+ return buf.Bytes(), nil
+}
+func (m *MplsTableAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MtIsAdd = buf.DecodeBool()
+ m.MtTable.MtTableID = buf.DecodeUint32()
+ m.MtTable.MtName = buf.DecodeString(64)
+ return nil
+}
+
+// MplsTableAddDelReply defines message 'mpls_table_add_del_reply'.
+type MplsTableAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MplsTableAddDelReply) Reset() { *m = MplsTableAddDelReply{} }
+func (*MplsTableAddDelReply) GetMessageName() string { return "mpls_table_add_del_reply" }
+func (*MplsTableAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*MplsTableAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MplsTableAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MplsTableAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// MplsTableDetails defines message 'mpls_table_details'.
+type MplsTableDetails struct {
+ MtTable MplsTable `binapi:"mpls_table,name=mt_table" json:"mt_table,omitempty"`
+}
+
+func (m *MplsTableDetails) Reset() { *m = MplsTableDetails{} }
+func (*MplsTableDetails) GetMessageName() string { return "mpls_table_details" }
+func (*MplsTableDetails) GetCrcString() string { return "f03ecdc8" }
+func (*MplsTableDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MplsTableDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.MtTable.MtTableID
+ size += 64 // m.MtTable.MtName
+ return size
+}
+func (m *MplsTableDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.MtTable.MtTableID)
+ buf.EncodeString(m.MtTable.MtName, 64)
+ return buf.Bytes(), nil
+}
+func (m *MplsTableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MtTable.MtTableID = buf.DecodeUint32()
+ m.MtTable.MtName = buf.DecodeString(64)
+ return nil
+}
+
+// MplsTableDump defines message 'mpls_table_dump'.
+type MplsTableDump struct{}
+
+func (m *MplsTableDump) Reset() { *m = MplsTableDump{} }
+func (*MplsTableDump) GetMessageName() string { return "mpls_table_dump" }
+func (*MplsTableDump) GetCrcString() string { return "51077d14" }
+func (*MplsTableDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MplsTableDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *MplsTableDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *MplsTableDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// MplsTunnelAddDel defines message 'mpls_tunnel_add_del'.
+type MplsTunnelAddDel struct {
+ MtIsAdd bool `binapi:"bool,name=mt_is_add,default=true" json:"mt_is_add,omitempty"`
+ MtTunnel MplsTunnel `binapi:"mpls_tunnel,name=mt_tunnel" json:"mt_tunnel,omitempty"`
+}
+
+func (m *MplsTunnelAddDel) Reset() { *m = MplsTunnelAddDel{} }
+func (*MplsTunnelAddDel) GetMessageName() string { return "mpls_tunnel_add_del" }
+func (*MplsTunnelAddDel) GetCrcString() string { return "0de2478e" }
+func (*MplsTunnelAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MplsTunnelAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.MtIsAdd
+ size += 4 // m.MtTunnel.MtSwIfIndex
+ size += 4 // m.MtTunnel.MtTunnelIndex
+ size += 1 // m.MtTunnel.MtL2Only
+ size += 1 // m.MtTunnel.MtIsMulticast
+ size += 1 // m.MtTunnel.MtNPaths
+ for j2 := 0; j2 < len(m.MtTunnel.MtPaths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.MtTunnel.MtPaths) {
+ s2 = m.MtTunnel.MtPaths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.MtIsAdd)
+ buf.EncodeUint32(uint32(m.MtTunnel.MtSwIfIndex))
+ buf.EncodeUint32(m.MtTunnel.MtTunnelIndex)
+ buf.EncodeBool(m.MtTunnel.MtL2Only)
+ buf.EncodeBool(m.MtTunnel.MtIsMulticast)
+ buf.EncodeUint8(uint8(len(m.MtTunnel.MtPaths)))
+ for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ {
+ var v1 FibPath // MtPaths
+ if j1 < len(m.MtTunnel.MtPaths) {
+ v1 = m.MtTunnel.MtPaths[j1]
+ }
+ 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[:], 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++ {
+ 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 *MplsTunnelAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MtIsAdd = buf.DecodeBool()
+ m.MtTunnel.MtSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.MtTunnel.MtTunnelIndex = buf.DecodeUint32()
+ m.MtTunnel.MtL2Only = buf.DecodeBool()
+ m.MtTunnel.MtIsMulticast = buf.DecodeBool()
+ m.MtTunnel.MtNPaths = buf.DecodeUint8()
+ m.MtTunnel.MtPaths = make([]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()
+ m.MtTunnel.MtPaths[j1].RpfID = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].Weight = buf.DecodeUint8()
+ m.MtTunnel.MtPaths[j1].Preference = buf.DecodeUint8()
+ m.MtTunnel.MtPaths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.MtTunnel.MtPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.MtTunnel.MtPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.MtTunnel.MtPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.MtTunnel.MtPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.MtTunnel.MtPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.MtTunnel.MtPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.MtTunnel.MtPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// MplsTunnelAddDelReply defines message 'mpls_tunnel_add_del_reply'.
+type MplsTunnelAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ TunnelIndex uint32 `binapi:"u32,name=tunnel_index" json:"tunnel_index,omitempty"`
+}
+
+func (m *MplsTunnelAddDelReply) Reset() { *m = MplsTunnelAddDelReply{} }
+func (*MplsTunnelAddDelReply) GetMessageName() string { return "mpls_tunnel_add_del_reply" }
+func (*MplsTunnelAddDelReply) GetCrcString() string { return "afb01472" }
+func (*MplsTunnelAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MplsTunnelAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ size += 4 // m.TunnelIndex
+ return size
+}
+func (m *MplsTunnelAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.TunnelIndex)
+ return buf.Bytes(), nil
+}
+func (m *MplsTunnelAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.TunnelIndex = buf.DecodeUint32()
+ return nil
+}
+
+// MplsTunnelDetails defines message 'mpls_tunnel_details'.
+type MplsTunnelDetails struct {
+ MtTunnel MplsTunnel `binapi:"mpls_tunnel,name=mt_tunnel" json:"mt_tunnel,omitempty"`
+}
+
+func (m *MplsTunnelDetails) Reset() { *m = MplsTunnelDetails{} }
+func (*MplsTunnelDetails) GetMessageName() string { return "mpls_tunnel_details" }
+func (*MplsTunnelDetails) GetCrcString() string { return "bdc55cce" }
+func (*MplsTunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MplsTunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.MtTunnel.MtSwIfIndex
+ size += 4 // m.MtTunnel.MtTunnelIndex
+ size += 1 // m.MtTunnel.MtL2Only
+ size += 1 // m.MtTunnel.MtIsMulticast
+ size += 1 // m.MtTunnel.MtNPaths
+ for j2 := 0; j2 < len(m.MtTunnel.MtPaths); j2++ {
+ var s2 FibPath
+ _ = s2
+ if j2 < len(m.MtTunnel.MtPaths) {
+ s2 = m.MtTunnel.MtPaths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.MtTunnel.MtSwIfIndex))
+ buf.EncodeUint32(m.MtTunnel.MtTunnelIndex)
+ buf.EncodeBool(m.MtTunnel.MtL2Only)
+ buf.EncodeBool(m.MtTunnel.MtIsMulticast)
+ buf.EncodeUint8(uint8(len(m.MtTunnel.MtPaths)))
+ for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ {
+ var v1 FibPath // MtPaths
+ if j1 < len(m.MtTunnel.MtPaths) {
+ v1 = m.MtTunnel.MtPaths[j1]
+ }
+ 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[:], 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++ {
+ 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 *MplsTunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MtTunnel.MtSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.MtTunnel.MtTunnelIndex = buf.DecodeUint32()
+ m.MtTunnel.MtL2Only = buf.DecodeBool()
+ m.MtTunnel.MtIsMulticast = buf.DecodeBool()
+ m.MtTunnel.MtNPaths = buf.DecodeUint8()
+ m.MtTunnel.MtPaths = make([]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()
+ m.MtTunnel.MtPaths[j1].RpfID = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].Weight = buf.DecodeUint8()
+ m.MtTunnel.MtPaths[j1].Preference = buf.DecodeUint8()
+ m.MtTunnel.MtPaths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.MtTunnel.MtPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.MtTunnel.MtPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.MtTunnel.MtPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.MtTunnel.MtPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.MtTunnel.MtPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.MtTunnel.MtPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.MtTunnel.MtPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.MtTunnel.MtPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// MplsTunnelDump defines message 'mpls_tunnel_dump'.
+type MplsTunnelDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *MplsTunnelDump) Reset() { *m = MplsTunnelDump{} }
+func (*MplsTunnelDump) GetMessageName() string { return "mpls_tunnel_dump" }
+func (*MplsTunnelDump) GetCrcString() string { return "f9e6675e" }
+func (*MplsTunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MplsTunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *MplsTunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *MplsTunnelDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// SwInterfaceSetMplsEnable defines message 'sw_interface_set_mpls_enable'.
+type SwInterfaceSetMplsEnable struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetMplsEnable) Reset() { *m = SwInterfaceSetMplsEnable{} }
+func (*SwInterfaceSetMplsEnable) GetMessageName() string { return "sw_interface_set_mpls_enable" }
+func (*SwInterfaceSetMplsEnable) GetCrcString() string { return "ae6cfcfb" }
+func (*SwInterfaceSetMplsEnable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetMplsEnable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetMplsEnable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetMplsEnable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// SwInterfaceSetMplsEnableReply defines message 'sw_interface_set_mpls_enable_reply'.
+type SwInterfaceSetMplsEnableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetMplsEnableReply) Reset() { *m = SwInterfaceSetMplsEnableReply{} }
+func (*SwInterfaceSetMplsEnableReply) GetMessageName() string {
+ return "sw_interface_set_mpls_enable_reply"
+}
+func (*SwInterfaceSetMplsEnableReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetMplsEnableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetMplsEnableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetMplsEnableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_mpls_binapi_init() }
+func file_mpls_binapi_init() {
+ api.RegisterMessage((*MplsIPBindUnbind)(nil), "mpls_ip_bind_unbind_48249a27")
+ api.RegisterMessage((*MplsIPBindUnbindReply)(nil), "mpls_ip_bind_unbind_reply_e8d4e804")
+ api.RegisterMessage((*MplsRouteAddDel)(nil), "mpls_route_add_del_343cff54")
+ api.RegisterMessage((*MplsRouteAddDelReply)(nil), "mpls_route_add_del_reply_1992deab")
+ api.RegisterMessage((*MplsRouteDetails)(nil), "mpls_route_details_d0ac384c")
+ api.RegisterMessage((*MplsRouteDump)(nil), "mpls_route_dump_935fdefa")
+ api.RegisterMessage((*MplsTableAddDel)(nil), "mpls_table_add_del_57817512")
+ api.RegisterMessage((*MplsTableAddDelReply)(nil), "mpls_table_add_del_reply_e8d4e804")
+ api.RegisterMessage((*MplsTableDetails)(nil), "mpls_table_details_f03ecdc8")
+ api.RegisterMessage((*MplsTableDump)(nil), "mpls_table_dump_51077d14")
+ api.RegisterMessage((*MplsTunnelAddDel)(nil), "mpls_tunnel_add_del_0de2478e")
+ api.RegisterMessage((*MplsTunnelAddDelReply)(nil), "mpls_tunnel_add_del_reply_afb01472")
+ api.RegisterMessage((*MplsTunnelDetails)(nil), "mpls_tunnel_details_bdc55cce")
+ api.RegisterMessage((*MplsTunnelDump)(nil), "mpls_tunnel_dump_f9e6675e")
+ api.RegisterMessage((*SwInterfaceSetMplsEnable)(nil), "sw_interface_set_mpls_enable_ae6cfcfb")
+ api.RegisterMessage((*SwInterfaceSetMplsEnableReply)(nil), "sw_interface_set_mpls_enable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*MplsIPBindUnbind)(nil),
+ (*MplsIPBindUnbindReply)(nil),
+ (*MplsRouteAddDel)(nil),
+ (*MplsRouteAddDelReply)(nil),
+ (*MplsRouteDetails)(nil),
+ (*MplsRouteDump)(nil),
+ (*MplsTableAddDel)(nil),
+ (*MplsTableAddDelReply)(nil),
+ (*MplsTableDetails)(nil),
+ (*MplsTableDump)(nil),
+ (*MplsTunnelAddDel)(nil),
+ (*MplsTunnelAddDelReply)(nil),
+ (*MplsTunnelDetails)(nil),
+ (*MplsTunnelDump)(nil),
+ (*SwInterfaceSetMplsEnable)(nil),
+ (*SwInterfaceSetMplsEnableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/mpls/mpls_rpc.ba.go b/internal/testbinapi/binapi2001/mpls/mpls_rpc.ba.go
new file mode 100644
index 0000000..422e185
--- /dev/null
+++ b/internal/testbinapi/binapi2001/mpls/mpls_rpc.ba.go
@@ -0,0 +1,193 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package mpls
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service mpls.
+type RPCService interface {
+ MplsIPBindUnbind(ctx context.Context, in *MplsIPBindUnbind) (*MplsIPBindUnbindReply, error)
+ MplsRouteAddDel(ctx context.Context, in *MplsRouteAddDel) (*MplsRouteAddDelReply, error)
+ MplsRouteDump(ctx context.Context, in *MplsRouteDump) (RPCService_MplsRouteDumpClient, error)
+ MplsTableAddDel(ctx context.Context, in *MplsTableAddDel) (*MplsTableAddDelReply, error)
+ MplsTableDump(ctx context.Context, in *MplsTableDump) (RPCService_MplsTableDumpClient, error)
+ MplsTunnelAddDel(ctx context.Context, in *MplsTunnelAddDel) (*MplsTunnelAddDelReply, error)
+ MplsTunnelDump(ctx context.Context, in *MplsTunnelDump) (RPCService_MplsTunnelDumpClient, error)
+ SwInterfaceSetMplsEnable(ctx context.Context, in *SwInterfaceSetMplsEnable) (*SwInterfaceSetMplsEnableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) MplsIPBindUnbind(ctx context.Context, in *MplsIPBindUnbind) (*MplsIPBindUnbindReply, error) {
+ out := new(MplsIPBindUnbindReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MplsRouteAddDel(ctx context.Context, in *MplsRouteAddDel) (*MplsRouteAddDelReply, error) {
+ out := new(MplsRouteAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MplsRouteDump(ctx context.Context, in *MplsRouteDump) (RPCService_MplsRouteDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_MplsRouteDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_MplsRouteDumpClient interface {
+ Recv() (*MplsRouteDetails, error)
+ api.Stream
+}
+
+type serviceClient_MplsRouteDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MplsRouteDumpClient) Recv() (*MplsRouteDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *MplsRouteDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) MplsTableAddDel(ctx context.Context, in *MplsTableAddDel) (*MplsTableAddDelReply, error) {
+ out := new(MplsTableAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MplsTableDump(ctx context.Context, in *MplsTableDump) (RPCService_MplsTableDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_MplsTableDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_MplsTableDumpClient interface {
+ Recv() (*MplsTableDetails, error)
+ api.Stream
+}
+
+type serviceClient_MplsTableDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MplsTableDumpClient) Recv() (*MplsTableDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *MplsTableDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) MplsTunnelAddDel(ctx context.Context, in *MplsTunnelAddDel) (*MplsTunnelAddDelReply, error) {
+ out := new(MplsTunnelAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MplsTunnelDump(ctx context.Context, in *MplsTunnelDump) (RPCService_MplsTunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_MplsTunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_MplsTunnelDumpClient interface {
+ Recv() (*MplsTunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_MplsTunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_MplsTunnelDumpClient) Recv() (*MplsTunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *MplsTunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) SwInterfaceSetMplsEnable(ctx context.Context, in *SwInterfaceSetMplsEnable) (*SwInterfaceSetMplsEnableReply, error) {
+ out := new(SwInterfaceSetMplsEnableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/nat/nat.ba.go b/internal/testbinapi/binapi2001/nat/nat.ba.go
new file mode 100644
index 0000000..e6ef501
--- /dev/null
+++ b/internal/testbinapi/binapi2001/nat/nat.ba.go
@@ -0,0 +1,6378 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/nat.api.json
+
+// Package nat contains generated bindings for API file nat.api.
+//
+// Contents:
+// 6 aliases
+// 12 enums
+// 7 structs
+// 1 union
+// 131 messages
+//
+package nat
+
+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 = "nat"
+ APIVersion = "5.2.0"
+ VersionCrc = 0xef1a1c94
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// NatConfigFlags defines enum 'nat_config_flags'.
+type NatConfigFlags uint8
+
+const (
+ NAT_IS_NONE NatConfigFlags = 0
+ NAT_IS_TWICE_NAT NatConfigFlags = 1
+ NAT_IS_SELF_TWICE_NAT NatConfigFlags = 2
+ NAT_IS_OUT2IN_ONLY NatConfigFlags = 4
+ NAT_IS_ADDR_ONLY NatConfigFlags = 8
+ NAT_IS_OUTSIDE NatConfigFlags = 16
+ NAT_IS_INSIDE NatConfigFlags = 32
+ NAT_IS_STATIC NatConfigFlags = 64
+ NAT_IS_EXT_HOST_VALID NatConfigFlags = 128
+)
+
+var (
+ NatConfigFlags_name = map[uint8]string{
+ 0: "NAT_IS_NONE",
+ 1: "NAT_IS_TWICE_NAT",
+ 2: "NAT_IS_SELF_TWICE_NAT",
+ 4: "NAT_IS_OUT2IN_ONLY",
+ 8: "NAT_IS_ADDR_ONLY",
+ 16: "NAT_IS_OUTSIDE",
+ 32: "NAT_IS_INSIDE",
+ 64: "NAT_IS_STATIC",
+ 128: "NAT_IS_EXT_HOST_VALID",
+ }
+ NatConfigFlags_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x NatConfigFlags) String() string {
+ s, ok := NatConfigFlags_name[uint8(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint8) string {
+ s, ok := NatConfigFlags_name[uint8(n)]
+ if ok {
+ return s
+ }
+ return "NatConfigFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint8(0); i <= 8; i++ {
+ val := uint8(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint8(x))
+ }
+ return s
+}
+
+// NatLogLevel defines enum 'nat_log_level'.
+type NatLogLevel uint8
+
+const (
+ NAT_LOG_NONE NatLogLevel = 0
+ NAT_LOG_ERROR NatLogLevel = 1
+ NAT_LOG_WARNING NatLogLevel = 2
+ NAT_LOG_NOTICE NatLogLevel = 3
+ NAT_LOG_INFO NatLogLevel = 4
+ NAT_LOG_DEBUG NatLogLevel = 5
+)
+
+var (
+ NatLogLevel_name = map[uint8]string{
+ 0: "NAT_LOG_NONE",
+ 1: "NAT_LOG_ERROR",
+ 2: "NAT_LOG_WARNING",
+ 3: "NAT_LOG_NOTICE",
+ 4: "NAT_LOG_INFO",
+ 5: "NAT_LOG_DEBUG",
+ }
+ NatLogLevel_value = map[string]uint8{
+ "NAT_LOG_NONE": 0,
+ "NAT_LOG_ERROR": 1,
+ "NAT_LOG_WARNING": 2,
+ "NAT_LOG_NOTICE": 3,
+ "NAT_LOG_INFO": 4,
+ "NAT_LOG_DEBUG": 5,
+ }
+)
+
+func (x NatLogLevel) String() string {
+ s, ok := NatLogLevel_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "NatLogLevel(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Nat44LbAddrPort defines type 'nat44_lb_addr_port'.
+type Nat44LbAddrPort struct {
+ Addr IP4Address `binapi:"ip4_address,name=addr" json:"addr,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ Probability uint8 `binapi:"u8,name=probability" json:"probability,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// DsliteAddDelPoolAddrRange defines message 'dslite_add_del_pool_addr_range'.
+type DsliteAddDelPoolAddrRange struct {
+ StartAddr IP4Address `binapi:"ip4_address,name=start_addr" json:"start_addr,omitempty"`
+ EndAddr IP4Address `binapi:"ip4_address,name=end_addr" json:"end_addr,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *DsliteAddDelPoolAddrRange) Reset() { *m = DsliteAddDelPoolAddrRange{} }
+func (*DsliteAddDelPoolAddrRange) GetMessageName() string { return "dslite_add_del_pool_addr_range" }
+func (*DsliteAddDelPoolAddrRange) GetCrcString() string { return "c448457a" }
+func (*DsliteAddDelPoolAddrRange) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DsliteAddDelPoolAddrRange) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.StartAddr
+ size += 1 * 4 // m.EndAddr
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *DsliteAddDelPoolAddrRange) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.StartAddr[:], 4)
+ buf.EncodeBytes(m.EndAddr[:], 4)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *DsliteAddDelPoolAddrRange) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.StartAddr[:], buf.DecodeBytes(4))
+ copy(m.EndAddr[:], buf.DecodeBytes(4))
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// DsliteAddDelPoolAddrRangeReply defines message 'dslite_add_del_pool_addr_range_reply'.
+type DsliteAddDelPoolAddrRangeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DsliteAddDelPoolAddrRangeReply) Reset() { *m = DsliteAddDelPoolAddrRangeReply{} }
+func (*DsliteAddDelPoolAddrRangeReply) GetMessageName() string {
+ return "dslite_add_del_pool_addr_range_reply"
+}
+func (*DsliteAddDelPoolAddrRangeReply) GetCrcString() string { return "e8d4e804" }
+func (*DsliteAddDelPoolAddrRangeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DsliteAddDelPoolAddrRangeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DsliteAddDelPoolAddrRangeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DsliteAddressDetails defines message 'dslite_address_details'.
+type DsliteAddressDetails struct {
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+}
+
+func (m *DsliteAddressDetails) Reset() { *m = DsliteAddressDetails{} }
+func (*DsliteAddressDetails) GetMessageName() string { return "dslite_address_details" }
+func (*DsliteAddressDetails) GetCrcString() string { return "ec26d648" }
+func (*DsliteAddressDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DsliteAddressDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.IPAddress
+ return size
+}
+func (m *DsliteAddressDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IPAddress[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *DsliteAddressDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// DsliteAddressDump defines message 'dslite_address_dump'.
+type DsliteAddressDump struct{}
+
+func (m *DsliteAddressDump) Reset() { *m = DsliteAddressDump{} }
+func (*DsliteAddressDump) GetMessageName() string { return "dslite_address_dump" }
+func (*DsliteAddressDump) GetCrcString() string { return "51077d14" }
+func (*DsliteAddressDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DsliteAddressDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *DsliteAddressDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *DsliteAddressDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// DsliteGetAftrAddr defines message 'dslite_get_aftr_addr'.
+type DsliteGetAftrAddr struct{}
+
+func (m *DsliteGetAftrAddr) Reset() { *m = DsliteGetAftrAddr{} }
+func (*DsliteGetAftrAddr) GetMessageName() string { return "dslite_get_aftr_addr" }
+func (*DsliteGetAftrAddr) GetCrcString() string { return "51077d14" }
+func (*DsliteGetAftrAddr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DsliteGetAftrAddr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *DsliteGetAftrAddr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *DsliteGetAftrAddr) Unmarshal(b []byte) error {
+ return nil
+}
+
+// DsliteGetAftrAddrReply defines message 'dslite_get_aftr_addr_reply'.
+type DsliteGetAftrAddrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IP4Addr IP4Address `binapi:"ip4_address,name=ip4_addr" json:"ip4_addr,omitempty"`
+ IP6Addr IP6Address `binapi:"ip6_address,name=ip6_addr" json:"ip6_addr,omitempty"`
+}
+
+func (m *DsliteGetAftrAddrReply) Reset() { *m = DsliteGetAftrAddrReply{} }
+func (*DsliteGetAftrAddrReply) GetMessageName() string { return "dslite_get_aftr_addr_reply" }
+func (*DsliteGetAftrAddrReply) GetCrcString() string { return "38e30db1" }
+func (*DsliteGetAftrAddrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DsliteGetAftrAddrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 4 // m.IP4Addr
+ size += 1 * 16 // m.IP6Addr
+ return size
+}
+func (m *DsliteGetAftrAddrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ copy(m.IP4Addr[:], buf.DecodeBytes(4))
+ copy(m.IP6Addr[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// DsliteGetB4Addr defines message 'dslite_get_b4_addr'.
+type DsliteGetB4Addr struct{}
+
+func (m *DsliteGetB4Addr) Reset() { *m = DsliteGetB4Addr{} }
+func (*DsliteGetB4Addr) GetMessageName() string { return "dslite_get_b4_addr" }
+func (*DsliteGetB4Addr) GetCrcString() string { return "51077d14" }
+func (*DsliteGetB4Addr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DsliteGetB4Addr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *DsliteGetB4Addr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *DsliteGetB4Addr) Unmarshal(b []byte) error {
+ return nil
+}
+
+// DsliteGetB4AddrReply defines message 'dslite_get_b4_addr_reply'.
+type DsliteGetB4AddrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IP4Addr IP4Address `binapi:"ip4_address,name=ip4_addr" json:"ip4_addr,omitempty"`
+ IP6Addr IP6Address `binapi:"ip6_address,name=ip6_addr" json:"ip6_addr,omitempty"`
+}
+
+func (m *DsliteGetB4AddrReply) Reset() { *m = DsliteGetB4AddrReply{} }
+func (*DsliteGetB4AddrReply) GetMessageName() string { return "dslite_get_b4_addr_reply" }
+func (*DsliteGetB4AddrReply) GetCrcString() string { return "38e30db1" }
+func (*DsliteGetB4AddrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DsliteGetB4AddrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 4 // m.IP4Addr
+ size += 1 * 16 // m.IP6Addr
+ return size
+}
+func (m *DsliteGetB4AddrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ copy(m.IP4Addr[:], buf.DecodeBytes(4))
+ copy(m.IP6Addr[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// DsliteSetAftrAddr defines message 'dslite_set_aftr_addr'.
+type DsliteSetAftrAddr struct {
+ IP4Addr IP4Address `binapi:"ip4_address,name=ip4_addr" json:"ip4_addr,omitempty"`
+ IP6Addr IP6Address `binapi:"ip6_address,name=ip6_addr" json:"ip6_addr,omitempty"`
+}
+
+func (m *DsliteSetAftrAddr) Reset() { *m = DsliteSetAftrAddr{} }
+func (*DsliteSetAftrAddr) GetMessageName() string { return "dslite_set_aftr_addr" }
+func (*DsliteSetAftrAddr) GetCrcString() string { return "1e955f8d" }
+func (*DsliteSetAftrAddr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DsliteSetAftrAddr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.IP4Addr
+ size += 1 * 16 // m.IP6Addr
+ return size
+}
+func (m *DsliteSetAftrAddr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IP4Addr[:], 4)
+ buf.EncodeBytes(m.IP6Addr[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *DsliteSetAftrAddr) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IP4Addr[:], buf.DecodeBytes(4))
+ copy(m.IP6Addr[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// DsliteSetAftrAddrReply defines message 'dslite_set_aftr_addr_reply'.
+type DsliteSetAftrAddrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DsliteSetAftrAddrReply) Reset() { *m = DsliteSetAftrAddrReply{} }
+func (*DsliteSetAftrAddrReply) GetMessageName() string { return "dslite_set_aftr_addr_reply" }
+func (*DsliteSetAftrAddrReply) GetCrcString() string { return "e8d4e804" }
+func (*DsliteSetAftrAddrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DsliteSetAftrAddrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DsliteSetAftrAddrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// DsliteSetB4Addr defines message 'dslite_set_b4_addr'.
+type DsliteSetB4Addr struct {
+ IP4Addr IP4Address `binapi:"ip4_address,name=ip4_addr" json:"ip4_addr,omitempty"`
+ IP6Addr IP6Address `binapi:"ip6_address,name=ip6_addr" json:"ip6_addr,omitempty"`
+}
+
+func (m *DsliteSetB4Addr) Reset() { *m = DsliteSetB4Addr{} }
+func (*DsliteSetB4Addr) GetMessageName() string { return "dslite_set_b4_addr" }
+func (*DsliteSetB4Addr) GetCrcString() string { return "1e955f8d" }
+func (*DsliteSetB4Addr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DsliteSetB4Addr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.IP4Addr
+ size += 1 * 16 // m.IP6Addr
+ return size
+}
+func (m *DsliteSetB4Addr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IP4Addr[:], 4)
+ buf.EncodeBytes(m.IP6Addr[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *DsliteSetB4Addr) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IP4Addr[:], buf.DecodeBytes(4))
+ copy(m.IP6Addr[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// DsliteSetB4AddrReply defines message 'dslite_set_b4_addr_reply'.
+type DsliteSetB4AddrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DsliteSetB4AddrReply) Reset() { *m = DsliteSetB4AddrReply{} }
+func (*DsliteSetB4AddrReply) GetMessageName() string { return "dslite_set_b4_addr_reply" }
+func (*DsliteSetB4AddrReply) GetCrcString() string { return "e8d4e804" }
+func (*DsliteSetB4AddrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DsliteSetB4AddrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DsliteSetB4AddrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44AddDelAddressRange defines message 'nat44_add_del_address_range'.
+type Nat44AddDelAddressRange struct {
+ FirstIPAddress IP4Address `binapi:"ip4_address,name=first_ip_address" json:"first_ip_address,omitempty"`
+ LastIPAddress IP4Address `binapi:"ip4_address,name=last_ip_address" json:"last_ip_address,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+}
+
+func (m *Nat44AddDelAddressRange) Reset() { *m = Nat44AddDelAddressRange{} }
+func (*Nat44AddDelAddressRange) GetMessageName() string { return "nat44_add_del_address_range" }
+func (*Nat44AddDelAddressRange) GetCrcString() string { return "d4c7568c" }
+func (*Nat44AddDelAddressRange) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44AddDelAddressRange) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.FirstIPAddress
+ size += 1 * 4 // m.LastIPAddress
+ size += 4 // m.VrfID
+ size += 1 // m.IsAdd
+ size += 1 // m.Flags
+ return size
+}
+func (m *Nat44AddDelAddressRange) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.FirstIPAddress[:], 4)
+ buf.EncodeBytes(m.LastIPAddress[:], 4)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint8(uint8(m.Flags))
+ return buf.Bytes(), nil
+}
+func (m *Nat44AddDelAddressRange) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.FirstIPAddress[:], buf.DecodeBytes(4))
+ copy(m.LastIPAddress[:], buf.DecodeBytes(4))
+ m.VrfID = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ return nil
+}
+
+// Nat44AddDelAddressRangeReply defines message 'nat44_add_del_address_range_reply'.
+type Nat44AddDelAddressRangeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44AddDelAddressRangeReply) Reset() { *m = Nat44AddDelAddressRangeReply{} }
+func (*Nat44AddDelAddressRangeReply) GetMessageName() string {
+ return "nat44_add_del_address_range_reply"
+}
+func (*Nat44AddDelAddressRangeReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44AddDelAddressRangeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44AddDelAddressRangeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44AddDelAddressRangeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44AddDelIdentityMapping defines message 'nat44_add_del_identity_mapping'.
+type Nat44AddDelIdentityMapping struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *Nat44AddDelIdentityMapping) Reset() { *m = Nat44AddDelIdentityMapping{} }
+func (*Nat44AddDelIdentityMapping) GetMessageName() string { return "nat44_add_del_identity_mapping" }
+func (*Nat44AddDelIdentityMapping) GetCrcString() string { return "8e12743f" }
+func (*Nat44AddDelIdentityMapping) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44AddDelIdentityMapping) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Flags
+ size += 1 * 4 // m.IPAddress
+ size += 1 // m.Protocol
+ size += 2 // m.Port
+ size += 4 // m.SwIfIndex
+ size += 4 // m.VrfID
+ size += 64 // m.Tag
+ return size
+}
+func (m *Nat44AddDelIdentityMapping) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(m.Protocol)
+ buf.EncodeUint16(m.Port)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeString(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *Nat44AddDelIdentityMapping) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ m.Protocol = buf.DecodeUint8()
+ m.Port = buf.DecodeUint16()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.VrfID = buf.DecodeUint32()
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// Nat44AddDelIdentityMappingReply defines message 'nat44_add_del_identity_mapping_reply'.
+type Nat44AddDelIdentityMappingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44AddDelIdentityMappingReply) Reset() { *m = Nat44AddDelIdentityMappingReply{} }
+func (*Nat44AddDelIdentityMappingReply) GetMessageName() string {
+ return "nat44_add_del_identity_mapping_reply"
+}
+func (*Nat44AddDelIdentityMappingReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44AddDelIdentityMappingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44AddDelIdentityMappingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44AddDelIdentityMappingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44AddDelInterfaceAddr defines message 'nat44_add_del_interface_addr'.
+type Nat44AddDelInterfaceAddr struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+}
+
+func (m *Nat44AddDelInterfaceAddr) Reset() { *m = Nat44AddDelInterfaceAddr{} }
+func (*Nat44AddDelInterfaceAddr) GetMessageName() string { return "nat44_add_del_interface_addr" }
+func (*Nat44AddDelInterfaceAddr) GetCrcString() string { return "fc835325" }
+func (*Nat44AddDelInterfaceAddr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44AddDelInterfaceAddr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Flags
+ return size
+}
+func (m *Nat44AddDelInterfaceAddr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint8(uint8(m.Flags))
+ return buf.Bytes(), nil
+}
+func (m *Nat44AddDelInterfaceAddr) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ return nil
+}
+
+// Nat44AddDelInterfaceAddrReply defines message 'nat44_add_del_interface_addr_reply'.
+type Nat44AddDelInterfaceAddrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44AddDelInterfaceAddrReply) Reset() { *m = Nat44AddDelInterfaceAddrReply{} }
+func (*Nat44AddDelInterfaceAddrReply) GetMessageName() string {
+ return "nat44_add_del_interface_addr_reply"
+}
+func (*Nat44AddDelInterfaceAddrReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44AddDelInterfaceAddrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44AddDelInterfaceAddrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44AddDelInterfaceAddrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44AddDelLbStaticMapping defines message 'nat44_add_del_lb_static_mapping'.
+type Nat44AddDelLbStaticMapping struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ ExternalAddr IP4Address `binapi:"ip4_address,name=external_addr" json:"external_addr,omitempty"`
+ ExternalPort uint16 `binapi:"u16,name=external_port" json:"external_port,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ Affinity uint32 `binapi:"u32,name=affinity" json:"affinity,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+ LocalNum uint32 `binapi:"u32,name=local_num" json:"-"`
+ Locals []Nat44LbAddrPort `binapi:"nat44_lb_addr_port[local_num],name=locals" json:"locals,omitempty"`
+}
+
+func (m *Nat44AddDelLbStaticMapping) Reset() { *m = Nat44AddDelLbStaticMapping{} }
+func (*Nat44AddDelLbStaticMapping) GetMessageName() string { return "nat44_add_del_lb_static_mapping" }
+func (*Nat44AddDelLbStaticMapping) GetCrcString() string { return "53b24611" }
+func (*Nat44AddDelLbStaticMapping) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44AddDelLbStaticMapping) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Flags
+ size += 1 * 4 // m.ExternalAddr
+ size += 2 // m.ExternalPort
+ size += 1 // m.Protocol
+ size += 4 // m.Affinity
+ size += 64 // m.Tag
+ size += 4 // m.LocalNum
+ for j1 := 0; j1 < len(m.Locals); j1++ {
+ var s1 Nat44LbAddrPort
+ _ = s1
+ if j1 < len(m.Locals) {
+ s1 = m.Locals[j1]
+ }
+ size += 1 * 4 // s1.Addr
+ size += 2 // s1.Port
+ size += 1 // s1.Probability
+ size += 4 // s1.VrfID
+ }
+ return size
+}
+func (m *Nat44AddDelLbStaticMapping) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(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 // Locals
+ if j0 < len(m.Locals) {
+ v0 = m.Locals[j0]
+ }
+ buf.EncodeBytes(v0.Addr[:], 4)
+ buf.EncodeUint16(v0.Port)
+ buf.EncodeUint8(v0.Probability)
+ buf.EncodeUint32(v0.VrfID)
+ }
+ return buf.Bytes(), nil
+}
+func (m *Nat44AddDelLbStaticMapping) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ copy(m.ExternalAddr[:], buf.DecodeBytes(4))
+ m.ExternalPort = buf.DecodeUint16()
+ m.Protocol = buf.DecodeUint8()
+ m.Affinity = buf.DecodeUint32()
+ m.Tag = buf.DecodeString(64)
+ m.LocalNum = buf.DecodeUint32()
+ 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()
+ m.Locals[j0].Probability = buf.DecodeUint8()
+ m.Locals[j0].VrfID = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// Nat44AddDelLbStaticMappingReply defines message 'nat44_add_del_lb_static_mapping_reply'.
+type Nat44AddDelLbStaticMappingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44AddDelLbStaticMappingReply) Reset() { *m = Nat44AddDelLbStaticMappingReply{} }
+func (*Nat44AddDelLbStaticMappingReply) GetMessageName() string {
+ return "nat44_add_del_lb_static_mapping_reply"
+}
+func (*Nat44AddDelLbStaticMappingReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44AddDelLbStaticMappingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44AddDelLbStaticMappingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44AddDelLbStaticMappingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44AddDelStaticMapping defines message 'nat44_add_del_static_mapping'.
+type Nat44AddDelStaticMapping struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ LocalIPAddress IP4Address `binapi:"ip4_address,name=local_ip_address" json:"local_ip_address,omitempty"`
+ ExternalIPAddress IP4Address `binapi:"ip4_address,name=external_ip_address" json:"external_ip_address,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ LocalPort uint16 `binapi:"u16,name=local_port" json:"local_port,omitempty"`
+ ExternalPort uint16 `binapi:"u16,name=external_port" json:"external_port,omitempty"`
+ ExternalSwIfIndex InterfaceIndex `binapi:"interface_index,name=external_sw_if_index" json:"external_sw_if_index,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *Nat44AddDelStaticMapping) Reset() { *m = Nat44AddDelStaticMapping{} }
+func (*Nat44AddDelStaticMapping) GetMessageName() string { return "nat44_add_del_static_mapping" }
+func (*Nat44AddDelStaticMapping) GetCrcString() string { return "e165e83b" }
+func (*Nat44AddDelStaticMapping) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44AddDelStaticMapping) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Flags
+ size += 1 * 4 // m.LocalIPAddress
+ size += 1 * 4 // m.ExternalIPAddress
+ size += 1 // m.Protocol
+ size += 2 // m.LocalPort
+ size += 2 // m.ExternalPort
+ size += 4 // m.ExternalSwIfIndex
+ size += 4 // m.VrfID
+ size += 64 // m.Tag
+ return size
+}
+func (m *Nat44AddDelStaticMapping) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(m.Protocol)
+ buf.EncodeUint16(m.LocalPort)
+ buf.EncodeUint16(m.ExternalPort)
+ buf.EncodeUint32(uint32(m.ExternalSwIfIndex))
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeString(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *Nat44AddDelStaticMapping) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ copy(m.LocalIPAddress[:], buf.DecodeBytes(4))
+ copy(m.ExternalIPAddress[:], buf.DecodeBytes(4))
+ m.Protocol = buf.DecodeUint8()
+ m.LocalPort = buf.DecodeUint16()
+ m.ExternalPort = buf.DecodeUint16()
+ m.ExternalSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.VrfID = buf.DecodeUint32()
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// Nat44AddDelStaticMappingReply defines message 'nat44_add_del_static_mapping_reply'.
+type Nat44AddDelStaticMappingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44AddDelStaticMappingReply) Reset() { *m = Nat44AddDelStaticMappingReply{} }
+func (*Nat44AddDelStaticMappingReply) GetMessageName() string {
+ return "nat44_add_del_static_mapping_reply"
+}
+func (*Nat44AddDelStaticMappingReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44AddDelStaticMappingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44AddDelStaticMappingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44AddDelStaticMappingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44AddressDetails defines message 'nat44_address_details'.
+type Nat44AddressDetails struct {
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+}
+
+func (m *Nat44AddressDetails) Reset() { *m = Nat44AddressDetails{} }
+func (*Nat44AddressDetails) GetMessageName() string { return "nat44_address_details" }
+func (*Nat44AddressDetails) GetCrcString() string { return "45410ac4" }
+func (*Nat44AddressDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44AddressDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.IPAddress
+ size += 1 // m.Flags
+ size += 4 // m.VrfID
+ return size
+}
+func (m *Nat44AddressDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IPAddress[:], 4)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(m.VrfID)
+ return buf.Bytes(), nil
+}
+func (m *Nat44AddressDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.VrfID = buf.DecodeUint32()
+ return nil
+}
+
+// Nat44AddressDump defines message 'nat44_address_dump'.
+type Nat44AddressDump struct{}
+
+func (m *Nat44AddressDump) Reset() { *m = Nat44AddressDump{} }
+func (*Nat44AddressDump) GetMessageName() string { return "nat44_address_dump" }
+func (*Nat44AddressDump) GetCrcString() string { return "51077d14" }
+func (*Nat44AddressDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44AddressDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat44AddressDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat44AddressDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat44DelSession defines message 'nat44_del_session'.
+type Nat44DelSession struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ ExtHostAddress IP4Address `binapi:"ip4_address,name=ext_host_address" json:"ext_host_address,omitempty"`
+ ExtHostPort uint16 `binapi:"u16,name=ext_host_port" json:"ext_host_port,omitempty"`
+}
+
+func (m *Nat44DelSession) Reset() { *m = Nat44DelSession{} }
+func (*Nat44DelSession) GetMessageName() string { return "nat44_del_session" }
+func (*Nat44DelSession) GetCrcString() string { return "4c49c387" }
+func (*Nat44DelSession) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44DelSession) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.Address
+ size += 1 // m.Protocol
+ size += 2 // m.Port
+ size += 4 // m.VrfID
+ size += 1 // m.Flags
+ size += 1 * 4 // m.ExtHostAddress
+ size += 2 // m.ExtHostPort
+ return size
+}
+func (m *Nat44DelSession) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Address[:], 4)
+ buf.EncodeUint8(m.Protocol)
+ buf.EncodeUint16(m.Port)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeBytes(m.ExtHostAddress[:], 4)
+ buf.EncodeUint16(m.ExtHostPort)
+ return buf.Bytes(), nil
+}
+func (m *Nat44DelSession) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.Address[:], buf.DecodeBytes(4))
+ m.Protocol = buf.DecodeUint8()
+ m.Port = buf.DecodeUint16()
+ m.VrfID = buf.DecodeUint32()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ copy(m.ExtHostAddress[:], buf.DecodeBytes(4))
+ m.ExtHostPort = buf.DecodeUint16()
+ return nil
+}
+
+// Nat44DelSessionReply defines message 'nat44_del_session_reply'.
+type Nat44DelSessionReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44DelSessionReply) Reset() { *m = Nat44DelSessionReply{} }
+func (*Nat44DelSessionReply) GetMessageName() string { return "nat44_del_session_reply" }
+func (*Nat44DelSessionReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44DelSessionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44DelSessionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44DelSessionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44ForwardingEnableDisable defines message 'nat44_forwarding_enable_disable'.
+type Nat44ForwardingEnableDisable struct {
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *Nat44ForwardingEnableDisable) Reset() { *m = Nat44ForwardingEnableDisable{} }
+func (*Nat44ForwardingEnableDisable) GetMessageName() string {
+ return "nat44_forwarding_enable_disable"
+}
+func (*Nat44ForwardingEnableDisable) GetCrcString() string { return "b3e225d2" }
+func (*Nat44ForwardingEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44ForwardingEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ return size
+}
+func (m *Nat44ForwardingEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *Nat44ForwardingEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// Nat44ForwardingEnableDisableReply defines message 'nat44_forwarding_enable_disable_reply'.
+type Nat44ForwardingEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44ForwardingEnableDisableReply) Reset() { *m = Nat44ForwardingEnableDisableReply{} }
+func (*Nat44ForwardingEnableDisableReply) GetMessageName() string {
+ return "nat44_forwarding_enable_disable_reply"
+}
+func (*Nat44ForwardingEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44ForwardingEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44ForwardingEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44ForwardingEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44ForwardingIsEnabled defines message 'nat44_forwarding_is_enabled'.
+type Nat44ForwardingIsEnabled struct{}
+
+func (m *Nat44ForwardingIsEnabled) Reset() { *m = Nat44ForwardingIsEnabled{} }
+func (*Nat44ForwardingIsEnabled) GetMessageName() string { return "nat44_forwarding_is_enabled" }
+func (*Nat44ForwardingIsEnabled) GetCrcString() string { return "51077d14" }
+func (*Nat44ForwardingIsEnabled) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44ForwardingIsEnabled) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat44ForwardingIsEnabled) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat44ForwardingIsEnabled) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat44ForwardingIsEnabledReply defines message 'nat44_forwarding_is_enabled_reply'.
+type Nat44ForwardingIsEnabledReply struct {
+ Enabled bool `binapi:"bool,name=enabled" json:"enabled,omitempty"`
+}
+
+func (m *Nat44ForwardingIsEnabledReply) Reset() { *m = Nat44ForwardingIsEnabledReply{} }
+func (*Nat44ForwardingIsEnabledReply) GetMessageName() string {
+ return "nat44_forwarding_is_enabled_reply"
+}
+func (*Nat44ForwardingIsEnabledReply) GetCrcString() string { return "46924a06" }
+func (*Nat44ForwardingIsEnabledReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44ForwardingIsEnabledReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enabled
+ return size
+}
+func (m *Nat44ForwardingIsEnabledReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enabled)
+ return buf.Bytes(), nil
+}
+func (m *Nat44ForwardingIsEnabledReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enabled = buf.DecodeBool()
+ return nil
+}
+
+// Nat44IdentityMappingDetails defines message 'nat44_identity_mapping_details'.
+type Nat44IdentityMappingDetails struct {
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *Nat44IdentityMappingDetails) Reset() { *m = Nat44IdentityMappingDetails{} }
+func (*Nat44IdentityMappingDetails) GetMessageName() string { return "nat44_identity_mapping_details" }
+func (*Nat44IdentityMappingDetails) GetCrcString() string { return "36d21351" }
+func (*Nat44IdentityMappingDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44IdentityMappingDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Flags
+ size += 1 * 4 // m.IPAddress
+ size += 1 // m.Protocol
+ size += 2 // m.Port
+ size += 4 // m.SwIfIndex
+ size += 4 // m.VrfID
+ size += 64 // m.Tag
+ return size
+}
+func (m *Nat44IdentityMappingDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeBytes(m.IPAddress[:], 4)
+ buf.EncodeUint8(m.Protocol)
+ buf.EncodeUint16(m.Port)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeString(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *Nat44IdentityMappingDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ m.Protocol = buf.DecodeUint8()
+ m.Port = buf.DecodeUint16()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.VrfID = buf.DecodeUint32()
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// Nat44IdentityMappingDump defines message 'nat44_identity_mapping_dump'.
+type Nat44IdentityMappingDump struct{}
+
+func (m *Nat44IdentityMappingDump) Reset() { *m = Nat44IdentityMappingDump{} }
+func (*Nat44IdentityMappingDump) GetMessageName() string { return "nat44_identity_mapping_dump" }
+func (*Nat44IdentityMappingDump) GetCrcString() string { return "51077d14" }
+func (*Nat44IdentityMappingDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44IdentityMappingDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat44IdentityMappingDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat44IdentityMappingDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat44InterfaceAddDelFeature defines message 'nat44_interface_add_del_feature'.
+type Nat44InterfaceAddDelFeature struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Nat44InterfaceAddDelFeature) Reset() { *m = Nat44InterfaceAddDelFeature{} }
+func (*Nat44InterfaceAddDelFeature) GetMessageName() string { return "nat44_interface_add_del_feature" }
+func (*Nat44InterfaceAddDelFeature) GetCrcString() string { return "f3699b83" }
+func (*Nat44InterfaceAddDelFeature) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44InterfaceAddDelFeature) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Flags
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Nat44InterfaceAddDelFeature) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Nat44InterfaceAddDelFeature) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Nat44InterfaceAddDelFeatureReply defines message 'nat44_interface_add_del_feature_reply'.
+type Nat44InterfaceAddDelFeatureReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44InterfaceAddDelFeatureReply) Reset() { *m = Nat44InterfaceAddDelFeatureReply{} }
+func (*Nat44InterfaceAddDelFeatureReply) GetMessageName() string {
+ return "nat44_interface_add_del_feature_reply"
+}
+func (*Nat44InterfaceAddDelFeatureReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44InterfaceAddDelFeatureReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44InterfaceAddDelFeatureReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44InterfaceAddDelFeatureReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44InterfaceAddDelOutputFeature defines message 'nat44_interface_add_del_output_feature'.
+type Nat44InterfaceAddDelOutputFeature struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Nat44InterfaceAddDelOutputFeature) Reset() { *m = Nat44InterfaceAddDelOutputFeature{} }
+func (*Nat44InterfaceAddDelOutputFeature) GetMessageName() string {
+ return "nat44_interface_add_del_output_feature"
+}
+func (*Nat44InterfaceAddDelOutputFeature) GetCrcString() string { return "f3699b83" }
+func (*Nat44InterfaceAddDelOutputFeature) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44InterfaceAddDelOutputFeature) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Flags
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Nat44InterfaceAddDelOutputFeature) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Nat44InterfaceAddDelOutputFeature) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Nat44InterfaceAddDelOutputFeatureReply defines message 'nat44_interface_add_del_output_feature_reply'.
+type Nat44InterfaceAddDelOutputFeatureReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44InterfaceAddDelOutputFeatureReply) Reset() {
+ *m = Nat44InterfaceAddDelOutputFeatureReply{}
+}
+func (*Nat44InterfaceAddDelOutputFeatureReply) GetMessageName() string {
+ return "nat44_interface_add_del_output_feature_reply"
+}
+func (*Nat44InterfaceAddDelOutputFeatureReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44InterfaceAddDelOutputFeatureReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44InterfaceAddDelOutputFeatureReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44InterfaceAddDelOutputFeatureReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44InterfaceAddrDetails defines message 'nat44_interface_addr_details'.
+type Nat44InterfaceAddrDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+}
+
+func (m *Nat44InterfaceAddrDetails) Reset() { *m = Nat44InterfaceAddrDetails{} }
+func (*Nat44InterfaceAddrDetails) GetMessageName() string { return "nat44_interface_addr_details" }
+func (*Nat44InterfaceAddrDetails) GetCrcString() string { return "3e687514" }
+func (*Nat44InterfaceAddrDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44InterfaceAddrDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Flags
+ return size
+}
+func (m *Nat44InterfaceAddrDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint8(uint8(m.Flags))
+ return buf.Bytes(), nil
+}
+func (m *Nat44InterfaceAddrDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ return nil
+}
+
+// Nat44InterfaceAddrDump defines message 'nat44_interface_addr_dump'.
+type Nat44InterfaceAddrDump struct{}
+
+func (m *Nat44InterfaceAddrDump) Reset() { *m = Nat44InterfaceAddrDump{} }
+func (*Nat44InterfaceAddrDump) GetMessageName() string { return "nat44_interface_addr_dump" }
+func (*Nat44InterfaceAddrDump) GetCrcString() string { return "51077d14" }
+func (*Nat44InterfaceAddrDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44InterfaceAddrDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat44InterfaceAddrDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat44InterfaceAddrDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat44InterfaceDetails defines message 'nat44_interface_details'.
+type Nat44InterfaceDetails struct {
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Nat44InterfaceDetails) Reset() { *m = Nat44InterfaceDetails{} }
+func (*Nat44InterfaceDetails) GetMessageName() string { return "nat44_interface_details" }
+func (*Nat44InterfaceDetails) GetCrcString() string { return "5d286289" }
+func (*Nat44InterfaceDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44InterfaceDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Flags
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Nat44InterfaceDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Nat44InterfaceDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Nat44InterfaceDump defines message 'nat44_interface_dump'.
+type Nat44InterfaceDump struct{}
+
+func (m *Nat44InterfaceDump) Reset() { *m = Nat44InterfaceDump{} }
+func (*Nat44InterfaceDump) GetMessageName() string { return "nat44_interface_dump" }
+func (*Nat44InterfaceDump) GetCrcString() string { return "51077d14" }
+func (*Nat44InterfaceDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44InterfaceDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat44InterfaceDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat44InterfaceDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat44InterfaceOutputFeatureDetails defines message 'nat44_interface_output_feature_details'.
+type Nat44InterfaceOutputFeatureDetails struct {
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Nat44InterfaceOutputFeatureDetails) Reset() { *m = Nat44InterfaceOutputFeatureDetails{} }
+func (*Nat44InterfaceOutputFeatureDetails) GetMessageName() string {
+ return "nat44_interface_output_feature_details"
+}
+func (*Nat44InterfaceOutputFeatureDetails) GetCrcString() string { return "5d286289" }
+func (*Nat44InterfaceOutputFeatureDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44InterfaceOutputFeatureDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Flags
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Nat44InterfaceOutputFeatureDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Nat44InterfaceOutputFeatureDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Nat44InterfaceOutputFeatureDump defines message 'nat44_interface_output_feature_dump'.
+type Nat44InterfaceOutputFeatureDump struct{}
+
+func (m *Nat44InterfaceOutputFeatureDump) Reset() { *m = Nat44InterfaceOutputFeatureDump{} }
+func (*Nat44InterfaceOutputFeatureDump) GetMessageName() string {
+ return "nat44_interface_output_feature_dump"
+}
+func (*Nat44InterfaceOutputFeatureDump) GetCrcString() string { return "51077d14" }
+func (*Nat44InterfaceOutputFeatureDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44InterfaceOutputFeatureDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat44InterfaceOutputFeatureDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat44InterfaceOutputFeatureDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat44LbStaticMappingAddDelLocal defines message 'nat44_lb_static_mapping_add_del_local'.
+type Nat44LbStaticMappingAddDelLocal struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ ExternalAddr IP4Address `binapi:"ip4_address,name=external_addr" json:"external_addr,omitempty"`
+ ExternalPort uint16 `binapi:"u16,name=external_port" json:"external_port,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ Local Nat44LbAddrPort `binapi:"nat44_lb_addr_port,name=local" json:"local,omitempty"`
+}
+
+func (m *Nat44LbStaticMappingAddDelLocal) Reset() { *m = Nat44LbStaticMappingAddDelLocal{} }
+func (*Nat44LbStaticMappingAddDelLocal) GetMessageName() string {
+ return "nat44_lb_static_mapping_add_del_local"
+}
+func (*Nat44LbStaticMappingAddDelLocal) GetCrcString() string { return "2910a151" }
+func (*Nat44LbStaticMappingAddDelLocal) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44LbStaticMappingAddDelLocal) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 4 // m.ExternalAddr
+ size += 2 // m.ExternalPort
+ size += 1 // m.Protocol
+ size += 1 * 4 // m.Local.Addr
+ size += 2 // m.Local.Port
+ size += 1 // m.Local.Probability
+ size += 4 // m.Local.VrfID
+ return size
+}
+func (m *Nat44LbStaticMappingAddDelLocal) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBytes(m.ExternalAddr[:], 4)
+ buf.EncodeUint16(m.ExternalPort)
+ buf.EncodeUint8(m.Protocol)
+ buf.EncodeBytes(m.Local.Addr[:], 4)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ copy(m.ExternalAddr[:], buf.DecodeBytes(4))
+ m.ExternalPort = buf.DecodeUint16()
+ m.Protocol = buf.DecodeUint8()
+ copy(m.Local.Addr[:], buf.DecodeBytes(4))
+ m.Local.Port = buf.DecodeUint16()
+ m.Local.Probability = buf.DecodeUint8()
+ m.Local.VrfID = buf.DecodeUint32()
+ return nil
+}
+
+// Nat44LbStaticMappingAddDelLocalReply defines message 'nat44_lb_static_mapping_add_del_local_reply'.
+type Nat44LbStaticMappingAddDelLocalReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat44LbStaticMappingAddDelLocalReply) Reset() { *m = Nat44LbStaticMappingAddDelLocalReply{} }
+func (*Nat44LbStaticMappingAddDelLocalReply) GetMessageName() string {
+ return "nat44_lb_static_mapping_add_del_local_reply"
+}
+func (*Nat44LbStaticMappingAddDelLocalReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat44LbStaticMappingAddDelLocalReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44LbStaticMappingAddDelLocalReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat44LbStaticMappingAddDelLocalReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat44LbStaticMappingDetails defines message 'nat44_lb_static_mapping_details'.
+type Nat44LbStaticMappingDetails struct {
+ ExternalAddr IP4Address `binapi:"ip4_address,name=external_addr" json:"external_addr,omitempty"`
+ ExternalPort uint16 `binapi:"u16,name=external_port" json:"external_port,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ Affinity uint32 `binapi:"u32,name=affinity" json:"affinity,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+ LocalNum uint32 `binapi:"u32,name=local_num" json:"-"`
+ Locals []Nat44LbAddrPort `binapi:"nat44_lb_addr_port[local_num],name=locals" json:"locals,omitempty"`
+}
+
+func (m *Nat44LbStaticMappingDetails) Reset() { *m = Nat44LbStaticMappingDetails{} }
+func (*Nat44LbStaticMappingDetails) GetMessageName() string { return "nat44_lb_static_mapping_details" }
+func (*Nat44LbStaticMappingDetails) GetCrcString() string { return "2267b9e8" }
+func (*Nat44LbStaticMappingDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44LbStaticMappingDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.ExternalAddr
+ size += 2 // m.ExternalPort
+ size += 1 // m.Protocol
+ size += 1 // m.Flags
+ size += 4 // m.Affinity
+ size += 64 // m.Tag
+ size += 4 // m.LocalNum
+ for j1 := 0; j1 < len(m.Locals); j1++ {
+ var s1 Nat44LbAddrPort
+ _ = s1
+ if j1 < len(m.Locals) {
+ s1 = m.Locals[j1]
+ }
+ size += 1 * 4 // s1.Addr
+ size += 2 // s1.Port
+ size += 1 // s1.Probability
+ size += 4 // s1.VrfID
+ }
+ return size
+}
+func (m *Nat44LbStaticMappingDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.ExternalAddr[:], 4)
+ buf.EncodeUint16(m.ExternalPort)
+ buf.EncodeUint8(m.Protocol)
+ buf.EncodeUint8(uint8(m.Flags))
+ 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 // Locals
+ if j0 < len(m.Locals) {
+ v0 = m.Locals[j0]
+ }
+ buf.EncodeBytes(v0.Addr[:], 4)
+ buf.EncodeUint16(v0.Port)
+ buf.EncodeUint8(v0.Probability)
+ buf.EncodeUint32(v0.VrfID)
+ }
+ return buf.Bytes(), nil
+}
+func (m *Nat44LbStaticMappingDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.ExternalAddr[:], buf.DecodeBytes(4))
+ m.ExternalPort = buf.DecodeUint16()
+ m.Protocol = buf.DecodeUint8()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.Affinity = buf.DecodeUint32()
+ m.Tag = buf.DecodeString(64)
+ m.LocalNum = buf.DecodeUint32()
+ 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()
+ m.Locals[j0].Probability = buf.DecodeUint8()
+ m.Locals[j0].VrfID = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// Nat44LbStaticMappingDump defines message 'nat44_lb_static_mapping_dump'.
+type Nat44LbStaticMappingDump struct{}
+
+func (m *Nat44LbStaticMappingDump) Reset() { *m = Nat44LbStaticMappingDump{} }
+func (*Nat44LbStaticMappingDump) GetMessageName() string { return "nat44_lb_static_mapping_dump" }
+func (*Nat44LbStaticMappingDump) GetCrcString() string { return "51077d14" }
+func (*Nat44LbStaticMappingDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44LbStaticMappingDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat44LbStaticMappingDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat44LbStaticMappingDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat44StaticMappingDetails defines message 'nat44_static_mapping_details'.
+type Nat44StaticMappingDetails struct {
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ LocalIPAddress IP4Address `binapi:"ip4_address,name=local_ip_address" json:"local_ip_address,omitempty"`
+ ExternalIPAddress IP4Address `binapi:"ip4_address,name=external_ip_address" json:"external_ip_address,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ LocalPort uint16 `binapi:"u16,name=local_port" json:"local_port,omitempty"`
+ ExternalPort uint16 `binapi:"u16,name=external_port" json:"external_port,omitempty"`
+ ExternalSwIfIndex InterfaceIndex `binapi:"interface_index,name=external_sw_if_index" json:"external_sw_if_index,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *Nat44StaticMappingDetails) Reset() { *m = Nat44StaticMappingDetails{} }
+func (*Nat44StaticMappingDetails) GetMessageName() string { return "nat44_static_mapping_details" }
+func (*Nat44StaticMappingDetails) GetCrcString() string { return "1a433ef7" }
+func (*Nat44StaticMappingDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44StaticMappingDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Flags
+ size += 1 * 4 // m.LocalIPAddress
+ size += 1 * 4 // m.ExternalIPAddress
+ size += 1 // m.Protocol
+ size += 2 // m.LocalPort
+ size += 2 // m.ExternalPort
+ size += 4 // m.ExternalSwIfIndex
+ size += 4 // m.VrfID
+ size += 64 // m.Tag
+ return size
+}
+func (m *Nat44StaticMappingDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(m.Protocol)
+ buf.EncodeUint16(m.LocalPort)
+ buf.EncodeUint16(m.ExternalPort)
+ buf.EncodeUint32(uint32(m.ExternalSwIfIndex))
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeString(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *Nat44StaticMappingDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ copy(m.LocalIPAddress[:], buf.DecodeBytes(4))
+ copy(m.ExternalIPAddress[:], buf.DecodeBytes(4))
+ m.Protocol = buf.DecodeUint8()
+ m.LocalPort = buf.DecodeUint16()
+ m.ExternalPort = buf.DecodeUint16()
+ m.ExternalSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.VrfID = buf.DecodeUint32()
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// Nat44StaticMappingDump defines message 'nat44_static_mapping_dump'.
+type Nat44StaticMappingDump struct{}
+
+func (m *Nat44StaticMappingDump) Reset() { *m = Nat44StaticMappingDump{} }
+func (*Nat44StaticMappingDump) GetMessageName() string { return "nat44_static_mapping_dump" }
+func (*Nat44StaticMappingDump) GetCrcString() string { return "51077d14" }
+func (*Nat44StaticMappingDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44StaticMappingDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat44StaticMappingDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat44StaticMappingDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat44UserDetails defines message 'nat44_user_details'.
+type Nat44UserDetails struct {
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+ Nsessions uint32 `binapi:"u32,name=nsessions" json:"nsessions,omitempty"`
+ Nstaticsessions uint32 `binapi:"u32,name=nstaticsessions" json:"nstaticsessions,omitempty"`
+}
+
+func (m *Nat44UserDetails) Reset() { *m = Nat44UserDetails{} }
+func (*Nat44UserDetails) GetMessageName() string { return "nat44_user_details" }
+func (*Nat44UserDetails) GetCrcString() string { return "355896c2" }
+func (*Nat44UserDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44UserDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.VrfID
+ size += 1 * 4 // m.IPAddress
+ size += 4 // m.Nsessions
+ size += 4 // m.Nstaticsessions
+ return size
+}
+func (m *Nat44UserDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeBytes(m.IPAddress[:], 4)
+ buf.EncodeUint32(m.Nsessions)
+ buf.EncodeUint32(m.Nstaticsessions)
+ return buf.Bytes(), nil
+}
+func (m *Nat44UserDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.VrfID = buf.DecodeUint32()
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ m.Nsessions = buf.DecodeUint32()
+ m.Nstaticsessions = buf.DecodeUint32()
+ return nil
+}
+
+// Nat44UserDump defines message 'nat44_user_dump'.
+type Nat44UserDump struct{}
+
+func (m *Nat44UserDump) Reset() { *m = Nat44UserDump{} }
+func (*Nat44UserDump) GetMessageName() string { return "nat44_user_dump" }
+func (*Nat44UserDump) GetCrcString() string { return "51077d14" }
+func (*Nat44UserDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44UserDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat44UserDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat44UserDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat44UserSessionDetails defines message 'nat44_user_session_details'.
+type Nat44UserSessionDetails struct {
+ OutsideIPAddress IP4Address `binapi:"ip4_address,name=outside_ip_address" json:"outside_ip_address,omitempty"`
+ OutsidePort uint16 `binapi:"u16,name=outside_port" json:"outside_port,omitempty"`
+ InsideIPAddress IP4Address `binapi:"ip4_address,name=inside_ip_address" json:"inside_ip_address,omitempty"`
+ InsidePort uint16 `binapi:"u16,name=inside_port" json:"inside_port,omitempty"`
+ Protocol uint16 `binapi:"u16,name=protocol" json:"protocol,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ LastHeard uint64 `binapi:"u64,name=last_heard" json:"last_heard,omitempty"`
+ TotalBytes uint64 `binapi:"u64,name=total_bytes" json:"total_bytes,omitempty"`
+ TotalPkts uint32 `binapi:"u32,name=total_pkts" json:"total_pkts,omitempty"`
+ ExtHostAddress IP4Address `binapi:"ip4_address,name=ext_host_address" json:"ext_host_address,omitempty"`
+ ExtHostPort uint16 `binapi:"u16,name=ext_host_port" json:"ext_host_port,omitempty"`
+ ExtHostNatAddress IP4Address `binapi:"ip4_address,name=ext_host_nat_address" json:"ext_host_nat_address,omitempty"`
+ ExtHostNatPort uint16 `binapi:"u16,name=ext_host_nat_port" json:"ext_host_nat_port,omitempty"`
+}
+
+func (m *Nat44UserSessionDetails) Reset() { *m = Nat44UserSessionDetails{} }
+func (*Nat44UserSessionDetails) GetMessageName() string { return "nat44_user_session_details" }
+func (*Nat44UserSessionDetails) GetCrcString() string { return "1965fd69" }
+func (*Nat44UserSessionDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat44UserSessionDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.OutsideIPAddress
+ size += 2 // m.OutsidePort
+ size += 1 * 4 // m.InsideIPAddress
+ size += 2 // m.InsidePort
+ size += 2 // m.Protocol
+ size += 1 // m.Flags
+ size += 8 // m.LastHeard
+ size += 8 // m.TotalBytes
+ size += 4 // m.TotalPkts
+ size += 1 * 4 // m.ExtHostAddress
+ size += 2 // m.ExtHostPort
+ size += 1 * 4 // m.ExtHostNatAddress
+ size += 2 // m.ExtHostNatPort
+ return size
+}
+func (m *Nat44UserSessionDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.OutsideIPAddress[:], 4)
+ buf.EncodeUint16(m.OutsidePort)
+ buf.EncodeBytes(m.InsideIPAddress[:], 4)
+ buf.EncodeUint16(m.InsidePort)
+ buf.EncodeUint16(m.Protocol)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint64(m.LastHeard)
+ buf.EncodeUint64(m.TotalBytes)
+ buf.EncodeUint32(m.TotalPkts)
+ buf.EncodeBytes(m.ExtHostAddress[:], 4)
+ buf.EncodeUint16(m.ExtHostPort)
+ buf.EncodeBytes(m.ExtHostNatAddress[:], 4)
+ buf.EncodeUint16(m.ExtHostNatPort)
+ return buf.Bytes(), nil
+}
+func (m *Nat44UserSessionDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.OutsideIPAddress[:], buf.DecodeBytes(4))
+ m.OutsidePort = buf.DecodeUint16()
+ copy(m.InsideIPAddress[:], buf.DecodeBytes(4))
+ m.InsidePort = buf.DecodeUint16()
+ m.Protocol = buf.DecodeUint16()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.LastHeard = buf.DecodeUint64()
+ m.TotalBytes = buf.DecodeUint64()
+ m.TotalPkts = buf.DecodeUint32()
+ copy(m.ExtHostAddress[:], buf.DecodeBytes(4))
+ m.ExtHostPort = buf.DecodeUint16()
+ copy(m.ExtHostNatAddress[:], buf.DecodeBytes(4))
+ m.ExtHostNatPort = buf.DecodeUint16()
+ return nil
+}
+
+// Nat44UserSessionDump defines message 'nat44_user_session_dump'.
+type Nat44UserSessionDump struct {
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+}
+
+func (m *Nat44UserSessionDump) Reset() { *m = Nat44UserSessionDump{} }
+func (*Nat44UserSessionDump) GetMessageName() string { return "nat44_user_session_dump" }
+func (*Nat44UserSessionDump) GetCrcString() string { return "e1899c98" }
+func (*Nat44UserSessionDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat44UserSessionDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.IPAddress
+ size += 4 // m.VrfID
+ return size
+}
+func (m *Nat44UserSessionDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IPAddress[:], 4)
+ buf.EncodeUint32(m.VrfID)
+ return buf.Bytes(), nil
+}
+func (m *Nat44UserSessionDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ m.VrfID = buf.DecodeUint32()
+ return nil
+}
+
+// Nat64AddDelInterface defines message 'nat64_add_del_interface'.
+type Nat64AddDelInterface struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Nat64AddDelInterface) Reset() { *m = Nat64AddDelInterface{} }
+func (*Nat64AddDelInterface) GetMessageName() string { return "nat64_add_del_interface" }
+func (*Nat64AddDelInterface) GetCrcString() string { return "f3699b83" }
+func (*Nat64AddDelInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64AddDelInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Flags
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Nat64AddDelInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Nat64AddDelInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Nat64AddDelInterfaceAddr defines message 'nat64_add_del_interface_addr'.
+type Nat64AddDelInterfaceAddr struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Nat64AddDelInterfaceAddr) Reset() { *m = Nat64AddDelInterfaceAddr{} }
+func (*Nat64AddDelInterfaceAddr) GetMessageName() string { return "nat64_add_del_interface_addr" }
+func (*Nat64AddDelInterfaceAddr) GetCrcString() string { return "47d6e753" }
+func (*Nat64AddDelInterfaceAddr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64AddDelInterfaceAddr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Nat64AddDelInterfaceAddr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Nat64AddDelInterfaceAddr) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Nat64AddDelInterfaceAddrReply defines message 'nat64_add_del_interface_addr_reply'.
+type Nat64AddDelInterfaceAddrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat64AddDelInterfaceAddrReply) Reset() { *m = Nat64AddDelInterfaceAddrReply{} }
+func (*Nat64AddDelInterfaceAddrReply) GetMessageName() string {
+ return "nat64_add_del_interface_addr_reply"
+}
+func (*Nat64AddDelInterfaceAddrReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat64AddDelInterfaceAddrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64AddDelInterfaceAddrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat64AddDelInterfaceAddrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat64AddDelInterfaceReply defines message 'nat64_add_del_interface_reply'.
+type Nat64AddDelInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat64AddDelInterfaceReply) Reset() { *m = Nat64AddDelInterfaceReply{} }
+func (*Nat64AddDelInterfaceReply) GetMessageName() string { return "nat64_add_del_interface_reply" }
+func (*Nat64AddDelInterfaceReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat64AddDelInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64AddDelInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat64AddDelInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat64AddDelPoolAddrRange defines message 'nat64_add_del_pool_addr_range'.
+type Nat64AddDelPoolAddrRange struct {
+ StartAddr IP4Address `binapi:"ip4_address,name=start_addr" json:"start_addr,omitempty"`
+ EndAddr IP4Address `binapi:"ip4_address,name=end_addr" json:"end_addr,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *Nat64AddDelPoolAddrRange) Reset() { *m = Nat64AddDelPoolAddrRange{} }
+func (*Nat64AddDelPoolAddrRange) GetMessageName() string { return "nat64_add_del_pool_addr_range" }
+func (*Nat64AddDelPoolAddrRange) GetCrcString() string { return "21234ef3" }
+func (*Nat64AddDelPoolAddrRange) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64AddDelPoolAddrRange) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.StartAddr
+ size += 1 * 4 // m.EndAddr
+ size += 4 // m.VrfID
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *Nat64AddDelPoolAddrRange) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.StartAddr[:], 4)
+ buf.EncodeBytes(m.EndAddr[:], 4)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *Nat64AddDelPoolAddrRange) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.StartAddr[:], buf.DecodeBytes(4))
+ copy(m.EndAddr[:], buf.DecodeBytes(4))
+ m.VrfID = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// Nat64AddDelPoolAddrRangeReply defines message 'nat64_add_del_pool_addr_range_reply'.
+type Nat64AddDelPoolAddrRangeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat64AddDelPoolAddrRangeReply) Reset() { *m = Nat64AddDelPoolAddrRangeReply{} }
+func (*Nat64AddDelPoolAddrRangeReply) GetMessageName() string {
+ return "nat64_add_del_pool_addr_range_reply"
+}
+func (*Nat64AddDelPoolAddrRangeReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat64AddDelPoolAddrRangeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64AddDelPoolAddrRangeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat64AddDelPoolAddrRangeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat64AddDelPrefix defines message 'nat64_add_del_prefix'.
+type Nat64AddDelPrefix struct {
+ Prefix IP6Prefix `binapi:"ip6_prefix,name=prefix" json:"prefix,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *Nat64AddDelPrefix) Reset() { *m = Nat64AddDelPrefix{} }
+func (*Nat64AddDelPrefix) GetMessageName() string { return "nat64_add_del_prefix" }
+func (*Nat64AddDelPrefix) GetCrcString() string { return "727b2f4c" }
+func (*Nat64AddDelPrefix) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64AddDelPrefix) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 16 // m.Prefix.Address
+ size += 1 // m.Prefix.Len
+ size += 4 // m.VrfID
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *Nat64AddDelPrefix) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Prefix.Address[:], 16)
+ buf.EncodeUint8(m.Prefix.Len)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *Nat64AddDelPrefix) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.Prefix.Address[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
+ m.VrfID = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// Nat64AddDelPrefixReply defines message 'nat64_add_del_prefix_reply'.
+type Nat64AddDelPrefixReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat64AddDelPrefixReply) Reset() { *m = Nat64AddDelPrefixReply{} }
+func (*Nat64AddDelPrefixReply) GetMessageName() string { return "nat64_add_del_prefix_reply" }
+func (*Nat64AddDelPrefixReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat64AddDelPrefixReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64AddDelPrefixReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat64AddDelPrefixReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat64AddDelStaticBib defines message 'nat64_add_del_static_bib'.
+type Nat64AddDelStaticBib struct {
+ IAddr IP6Address `binapi:"ip6_address,name=i_addr" json:"i_addr,omitempty"`
+ OAddr IP4Address `binapi:"ip4_address,name=o_addr" json:"o_addr,omitempty"`
+ IPort uint16 `binapi:"u16,name=i_port" json:"i_port,omitempty"`
+ OPort uint16 `binapi:"u16,name=o_port" json:"o_port,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *Nat64AddDelStaticBib) Reset() { *m = Nat64AddDelStaticBib{} }
+func (*Nat64AddDelStaticBib) GetMessageName() string { return "nat64_add_del_static_bib" }
+func (*Nat64AddDelStaticBib) GetCrcString() string { return "90fae58a" }
+func (*Nat64AddDelStaticBib) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64AddDelStaticBib) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 16 // m.IAddr
+ size += 1 * 4 // m.OAddr
+ size += 2 // m.IPort
+ size += 2 // m.OPort
+ size += 4 // m.VrfID
+ size += 1 // m.Proto
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *Nat64AddDelStaticBib) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IAddr[:], 16)
+ buf.EncodeBytes(m.OAddr[:], 4)
+ buf.EncodeUint16(m.IPort)
+ buf.EncodeUint16(m.OPort)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeUint8(m.Proto)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *Nat64AddDelStaticBib) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IAddr[:], buf.DecodeBytes(16))
+ copy(m.OAddr[:], buf.DecodeBytes(4))
+ m.IPort = buf.DecodeUint16()
+ m.OPort = buf.DecodeUint16()
+ m.VrfID = buf.DecodeUint32()
+ m.Proto = buf.DecodeUint8()
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// Nat64AddDelStaticBibReply defines message 'nat64_add_del_static_bib_reply'.
+type Nat64AddDelStaticBibReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat64AddDelStaticBibReply) Reset() { *m = Nat64AddDelStaticBibReply{} }
+func (*Nat64AddDelStaticBibReply) GetMessageName() string { return "nat64_add_del_static_bib_reply" }
+func (*Nat64AddDelStaticBibReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat64AddDelStaticBibReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64AddDelStaticBibReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat64AddDelStaticBibReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat64BibDetails defines message 'nat64_bib_details'.
+type Nat64BibDetails struct {
+ IAddr IP6Address `binapi:"ip6_address,name=i_addr" json:"i_addr,omitempty"`
+ OAddr IP4Address `binapi:"ip4_address,name=o_addr" json:"o_addr,omitempty"`
+ IPort uint16 `binapi:"u16,name=i_port" json:"i_port,omitempty"`
+ OPort uint16 `binapi:"u16,name=o_port" json:"o_port,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ SesNum uint32 `binapi:"u32,name=ses_num" json:"ses_num,omitempty"`
+}
+
+func (m *Nat64BibDetails) Reset() { *m = Nat64BibDetails{} }
+func (*Nat64BibDetails) GetMessageName() string { return "nat64_bib_details" }
+func (*Nat64BibDetails) GetCrcString() string { return "62c8541d" }
+func (*Nat64BibDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64BibDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 16 // m.IAddr
+ size += 1 * 4 // m.OAddr
+ size += 2 // m.IPort
+ size += 2 // m.OPort
+ size += 4 // m.VrfID
+ size += 1 // m.Proto
+ size += 1 // m.Flags
+ size += 4 // m.SesNum
+ return size
+}
+func (m *Nat64BibDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IAddr[:], 16)
+ buf.EncodeBytes(m.OAddr[:], 4)
+ buf.EncodeUint16(m.IPort)
+ buf.EncodeUint16(m.OPort)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeUint8(m.Proto)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(m.SesNum)
+ return buf.Bytes(), nil
+}
+func (m *Nat64BibDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IAddr[:], buf.DecodeBytes(16))
+ copy(m.OAddr[:], buf.DecodeBytes(4))
+ m.IPort = buf.DecodeUint16()
+ m.OPort = buf.DecodeUint16()
+ m.VrfID = buf.DecodeUint32()
+ m.Proto = buf.DecodeUint8()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.SesNum = buf.DecodeUint32()
+ return nil
+}
+
+// Nat64BibDump defines message 'nat64_bib_dump'.
+type Nat64BibDump struct {
+ Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
+}
+
+func (m *Nat64BibDump) Reset() { *m = Nat64BibDump{} }
+func (*Nat64BibDump) GetMessageName() string { return "nat64_bib_dump" }
+func (*Nat64BibDump) GetCrcString() string { return "cfcb6b75" }
+func (*Nat64BibDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64BibDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Proto
+ return size
+}
+func (m *Nat64BibDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Proto)
+ return buf.Bytes(), nil
+}
+func (m *Nat64BibDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Proto = buf.DecodeUint8()
+ return nil
+}
+
+// Nat64InterfaceDetails defines message 'nat64_interface_details'.
+type Nat64InterfaceDetails struct {
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Nat64InterfaceDetails) Reset() { *m = Nat64InterfaceDetails{} }
+func (*Nat64InterfaceDetails) GetMessageName() string { return "nat64_interface_details" }
+func (*Nat64InterfaceDetails) GetCrcString() string { return "5d286289" }
+func (*Nat64InterfaceDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64InterfaceDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Flags
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Nat64InterfaceDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Nat64InterfaceDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Nat64InterfaceDump defines message 'nat64_interface_dump'.
+type Nat64InterfaceDump struct{}
+
+func (m *Nat64InterfaceDump) Reset() { *m = Nat64InterfaceDump{} }
+func (*Nat64InterfaceDump) GetMessageName() string { return "nat64_interface_dump" }
+func (*Nat64InterfaceDump) GetCrcString() string { return "51077d14" }
+func (*Nat64InterfaceDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64InterfaceDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat64InterfaceDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat64InterfaceDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat64PoolAddrDetails defines message 'nat64_pool_addr_details'.
+type Nat64PoolAddrDetails struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+}
+
+func (m *Nat64PoolAddrDetails) Reset() { *m = Nat64PoolAddrDetails{} }
+func (*Nat64PoolAddrDetails) GetMessageName() string { return "nat64_pool_addr_details" }
+func (*Nat64PoolAddrDetails) GetCrcString() string { return "9bb99cdb" }
+func (*Nat64PoolAddrDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64PoolAddrDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.Address
+ size += 4 // m.VrfID
+ return size
+}
+func (m *Nat64PoolAddrDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Address[:], 4)
+ buf.EncodeUint32(m.VrfID)
+ return buf.Bytes(), nil
+}
+func (m *Nat64PoolAddrDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.Address[:], buf.DecodeBytes(4))
+ m.VrfID = buf.DecodeUint32()
+ return nil
+}
+
+// Nat64PoolAddrDump defines message 'nat64_pool_addr_dump'.
+type Nat64PoolAddrDump struct{}
+
+func (m *Nat64PoolAddrDump) Reset() { *m = Nat64PoolAddrDump{} }
+func (*Nat64PoolAddrDump) GetMessageName() string { return "nat64_pool_addr_dump" }
+func (*Nat64PoolAddrDump) GetCrcString() string { return "51077d14" }
+func (*Nat64PoolAddrDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64PoolAddrDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat64PoolAddrDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat64PoolAddrDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat64PrefixDetails defines message 'nat64_prefix_details'.
+type Nat64PrefixDetails struct {
+ Prefix IP6Prefix `binapi:"ip6_prefix,name=prefix" json:"prefix,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+}
+
+func (m *Nat64PrefixDetails) Reset() { *m = Nat64PrefixDetails{} }
+func (*Nat64PrefixDetails) GetMessageName() string { return "nat64_prefix_details" }
+func (*Nat64PrefixDetails) GetCrcString() string { return "20568de3" }
+func (*Nat64PrefixDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64PrefixDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Prefix.Address[:], 16)
+ buf.EncodeUint8(m.Prefix.Len)
+ buf.EncodeUint32(m.VrfID)
+ return buf.Bytes(), nil
+}
+func (m *Nat64PrefixDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.Prefix.Address[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
+ m.VrfID = buf.DecodeUint32()
+ return nil
+}
+
+// Nat64PrefixDump defines message 'nat64_prefix_dump'.
+type Nat64PrefixDump struct{}
+
+func (m *Nat64PrefixDump) Reset() { *m = Nat64PrefixDump{} }
+func (*Nat64PrefixDump) GetMessageName() string { return "nat64_prefix_dump" }
+func (*Nat64PrefixDump) GetCrcString() string { return "51077d14" }
+func (*Nat64PrefixDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64PrefixDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat64PrefixDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat64PrefixDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat64StDetails defines message 'nat64_st_details'.
+type Nat64StDetails struct {
+ IlAddr IP6Address `binapi:"ip6_address,name=il_addr" json:"il_addr,omitempty"`
+ OlAddr IP4Address `binapi:"ip4_address,name=ol_addr" json:"ol_addr,omitempty"`
+ IlPort uint16 `binapi:"u16,name=il_port" json:"il_port,omitempty"`
+ OlPort uint16 `binapi:"u16,name=ol_port" json:"ol_port,omitempty"`
+ IrAddr IP6Address `binapi:"ip6_address,name=ir_addr" json:"ir_addr,omitempty"`
+ OrAddr IP4Address `binapi:"ip4_address,name=or_addr" json:"or_addr,omitempty"`
+ RPort uint16 `binapi:"u16,name=r_port" json:"r_port,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
+}
+
+func (m *Nat64StDetails) Reset() { *m = Nat64StDetails{} }
+func (*Nat64StDetails) GetMessageName() string { return "nat64_st_details" }
+func (*Nat64StDetails) GetCrcString() string { return "c770d620" }
+func (*Nat64StDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat64StDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 16 // m.IlAddr
+ size += 1 * 4 // m.OlAddr
+ size += 2 // m.IlPort
+ size += 2 // m.OlPort
+ size += 1 * 16 // m.IrAddr
+ size += 1 * 4 // m.OrAddr
+ size += 2 // m.RPort
+ size += 4 // m.VrfID
+ size += 1 // m.Proto
+ return size
+}
+func (m *Nat64StDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IlAddr[:], 16)
+ buf.EncodeBytes(m.OlAddr[:], 4)
+ buf.EncodeUint16(m.IlPort)
+ buf.EncodeUint16(m.OlPort)
+ buf.EncodeBytes(m.IrAddr[:], 16)
+ buf.EncodeBytes(m.OrAddr[:], 4)
+ buf.EncodeUint16(m.RPort)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeUint8(m.Proto)
+ return buf.Bytes(), nil
+}
+func (m *Nat64StDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IlAddr[:], buf.DecodeBytes(16))
+ copy(m.OlAddr[:], buf.DecodeBytes(4))
+ m.IlPort = buf.DecodeUint16()
+ m.OlPort = buf.DecodeUint16()
+ copy(m.IrAddr[:], buf.DecodeBytes(16))
+ copy(m.OrAddr[:], buf.DecodeBytes(4))
+ m.RPort = buf.DecodeUint16()
+ m.VrfID = buf.DecodeUint32()
+ m.Proto = buf.DecodeUint8()
+ return nil
+}
+
+// Nat64StDump defines message 'nat64_st_dump'.
+type Nat64StDump struct {
+ Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
+}
+
+func (m *Nat64StDump) Reset() { *m = Nat64StDump{} }
+func (*Nat64StDump) GetMessageName() string { return "nat64_st_dump" }
+func (*Nat64StDump) GetCrcString() string { return "cfcb6b75" }
+func (*Nat64StDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat64StDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Proto
+ return size
+}
+func (m *Nat64StDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Proto)
+ return buf.Bytes(), nil
+}
+func (m *Nat64StDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Proto = buf.DecodeUint8()
+ return nil
+}
+
+// Nat66AddDelInterface defines message 'nat66_add_del_interface'.
+type Nat66AddDelInterface struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Nat66AddDelInterface) Reset() { *m = Nat66AddDelInterface{} }
+func (*Nat66AddDelInterface) GetMessageName() string { return "nat66_add_del_interface" }
+func (*Nat66AddDelInterface) GetCrcString() string { return "f3699b83" }
+func (*Nat66AddDelInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat66AddDelInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.Flags
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Nat66AddDelInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Nat66AddDelInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Nat66AddDelInterfaceReply defines message 'nat66_add_del_interface_reply'.
+type Nat66AddDelInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat66AddDelInterfaceReply) Reset() { *m = Nat66AddDelInterfaceReply{} }
+func (*Nat66AddDelInterfaceReply) GetMessageName() string { return "nat66_add_del_interface_reply" }
+func (*Nat66AddDelInterfaceReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat66AddDelInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat66AddDelInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat66AddDelInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat66AddDelStaticMapping defines message 'nat66_add_del_static_mapping'.
+type Nat66AddDelStaticMapping struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ LocalIPAddress IP6Address `binapi:"ip6_address,name=local_ip_address" json:"local_ip_address,omitempty"`
+ ExternalIPAddress IP6Address `binapi:"ip6_address,name=external_ip_address" json:"external_ip_address,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+}
+
+func (m *Nat66AddDelStaticMapping) Reset() { *m = Nat66AddDelStaticMapping{} }
+func (*Nat66AddDelStaticMapping) GetMessageName() string { return "nat66_add_del_static_mapping" }
+func (*Nat66AddDelStaticMapping) GetCrcString() string { return "fb64e50b" }
+func (*Nat66AddDelStaticMapping) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat66AddDelStaticMapping) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 16 // m.LocalIPAddress
+ size += 1 * 16 // m.ExternalIPAddress
+ size += 4 // m.VrfID
+ return size
+}
+func (m *Nat66AddDelStaticMapping) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(m.VrfID)
+ return buf.Bytes(), nil
+}
+func (m *Nat66AddDelStaticMapping) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ copy(m.LocalIPAddress[:], buf.DecodeBytes(16))
+ copy(m.ExternalIPAddress[:], buf.DecodeBytes(16))
+ m.VrfID = buf.DecodeUint32()
+ return nil
+}
+
+// Nat66AddDelStaticMappingReply defines message 'nat66_add_del_static_mapping_reply'.
+type Nat66AddDelStaticMappingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Nat66AddDelStaticMappingReply) Reset() { *m = Nat66AddDelStaticMappingReply{} }
+func (*Nat66AddDelStaticMappingReply) GetMessageName() string {
+ return "nat66_add_del_static_mapping_reply"
+}
+func (*Nat66AddDelStaticMappingReply) GetCrcString() string { return "e8d4e804" }
+func (*Nat66AddDelStaticMappingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat66AddDelStaticMappingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Nat66AddDelStaticMappingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Nat66InterfaceDetails defines message 'nat66_interface_details'.
+type Nat66InterfaceDetails struct {
+ Flags NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Nat66InterfaceDetails) Reset() { *m = Nat66InterfaceDetails{} }
+func (*Nat66InterfaceDetails) GetMessageName() string { return "nat66_interface_details" }
+func (*Nat66InterfaceDetails) GetCrcString() string { return "5d286289" }
+func (*Nat66InterfaceDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat66InterfaceDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Flags
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Nat66InterfaceDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.Flags))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Nat66InterfaceDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Flags = NatConfigFlags(buf.DecodeUint8())
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Nat66InterfaceDump defines message 'nat66_interface_dump'.
+type Nat66InterfaceDump struct{}
+
+func (m *Nat66InterfaceDump) Reset() { *m = Nat66InterfaceDump{} }
+func (*Nat66InterfaceDump) GetMessageName() string { return "nat66_interface_dump" }
+func (*Nat66InterfaceDump) GetCrcString() string { return "51077d14" }
+func (*Nat66InterfaceDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat66InterfaceDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat66InterfaceDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat66InterfaceDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// Nat66StaticMappingDetails defines message 'nat66_static_mapping_details'.
+type Nat66StaticMappingDetails struct {
+ LocalIPAddress IP6Address `binapi:"ip6_address,name=local_ip_address" json:"local_ip_address,omitempty"`
+ ExternalIPAddress IP6Address `binapi:"ip6_address,name=external_ip_address" json:"external_ip_address,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ TotalBytes uint64 `binapi:"u64,name=total_bytes" json:"total_bytes,omitempty"`
+ TotalPkts uint64 `binapi:"u64,name=total_pkts" json:"total_pkts,omitempty"`
+}
+
+func (m *Nat66StaticMappingDetails) Reset() { *m = Nat66StaticMappingDetails{} }
+func (*Nat66StaticMappingDetails) GetMessageName() string { return "nat66_static_mapping_details" }
+func (*Nat66StaticMappingDetails) GetCrcString() string { return "5c568448" }
+func (*Nat66StaticMappingDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Nat66StaticMappingDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 16 // m.LocalIPAddress
+ size += 1 * 16 // m.ExternalIPAddress
+ size += 4 // m.VrfID
+ size += 8 // m.TotalBytes
+ size += 8 // m.TotalPkts
+ return size
+}
+func (m *Nat66StaticMappingDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.LocalIPAddress[:], 16)
+ buf.EncodeBytes(m.ExternalIPAddress[:], 16)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeUint64(m.TotalBytes)
+ buf.EncodeUint64(m.TotalPkts)
+ return buf.Bytes(), nil
+}
+func (m *Nat66StaticMappingDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.LocalIPAddress[:], buf.DecodeBytes(16))
+ copy(m.ExternalIPAddress[:], buf.DecodeBytes(16))
+ m.VrfID = buf.DecodeUint32()
+ m.TotalBytes = buf.DecodeUint64()
+ m.TotalPkts = buf.DecodeUint64()
+ return nil
+}
+
+// Nat66StaticMappingDump defines message 'nat66_static_mapping_dump'.
+type Nat66StaticMappingDump struct{}
+
+func (m *Nat66StaticMappingDump) Reset() { *m = Nat66StaticMappingDump{} }
+func (*Nat66StaticMappingDump) GetMessageName() string { return "nat66_static_mapping_dump" }
+func (*Nat66StaticMappingDump) GetCrcString() string { return "51077d14" }
+func (*Nat66StaticMappingDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Nat66StaticMappingDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Nat66StaticMappingDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Nat66StaticMappingDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatControlPing defines message 'nat_control_ping'.
+type NatControlPing struct{}
+
+func (m *NatControlPing) Reset() { *m = NatControlPing{} }
+func (*NatControlPing) GetMessageName() string { return "nat_control_ping" }
+func (*NatControlPing) GetCrcString() string { return "51077d14" }
+func (*NatControlPing) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatControlPing) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatControlPing) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatControlPing) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatControlPingReply defines message 'nat_control_ping_reply'.
+type NatControlPingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ ClientIndex uint32 `binapi:"u32,name=client_index" json:"client_index,omitempty"`
+ VpePID uint32 `binapi:"u32,name=vpe_pid" json:"vpe_pid,omitempty"`
+}
+
+func (m *NatControlPingReply) Reset() { *m = NatControlPingReply{} }
+func (*NatControlPingReply) GetMessageName() string { return "nat_control_ping_reply" }
+func (*NatControlPingReply) GetCrcString() string { return "f6b0b8ca" }
+func (*NatControlPingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatControlPingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.ClientIndex
+ size += 4 // m.VpePID
+ return size
+}
+func (m *NatControlPingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.ClientIndex = buf.DecodeUint32()
+ m.VpePID = buf.DecodeUint32()
+ return nil
+}
+
+// NatDetAddDelMap defines message 'nat_det_add_del_map'.
+type NatDetAddDelMap struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ InAddr IP4Address `binapi:"ip4_address,name=in_addr" json:"in_addr,omitempty"`
+ InPlen uint8 `binapi:"u8,name=in_plen" json:"in_plen,omitempty"`
+ OutAddr IP4Address `binapi:"ip4_address,name=out_addr" json:"out_addr,omitempty"`
+ OutPlen uint8 `binapi:"u8,name=out_plen" json:"out_plen,omitempty"`
+}
+
+func (m *NatDetAddDelMap) Reset() { *m = NatDetAddDelMap{} }
+func (*NatDetAddDelMap) GetMessageName() string { return "nat_det_add_del_map" }
+func (*NatDetAddDelMap) GetCrcString() string { return "112fde05" }
+func (*NatDetAddDelMap) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatDetAddDelMap) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 4 // m.InAddr
+ size += 1 // m.InPlen
+ size += 1 * 4 // m.OutAddr
+ size += 1 // m.OutPlen
+ return size
+}
+func (m *NatDetAddDelMap) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBytes(m.InAddr[:], 4)
+ buf.EncodeUint8(m.InPlen)
+ buf.EncodeBytes(m.OutAddr[:], 4)
+ buf.EncodeUint8(m.OutPlen)
+ return buf.Bytes(), nil
+}
+func (m *NatDetAddDelMap) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ copy(m.InAddr[:], buf.DecodeBytes(4))
+ m.InPlen = buf.DecodeUint8()
+ copy(m.OutAddr[:], buf.DecodeBytes(4))
+ m.OutPlen = buf.DecodeUint8()
+ return nil
+}
+
+// NatDetAddDelMapReply defines message 'nat_det_add_del_map_reply'.
+type NatDetAddDelMapReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatDetAddDelMapReply) Reset() { *m = NatDetAddDelMapReply{} }
+func (*NatDetAddDelMapReply) GetMessageName() string { return "nat_det_add_del_map_reply" }
+func (*NatDetAddDelMapReply) GetCrcString() string { return "e8d4e804" }
+func (*NatDetAddDelMapReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatDetAddDelMapReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatDetAddDelMapReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatDetCloseSessionIn defines message 'nat_det_close_session_in'.
+type NatDetCloseSessionIn struct {
+ InAddr IP4Address `binapi:"ip4_address,name=in_addr" json:"in_addr,omitempty"`
+ InPort uint16 `binapi:"u16,name=in_port" json:"in_port,omitempty"`
+ ExtAddr IP4Address `binapi:"ip4_address,name=ext_addr" json:"ext_addr,omitempty"`
+ ExtPort uint16 `binapi:"u16,name=ext_port" json:"ext_port,omitempty"`
+}
+
+func (m *NatDetCloseSessionIn) Reset() { *m = NatDetCloseSessionIn{} }
+func (*NatDetCloseSessionIn) GetMessageName() string { return "nat_det_close_session_in" }
+func (*NatDetCloseSessionIn) GetCrcString() string { return "0a10ef64" }
+func (*NatDetCloseSessionIn) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatDetCloseSessionIn) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.InAddr
+ size += 2 // m.InPort
+ size += 1 * 4 // m.ExtAddr
+ size += 2 // m.ExtPort
+ return size
+}
+func (m *NatDetCloseSessionIn) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.InAddr[:], 4)
+ buf.EncodeUint16(m.InPort)
+ buf.EncodeBytes(m.ExtAddr[:], 4)
+ buf.EncodeUint16(m.ExtPort)
+ return buf.Bytes(), nil
+}
+func (m *NatDetCloseSessionIn) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.InAddr[:], buf.DecodeBytes(4))
+ m.InPort = buf.DecodeUint16()
+ copy(m.ExtAddr[:], buf.DecodeBytes(4))
+ m.ExtPort = buf.DecodeUint16()
+ return nil
+}
+
+// NatDetCloseSessionInReply defines message 'nat_det_close_session_in_reply'.
+type NatDetCloseSessionInReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatDetCloseSessionInReply) Reset() { *m = NatDetCloseSessionInReply{} }
+func (*NatDetCloseSessionInReply) GetMessageName() string { return "nat_det_close_session_in_reply" }
+func (*NatDetCloseSessionInReply) GetCrcString() string { return "e8d4e804" }
+func (*NatDetCloseSessionInReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatDetCloseSessionInReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatDetCloseSessionInReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatDetCloseSessionOut defines message 'nat_det_close_session_out'.
+type NatDetCloseSessionOut struct {
+ OutAddr IP4Address `binapi:"ip4_address,name=out_addr" json:"out_addr,omitempty"`
+ OutPort uint16 `binapi:"u16,name=out_port" json:"out_port,omitempty"`
+ ExtAddr IP4Address `binapi:"ip4_address,name=ext_addr" json:"ext_addr,omitempty"`
+ ExtPort uint16 `binapi:"u16,name=ext_port" json:"ext_port,omitempty"`
+}
+
+func (m *NatDetCloseSessionOut) Reset() { *m = NatDetCloseSessionOut{} }
+func (*NatDetCloseSessionOut) GetMessageName() string { return "nat_det_close_session_out" }
+func (*NatDetCloseSessionOut) GetCrcString() string { return "c1b6cbfb" }
+func (*NatDetCloseSessionOut) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatDetCloseSessionOut) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.OutAddr
+ size += 2 // m.OutPort
+ size += 1 * 4 // m.ExtAddr
+ size += 2 // m.ExtPort
+ return size
+}
+func (m *NatDetCloseSessionOut) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.OutAddr[:], 4)
+ buf.EncodeUint16(m.OutPort)
+ buf.EncodeBytes(m.ExtAddr[:], 4)
+ buf.EncodeUint16(m.ExtPort)
+ return buf.Bytes(), nil
+}
+func (m *NatDetCloseSessionOut) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.OutAddr[:], buf.DecodeBytes(4))
+ m.OutPort = buf.DecodeUint16()
+ copy(m.ExtAddr[:], buf.DecodeBytes(4))
+ m.ExtPort = buf.DecodeUint16()
+ return nil
+}
+
+// NatDetCloseSessionOutReply defines message 'nat_det_close_session_out_reply'.
+type NatDetCloseSessionOutReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatDetCloseSessionOutReply) Reset() { *m = NatDetCloseSessionOutReply{} }
+func (*NatDetCloseSessionOutReply) GetMessageName() string { return "nat_det_close_session_out_reply" }
+func (*NatDetCloseSessionOutReply) GetCrcString() string { return "e8d4e804" }
+func (*NatDetCloseSessionOutReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatDetCloseSessionOutReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatDetCloseSessionOutReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatDetForward defines message 'nat_det_forward'.
+type NatDetForward struct {
+ InAddr IP4Address `binapi:"ip4_address,name=in_addr" json:"in_addr,omitempty"`
+}
+
+func (m *NatDetForward) Reset() { *m = NatDetForward{} }
+func (*NatDetForward) GetMessageName() string { return "nat_det_forward" }
+func (*NatDetForward) GetCrcString() string { return "7f8a89cd" }
+func (*NatDetForward) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatDetForward) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.InAddr
+ return size
+}
+func (m *NatDetForward) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.InAddr[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *NatDetForward) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.InAddr[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// NatDetForwardReply defines message 'nat_det_forward_reply'.
+type NatDetForwardReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ OutPortLo uint16 `binapi:"u16,name=out_port_lo" json:"out_port_lo,omitempty"`
+ OutPortHi uint16 `binapi:"u16,name=out_port_hi" json:"out_port_hi,omitempty"`
+ OutAddr IP4Address `binapi:"ip4_address,name=out_addr" json:"out_addr,omitempty"`
+}
+
+func (m *NatDetForwardReply) Reset() { *m = NatDetForwardReply{} }
+func (*NatDetForwardReply) GetMessageName() string { return "nat_det_forward_reply" }
+func (*NatDetForwardReply) GetCrcString() string { return "a8ccbdc0" }
+func (*NatDetForwardReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatDetForwardReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 2 // m.OutPortLo
+ size += 2 // m.OutPortHi
+ size += 1 * 4 // m.OutAddr
+ return size
+}
+func (m *NatDetForwardReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.OutPortLo = buf.DecodeUint16()
+ m.OutPortHi = buf.DecodeUint16()
+ copy(m.OutAddr[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// NatDetMapDetails defines message 'nat_det_map_details'.
+type NatDetMapDetails struct {
+ InAddr IP4Address `binapi:"ip4_address,name=in_addr" json:"in_addr,omitempty"`
+ InPlen uint8 `binapi:"u8,name=in_plen" json:"in_plen,omitempty"`
+ OutAddr IP4Address `binapi:"ip4_address,name=out_addr" json:"out_addr,omitempty"`
+ OutPlen uint8 `binapi:"u8,name=out_plen" json:"out_plen,omitempty"`
+ SharingRatio uint32 `binapi:"u32,name=sharing_ratio" json:"sharing_ratio,omitempty"`
+ PortsPerHost uint16 `binapi:"u16,name=ports_per_host" json:"ports_per_host,omitempty"`
+ SesNum uint32 `binapi:"u32,name=ses_num" json:"ses_num,omitempty"`
+}
+
+func (m *NatDetMapDetails) Reset() { *m = NatDetMapDetails{} }
+func (*NatDetMapDetails) GetMessageName() string { return "nat_det_map_details" }
+func (*NatDetMapDetails) GetCrcString() string { return "88000ee1" }
+func (*NatDetMapDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatDetMapDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.InAddr
+ size += 1 // m.InPlen
+ size += 1 * 4 // m.OutAddr
+ size += 1 // m.OutPlen
+ size += 4 // m.SharingRatio
+ size += 2 // m.PortsPerHost
+ size += 4 // m.SesNum
+ return size
+}
+func (m *NatDetMapDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.InAddr[:], 4)
+ buf.EncodeUint8(m.InPlen)
+ buf.EncodeBytes(m.OutAddr[:], 4)
+ 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 {
+ buf := codec.NewBuffer(b)
+ copy(m.InAddr[:], buf.DecodeBytes(4))
+ m.InPlen = buf.DecodeUint8()
+ copy(m.OutAddr[:], buf.DecodeBytes(4))
+ m.OutPlen = buf.DecodeUint8()
+ m.SharingRatio = buf.DecodeUint32()
+ m.PortsPerHost = buf.DecodeUint16()
+ m.SesNum = buf.DecodeUint32()
+ return nil
+}
+
+// NatDetMapDump defines message 'nat_det_map_dump'.
+type NatDetMapDump struct{}
+
+func (m *NatDetMapDump) Reset() { *m = NatDetMapDump{} }
+func (*NatDetMapDump) GetMessageName() string { return "nat_det_map_dump" }
+func (*NatDetMapDump) GetCrcString() string { return "51077d14" }
+func (*NatDetMapDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatDetMapDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatDetMapDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatDetMapDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatDetReverse defines message 'nat_det_reverse'.
+type NatDetReverse struct {
+ OutPort uint16 `binapi:"u16,name=out_port" json:"out_port,omitempty"`
+ OutAddr IP4Address `binapi:"ip4_address,name=out_addr" json:"out_addr,omitempty"`
+}
+
+func (m *NatDetReverse) Reset() { *m = NatDetReverse{} }
+func (*NatDetReverse) GetMessageName() string { return "nat_det_reverse" }
+func (*NatDetReverse) GetCrcString() string { return "a7573fe1" }
+func (*NatDetReverse) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatDetReverse) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.OutPort
+ size += 1 * 4 // m.OutAddr
+ return size
+}
+func (m *NatDetReverse) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.OutPort)
+ buf.EncodeBytes(m.OutAddr[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *NatDetReverse) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.OutPort = buf.DecodeUint16()
+ copy(m.OutAddr[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// NatDetReverseReply defines message 'nat_det_reverse_reply'.
+type NatDetReverseReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ InAddr IP4Address `binapi:"ip4_address,name=in_addr" json:"in_addr,omitempty"`
+}
+
+func (m *NatDetReverseReply) Reset() { *m = NatDetReverseReply{} }
+func (*NatDetReverseReply) GetMessageName() string { return "nat_det_reverse_reply" }
+func (*NatDetReverseReply) GetCrcString() string { return "34066d48" }
+func (*NatDetReverseReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatDetReverseReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 4 // m.InAddr
+ return size
+}
+func (m *NatDetReverseReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ copy(m.InAddr[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// NatDetSessionDetails defines message 'nat_det_session_details'.
+type NatDetSessionDetails struct {
+ InPort uint16 `binapi:"u16,name=in_port" json:"in_port,omitempty"`
+ ExtAddr IP4Address `binapi:"ip4_address,name=ext_addr" json:"ext_addr,omitempty"`
+ ExtPort uint16 `binapi:"u16,name=ext_port" json:"ext_port,omitempty"`
+ OutPort uint16 `binapi:"u16,name=out_port" json:"out_port,omitempty"`
+ State uint8 `binapi:"u8,name=state" json:"state,omitempty"`
+ Expire uint32 `binapi:"u32,name=expire" json:"expire,omitempty"`
+}
+
+func (m *NatDetSessionDetails) Reset() { *m = NatDetSessionDetails{} }
+func (*NatDetSessionDetails) GetMessageName() string { return "nat_det_session_details" }
+func (*NatDetSessionDetails) GetCrcString() string { return "27f3c171" }
+func (*NatDetSessionDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatDetSessionDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.InPort
+ size += 1 * 4 // m.ExtAddr
+ size += 2 // m.ExtPort
+ size += 2 // m.OutPort
+ size += 1 // m.State
+ size += 4 // m.Expire
+ return size
+}
+func (m *NatDetSessionDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.InPort)
+ buf.EncodeBytes(m.ExtAddr[:], 4)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.InPort = buf.DecodeUint16()
+ copy(m.ExtAddr[:], buf.DecodeBytes(4))
+ m.ExtPort = buf.DecodeUint16()
+ m.OutPort = buf.DecodeUint16()
+ m.State = buf.DecodeUint8()
+ m.Expire = buf.DecodeUint32()
+ return nil
+}
+
+// NatDetSessionDump defines message 'nat_det_session_dump'.
+type NatDetSessionDump struct {
+ UserAddr IP4Address `binapi:"ip4_address,name=user_addr" json:"user_addr,omitempty"`
+}
+
+func (m *NatDetSessionDump) Reset() { *m = NatDetSessionDump{} }
+func (*NatDetSessionDump) GetMessageName() string { return "nat_det_session_dump" }
+func (*NatDetSessionDump) GetCrcString() string { return "e45a3af7" }
+func (*NatDetSessionDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatDetSessionDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.UserAddr
+ return size
+}
+func (m *NatDetSessionDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.UserAddr[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *NatDetSessionDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.UserAddr[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// NatGetAddrAndPortAllocAlg defines message 'nat_get_addr_and_port_alloc_alg'.
+type NatGetAddrAndPortAllocAlg struct{}
+
+func (m *NatGetAddrAndPortAllocAlg) Reset() { *m = NatGetAddrAndPortAllocAlg{} }
+func (*NatGetAddrAndPortAllocAlg) GetMessageName() string { return "nat_get_addr_and_port_alloc_alg" }
+func (*NatGetAddrAndPortAllocAlg) GetCrcString() string { return "51077d14" }
+func (*NatGetAddrAndPortAllocAlg) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatGetAddrAndPortAllocAlg) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatGetAddrAndPortAllocAlg) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatGetAddrAndPortAllocAlg) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatGetAddrAndPortAllocAlgReply defines message 'nat_get_addr_and_port_alloc_alg_reply'.
+type NatGetAddrAndPortAllocAlgReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Alg uint8 `binapi:"u8,name=alg" json:"alg,omitempty"`
+ PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"`
+ PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"`
+ Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"`
+ StartPort uint16 `binapi:"u16,name=start_port" json:"start_port,omitempty"`
+ EndPort uint16 `binapi:"u16,name=end_port" json:"end_port,omitempty"`
+}
+
+func (m *NatGetAddrAndPortAllocAlgReply) Reset() { *m = NatGetAddrAndPortAllocAlgReply{} }
+func (*NatGetAddrAndPortAllocAlgReply) GetMessageName() string {
+ return "nat_get_addr_and_port_alloc_alg_reply"
+}
+func (*NatGetAddrAndPortAllocAlgReply) GetCrcString() string { return "3607a7d0" }
+func (*NatGetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatGetAddrAndPortAllocAlgReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.Alg
+ size += 1 // m.PsidOffset
+ size += 1 // m.PsidLength
+ size += 2 // m.Psid
+ size += 2 // m.StartPort
+ size += 2 // m.EndPort
+ return size
+}
+func (m *NatGetAddrAndPortAllocAlgReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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 = buf.DecodeInt32()
+ m.Alg = buf.DecodeUint8()
+ m.PsidOffset = buf.DecodeUint8()
+ m.PsidLength = buf.DecodeUint8()
+ m.Psid = buf.DecodeUint16()
+ m.StartPort = buf.DecodeUint16()
+ m.EndPort = buf.DecodeUint16()
+ return nil
+}
+
+// NatGetMssClamping defines message 'nat_get_mss_clamping'.
+type NatGetMssClamping struct{}
+
+func (m *NatGetMssClamping) Reset() { *m = NatGetMssClamping{} }
+func (*NatGetMssClamping) GetMessageName() string { return "nat_get_mss_clamping" }
+func (*NatGetMssClamping) GetCrcString() string { return "51077d14" }
+func (*NatGetMssClamping) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatGetMssClamping) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatGetMssClamping) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatGetMssClamping) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatGetMssClampingReply defines message 'nat_get_mss_clamping_reply'.
+type NatGetMssClampingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ MssValue uint16 `binapi:"u16,name=mss_value" json:"mss_value,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *NatGetMssClampingReply) Reset() { *m = NatGetMssClampingReply{} }
+func (*NatGetMssClampingReply) GetMessageName() string { return "nat_get_mss_clamping_reply" }
+func (*NatGetMssClampingReply) GetCrcString() string { return "1c0b2a78" }
+func (*NatGetMssClampingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatGetMssClampingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 2 // m.MssValue
+ size += 1 // m.Enable
+ return size
+}
+func (m *NatGetMssClampingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.MssValue = buf.DecodeUint16()
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// NatGetTimeouts defines message 'nat_get_timeouts'.
+type NatGetTimeouts struct{}
+
+func (m *NatGetTimeouts) Reset() { *m = NatGetTimeouts{} }
+func (*NatGetTimeouts) GetMessageName() string { return "nat_get_timeouts" }
+func (*NatGetTimeouts) GetCrcString() string { return "51077d14" }
+func (*NatGetTimeouts) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatGetTimeouts) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatGetTimeouts) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatGetTimeouts) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatGetTimeoutsReply defines message 'nat_get_timeouts_reply'.
+type NatGetTimeoutsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ UDP uint32 `binapi:"u32,name=udp" json:"udp,omitempty"`
+ TCPEstablished uint32 `binapi:"u32,name=tcp_established" json:"tcp_established,omitempty"`
+ TCPTransitory uint32 `binapi:"u32,name=tcp_transitory" json:"tcp_transitory,omitempty"`
+ ICMP uint32 `binapi:"u32,name=icmp" json:"icmp,omitempty"`
+}
+
+func (m *NatGetTimeoutsReply) Reset() { *m = NatGetTimeoutsReply{} }
+func (*NatGetTimeoutsReply) GetMessageName() string { return "nat_get_timeouts_reply" }
+func (*NatGetTimeoutsReply) GetCrcString() string { return "3c4df4e1" }
+func (*NatGetTimeoutsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatGetTimeoutsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.UDP
+ size += 4 // m.TCPEstablished
+ size += 4 // m.TCPTransitory
+ size += 4 // m.ICMP
+ return size
+}
+func (m *NatGetTimeoutsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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 = buf.DecodeInt32()
+ m.UDP = buf.DecodeUint32()
+ m.TCPEstablished = buf.DecodeUint32()
+ m.TCPTransitory = buf.DecodeUint32()
+ m.ICMP = buf.DecodeUint32()
+ return nil
+}
+
+// NatHaFlush defines message 'nat_ha_flush'.
+type NatHaFlush struct{}
+
+func (m *NatHaFlush) Reset() { *m = NatHaFlush{} }
+func (*NatHaFlush) GetMessageName() string { return "nat_ha_flush" }
+func (*NatHaFlush) GetCrcString() string { return "51077d14" }
+func (*NatHaFlush) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatHaFlush) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatHaFlush) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatHaFlush) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatHaFlushReply defines message 'nat_ha_flush_reply'.
+type NatHaFlushReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatHaFlushReply) Reset() { *m = NatHaFlushReply{} }
+func (*NatHaFlushReply) GetMessageName() string { return "nat_ha_flush_reply" }
+func (*NatHaFlushReply) GetCrcString() string { return "e8d4e804" }
+func (*NatHaFlushReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatHaFlushReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatHaFlushReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatHaGetFailover defines message 'nat_ha_get_failover'.
+type NatHaGetFailover struct{}
+
+func (m *NatHaGetFailover) Reset() { *m = NatHaGetFailover{} }
+func (*NatHaGetFailover) GetMessageName() string { return "nat_ha_get_failover" }
+func (*NatHaGetFailover) GetCrcString() string { return "51077d14" }
+func (*NatHaGetFailover) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatHaGetFailover) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatHaGetFailover) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatHaGetFailover) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatHaGetFailoverReply defines message 'nat_ha_get_failover_reply'.
+type NatHaGetFailoverReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ SessionRefreshInterval uint32 `binapi:"u32,name=session_refresh_interval" json:"session_refresh_interval,omitempty"`
+}
+
+func (m *NatHaGetFailoverReply) Reset() { *m = NatHaGetFailoverReply{} }
+func (*NatHaGetFailoverReply) GetMessageName() string { return "nat_ha_get_failover_reply" }
+func (*NatHaGetFailoverReply) GetCrcString() string { return "a67d8752" }
+func (*NatHaGetFailoverReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatHaGetFailoverReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 4 // m.IPAddress
+ size += 2 // m.Port
+ size += 4 // m.SessionRefreshInterval
+ return size
+}
+func (m *NatHaGetFailoverReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeBytes(m.IPAddress[:], 4)
+ 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 = buf.DecodeInt32()
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ m.Port = buf.DecodeUint16()
+ m.SessionRefreshInterval = buf.DecodeUint32()
+ return nil
+}
+
+// NatHaGetListener defines message 'nat_ha_get_listener'.
+type NatHaGetListener struct{}
+
+func (m *NatHaGetListener) Reset() { *m = NatHaGetListener{} }
+func (*NatHaGetListener) GetMessageName() string { return "nat_ha_get_listener" }
+func (*NatHaGetListener) GetCrcString() string { return "51077d14" }
+func (*NatHaGetListener) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatHaGetListener) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatHaGetListener) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatHaGetListener) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatHaGetListenerReply defines message 'nat_ha_get_listener_reply'.
+type NatHaGetListenerReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ PathMtu uint32 `binapi:"u32,name=path_mtu" json:"path_mtu,omitempty"`
+}
+
+func (m *NatHaGetListenerReply) Reset() { *m = NatHaGetListenerReply{} }
+func (*NatHaGetListenerReply) GetMessageName() string { return "nat_ha_get_listener_reply" }
+func (*NatHaGetListenerReply) GetCrcString() string { return "123ea41f" }
+func (*NatHaGetListenerReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatHaGetListenerReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 4 // m.IPAddress
+ size += 2 // m.Port
+ size += 4 // m.PathMtu
+ return size
+}
+func (m *NatHaGetListenerReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeBytes(m.IPAddress[:], 4)
+ 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 = buf.DecodeInt32()
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ m.Port = buf.DecodeUint16()
+ m.PathMtu = buf.DecodeUint32()
+ return nil
+}
+
+// NatHaResync defines message 'nat_ha_resync'.
+type NatHaResync struct {
+ WantResyncEvent uint8 `binapi:"u8,name=want_resync_event" json:"want_resync_event,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *NatHaResync) Reset() { *m = NatHaResync{} }
+func (*NatHaResync) GetMessageName() string { return "nat_ha_resync" }
+func (*NatHaResync) GetCrcString() string { return "c8ab9e03" }
+func (*NatHaResync) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatHaResync) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.WantResyncEvent
+ size += 4 // m.PID
+ return size
+}
+func (m *NatHaResync) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.WantResyncEvent)
+ buf.EncodeUint32(m.PID)
+ return buf.Bytes(), nil
+}
+func (m *NatHaResync) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.WantResyncEvent = buf.DecodeUint8()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// NatHaResyncCompletedEvent defines message 'nat_ha_resync_completed_event'.
+type NatHaResyncCompletedEvent struct {
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+ MissedCount uint32 `binapi:"u32,name=missed_count" json:"missed_count,omitempty"`
+}
+
+func (m *NatHaResyncCompletedEvent) Reset() { *m = NatHaResyncCompletedEvent{} }
+func (*NatHaResyncCompletedEvent) GetMessageName() string { return "nat_ha_resync_completed_event" }
+func (*NatHaResyncCompletedEvent) GetCrcString() string { return "fdc598fb" }
+func (*NatHaResyncCompletedEvent) GetMessageType() api.MessageType {
+ return api.EventMessage
+}
+
+func (m *NatHaResyncCompletedEvent) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PID
+ size += 4 // m.MissedCount
+ return size
+}
+func (m *NatHaResyncCompletedEvent) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PID)
+ buf.EncodeUint32(m.MissedCount)
+ return buf.Bytes(), nil
+}
+func (m *NatHaResyncCompletedEvent) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PID = buf.DecodeUint32()
+ m.MissedCount = buf.DecodeUint32()
+ return nil
+}
+
+// NatHaResyncReply defines message 'nat_ha_resync_reply'.
+type NatHaResyncReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatHaResyncReply) Reset() { *m = NatHaResyncReply{} }
+func (*NatHaResyncReply) GetMessageName() string { return "nat_ha_resync_reply" }
+func (*NatHaResyncReply) GetCrcString() string { return "e8d4e804" }
+func (*NatHaResyncReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatHaResyncReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatHaResyncReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatHaSetFailover defines message 'nat_ha_set_failover'.
+type NatHaSetFailover struct {
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ SessionRefreshInterval uint32 `binapi:"u32,name=session_refresh_interval" json:"session_refresh_interval,omitempty"`
+}
+
+func (m *NatHaSetFailover) Reset() { *m = NatHaSetFailover{} }
+func (*NatHaSetFailover) GetMessageName() string { return "nat_ha_set_failover" }
+func (*NatHaSetFailover) GetCrcString() string { return "718246af" }
+func (*NatHaSetFailover) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatHaSetFailover) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.IPAddress
+ size += 2 // m.Port
+ size += 4 // m.SessionRefreshInterval
+ return size
+}
+func (m *NatHaSetFailover) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IPAddress[:], 4)
+ buf.EncodeUint16(m.Port)
+ buf.EncodeUint32(m.SessionRefreshInterval)
+ return buf.Bytes(), nil
+}
+func (m *NatHaSetFailover) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ m.Port = buf.DecodeUint16()
+ m.SessionRefreshInterval = buf.DecodeUint32()
+ return nil
+}
+
+// NatHaSetFailoverReply defines message 'nat_ha_set_failover_reply'.
+type NatHaSetFailoverReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatHaSetFailoverReply) Reset() { *m = NatHaSetFailoverReply{} }
+func (*NatHaSetFailoverReply) GetMessageName() string { return "nat_ha_set_failover_reply" }
+func (*NatHaSetFailoverReply) GetCrcString() string { return "e8d4e804" }
+func (*NatHaSetFailoverReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatHaSetFailoverReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatHaSetFailoverReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatHaSetListener defines message 'nat_ha_set_listener'.
+type NatHaSetListener struct {
+ IPAddress IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ PathMtu uint32 `binapi:"u32,name=path_mtu" json:"path_mtu,omitempty"`
+}
+
+func (m *NatHaSetListener) Reset() { *m = NatHaSetListener{} }
+func (*NatHaSetListener) GetMessageName() string { return "nat_ha_set_listener" }
+func (*NatHaSetListener) GetCrcString() string { return "e4a8cb4e" }
+func (*NatHaSetListener) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatHaSetListener) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.IPAddress
+ size += 2 // m.Port
+ size += 4 // m.PathMtu
+ return size
+}
+func (m *NatHaSetListener) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.IPAddress[:], 4)
+ buf.EncodeUint16(m.Port)
+ buf.EncodeUint32(m.PathMtu)
+ return buf.Bytes(), nil
+}
+func (m *NatHaSetListener) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.IPAddress[:], buf.DecodeBytes(4))
+ m.Port = buf.DecodeUint16()
+ m.PathMtu = buf.DecodeUint32()
+ return nil
+}
+
+// NatHaSetListenerReply defines message 'nat_ha_set_listener_reply'.
+type NatHaSetListenerReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatHaSetListenerReply) Reset() { *m = NatHaSetListenerReply{} }
+func (*NatHaSetListenerReply) GetMessageName() string { return "nat_ha_set_listener_reply" }
+func (*NatHaSetListenerReply) GetCrcString() string { return "e8d4e804" }
+func (*NatHaSetListenerReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatHaSetListenerReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatHaSetListenerReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatIpfixEnableDisable defines message 'nat_ipfix_enable_disable'.
+type NatIpfixEnableDisable struct {
+ DomainID uint32 `binapi:"u32,name=domain_id" json:"domain_id,omitempty"`
+ SrcPort uint16 `binapi:"u16,name=src_port" json:"src_port,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *NatIpfixEnableDisable) Reset() { *m = NatIpfixEnableDisable{} }
+func (*NatIpfixEnableDisable) GetMessageName() string { return "nat_ipfix_enable_disable" }
+func (*NatIpfixEnableDisable) GetCrcString() string { return "9af4a2d2" }
+func (*NatIpfixEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatIpfixEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.DomainID
+ size += 2 // m.SrcPort
+ size += 1 // m.Enable
+ return size
+}
+func (m *NatIpfixEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.DomainID)
+ buf.EncodeUint16(m.SrcPort)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *NatIpfixEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.DomainID = buf.DecodeUint32()
+ m.SrcPort = buf.DecodeUint16()
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// NatIpfixEnableDisableReply defines message 'nat_ipfix_enable_disable_reply'.
+type NatIpfixEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatIpfixEnableDisableReply) Reset() { *m = NatIpfixEnableDisableReply{} }
+func (*NatIpfixEnableDisableReply) GetMessageName() string { return "nat_ipfix_enable_disable_reply" }
+func (*NatIpfixEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*NatIpfixEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatIpfixEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatIpfixEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatSetAddrAndPortAllocAlg defines message 'nat_set_addr_and_port_alloc_alg'.
+type NatSetAddrAndPortAllocAlg struct {
+ Alg uint8 `binapi:"u8,name=alg" json:"alg,omitempty"`
+ PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"`
+ PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"`
+ Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"`
+ StartPort uint16 `binapi:"u16,name=start_port" json:"start_port,omitempty"`
+ EndPort uint16 `binapi:"u16,name=end_port" json:"end_port,omitempty"`
+}
+
+func (m *NatSetAddrAndPortAllocAlg) Reset() { *m = NatSetAddrAndPortAllocAlg{} }
+func (*NatSetAddrAndPortAllocAlg) GetMessageName() string { return "nat_set_addr_and_port_alloc_alg" }
+func (*NatSetAddrAndPortAllocAlg) GetCrcString() string { return "deeb746f" }
+func (*NatSetAddrAndPortAllocAlg) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatSetAddrAndPortAllocAlg) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Alg
+ size += 1 // m.PsidOffset
+ size += 1 // m.PsidLength
+ size += 2 // m.Psid
+ size += 2 // m.StartPort
+ size += 2 // m.EndPort
+ return size
+}
+func (m *NatSetAddrAndPortAllocAlg) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Alg = buf.DecodeUint8()
+ m.PsidOffset = buf.DecodeUint8()
+ m.PsidLength = buf.DecodeUint8()
+ m.Psid = buf.DecodeUint16()
+ m.StartPort = buf.DecodeUint16()
+ m.EndPort = buf.DecodeUint16()
+ return nil
+}
+
+// NatSetAddrAndPortAllocAlgReply defines message 'nat_set_addr_and_port_alloc_alg_reply'.
+type NatSetAddrAndPortAllocAlgReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatSetAddrAndPortAllocAlgReply) Reset() { *m = NatSetAddrAndPortAllocAlgReply{} }
+func (*NatSetAddrAndPortAllocAlgReply) GetMessageName() string {
+ return "nat_set_addr_and_port_alloc_alg_reply"
+}
+func (*NatSetAddrAndPortAllocAlgReply) GetCrcString() string { return "e8d4e804" }
+func (*NatSetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatSetAddrAndPortAllocAlgReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatSetAddrAndPortAllocAlgReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatSetLogLevel defines message 'nat_set_log_level'.
+type NatSetLogLevel struct {
+ LogLevel NatLogLevel `binapi:"nat_log_level,name=log_level" json:"log_level,omitempty"`
+}
+
+func (m *NatSetLogLevel) Reset() { *m = NatSetLogLevel{} }
+func (*NatSetLogLevel) GetMessageName() string { return "nat_set_log_level" }
+func (*NatSetLogLevel) GetCrcString() string { return "70076bfe" }
+func (*NatSetLogLevel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatSetLogLevel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.LogLevel
+ return size
+}
+func (m *NatSetLogLevel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(uint8(m.LogLevel))
+ return buf.Bytes(), nil
+}
+func (m *NatSetLogLevel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.LogLevel = NatLogLevel(buf.DecodeUint8())
+ return nil
+}
+
+// NatSetLogLevelReply defines message 'nat_set_log_level_reply'.
+type NatSetLogLevelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatSetLogLevelReply) Reset() { *m = NatSetLogLevelReply{} }
+func (*NatSetLogLevelReply) GetMessageName() string { return "nat_set_log_level_reply" }
+func (*NatSetLogLevelReply) GetCrcString() string { return "e8d4e804" }
+func (*NatSetLogLevelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatSetLogLevelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatSetLogLevelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatSetMssClamping defines message 'nat_set_mss_clamping'.
+type NatSetMssClamping struct {
+ MssValue uint16 `binapi:"u16,name=mss_value" json:"mss_value,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *NatSetMssClamping) Reset() { *m = NatSetMssClamping{} }
+func (*NatSetMssClamping) GetMessageName() string { return "nat_set_mss_clamping" }
+func (*NatSetMssClamping) GetCrcString() string { return "25e90abb" }
+func (*NatSetMssClamping) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatSetMssClamping) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.MssValue
+ size += 1 // m.Enable
+ return size
+}
+func (m *NatSetMssClamping) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.MssValue)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *NatSetMssClamping) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MssValue = buf.DecodeUint16()
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// NatSetMssClampingReply defines message 'nat_set_mss_clamping_reply'.
+type NatSetMssClampingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatSetMssClampingReply) Reset() { *m = NatSetMssClampingReply{} }
+func (*NatSetMssClampingReply) GetMessageName() string { return "nat_set_mss_clamping_reply" }
+func (*NatSetMssClampingReply) GetCrcString() string { return "e8d4e804" }
+func (*NatSetMssClampingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatSetMssClampingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatSetMssClampingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatSetTimeouts defines message 'nat_set_timeouts'.
+type NatSetTimeouts struct {
+ UDP uint32 `binapi:"u32,name=udp" json:"udp,omitempty"`
+ TCPEstablished uint32 `binapi:"u32,name=tcp_established" json:"tcp_established,omitempty"`
+ TCPTransitory uint32 `binapi:"u32,name=tcp_transitory" json:"tcp_transitory,omitempty"`
+ ICMP uint32 `binapi:"u32,name=icmp" json:"icmp,omitempty"`
+}
+
+func (m *NatSetTimeouts) Reset() { *m = NatSetTimeouts{} }
+func (*NatSetTimeouts) GetMessageName() string { return "nat_set_timeouts" }
+func (*NatSetTimeouts) GetCrcString() string { return "d4746b16" }
+func (*NatSetTimeouts) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatSetTimeouts) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.UDP
+ size += 4 // m.TCPEstablished
+ size += 4 // m.TCPTransitory
+ size += 4 // m.ICMP
+ return size
+}
+func (m *NatSetTimeouts) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.UDP = buf.DecodeUint32()
+ m.TCPEstablished = buf.DecodeUint32()
+ m.TCPTransitory = buf.DecodeUint32()
+ m.ICMP = buf.DecodeUint32()
+ return nil
+}
+
+// NatSetTimeoutsReply defines message 'nat_set_timeouts_reply'.
+type NatSetTimeoutsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatSetTimeoutsReply) Reset() { *m = NatSetTimeoutsReply{} }
+func (*NatSetTimeoutsReply) GetMessageName() string { return "nat_set_timeouts_reply" }
+func (*NatSetTimeoutsReply) GetCrcString() string { return "e8d4e804" }
+func (*NatSetTimeoutsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatSetTimeoutsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatSetTimeoutsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatSetWorkers defines message 'nat_set_workers'.
+type NatSetWorkers struct {
+ WorkerMask uint64 `binapi:"u64,name=worker_mask" json:"worker_mask,omitempty"`
+}
+
+func (m *NatSetWorkers) Reset() { *m = NatSetWorkers{} }
+func (*NatSetWorkers) GetMessageName() string { return "nat_set_workers" }
+func (*NatSetWorkers) GetCrcString() string { return "da926638" }
+func (*NatSetWorkers) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatSetWorkers) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 8 // m.WorkerMask
+ return size
+}
+func (m *NatSetWorkers) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint64(m.WorkerMask)
+ return buf.Bytes(), nil
+}
+func (m *NatSetWorkers) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.WorkerMask = buf.DecodeUint64()
+ return nil
+}
+
+// NatSetWorkersReply defines message 'nat_set_workers_reply'.
+type NatSetWorkersReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NatSetWorkersReply) Reset() { *m = NatSetWorkersReply{} }
+func (*NatSetWorkersReply) GetMessageName() string { return "nat_set_workers_reply" }
+func (*NatSetWorkersReply) GetCrcString() string { return "e8d4e804" }
+func (*NatSetWorkersReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatSetWorkersReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NatSetWorkersReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NatShowConfig defines message 'nat_show_config'.
+type NatShowConfig struct{}
+
+func (m *NatShowConfig) Reset() { *m = NatShowConfig{} }
+func (*NatShowConfig) GetMessageName() string { return "nat_show_config" }
+func (*NatShowConfig) GetCrcString() string { return "51077d14" }
+func (*NatShowConfig) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatShowConfig) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatShowConfig) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatShowConfig) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NatShowConfigReply defines message 'nat_show_config_reply'.
+type NatShowConfigReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ StaticMappingOnly bool `binapi:"bool,name=static_mapping_only" json:"static_mapping_only,omitempty"`
+ StaticMappingConnectionTracking bool `binapi:"bool,name=static_mapping_connection_tracking" json:"static_mapping_connection_tracking,omitempty"`
+ Deterministic bool `binapi:"bool,name=deterministic" json:"deterministic,omitempty"`
+ EndpointDependent bool `binapi:"bool,name=endpoint_dependent" json:"endpoint_dependent,omitempty"`
+ Out2inDpo bool `binapi:"bool,name=out2in_dpo" json:"out2in_dpo,omitempty"`
+ DsliteCe bool `binapi:"bool,name=dslite_ce" json:"dslite_ce,omitempty"`
+ TranslationBuckets uint32 `binapi:"u32,name=translation_buckets" json:"translation_buckets,omitempty"`
+ TranslationMemorySize uint32 `binapi:"u32,name=translation_memory_size" json:"translation_memory_size,omitempty"`
+ UserBuckets uint32 `binapi:"u32,name=user_buckets" json:"user_buckets,omitempty"`
+ UserMemorySize uint32 `binapi:"u32,name=user_memory_size" json:"user_memory_size,omitempty"`
+ MaxTranslationsPerUser uint32 `binapi:"u32,name=max_translations_per_user" json:"max_translations_per_user,omitempty"`
+ OutsideVrfID uint32 `binapi:"u32,name=outside_vrf_id" json:"outside_vrf_id,omitempty"`
+ InsideVrfID uint32 `binapi:"u32,name=inside_vrf_id" json:"inside_vrf_id,omitempty"`
+ Nat64BibBuckets uint32 `binapi:"u32,name=nat64_bib_buckets" json:"nat64_bib_buckets,omitempty"`
+ Nat64BibMemorySize uint32 `binapi:"u32,name=nat64_bib_memory_size" json:"nat64_bib_memory_size,omitempty"`
+ Nat64StBuckets uint32 `binapi:"u32,name=nat64_st_buckets" json:"nat64_st_buckets,omitempty"`
+ Nat64StMemorySize uint32 `binapi:"u32,name=nat64_st_memory_size" json:"nat64_st_memory_size,omitempty"`
+}
+
+func (m *NatShowConfigReply) Reset() { *m = NatShowConfigReply{} }
+func (*NatShowConfigReply) GetMessageName() string { return "nat_show_config_reply" }
+func (*NatShowConfigReply) GetCrcString() string { return "006a0786" }
+func (*NatShowConfigReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatShowConfigReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.StaticMappingOnly
+ size += 1 // m.StaticMappingConnectionTracking
+ size += 1 // m.Deterministic
+ size += 1 // m.EndpointDependent
+ size += 1 // m.Out2inDpo
+ size += 1 // m.DsliteCe
+ size += 4 // m.TranslationBuckets
+ size += 4 // m.TranslationMemorySize
+ size += 4 // m.UserBuckets
+ size += 4 // m.UserMemorySize
+ size += 4 // m.MaxTranslationsPerUser
+ size += 4 // m.OutsideVrfID
+ size += 4 // m.InsideVrfID
+ size += 4 // m.Nat64BibBuckets
+ size += 4 // m.Nat64BibMemorySize
+ size += 4 // m.Nat64StBuckets
+ size += 4 // m.Nat64StMemorySize
+ return size
+}
+func (m *NatShowConfigReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(m.TranslationBuckets)
+ buf.EncodeUint32(m.TranslationMemorySize)
+ buf.EncodeUint32(m.UserBuckets)
+ buf.EncodeUint32(m.UserMemorySize)
+ buf.EncodeUint32(m.MaxTranslationsPerUser)
+ buf.EncodeUint32(m.OutsideVrfID)
+ buf.EncodeUint32(m.InsideVrfID)
+ buf.EncodeUint32(m.Nat64BibBuckets)
+ buf.EncodeUint32(m.Nat64BibMemorySize)
+ buf.EncodeUint32(m.Nat64StBuckets)
+ buf.EncodeUint32(m.Nat64StMemorySize)
+ return buf.Bytes(), nil
+}
+func (m *NatShowConfigReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.StaticMappingOnly = buf.DecodeBool()
+ m.StaticMappingConnectionTracking = buf.DecodeBool()
+ m.Deterministic = buf.DecodeBool()
+ m.EndpointDependent = buf.DecodeBool()
+ m.Out2inDpo = buf.DecodeBool()
+ m.DsliteCe = buf.DecodeBool()
+ m.TranslationBuckets = buf.DecodeUint32()
+ m.TranslationMemorySize = buf.DecodeUint32()
+ m.UserBuckets = buf.DecodeUint32()
+ m.UserMemorySize = buf.DecodeUint32()
+ m.MaxTranslationsPerUser = buf.DecodeUint32()
+ m.OutsideVrfID = buf.DecodeUint32()
+ m.InsideVrfID = buf.DecodeUint32()
+ m.Nat64BibBuckets = buf.DecodeUint32()
+ m.Nat64BibMemorySize = buf.DecodeUint32()
+ m.Nat64StBuckets = buf.DecodeUint32()
+ m.Nat64StMemorySize = buf.DecodeUint32()
+ return nil
+}
+
+// NatWorkerDetails defines message 'nat_worker_details'.
+type NatWorkerDetails struct {
+ WorkerIndex uint32 `binapi:"u32,name=worker_index" json:"worker_index,omitempty"`
+ LcoreID uint32 `binapi:"u32,name=lcore_id" json:"lcore_id,omitempty"`
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+}
+
+func (m *NatWorkerDetails) Reset() { *m = NatWorkerDetails{} }
+func (*NatWorkerDetails) GetMessageName() string { return "nat_worker_details" }
+func (*NatWorkerDetails) GetCrcString() string { return "84bf06fc" }
+func (*NatWorkerDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NatWorkerDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.WorkerIndex
+ size += 4 // m.LcoreID
+ size += 64 // m.Name
+ return size
+}
+func (m *NatWorkerDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.WorkerIndex)
+ buf.EncodeUint32(m.LcoreID)
+ buf.EncodeString(m.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *NatWorkerDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.WorkerIndex = buf.DecodeUint32()
+ m.LcoreID = buf.DecodeUint32()
+ m.Name = buf.DecodeString(64)
+ return nil
+}
+
+// NatWorkerDump defines message 'nat_worker_dump'.
+type NatWorkerDump struct{}
+
+func (m *NatWorkerDump) Reset() { *m = NatWorkerDump{} }
+func (*NatWorkerDump) GetMessageName() string { return "nat_worker_dump" }
+func (*NatWorkerDump) GetCrcString() string { return "51077d14" }
+func (*NatWorkerDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NatWorkerDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NatWorkerDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NatWorkerDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_nat_binapi_init() }
+func file_nat_binapi_init() {
+ api.RegisterMessage((*DsliteAddDelPoolAddrRange)(nil), "dslite_add_del_pool_addr_range_c448457a")
+ api.RegisterMessage((*DsliteAddDelPoolAddrRangeReply)(nil), "dslite_add_del_pool_addr_range_reply_e8d4e804")
+ api.RegisterMessage((*DsliteAddressDetails)(nil), "dslite_address_details_ec26d648")
+ api.RegisterMessage((*DsliteAddressDump)(nil), "dslite_address_dump_51077d14")
+ api.RegisterMessage((*DsliteGetAftrAddr)(nil), "dslite_get_aftr_addr_51077d14")
+ api.RegisterMessage((*DsliteGetAftrAddrReply)(nil), "dslite_get_aftr_addr_reply_38e30db1")
+ api.RegisterMessage((*DsliteGetB4Addr)(nil), "dslite_get_b4_addr_51077d14")
+ api.RegisterMessage((*DsliteGetB4AddrReply)(nil), "dslite_get_b4_addr_reply_38e30db1")
+ api.RegisterMessage((*DsliteSetAftrAddr)(nil), "dslite_set_aftr_addr_1e955f8d")
+ api.RegisterMessage((*DsliteSetAftrAddrReply)(nil), "dslite_set_aftr_addr_reply_e8d4e804")
+ api.RegisterMessage((*DsliteSetB4Addr)(nil), "dslite_set_b4_addr_1e955f8d")
+ api.RegisterMessage((*DsliteSetB4AddrReply)(nil), "dslite_set_b4_addr_reply_e8d4e804")
+ api.RegisterMessage((*Nat44AddDelAddressRange)(nil), "nat44_add_del_address_range_d4c7568c")
+ api.RegisterMessage((*Nat44AddDelAddressRangeReply)(nil), "nat44_add_del_address_range_reply_e8d4e804")
+ api.RegisterMessage((*Nat44AddDelIdentityMapping)(nil), "nat44_add_del_identity_mapping_8e12743f")
+ api.RegisterMessage((*Nat44AddDelIdentityMappingReply)(nil), "nat44_add_del_identity_mapping_reply_e8d4e804")
+ api.RegisterMessage((*Nat44AddDelInterfaceAddr)(nil), "nat44_add_del_interface_addr_fc835325")
+ api.RegisterMessage((*Nat44AddDelInterfaceAddrReply)(nil), "nat44_add_del_interface_addr_reply_e8d4e804")
+ api.RegisterMessage((*Nat44AddDelLbStaticMapping)(nil), "nat44_add_del_lb_static_mapping_53b24611")
+ api.RegisterMessage((*Nat44AddDelLbStaticMappingReply)(nil), "nat44_add_del_lb_static_mapping_reply_e8d4e804")
+ api.RegisterMessage((*Nat44AddDelStaticMapping)(nil), "nat44_add_del_static_mapping_e165e83b")
+ api.RegisterMessage((*Nat44AddDelStaticMappingReply)(nil), "nat44_add_del_static_mapping_reply_e8d4e804")
+ api.RegisterMessage((*Nat44AddressDetails)(nil), "nat44_address_details_45410ac4")
+ api.RegisterMessage((*Nat44AddressDump)(nil), "nat44_address_dump_51077d14")
+ api.RegisterMessage((*Nat44DelSession)(nil), "nat44_del_session_4c49c387")
+ api.RegisterMessage((*Nat44DelSessionReply)(nil), "nat44_del_session_reply_e8d4e804")
+ api.RegisterMessage((*Nat44ForwardingEnableDisable)(nil), "nat44_forwarding_enable_disable_b3e225d2")
+ api.RegisterMessage((*Nat44ForwardingEnableDisableReply)(nil), "nat44_forwarding_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*Nat44ForwardingIsEnabled)(nil), "nat44_forwarding_is_enabled_51077d14")
+ api.RegisterMessage((*Nat44ForwardingIsEnabledReply)(nil), "nat44_forwarding_is_enabled_reply_46924a06")
+ api.RegisterMessage((*Nat44IdentityMappingDetails)(nil), "nat44_identity_mapping_details_36d21351")
+ api.RegisterMessage((*Nat44IdentityMappingDump)(nil), "nat44_identity_mapping_dump_51077d14")
+ api.RegisterMessage((*Nat44InterfaceAddDelFeature)(nil), "nat44_interface_add_del_feature_f3699b83")
+ api.RegisterMessage((*Nat44InterfaceAddDelFeatureReply)(nil), "nat44_interface_add_del_feature_reply_e8d4e804")
+ api.RegisterMessage((*Nat44InterfaceAddDelOutputFeature)(nil), "nat44_interface_add_del_output_feature_f3699b83")
+ api.RegisterMessage((*Nat44InterfaceAddDelOutputFeatureReply)(nil), "nat44_interface_add_del_output_feature_reply_e8d4e804")
+ api.RegisterMessage((*Nat44InterfaceAddrDetails)(nil), "nat44_interface_addr_details_3e687514")
+ api.RegisterMessage((*Nat44InterfaceAddrDump)(nil), "nat44_interface_addr_dump_51077d14")
+ api.RegisterMessage((*Nat44InterfaceDetails)(nil), "nat44_interface_details_5d286289")
+ api.RegisterMessage((*Nat44InterfaceDump)(nil), "nat44_interface_dump_51077d14")
+ api.RegisterMessage((*Nat44InterfaceOutputFeatureDetails)(nil), "nat44_interface_output_feature_details_5d286289")
+ api.RegisterMessage((*Nat44InterfaceOutputFeatureDump)(nil), "nat44_interface_output_feature_dump_51077d14")
+ api.RegisterMessage((*Nat44LbStaticMappingAddDelLocal)(nil), "nat44_lb_static_mapping_add_del_local_2910a151")
+ api.RegisterMessage((*Nat44LbStaticMappingAddDelLocalReply)(nil), "nat44_lb_static_mapping_add_del_local_reply_e8d4e804")
+ api.RegisterMessage((*Nat44LbStaticMappingDetails)(nil), "nat44_lb_static_mapping_details_2267b9e8")
+ api.RegisterMessage((*Nat44LbStaticMappingDump)(nil), "nat44_lb_static_mapping_dump_51077d14")
+ api.RegisterMessage((*Nat44StaticMappingDetails)(nil), "nat44_static_mapping_details_1a433ef7")
+ api.RegisterMessage((*Nat44StaticMappingDump)(nil), "nat44_static_mapping_dump_51077d14")
+ api.RegisterMessage((*Nat44UserDetails)(nil), "nat44_user_details_355896c2")
+ api.RegisterMessage((*Nat44UserDump)(nil), "nat44_user_dump_51077d14")
+ api.RegisterMessage((*Nat44UserSessionDetails)(nil), "nat44_user_session_details_1965fd69")
+ api.RegisterMessage((*Nat44UserSessionDump)(nil), "nat44_user_session_dump_e1899c98")
+ api.RegisterMessage((*Nat64AddDelInterface)(nil), "nat64_add_del_interface_f3699b83")
+ api.RegisterMessage((*Nat64AddDelInterfaceAddr)(nil), "nat64_add_del_interface_addr_47d6e753")
+ api.RegisterMessage((*Nat64AddDelInterfaceAddrReply)(nil), "nat64_add_del_interface_addr_reply_e8d4e804")
+ api.RegisterMessage((*Nat64AddDelInterfaceReply)(nil), "nat64_add_del_interface_reply_e8d4e804")
+ api.RegisterMessage((*Nat64AddDelPoolAddrRange)(nil), "nat64_add_del_pool_addr_range_21234ef3")
+ api.RegisterMessage((*Nat64AddDelPoolAddrRangeReply)(nil), "nat64_add_del_pool_addr_range_reply_e8d4e804")
+ api.RegisterMessage((*Nat64AddDelPrefix)(nil), "nat64_add_del_prefix_727b2f4c")
+ api.RegisterMessage((*Nat64AddDelPrefixReply)(nil), "nat64_add_del_prefix_reply_e8d4e804")
+ api.RegisterMessage((*Nat64AddDelStaticBib)(nil), "nat64_add_del_static_bib_90fae58a")
+ api.RegisterMessage((*Nat64AddDelStaticBibReply)(nil), "nat64_add_del_static_bib_reply_e8d4e804")
+ api.RegisterMessage((*Nat64BibDetails)(nil), "nat64_bib_details_62c8541d")
+ api.RegisterMessage((*Nat64BibDump)(nil), "nat64_bib_dump_cfcb6b75")
+ api.RegisterMessage((*Nat64InterfaceDetails)(nil), "nat64_interface_details_5d286289")
+ api.RegisterMessage((*Nat64InterfaceDump)(nil), "nat64_interface_dump_51077d14")
+ api.RegisterMessage((*Nat64PoolAddrDetails)(nil), "nat64_pool_addr_details_9bb99cdb")
+ api.RegisterMessage((*Nat64PoolAddrDump)(nil), "nat64_pool_addr_dump_51077d14")
+ api.RegisterMessage((*Nat64PrefixDetails)(nil), "nat64_prefix_details_20568de3")
+ api.RegisterMessage((*Nat64PrefixDump)(nil), "nat64_prefix_dump_51077d14")
+ api.RegisterMessage((*Nat64StDetails)(nil), "nat64_st_details_c770d620")
+ api.RegisterMessage((*Nat64StDump)(nil), "nat64_st_dump_cfcb6b75")
+ api.RegisterMessage((*Nat66AddDelInterface)(nil), "nat66_add_del_interface_f3699b83")
+ api.RegisterMessage((*Nat66AddDelInterfaceReply)(nil), "nat66_add_del_interface_reply_e8d4e804")
+ api.RegisterMessage((*Nat66AddDelStaticMapping)(nil), "nat66_add_del_static_mapping_fb64e50b")
+ api.RegisterMessage((*Nat66AddDelStaticMappingReply)(nil), "nat66_add_del_static_mapping_reply_e8d4e804")
+ api.RegisterMessage((*Nat66InterfaceDetails)(nil), "nat66_interface_details_5d286289")
+ api.RegisterMessage((*Nat66InterfaceDump)(nil), "nat66_interface_dump_51077d14")
+ api.RegisterMessage((*Nat66StaticMappingDetails)(nil), "nat66_static_mapping_details_5c568448")
+ api.RegisterMessage((*Nat66StaticMappingDump)(nil), "nat66_static_mapping_dump_51077d14")
+ api.RegisterMessage((*NatControlPing)(nil), "nat_control_ping_51077d14")
+ api.RegisterMessage((*NatControlPingReply)(nil), "nat_control_ping_reply_f6b0b8ca")
+ api.RegisterMessage((*NatDetAddDelMap)(nil), "nat_det_add_del_map_112fde05")
+ api.RegisterMessage((*NatDetAddDelMapReply)(nil), "nat_det_add_del_map_reply_e8d4e804")
+ api.RegisterMessage((*NatDetCloseSessionIn)(nil), "nat_det_close_session_in_0a10ef64")
+ api.RegisterMessage((*NatDetCloseSessionInReply)(nil), "nat_det_close_session_in_reply_e8d4e804")
+ api.RegisterMessage((*NatDetCloseSessionOut)(nil), "nat_det_close_session_out_c1b6cbfb")
+ api.RegisterMessage((*NatDetCloseSessionOutReply)(nil), "nat_det_close_session_out_reply_e8d4e804")
+ api.RegisterMessage((*NatDetForward)(nil), "nat_det_forward_7f8a89cd")
+ api.RegisterMessage((*NatDetForwardReply)(nil), "nat_det_forward_reply_a8ccbdc0")
+ api.RegisterMessage((*NatDetMapDetails)(nil), "nat_det_map_details_88000ee1")
+ api.RegisterMessage((*NatDetMapDump)(nil), "nat_det_map_dump_51077d14")
+ api.RegisterMessage((*NatDetReverse)(nil), "nat_det_reverse_a7573fe1")
+ api.RegisterMessage((*NatDetReverseReply)(nil), "nat_det_reverse_reply_34066d48")
+ api.RegisterMessage((*NatDetSessionDetails)(nil), "nat_det_session_details_27f3c171")
+ api.RegisterMessage((*NatDetSessionDump)(nil), "nat_det_session_dump_e45a3af7")
+ api.RegisterMessage((*NatGetAddrAndPortAllocAlg)(nil), "nat_get_addr_and_port_alloc_alg_51077d14")
+ api.RegisterMessage((*NatGetAddrAndPortAllocAlgReply)(nil), "nat_get_addr_and_port_alloc_alg_reply_3607a7d0")
+ api.RegisterMessage((*NatGetMssClamping)(nil), "nat_get_mss_clamping_51077d14")
+ api.RegisterMessage((*NatGetMssClampingReply)(nil), "nat_get_mss_clamping_reply_1c0b2a78")
+ api.RegisterMessage((*NatGetTimeouts)(nil), "nat_get_timeouts_51077d14")
+ api.RegisterMessage((*NatGetTimeoutsReply)(nil), "nat_get_timeouts_reply_3c4df4e1")
+ api.RegisterMessage((*NatHaFlush)(nil), "nat_ha_flush_51077d14")
+ api.RegisterMessage((*NatHaFlushReply)(nil), "nat_ha_flush_reply_e8d4e804")
+ api.RegisterMessage((*NatHaGetFailover)(nil), "nat_ha_get_failover_51077d14")
+ api.RegisterMessage((*NatHaGetFailoverReply)(nil), "nat_ha_get_failover_reply_a67d8752")
+ api.RegisterMessage((*NatHaGetListener)(nil), "nat_ha_get_listener_51077d14")
+ api.RegisterMessage((*NatHaGetListenerReply)(nil), "nat_ha_get_listener_reply_123ea41f")
+ api.RegisterMessage((*NatHaResync)(nil), "nat_ha_resync_c8ab9e03")
+ api.RegisterMessage((*NatHaResyncCompletedEvent)(nil), "nat_ha_resync_completed_event_fdc598fb")
+ api.RegisterMessage((*NatHaResyncReply)(nil), "nat_ha_resync_reply_e8d4e804")
+ api.RegisterMessage((*NatHaSetFailover)(nil), "nat_ha_set_failover_718246af")
+ api.RegisterMessage((*NatHaSetFailoverReply)(nil), "nat_ha_set_failover_reply_e8d4e804")
+ api.RegisterMessage((*NatHaSetListener)(nil), "nat_ha_set_listener_e4a8cb4e")
+ api.RegisterMessage((*NatHaSetListenerReply)(nil), "nat_ha_set_listener_reply_e8d4e804")
+ api.RegisterMessage((*NatIpfixEnableDisable)(nil), "nat_ipfix_enable_disable_9af4a2d2")
+ api.RegisterMessage((*NatIpfixEnableDisableReply)(nil), "nat_ipfix_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*NatSetAddrAndPortAllocAlg)(nil), "nat_set_addr_and_port_alloc_alg_deeb746f")
+ api.RegisterMessage((*NatSetAddrAndPortAllocAlgReply)(nil), "nat_set_addr_and_port_alloc_alg_reply_e8d4e804")
+ api.RegisterMessage((*NatSetLogLevel)(nil), "nat_set_log_level_70076bfe")
+ api.RegisterMessage((*NatSetLogLevelReply)(nil), "nat_set_log_level_reply_e8d4e804")
+ api.RegisterMessage((*NatSetMssClamping)(nil), "nat_set_mss_clamping_25e90abb")
+ api.RegisterMessage((*NatSetMssClampingReply)(nil), "nat_set_mss_clamping_reply_e8d4e804")
+ api.RegisterMessage((*NatSetTimeouts)(nil), "nat_set_timeouts_d4746b16")
+ api.RegisterMessage((*NatSetTimeoutsReply)(nil), "nat_set_timeouts_reply_e8d4e804")
+ api.RegisterMessage((*NatSetWorkers)(nil), "nat_set_workers_da926638")
+ api.RegisterMessage((*NatSetWorkersReply)(nil), "nat_set_workers_reply_e8d4e804")
+ api.RegisterMessage((*NatShowConfig)(nil), "nat_show_config_51077d14")
+ api.RegisterMessage((*NatShowConfigReply)(nil), "nat_show_config_reply_006a0786")
+ api.RegisterMessage((*NatWorkerDetails)(nil), "nat_worker_details_84bf06fc")
+ api.RegisterMessage((*NatWorkerDump)(nil), "nat_worker_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*DsliteAddDelPoolAddrRange)(nil),
+ (*DsliteAddDelPoolAddrRangeReply)(nil),
+ (*DsliteAddressDetails)(nil),
+ (*DsliteAddressDump)(nil),
+ (*DsliteGetAftrAddr)(nil),
+ (*DsliteGetAftrAddrReply)(nil),
+ (*DsliteGetB4Addr)(nil),
+ (*DsliteGetB4AddrReply)(nil),
+ (*DsliteSetAftrAddr)(nil),
+ (*DsliteSetAftrAddrReply)(nil),
+ (*DsliteSetB4Addr)(nil),
+ (*DsliteSetB4AddrReply)(nil),
+ (*Nat44AddDelAddressRange)(nil),
+ (*Nat44AddDelAddressRangeReply)(nil),
+ (*Nat44AddDelIdentityMapping)(nil),
+ (*Nat44AddDelIdentityMappingReply)(nil),
+ (*Nat44AddDelInterfaceAddr)(nil),
+ (*Nat44AddDelInterfaceAddrReply)(nil),
+ (*Nat44AddDelLbStaticMapping)(nil),
+ (*Nat44AddDelLbStaticMappingReply)(nil),
+ (*Nat44AddDelStaticMapping)(nil),
+ (*Nat44AddDelStaticMappingReply)(nil),
+ (*Nat44AddressDetails)(nil),
+ (*Nat44AddressDump)(nil),
+ (*Nat44DelSession)(nil),
+ (*Nat44DelSessionReply)(nil),
+ (*Nat44ForwardingEnableDisable)(nil),
+ (*Nat44ForwardingEnableDisableReply)(nil),
+ (*Nat44ForwardingIsEnabled)(nil),
+ (*Nat44ForwardingIsEnabledReply)(nil),
+ (*Nat44IdentityMappingDetails)(nil),
+ (*Nat44IdentityMappingDump)(nil),
+ (*Nat44InterfaceAddDelFeature)(nil),
+ (*Nat44InterfaceAddDelFeatureReply)(nil),
+ (*Nat44InterfaceAddDelOutputFeature)(nil),
+ (*Nat44InterfaceAddDelOutputFeatureReply)(nil),
+ (*Nat44InterfaceAddrDetails)(nil),
+ (*Nat44InterfaceAddrDump)(nil),
+ (*Nat44InterfaceDetails)(nil),
+ (*Nat44InterfaceDump)(nil),
+ (*Nat44InterfaceOutputFeatureDetails)(nil),
+ (*Nat44InterfaceOutputFeatureDump)(nil),
+ (*Nat44LbStaticMappingAddDelLocal)(nil),
+ (*Nat44LbStaticMappingAddDelLocalReply)(nil),
+ (*Nat44LbStaticMappingDetails)(nil),
+ (*Nat44LbStaticMappingDump)(nil),
+ (*Nat44StaticMappingDetails)(nil),
+ (*Nat44StaticMappingDump)(nil),
+ (*Nat44UserDetails)(nil),
+ (*Nat44UserDump)(nil),
+ (*Nat44UserSessionDetails)(nil),
+ (*Nat44UserSessionDump)(nil),
+ (*Nat64AddDelInterface)(nil),
+ (*Nat64AddDelInterfaceAddr)(nil),
+ (*Nat64AddDelInterfaceAddrReply)(nil),
+ (*Nat64AddDelInterfaceReply)(nil),
+ (*Nat64AddDelPoolAddrRange)(nil),
+ (*Nat64AddDelPoolAddrRangeReply)(nil),
+ (*Nat64AddDelPrefix)(nil),
+ (*Nat64AddDelPrefixReply)(nil),
+ (*Nat64AddDelStaticBib)(nil),
+ (*Nat64AddDelStaticBibReply)(nil),
+ (*Nat64BibDetails)(nil),
+ (*Nat64BibDump)(nil),
+ (*Nat64InterfaceDetails)(nil),
+ (*Nat64InterfaceDump)(nil),
+ (*Nat64PoolAddrDetails)(nil),
+ (*Nat64PoolAddrDump)(nil),
+ (*Nat64PrefixDetails)(nil),
+ (*Nat64PrefixDump)(nil),
+ (*Nat64StDetails)(nil),
+ (*Nat64StDump)(nil),
+ (*Nat66AddDelInterface)(nil),
+ (*Nat66AddDelInterfaceReply)(nil),
+ (*Nat66AddDelStaticMapping)(nil),
+ (*Nat66AddDelStaticMappingReply)(nil),
+ (*Nat66InterfaceDetails)(nil),
+ (*Nat66InterfaceDump)(nil),
+ (*Nat66StaticMappingDetails)(nil),
+ (*Nat66StaticMappingDump)(nil),
+ (*NatControlPing)(nil),
+ (*NatControlPingReply)(nil),
+ (*NatDetAddDelMap)(nil),
+ (*NatDetAddDelMapReply)(nil),
+ (*NatDetCloseSessionIn)(nil),
+ (*NatDetCloseSessionInReply)(nil),
+ (*NatDetCloseSessionOut)(nil),
+ (*NatDetCloseSessionOutReply)(nil),
+ (*NatDetForward)(nil),
+ (*NatDetForwardReply)(nil),
+ (*NatDetMapDetails)(nil),
+ (*NatDetMapDump)(nil),
+ (*NatDetReverse)(nil),
+ (*NatDetReverseReply)(nil),
+ (*NatDetSessionDetails)(nil),
+ (*NatDetSessionDump)(nil),
+ (*NatGetAddrAndPortAllocAlg)(nil),
+ (*NatGetAddrAndPortAllocAlgReply)(nil),
+ (*NatGetMssClamping)(nil),
+ (*NatGetMssClampingReply)(nil),
+ (*NatGetTimeouts)(nil),
+ (*NatGetTimeoutsReply)(nil),
+ (*NatHaFlush)(nil),
+ (*NatHaFlushReply)(nil),
+ (*NatHaGetFailover)(nil),
+ (*NatHaGetFailoverReply)(nil),
+ (*NatHaGetListener)(nil),
+ (*NatHaGetListenerReply)(nil),
+ (*NatHaResync)(nil),
+ (*NatHaResyncCompletedEvent)(nil),
+ (*NatHaResyncReply)(nil),
+ (*NatHaSetFailover)(nil),
+ (*NatHaSetFailoverReply)(nil),
+ (*NatHaSetListener)(nil),
+ (*NatHaSetListenerReply)(nil),
+ (*NatIpfixEnableDisable)(nil),
+ (*NatIpfixEnableDisableReply)(nil),
+ (*NatSetAddrAndPortAllocAlg)(nil),
+ (*NatSetAddrAndPortAllocAlgReply)(nil),
+ (*NatSetLogLevel)(nil),
+ (*NatSetLogLevelReply)(nil),
+ (*NatSetMssClamping)(nil),
+ (*NatSetMssClampingReply)(nil),
+ (*NatSetTimeouts)(nil),
+ (*NatSetTimeoutsReply)(nil),
+ (*NatSetWorkers)(nil),
+ (*NatSetWorkersReply)(nil),
+ (*NatShowConfig)(nil),
+ (*NatShowConfigReply)(nil),
+ (*NatWorkerDetails)(nil),
+ (*NatWorkerDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/nat/nat_rpc.ba.go b/internal/testbinapi/binapi2001/nat/nat_rpc.ba.go
new file mode 100644
index 0000000..f6069ec
--- /dev/null
+++ b/internal/testbinapi/binapi2001/nat/nat_rpc.ba.go
@@ -0,0 +1,1273 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package nat
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service nat.
+type RPCService interface {
+ DsliteAddDelPoolAddrRange(ctx context.Context, in *DsliteAddDelPoolAddrRange) (*DsliteAddDelPoolAddrRangeReply, error)
+ DsliteAddressDump(ctx context.Context, in *DsliteAddressDump) (RPCService_DsliteAddressDumpClient, error)
+ DsliteGetAftrAddr(ctx context.Context, in *DsliteGetAftrAddr) (*DsliteGetAftrAddrReply, error)
+ DsliteGetB4Addr(ctx context.Context, in *DsliteGetB4Addr) (*DsliteGetB4AddrReply, error)
+ DsliteSetAftrAddr(ctx context.Context, in *DsliteSetAftrAddr) (*DsliteSetAftrAddrReply, error)
+ DsliteSetB4Addr(ctx context.Context, in *DsliteSetB4Addr) (*DsliteSetB4AddrReply, error)
+ Nat44AddDelAddressRange(ctx context.Context, in *Nat44AddDelAddressRange) (*Nat44AddDelAddressRangeReply, error)
+ Nat44AddDelIdentityMapping(ctx context.Context, in *Nat44AddDelIdentityMapping) (*Nat44AddDelIdentityMappingReply, error)
+ Nat44AddDelInterfaceAddr(ctx context.Context, in *Nat44AddDelInterfaceAddr) (*Nat44AddDelInterfaceAddrReply, error)
+ Nat44AddDelLbStaticMapping(ctx context.Context, in *Nat44AddDelLbStaticMapping) (*Nat44AddDelLbStaticMappingReply, error)
+ Nat44AddDelStaticMapping(ctx context.Context, in *Nat44AddDelStaticMapping) (*Nat44AddDelStaticMappingReply, error)
+ Nat44AddressDump(ctx context.Context, in *Nat44AddressDump) (RPCService_Nat44AddressDumpClient, error)
+ Nat44DelSession(ctx context.Context, in *Nat44DelSession) (*Nat44DelSessionReply, error)
+ Nat44ForwardingEnableDisable(ctx context.Context, in *Nat44ForwardingEnableDisable) (*Nat44ForwardingEnableDisableReply, error)
+ Nat44ForwardingIsEnabled(ctx context.Context, in *Nat44ForwardingIsEnabled) (*Nat44ForwardingIsEnabledReply, error)
+ Nat44IdentityMappingDump(ctx context.Context, in *Nat44IdentityMappingDump) (RPCService_Nat44IdentityMappingDumpClient, error)
+ Nat44InterfaceAddDelFeature(ctx context.Context, in *Nat44InterfaceAddDelFeature) (*Nat44InterfaceAddDelFeatureReply, error)
+ Nat44InterfaceAddDelOutputFeature(ctx context.Context, in *Nat44InterfaceAddDelOutputFeature) (*Nat44InterfaceAddDelOutputFeatureReply, error)
+ Nat44InterfaceAddrDump(ctx context.Context, in *Nat44InterfaceAddrDump) (RPCService_Nat44InterfaceAddrDumpClient, error)
+ Nat44InterfaceDump(ctx context.Context, in *Nat44InterfaceDump) (RPCService_Nat44InterfaceDumpClient, error)
+ Nat44InterfaceOutputFeatureDump(ctx context.Context, in *Nat44InterfaceOutputFeatureDump) (RPCService_Nat44InterfaceOutputFeatureDumpClient, error)
+ Nat44LbStaticMappingAddDelLocal(ctx context.Context, in *Nat44LbStaticMappingAddDelLocal) (*Nat44LbStaticMappingAddDelLocalReply, error)
+ Nat44LbStaticMappingDump(ctx context.Context, in *Nat44LbStaticMappingDump) (RPCService_Nat44LbStaticMappingDumpClient, error)
+ Nat44StaticMappingDump(ctx context.Context, in *Nat44StaticMappingDump) (RPCService_Nat44StaticMappingDumpClient, error)
+ Nat44UserDump(ctx context.Context, in *Nat44UserDump) (RPCService_Nat44UserDumpClient, error)
+ Nat44UserSessionDump(ctx context.Context, in *Nat44UserSessionDump) (RPCService_Nat44UserSessionDumpClient, error)
+ Nat64AddDelInterface(ctx context.Context, in *Nat64AddDelInterface) (*Nat64AddDelInterfaceReply, error)
+ Nat64AddDelInterfaceAddr(ctx context.Context, in *Nat64AddDelInterfaceAddr) (*Nat64AddDelInterfaceAddrReply, error)
+ Nat64AddDelPoolAddrRange(ctx context.Context, in *Nat64AddDelPoolAddrRange) (*Nat64AddDelPoolAddrRangeReply, error)
+ Nat64AddDelPrefix(ctx context.Context, in *Nat64AddDelPrefix) (*Nat64AddDelPrefixReply, error)
+ Nat64AddDelStaticBib(ctx context.Context, in *Nat64AddDelStaticBib) (*Nat64AddDelStaticBibReply, error)
+ Nat64BibDump(ctx context.Context, in *Nat64BibDump) (RPCService_Nat64BibDumpClient, error)
+ Nat64InterfaceDump(ctx context.Context, in *Nat64InterfaceDump) (RPCService_Nat64InterfaceDumpClient, error)
+ Nat64PoolAddrDump(ctx context.Context, in *Nat64PoolAddrDump) (RPCService_Nat64PoolAddrDumpClient, error)
+ Nat64PrefixDump(ctx context.Context, in *Nat64PrefixDump) (RPCService_Nat64PrefixDumpClient, error)
+ Nat64StDump(ctx context.Context, in *Nat64StDump) (RPCService_Nat64StDumpClient, error)
+ Nat66AddDelInterface(ctx context.Context, in *Nat66AddDelInterface) (*Nat66AddDelInterfaceReply, error)
+ Nat66AddDelStaticMapping(ctx context.Context, in *Nat66AddDelStaticMapping) (*Nat66AddDelStaticMappingReply, error)
+ Nat66InterfaceDump(ctx context.Context, in *Nat66InterfaceDump) (RPCService_Nat66InterfaceDumpClient, error)
+ Nat66StaticMappingDump(ctx context.Context, in *Nat66StaticMappingDump) (RPCService_Nat66StaticMappingDumpClient, error)
+ NatControlPing(ctx context.Context, in *NatControlPing) (*NatControlPingReply, error)
+ NatDetAddDelMap(ctx context.Context, in *NatDetAddDelMap) (*NatDetAddDelMapReply, error)
+ NatDetCloseSessionIn(ctx context.Context, in *NatDetCloseSessionIn) (*NatDetCloseSessionInReply, error)
+ NatDetCloseSessionOut(ctx context.Context, in *NatDetCloseSessionOut) (*NatDetCloseSessionOutReply, error)
+ NatDetForward(ctx context.Context, in *NatDetForward) (*NatDetForwardReply, error)
+ NatDetMapDump(ctx context.Context, in *NatDetMapDump) (RPCService_NatDetMapDumpClient, error)
+ NatDetReverse(ctx context.Context, in *NatDetReverse) (*NatDetReverseReply, error)
+ NatDetSessionDump(ctx context.Context, in *NatDetSessionDump) (RPCService_NatDetSessionDumpClient, error)
+ NatGetAddrAndPortAllocAlg(ctx context.Context, in *NatGetAddrAndPortAllocAlg) (*NatGetAddrAndPortAllocAlgReply, error)
+ NatGetMssClamping(ctx context.Context, in *NatGetMssClamping) (*NatGetMssClampingReply, error)
+ NatGetTimeouts(ctx context.Context, in *NatGetTimeouts) (*NatGetTimeoutsReply, error)
+ NatHaFlush(ctx context.Context, in *NatHaFlush) (*NatHaFlushReply, error)
+ NatHaGetFailover(ctx context.Context, in *NatHaGetFailover) (*NatHaGetFailoverReply, error)
+ NatHaGetListener(ctx context.Context, in *NatHaGetListener) (*NatHaGetListenerReply, error)
+ NatHaResync(ctx context.Context, in *NatHaResync) (*NatHaResyncReply, error)
+ NatHaSetFailover(ctx context.Context, in *NatHaSetFailover) (*NatHaSetFailoverReply, error)
+ NatHaSetListener(ctx context.Context, in *NatHaSetListener) (*NatHaSetListenerReply, error)
+ NatIpfixEnableDisable(ctx context.Context, in *NatIpfixEnableDisable) (*NatIpfixEnableDisableReply, error)
+ NatSetAddrAndPortAllocAlg(ctx context.Context, in *NatSetAddrAndPortAllocAlg) (*NatSetAddrAndPortAllocAlgReply, error)
+ NatSetLogLevel(ctx context.Context, in *NatSetLogLevel) (*NatSetLogLevelReply, error)
+ NatSetMssClamping(ctx context.Context, in *NatSetMssClamping) (*NatSetMssClampingReply, error)
+ NatSetTimeouts(ctx context.Context, in *NatSetTimeouts) (*NatSetTimeoutsReply, error)
+ NatSetWorkers(ctx context.Context, in *NatSetWorkers) (*NatSetWorkersReply, error)
+ NatShowConfig(ctx context.Context, in *NatShowConfig) (*NatShowConfigReply, error)
+ NatWorkerDump(ctx context.Context, in *NatWorkerDump) (RPCService_NatWorkerDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) DsliteAddDelPoolAddrRange(ctx context.Context, in *DsliteAddDelPoolAddrRange) (*DsliteAddDelPoolAddrRangeReply, error) {
+ out := new(DsliteAddDelPoolAddrRangeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DsliteAddressDump(ctx context.Context, in *DsliteAddressDump) (RPCService_DsliteAddressDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_DsliteAddressDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_DsliteAddressDumpClient interface {
+ Recv() (*DsliteAddressDetails, error)
+ api.Stream
+}
+
+type serviceClient_DsliteAddressDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_DsliteAddressDumpClient) Recv() (*DsliteAddressDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *DsliteAddressDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) DsliteGetAftrAddr(ctx context.Context, in *DsliteGetAftrAddr) (*DsliteGetAftrAddrReply, error) {
+ out := new(DsliteGetAftrAddrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DsliteGetB4Addr(ctx context.Context, in *DsliteGetB4Addr) (*DsliteGetB4AddrReply, error) {
+ out := new(DsliteGetB4AddrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DsliteSetAftrAddr(ctx context.Context, in *DsliteSetAftrAddr) (*DsliteSetAftrAddrReply, error) {
+ out := new(DsliteSetAftrAddrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DsliteSetB4Addr(ctx context.Context, in *DsliteSetB4Addr) (*DsliteSetB4AddrReply, error) {
+ out := new(DsliteSetB4AddrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44AddDelAddressRange(ctx context.Context, in *Nat44AddDelAddressRange) (*Nat44AddDelAddressRangeReply, error) {
+ out := new(Nat44AddDelAddressRangeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44AddDelIdentityMapping(ctx context.Context, in *Nat44AddDelIdentityMapping) (*Nat44AddDelIdentityMappingReply, error) {
+ out := new(Nat44AddDelIdentityMappingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44AddDelInterfaceAddr(ctx context.Context, in *Nat44AddDelInterfaceAddr) (*Nat44AddDelInterfaceAddrReply, error) {
+ out := new(Nat44AddDelInterfaceAddrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44AddDelLbStaticMapping(ctx context.Context, in *Nat44AddDelLbStaticMapping) (*Nat44AddDelLbStaticMappingReply, error) {
+ out := new(Nat44AddDelLbStaticMappingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44AddDelStaticMapping(ctx context.Context, in *Nat44AddDelStaticMapping) (*Nat44AddDelStaticMappingReply, error) {
+ out := new(Nat44AddDelStaticMappingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44AddressDump(ctx context.Context, in *Nat44AddressDump) (RPCService_Nat44AddressDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat44AddressDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat44AddressDumpClient interface {
+ Recv() (*Nat44AddressDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat44AddressDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat44AddressDumpClient) Recv() (*Nat44AddressDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat44AddressDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat44DelSession(ctx context.Context, in *Nat44DelSession) (*Nat44DelSessionReply, error) {
+ out := new(Nat44DelSessionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44ForwardingEnableDisable(ctx context.Context, in *Nat44ForwardingEnableDisable) (*Nat44ForwardingEnableDisableReply, error) {
+ out := new(Nat44ForwardingEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44ForwardingIsEnabled(ctx context.Context, in *Nat44ForwardingIsEnabled) (*Nat44ForwardingIsEnabledReply, error) {
+ out := new(Nat44ForwardingIsEnabledReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44IdentityMappingDump(ctx context.Context, in *Nat44IdentityMappingDump) (RPCService_Nat44IdentityMappingDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat44IdentityMappingDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat44IdentityMappingDumpClient interface {
+ Recv() (*Nat44IdentityMappingDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat44IdentityMappingDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat44IdentityMappingDumpClient) Recv() (*Nat44IdentityMappingDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat44IdentityMappingDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat44InterfaceAddDelFeature(ctx context.Context, in *Nat44InterfaceAddDelFeature) (*Nat44InterfaceAddDelFeatureReply, error) {
+ out := new(Nat44InterfaceAddDelFeatureReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44InterfaceAddDelOutputFeature(ctx context.Context, in *Nat44InterfaceAddDelOutputFeature) (*Nat44InterfaceAddDelOutputFeatureReply, error) {
+ out := new(Nat44InterfaceAddDelOutputFeatureReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44InterfaceAddrDump(ctx context.Context, in *Nat44InterfaceAddrDump) (RPCService_Nat44InterfaceAddrDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat44InterfaceAddrDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat44InterfaceAddrDumpClient interface {
+ Recv() (*Nat44InterfaceAddrDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat44InterfaceAddrDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat44InterfaceAddrDumpClient) Recv() (*Nat44InterfaceAddrDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat44InterfaceAddrDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat44InterfaceDump(ctx context.Context, in *Nat44InterfaceDump) (RPCService_Nat44InterfaceDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat44InterfaceDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat44InterfaceDumpClient interface {
+ Recv() (*Nat44InterfaceDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat44InterfaceDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat44InterfaceDumpClient) Recv() (*Nat44InterfaceDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat44InterfaceDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat44InterfaceOutputFeatureDump(ctx context.Context, in *Nat44InterfaceOutputFeatureDump) (RPCService_Nat44InterfaceOutputFeatureDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat44InterfaceOutputFeatureDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat44InterfaceOutputFeatureDumpClient interface {
+ Recv() (*Nat44InterfaceOutputFeatureDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat44InterfaceOutputFeatureDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat44InterfaceOutputFeatureDumpClient) Recv() (*Nat44InterfaceOutputFeatureDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat44InterfaceOutputFeatureDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat44LbStaticMappingAddDelLocal(ctx context.Context, in *Nat44LbStaticMappingAddDelLocal) (*Nat44LbStaticMappingAddDelLocalReply, error) {
+ out := new(Nat44LbStaticMappingAddDelLocalReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat44LbStaticMappingDump(ctx context.Context, in *Nat44LbStaticMappingDump) (RPCService_Nat44LbStaticMappingDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat44LbStaticMappingDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat44LbStaticMappingDumpClient interface {
+ Recv() (*Nat44LbStaticMappingDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat44LbStaticMappingDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat44LbStaticMappingDumpClient) Recv() (*Nat44LbStaticMappingDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat44LbStaticMappingDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat44StaticMappingDump(ctx context.Context, in *Nat44StaticMappingDump) (RPCService_Nat44StaticMappingDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat44StaticMappingDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat44StaticMappingDumpClient interface {
+ Recv() (*Nat44StaticMappingDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat44StaticMappingDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat44StaticMappingDumpClient) Recv() (*Nat44StaticMappingDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat44StaticMappingDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat44UserDump(ctx context.Context, in *Nat44UserDump) (RPCService_Nat44UserDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat44UserDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat44UserDumpClient interface {
+ Recv() (*Nat44UserDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat44UserDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat44UserDumpClient) Recv() (*Nat44UserDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat44UserDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat44UserSessionDump(ctx context.Context, in *Nat44UserSessionDump) (RPCService_Nat44UserSessionDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat44UserSessionDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat44UserSessionDumpClient interface {
+ Recv() (*Nat44UserSessionDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat44UserSessionDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat44UserSessionDumpClient) Recv() (*Nat44UserSessionDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat44UserSessionDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat64AddDelInterface(ctx context.Context, in *Nat64AddDelInterface) (*Nat64AddDelInterfaceReply, error) {
+ out := new(Nat64AddDelInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat64AddDelInterfaceAddr(ctx context.Context, in *Nat64AddDelInterfaceAddr) (*Nat64AddDelInterfaceAddrReply, error) {
+ out := new(Nat64AddDelInterfaceAddrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat64AddDelPoolAddrRange(ctx context.Context, in *Nat64AddDelPoolAddrRange) (*Nat64AddDelPoolAddrRangeReply, error) {
+ out := new(Nat64AddDelPoolAddrRangeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat64AddDelPrefix(ctx context.Context, in *Nat64AddDelPrefix) (*Nat64AddDelPrefixReply, error) {
+ out := new(Nat64AddDelPrefixReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat64AddDelStaticBib(ctx context.Context, in *Nat64AddDelStaticBib) (*Nat64AddDelStaticBibReply, error) {
+ out := new(Nat64AddDelStaticBibReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat64BibDump(ctx context.Context, in *Nat64BibDump) (RPCService_Nat64BibDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat64BibDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat64BibDumpClient interface {
+ Recv() (*Nat64BibDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat64BibDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat64BibDumpClient) Recv() (*Nat64BibDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat64BibDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat64InterfaceDump(ctx context.Context, in *Nat64InterfaceDump) (RPCService_Nat64InterfaceDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat64InterfaceDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat64InterfaceDumpClient interface {
+ Recv() (*Nat64InterfaceDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat64InterfaceDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat64InterfaceDumpClient) Recv() (*Nat64InterfaceDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat64InterfaceDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat64PoolAddrDump(ctx context.Context, in *Nat64PoolAddrDump) (RPCService_Nat64PoolAddrDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat64PoolAddrDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat64PoolAddrDumpClient interface {
+ Recv() (*Nat64PoolAddrDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat64PoolAddrDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat64PoolAddrDumpClient) Recv() (*Nat64PoolAddrDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat64PoolAddrDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat64PrefixDump(ctx context.Context, in *Nat64PrefixDump) (RPCService_Nat64PrefixDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat64PrefixDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat64PrefixDumpClient interface {
+ Recv() (*Nat64PrefixDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat64PrefixDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat64PrefixDumpClient) Recv() (*Nat64PrefixDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat64PrefixDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat64StDump(ctx context.Context, in *Nat64StDump) (RPCService_Nat64StDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat64StDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat64StDumpClient interface {
+ Recv() (*Nat64StDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat64StDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat64StDumpClient) Recv() (*Nat64StDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat64StDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat66AddDelInterface(ctx context.Context, in *Nat66AddDelInterface) (*Nat66AddDelInterfaceReply, error) {
+ out := new(Nat66AddDelInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat66AddDelStaticMapping(ctx context.Context, in *Nat66AddDelStaticMapping) (*Nat66AddDelStaticMappingReply, error) {
+ out := new(Nat66AddDelStaticMappingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Nat66InterfaceDump(ctx context.Context, in *Nat66InterfaceDump) (RPCService_Nat66InterfaceDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat66InterfaceDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat66InterfaceDumpClient interface {
+ Recv() (*Nat66InterfaceDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat66InterfaceDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat66InterfaceDumpClient) Recv() (*Nat66InterfaceDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat66InterfaceDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) Nat66StaticMappingDump(ctx context.Context, in *Nat66StaticMappingDump) (RPCService_Nat66StaticMappingDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Nat66StaticMappingDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Nat66StaticMappingDumpClient interface {
+ Recv() (*Nat66StaticMappingDetails, error)
+ api.Stream
+}
+
+type serviceClient_Nat66StaticMappingDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Nat66StaticMappingDumpClient) Recv() (*Nat66StaticMappingDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Nat66StaticMappingDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) NatControlPing(ctx context.Context, in *NatControlPing) (*NatControlPingReply, error) {
+ out := new(NatControlPingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatDetAddDelMap(ctx context.Context, in *NatDetAddDelMap) (*NatDetAddDelMapReply, error) {
+ out := new(NatDetAddDelMapReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatDetCloseSessionIn(ctx context.Context, in *NatDetCloseSessionIn) (*NatDetCloseSessionInReply, error) {
+ out := new(NatDetCloseSessionInReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatDetCloseSessionOut(ctx context.Context, in *NatDetCloseSessionOut) (*NatDetCloseSessionOutReply, error) {
+ out := new(NatDetCloseSessionOutReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatDetForward(ctx context.Context, in *NatDetForward) (*NatDetForwardReply, error) {
+ out := new(NatDetForwardReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatDetMapDump(ctx context.Context, in *NatDetMapDump) (RPCService_NatDetMapDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_NatDetMapDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_NatDetMapDumpClient interface {
+ Recv() (*NatDetMapDetails, error)
+ api.Stream
+}
+
+type serviceClient_NatDetMapDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_NatDetMapDumpClient) Recv() (*NatDetMapDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *NatDetMapDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) NatDetReverse(ctx context.Context, in *NatDetReverse) (*NatDetReverseReply, error) {
+ out := new(NatDetReverseReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatDetSessionDump(ctx context.Context, in *NatDetSessionDump) (RPCService_NatDetSessionDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_NatDetSessionDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_NatDetSessionDumpClient interface {
+ Recv() (*NatDetSessionDetails, error)
+ api.Stream
+}
+
+type serviceClient_NatDetSessionDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_NatDetSessionDumpClient) Recv() (*NatDetSessionDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *NatDetSessionDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) NatGetAddrAndPortAllocAlg(ctx context.Context, in *NatGetAddrAndPortAllocAlg) (*NatGetAddrAndPortAllocAlgReply, error) {
+ out := new(NatGetAddrAndPortAllocAlgReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatGetMssClamping(ctx context.Context, in *NatGetMssClamping) (*NatGetMssClampingReply, error) {
+ out := new(NatGetMssClampingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatGetTimeouts(ctx context.Context, in *NatGetTimeouts) (*NatGetTimeoutsReply, error) {
+ out := new(NatGetTimeoutsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatHaFlush(ctx context.Context, in *NatHaFlush) (*NatHaFlushReply, error) {
+ out := new(NatHaFlushReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatHaGetFailover(ctx context.Context, in *NatHaGetFailover) (*NatHaGetFailoverReply, error) {
+ out := new(NatHaGetFailoverReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatHaGetListener(ctx context.Context, in *NatHaGetListener) (*NatHaGetListenerReply, error) {
+ out := new(NatHaGetListenerReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatHaResync(ctx context.Context, in *NatHaResync) (*NatHaResyncReply, error) {
+ out := new(NatHaResyncReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatHaSetFailover(ctx context.Context, in *NatHaSetFailover) (*NatHaSetFailoverReply, error) {
+ out := new(NatHaSetFailoverReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatHaSetListener(ctx context.Context, in *NatHaSetListener) (*NatHaSetListenerReply, error) {
+ out := new(NatHaSetListenerReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatIpfixEnableDisable(ctx context.Context, in *NatIpfixEnableDisable) (*NatIpfixEnableDisableReply, error) {
+ out := new(NatIpfixEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatSetAddrAndPortAllocAlg(ctx context.Context, in *NatSetAddrAndPortAllocAlg) (*NatSetAddrAndPortAllocAlgReply, error) {
+ out := new(NatSetAddrAndPortAllocAlgReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatSetLogLevel(ctx context.Context, in *NatSetLogLevel) (*NatSetLogLevelReply, error) {
+ out := new(NatSetLogLevelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatSetMssClamping(ctx context.Context, in *NatSetMssClamping) (*NatSetMssClampingReply, error) {
+ out := new(NatSetMssClampingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatSetTimeouts(ctx context.Context, in *NatSetTimeouts) (*NatSetTimeoutsReply, error) {
+ out := new(NatSetTimeoutsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatSetWorkers(ctx context.Context, in *NatSetWorkers) (*NatSetWorkersReply, error) {
+ out := new(NatSetWorkersReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatShowConfig(ctx context.Context, in *NatShowConfig) (*NatShowConfigReply, error) {
+ out := new(NatShowConfigReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NatWorkerDump(ctx context.Context, in *NatWorkerDump) (RPCService_NatWorkerDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_NatWorkerDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_NatWorkerDumpClient interface {
+ Recv() (*NatWorkerDetails, error)
+ api.Stream
+}
+
+type serviceClient_NatWorkerDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_NatWorkerDumpClient) Recv() (*NatWorkerDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *NatWorkerDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/netmap/netmap.ba.go b/internal/testbinapi/binapi2001/netmap/netmap.ba.go
new file mode 100644
index 0000000..0934ce6
--- /dev/null
+++ b/internal/testbinapi/binapi2001/netmap/netmap.ba.go
@@ -0,0 +1,198 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/netmap.api.json
+
+// Package netmap contains generated bindings for API file netmap.api.
+//
+// Contents:
+// 4 messages
+//
+package netmap
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "netmap"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x40e7a84f
+)
+
+// NetmapCreate defines message 'netmap_create'.
+type NetmapCreate struct {
+ NetmapIfName []byte `binapi:"u8[64],name=netmap_if_name" json:"netmap_if_name,omitempty"`
+ HwAddr []byte `binapi:"u8[6],name=hw_addr" json:"hw_addr,omitempty"`
+ UseRandomHwAddr uint8 `binapi:"u8,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"`
+ IsPipe uint8 `binapi:"u8,name=is_pipe" json:"is_pipe,omitempty"`
+ IsMaster uint8 `binapi:"u8,name=is_master" json:"is_master,omitempty"`
+}
+
+func (m *NetmapCreate) Reset() { *m = NetmapCreate{} }
+func (*NetmapCreate) GetMessageName() string { return "netmap_create" }
+func (*NetmapCreate) GetCrcString() string { return "5299044e" }
+func (*NetmapCreate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NetmapCreate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 64 // m.NetmapIfName
+ size += 1 * 6 // m.HwAddr
+ size += 1 // m.UseRandomHwAddr
+ size += 1 // m.IsPipe
+ size += 1 // m.IsMaster
+ return size
+}
+func (m *NetmapCreate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.NetmapIfName, 64)
+ buf.EncodeBytes(m.HwAddr, 6)
+ buf.EncodeUint8(m.UseRandomHwAddr)
+ buf.EncodeUint8(m.IsPipe)
+ buf.EncodeUint8(m.IsMaster)
+ return buf.Bytes(), nil
+}
+func (m *NetmapCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.NetmapIfName = make([]byte, 64)
+ copy(m.NetmapIfName, buf.DecodeBytes(len(m.NetmapIfName)))
+ m.HwAddr = make([]byte, 6)
+ copy(m.HwAddr, buf.DecodeBytes(len(m.HwAddr)))
+ m.UseRandomHwAddr = buf.DecodeUint8()
+ m.IsPipe = buf.DecodeUint8()
+ m.IsMaster = buf.DecodeUint8()
+ return nil
+}
+
+// NetmapCreateReply defines message 'netmap_create_reply'.
+type NetmapCreateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NetmapCreateReply) Reset() { *m = NetmapCreateReply{} }
+func (*NetmapCreateReply) GetMessageName() string { return "netmap_create_reply" }
+func (*NetmapCreateReply) GetCrcString() string { return "e8d4e804" }
+func (*NetmapCreateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NetmapCreateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NetmapCreateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *NetmapCreateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// NetmapDelete defines message 'netmap_delete'.
+type NetmapDelete struct {
+ NetmapIfName []byte `binapi:"u8[64],name=netmap_if_name" json:"netmap_if_name,omitempty"`
+}
+
+func (m *NetmapDelete) Reset() { *m = NetmapDelete{} }
+func (*NetmapDelete) GetMessageName() string { return "netmap_delete" }
+func (*NetmapDelete) GetCrcString() string { return "a8b6c201" }
+func (*NetmapDelete) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NetmapDelete) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 64 // m.NetmapIfName
+ return size
+}
+func (m *NetmapDelete) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.NetmapIfName, 64)
+ return buf.Bytes(), nil
+}
+func (m *NetmapDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.NetmapIfName = make([]byte, 64)
+ copy(m.NetmapIfName, buf.DecodeBytes(len(m.NetmapIfName)))
+ return nil
+}
+
+// NetmapDeleteReply defines message 'netmap_delete_reply'.
+type NetmapDeleteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NetmapDeleteReply) Reset() { *m = NetmapDeleteReply{} }
+func (*NetmapDeleteReply) GetMessageName() string { return "netmap_delete_reply" }
+func (*NetmapDeleteReply) GetCrcString() string { return "e8d4e804" }
+func (*NetmapDeleteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NetmapDeleteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NetmapDeleteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *NetmapDeleteReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_netmap_binapi_init() }
+func file_netmap_binapi_init() {
+ api.RegisterMessage((*NetmapCreate)(nil), "netmap_create_5299044e")
+ api.RegisterMessage((*NetmapCreateReply)(nil), "netmap_create_reply_e8d4e804")
+ api.RegisterMessage((*NetmapDelete)(nil), "netmap_delete_a8b6c201")
+ api.RegisterMessage((*NetmapDeleteReply)(nil), "netmap_delete_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*NetmapCreate)(nil),
+ (*NetmapCreateReply)(nil),
+ (*NetmapDelete)(nil),
+ (*NetmapDeleteReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/netmap/netmap_rpc.ba.go b/internal/testbinapi/binapi2001/netmap/netmap_rpc.ba.go
new file mode 100644
index 0000000..366bed0
--- /dev/null
+++ b/internal/testbinapi/binapi2001/netmap/netmap_rpc.ba.go
@@ -0,0 +1,40 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package netmap
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service netmap.
+type RPCService interface {
+ NetmapCreate(ctx context.Context, in *NetmapCreate) (*NetmapCreateReply, error)
+ NetmapDelete(ctx context.Context, in *NetmapDelete) (*NetmapDeleteReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) NetmapCreate(ctx context.Context, in *NetmapCreate) (*NetmapCreateReply, error) {
+ out := new(NetmapCreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NetmapDelete(ctx context.Context, in *NetmapDelete) (*NetmapDeleteReply, error) {
+ out := new(NetmapDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/nhrp/nhrp.ba.go b/internal/testbinapi/binapi2001/nhrp/nhrp.ba.go
new file mode 100644
index 0000000..0dd5c4c
--- /dev/null
+++ b/internal/testbinapi/binapi2001/nhrp/nhrp.ba.go
@@ -0,0 +1,1036 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/nhrp.api.json
+
+// Package nhrp contains generated bindings for API file nhrp.api.
+//
+// Contents:
+// 6 aliases
+// 10 enums
+// 7 structs
+// 1 union
+// 4 messages
+//
+package nhrp
+
+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 = "nhrp"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xfb0453b2
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// NhrpEntry defines type 'nhrp_entry'.
+type NhrpEntry struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Peer Address `binapi:"address,name=peer" json:"peer,omitempty"`
+ Nh Address `binapi:"address,name=nh" json:"nh,omitempty"`
+ NhTableID uint32 `binapi:"u32,name=nh_table_id" json:"nh_table_id,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// NhrpDetails defines message 'nhrp_details'.
+type NhrpDetails struct {
+ Entry NhrpEntry `binapi:"nhrp_entry,name=entry" json:"entry,omitempty"`
+}
+
+func (m *NhrpDetails) Reset() { *m = NhrpDetails{} }
+func (*NhrpDetails) GetMessageName() string { return "nhrp_details" }
+func (*NhrpDetails) GetCrcString() string { return "e351c50a" }
+func (*NhrpDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NhrpDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Entry.SwIfIndex
+ size += 4 // m.Entry.Peer.Af
+ size += 1 * 16 // m.Entry.Peer.Un
+ size += 4 // m.Entry.Nh.Af
+ size += 1 * 16 // m.Entry.Nh.Un
+ size += 4 // m.Entry.NhTableID
+ return size
+}
+func (m *NhrpDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Entry.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Entry.Peer.Af))
+ buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.Nh.Af))
+ buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(m.Entry.NhTableID)
+ return buf.Bytes(), nil
+}
+func (m *NhrpDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Entry.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Entry.Peer.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.Nh.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.NhTableID = buf.DecodeUint32()
+ return nil
+}
+
+// NhrpDump defines message 'nhrp_dump'.
+type NhrpDump struct{}
+
+func (m *NhrpDump) Reset() { *m = NhrpDump{} }
+func (*NhrpDump) GetMessageName() string { return "nhrp_dump" }
+func (*NhrpDump) GetCrcString() string { return "51077d14" }
+func (*NhrpDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NhrpDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *NhrpDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *NhrpDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// NhrpEntryAddDel defines message 'nhrp_entry_add_del'.
+type NhrpEntryAddDel struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Entry NhrpEntry `binapi:"nhrp_entry,name=entry" json:"entry,omitempty"`
+}
+
+func (m *NhrpEntryAddDel) Reset() { *m = NhrpEntryAddDel{} }
+func (*NhrpEntryAddDel) GetMessageName() string { return "nhrp_entry_add_del" }
+func (*NhrpEntryAddDel) GetCrcString() string { return "5a47c531" }
+func (*NhrpEntryAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NhrpEntryAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Entry.SwIfIndex
+ size += 4 // m.Entry.Peer.Af
+ size += 1 * 16 // m.Entry.Peer.Un
+ size += 4 // m.Entry.Nh.Af
+ size += 1 * 16 // m.Entry.Nh.Un
+ size += 4 // m.Entry.NhTableID
+ return size
+}
+func (m *NhrpEntryAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(uint32(m.Entry.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Entry.Peer.Af))
+ buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Entry.Nh.Af))
+ buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(m.Entry.NhTableID)
+ return buf.Bytes(), nil
+}
+func (m *NhrpEntryAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Entry.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Entry.Peer.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.Nh.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Entry.NhTableID = buf.DecodeUint32()
+ return nil
+}
+
+// NhrpEntryAddDelReply defines message 'nhrp_entry_add_del_reply'.
+type NhrpEntryAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NhrpEntryAddDelReply) Reset() { *m = NhrpEntryAddDelReply{} }
+func (*NhrpEntryAddDelReply) GetMessageName() string { return "nhrp_entry_add_del_reply" }
+func (*NhrpEntryAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*NhrpEntryAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NhrpEntryAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NhrpEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *NhrpEntryAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_nhrp_binapi_init() }
+func file_nhrp_binapi_init() {
+ api.RegisterMessage((*NhrpDetails)(nil), "nhrp_details_e351c50a")
+ api.RegisterMessage((*NhrpDump)(nil), "nhrp_dump_51077d14")
+ api.RegisterMessage((*NhrpEntryAddDel)(nil), "nhrp_entry_add_del_5a47c531")
+ api.RegisterMessage((*NhrpEntryAddDelReply)(nil), "nhrp_entry_add_del_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*NhrpDetails)(nil),
+ (*NhrpDump)(nil),
+ (*NhrpEntryAddDel)(nil),
+ (*NhrpEntryAddDelReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/nhrp/nhrp_rpc.ba.go b/internal/testbinapi/binapi2001/nhrp/nhrp_rpc.ba.go
new file mode 100644
index 0000000..841bda4
--- /dev/null
+++ b/internal/testbinapi/binapi2001/nhrp/nhrp_rpc.ba.go
@@ -0,0 +1,73 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package nhrp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service nhrp.
+type RPCService interface {
+ NhrpDump(ctx context.Context, in *NhrpDump) (RPCService_NhrpDumpClient, error)
+ NhrpEntryAddDel(ctx context.Context, in *NhrpEntryAddDel) (*NhrpEntryAddDelReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) NhrpDump(ctx context.Context, in *NhrpDump) (RPCService_NhrpDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_NhrpDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_NhrpDumpClient interface {
+ Recv() (*NhrpDetails, error)
+ api.Stream
+}
+
+type serviceClient_NhrpDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_NhrpDumpClient) Recv() (*NhrpDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *NhrpDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) NhrpEntryAddDel(ctx context.Context, in *NhrpEntryAddDel) (*NhrpEntryAddDelReply, error) {
+ out := new(NhrpEntryAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/nsh/nsh.ba.go b/internal/testbinapi/binapi2001/nsh/nsh.ba.go
new file mode 100644
index 0000000..75cb38a
--- /dev/null
+++ b/internal/testbinapi/binapi2001/nsh/nsh.ba.go
@@ -0,0 +1,730 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/nsh.api.json
+
+// Package nsh contains generated bindings for API file nsh.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 8 messages
+//
+package nsh
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "nsh"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xac2c8897
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// NshAddDelEntry defines message 'nsh_add_del_entry'.
+type NshAddDelEntry struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
+ MdType uint8 `binapi:"u8,name=md_type" json:"md_type,omitempty"`
+ VerOC uint8 `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
+ TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
+ Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
+ NextProtocol uint8 `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
+ C1 uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
+ C2 uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
+ C3 uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
+ C4 uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
+ TlvLength uint8 `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
+ Tlv []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
+}
+
+func (m *NshAddDelEntry) Reset() { *m = NshAddDelEntry{} }
+func (*NshAddDelEntry) GetMessageName() string { return "nsh_add_del_entry" }
+func (*NshAddDelEntry) GetCrcString() string { return "7dea480b" }
+func (*NshAddDelEntry) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NshAddDelEntry) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.NspNsi
+ size += 1 // m.MdType
+ size += 1 // m.VerOC
+ size += 1 // m.TTL
+ size += 1 // m.Length
+ size += 1 // m.NextProtocol
+ size += 4 // m.C1
+ size += 4 // m.C2
+ size += 4 // m.C3
+ size += 4 // m.C4
+ size += 1 // m.TlvLength
+ size += 1 * 248 // m.Tlv
+ return size
+}
+func (m *NshAddDelEntry) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.NspNsi = buf.DecodeUint32()
+ m.MdType = buf.DecodeUint8()
+ m.VerOC = buf.DecodeUint8()
+ m.TTL = buf.DecodeUint8()
+ m.Length = buf.DecodeUint8()
+ m.NextProtocol = buf.DecodeUint8()
+ m.C1 = buf.DecodeUint32()
+ m.C2 = buf.DecodeUint32()
+ m.C3 = buf.DecodeUint32()
+ m.C4 = buf.DecodeUint32()
+ m.TlvLength = buf.DecodeUint8()
+ m.Tlv = make([]byte, 248)
+ copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
+ return nil
+}
+
+// NshAddDelEntryReply defines message 'nsh_add_del_entry_reply'.
+type NshAddDelEntryReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
+}
+
+func (m *NshAddDelEntryReply) Reset() { *m = NshAddDelEntryReply{} }
+func (*NshAddDelEntryReply) GetMessageName() string { return "nsh_add_del_entry_reply" }
+func (*NshAddDelEntryReply) GetCrcString() string { return "6296a9eb" }
+func (*NshAddDelEntryReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NshAddDelEntryReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.EntryIndex
+ return size
+}
+func (m *NshAddDelEntryReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.EntryIndex = buf.DecodeUint32()
+ return nil
+}
+
+// NshAddDelMap defines message 'nsh_add_del_map'.
+type NshAddDelMap struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
+ MappedNspNsi uint32 `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
+ NshAction uint32 `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ RxSwIfIndex InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
+ NextNode uint32 `binapi:"u32,name=next_node" json:"next_node,omitempty"`
+}
+
+func (m *NshAddDelMap) Reset() { *m = NshAddDelMap{} }
+func (*NshAddDelMap) GetMessageName() string { return "nsh_add_del_map" }
+func (*NshAddDelMap) GetCrcString() string { return "898d857d" }
+func (*NshAddDelMap) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NshAddDelMap) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.NspNsi
+ size += 4 // m.MappedNspNsi
+ size += 4 // m.NshAction
+ size += 4 // m.SwIfIndex
+ size += 4 // m.RxSwIfIndex
+ size += 4 // m.NextNode
+ return size
+}
+func (m *NshAddDelMap) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(m.NspNsi)
+ buf.EncodeUint32(m.MappedNspNsi)
+ buf.EncodeUint32(m.NshAction)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.RxSwIfIndex))
+ buf.EncodeUint32(m.NextNode)
+ return buf.Bytes(), nil
+}
+func (m *NshAddDelMap) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.NspNsi = buf.DecodeUint32()
+ m.MappedNspNsi = buf.DecodeUint32()
+ m.NshAction = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.NextNode = buf.DecodeUint32()
+ return nil
+}
+
+// NshAddDelMapReply defines message 'nsh_add_del_map_reply'.
+type NshAddDelMapReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
+}
+
+func (m *NshAddDelMapReply) Reset() { *m = NshAddDelMapReply{} }
+func (*NshAddDelMapReply) GetMessageName() string { return "nsh_add_del_map_reply" }
+func (*NshAddDelMapReply) GetCrcString() string { return "b2b127ef" }
+func (*NshAddDelMapReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NshAddDelMapReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.MapIndex
+ return size
+}
+func (m *NshAddDelMapReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.MapIndex = buf.DecodeUint32()
+ return nil
+}
+
+// NshEntryDetails defines message 'nsh_entry_details'.
+type NshEntryDetails struct {
+ EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
+ NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
+ MdType uint8 `binapi:"u8,name=md_type" json:"md_type,omitempty"`
+ VerOC uint8 `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
+ TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
+ Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
+ NextProtocol uint8 `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
+ C1 uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
+ C2 uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
+ C3 uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
+ C4 uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
+ TlvLength uint8 `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
+ Tlv []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
+}
+
+func (m *NshEntryDetails) Reset() { *m = NshEntryDetails{} }
+func (*NshEntryDetails) GetMessageName() string { return "nsh_entry_details" }
+func (*NshEntryDetails) GetCrcString() string { return "046fb556" }
+func (*NshEntryDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NshEntryDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.EntryIndex
+ size += 4 // m.NspNsi
+ size += 1 // m.MdType
+ size += 1 // m.VerOC
+ size += 1 // m.TTL
+ size += 1 // m.Length
+ size += 1 // m.NextProtocol
+ size += 4 // m.C1
+ size += 4 // m.C2
+ size += 4 // m.C3
+ size += 4 // m.C4
+ size += 1 // m.TlvLength
+ size += 1 * 248 // m.Tlv
+ return size
+}
+func (m *NshEntryDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.EntryIndex = buf.DecodeUint32()
+ m.NspNsi = buf.DecodeUint32()
+ m.MdType = buf.DecodeUint8()
+ m.VerOC = buf.DecodeUint8()
+ m.TTL = buf.DecodeUint8()
+ m.Length = buf.DecodeUint8()
+ m.NextProtocol = buf.DecodeUint8()
+ m.C1 = buf.DecodeUint32()
+ m.C2 = buf.DecodeUint32()
+ m.C3 = buf.DecodeUint32()
+ m.C4 = buf.DecodeUint32()
+ m.TlvLength = buf.DecodeUint8()
+ m.Tlv = make([]byte, 248)
+ copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
+ return nil
+}
+
+// NshEntryDump defines message 'nsh_entry_dump'.
+type NshEntryDump struct {
+ EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
+}
+
+func (m *NshEntryDump) Reset() { *m = NshEntryDump{} }
+func (*NshEntryDump) GetMessageName() string { return "nsh_entry_dump" }
+func (*NshEntryDump) GetCrcString() string { return "cdaf8ccb" }
+func (*NshEntryDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NshEntryDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.EntryIndex
+ return size
+}
+func (m *NshEntryDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.EntryIndex)
+ return buf.Bytes(), nil
+}
+func (m *NshEntryDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EntryIndex = buf.DecodeUint32()
+ return nil
+}
+
+// NshMapDetails defines message 'nsh_map_details'.
+type NshMapDetails struct {
+ MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
+ NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
+ MappedNspNsi uint32 `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
+ NshAction uint32 `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ RxSwIfIndex InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
+ NextNode uint32 `binapi:"u32,name=next_node" json:"next_node,omitempty"`
+}
+
+func (m *NshMapDetails) Reset() { *m = NshMapDetails{} }
+func (*NshMapDetails) GetMessageName() string { return "nsh_map_details" }
+func (*NshMapDetails) GetCrcString() string { return "b34ac8a1" }
+func (*NshMapDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NshMapDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.MapIndex
+ size += 4 // m.NspNsi
+ size += 4 // m.MappedNspNsi
+ size += 4 // m.NshAction
+ size += 4 // m.SwIfIndex
+ size += 4 // m.RxSwIfIndex
+ size += 4 // m.NextNode
+ return size
+}
+func (m *NshMapDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(m.NextNode)
+ return buf.Bytes(), nil
+}
+func (m *NshMapDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MapIndex = buf.DecodeUint32()
+ m.NspNsi = buf.DecodeUint32()
+ m.MappedNspNsi = buf.DecodeUint32()
+ m.NshAction = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.NextNode = buf.DecodeUint32()
+ return nil
+}
+
+// NshMapDump defines message 'nsh_map_dump'.
+type NshMapDump struct {
+ MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
+}
+
+func (m *NshMapDump) Reset() { *m = NshMapDump{} }
+func (*NshMapDump) GetMessageName() string { return "nsh_map_dump" }
+func (*NshMapDump) GetCrcString() string { return "8fc06b82" }
+func (*NshMapDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NshMapDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.MapIndex
+ return size
+}
+func (m *NshMapDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.MapIndex)
+ return buf.Bytes(), nil
+}
+func (m *NshMapDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MapIndex = buf.DecodeUint32()
+ return nil
+}
+
+func init() { file_nsh_binapi_init() }
+func file_nsh_binapi_init() {
+ api.RegisterMessage((*NshAddDelEntry)(nil), "nsh_add_del_entry_7dea480b")
+ api.RegisterMessage((*NshAddDelEntryReply)(nil), "nsh_add_del_entry_reply_6296a9eb")
+ api.RegisterMessage((*NshAddDelMap)(nil), "nsh_add_del_map_898d857d")
+ api.RegisterMessage((*NshAddDelMapReply)(nil), "nsh_add_del_map_reply_b2b127ef")
+ api.RegisterMessage((*NshEntryDetails)(nil), "nsh_entry_details_046fb556")
+ api.RegisterMessage((*NshEntryDump)(nil), "nsh_entry_dump_cdaf8ccb")
+ api.RegisterMessage((*NshMapDetails)(nil), "nsh_map_details_b34ac8a1")
+ api.RegisterMessage((*NshMapDump)(nil), "nsh_map_dump_8fc06b82")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*NshAddDelEntry)(nil),
+ (*NshAddDelEntryReply)(nil),
+ (*NshAddDelMap)(nil),
+ (*NshAddDelMapReply)(nil),
+ (*NshEntryDetails)(nil),
+ (*NshEntryDump)(nil),
+ (*NshMapDetails)(nil),
+ (*NshMapDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/nsh/nsh_rpc.ba.go b/internal/testbinapi/binapi2001/nsh/nsh_rpc.ba.go
new file mode 100644
index 0000000..0c34e58
--- /dev/null
+++ b/internal/testbinapi/binapi2001/nsh/nsh_rpc.ba.go
@@ -0,0 +1,123 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package nsh
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service nsh.
+type RPCService interface {
+ NshAddDelEntry(ctx context.Context, in *NshAddDelEntry) (*NshAddDelEntryReply, error)
+ NshAddDelMap(ctx context.Context, in *NshAddDelMap) (*NshAddDelMapReply, error)
+ NshEntryDump(ctx context.Context, in *NshEntryDump) (RPCService_NshEntryDumpClient, error)
+ NshMapDump(ctx context.Context, in *NshMapDump) (RPCService_NshMapDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) NshAddDelEntry(ctx context.Context, in *NshAddDelEntry) (*NshAddDelEntryReply, error) {
+ out := new(NshAddDelEntryReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NshAddDelMap(ctx context.Context, in *NshAddDelMap) (*NshAddDelMapReply, error) {
+ out := new(NshAddDelMapReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NshEntryDump(ctx context.Context, in *NshEntryDump) (RPCService_NshEntryDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_NshEntryDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_NshEntryDumpClient interface {
+ Recv() (*NshEntryDetails, error)
+ api.Stream
+}
+
+type serviceClient_NshEntryDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_NshEntryDumpClient) Recv() (*NshEntryDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *NshEntryDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) NshMapDump(ctx context.Context, in *NshMapDump) (RPCService_NshMapDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_NshMapDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_NshMapDumpClient interface {
+ Recv() (*NshMapDetails, error)
+ api.Stream
+}
+
+type serviceClient_NshMapDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_NshMapDumpClient) Recv() (*NshMapDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *NshMapDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/nsim/nsim.ba.go b/internal/testbinapi/binapi2001/nsim/nsim.ba.go
new file mode 100644
index 0000000..4955164
--- /dev/null
+++ b/internal/testbinapi/binapi2001/nsim/nsim.ba.go
@@ -0,0 +1,538 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/nsim.api.json
+
+// Package nsim contains generated bindings for API file nsim.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 6 messages
+//
+package nsim
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "nsim"
+ APIVersion = "2.1.1"
+ VersionCrc = 0xd61e346f
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// NsimConfigure defines message 'nsim_configure'.
+type NsimConfigure struct {
+ DelayInUsec uint32 `binapi:"u32,name=delay_in_usec" json:"delay_in_usec,omitempty"`
+ AveragePacketSize uint32 `binapi:"u32,name=average_packet_size" json:"average_packet_size,omitempty"`
+ BandwidthInBitsPerSecond uint64 `binapi:"u64,name=bandwidth_in_bits_per_second" json:"bandwidth_in_bits_per_second,omitempty"`
+ PacketsPerDrop uint32 `binapi:"u32,name=packets_per_drop" json:"packets_per_drop,omitempty"`
+}
+
+func (m *NsimConfigure) Reset() { *m = NsimConfigure{} }
+func (*NsimConfigure) GetMessageName() string { return "nsim_configure" }
+func (*NsimConfigure) GetCrcString() string { return "16ed400f" }
+func (*NsimConfigure) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NsimConfigure) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.DelayInUsec
+ size += 4 // m.AveragePacketSize
+ size += 8 // m.BandwidthInBitsPerSecond
+ size += 4 // m.PacketsPerDrop
+ return size
+}
+func (m *NsimConfigure) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.DelayInUsec = buf.DecodeUint32()
+ m.AveragePacketSize = buf.DecodeUint32()
+ m.BandwidthInBitsPerSecond = buf.DecodeUint64()
+ m.PacketsPerDrop = buf.DecodeUint32()
+ return nil
+}
+
+// NsimConfigureReply defines message 'nsim_configure_reply'.
+type NsimConfigureReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NsimConfigureReply) Reset() { *m = NsimConfigureReply{} }
+func (*NsimConfigureReply) GetMessageName() string { return "nsim_configure_reply" }
+func (*NsimConfigureReply) GetCrcString() string { return "e8d4e804" }
+func (*NsimConfigureReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NsimConfigureReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NsimConfigureReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NsimCrossConnectEnableDisable defines message 'nsim_cross_connect_enable_disable'.
+type NsimCrossConnectEnableDisable struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ SwIfIndex0 InterfaceIndex `binapi:"interface_index,name=sw_if_index0" json:"sw_if_index0,omitempty"`
+ SwIfIndex1 InterfaceIndex `binapi:"interface_index,name=sw_if_index1" json:"sw_if_index1,omitempty"`
+}
+
+func (m *NsimCrossConnectEnableDisable) Reset() { *m = NsimCrossConnectEnableDisable{} }
+func (*NsimCrossConnectEnableDisable) GetMessageName() string {
+ return "nsim_cross_connect_enable_disable"
+}
+func (*NsimCrossConnectEnableDisable) GetCrcString() string { return "16f70bdf" }
+func (*NsimCrossConnectEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NsimCrossConnectEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ size += 4 // m.SwIfIndex0
+ size += 4 // m.SwIfIndex1
+ return size
+}
+func (m *NsimCrossConnectEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeUint32(uint32(m.SwIfIndex0))
+ buf.EncodeUint32(uint32(m.SwIfIndex1))
+ return buf.Bytes(), nil
+}
+func (m *NsimCrossConnectEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ m.SwIfIndex0 = InterfaceIndex(buf.DecodeUint32())
+ m.SwIfIndex1 = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// NsimCrossConnectEnableDisableReply defines message 'nsim_cross_connect_enable_disable_reply'.
+type NsimCrossConnectEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NsimCrossConnectEnableDisableReply) Reset() { *m = NsimCrossConnectEnableDisableReply{} }
+func (*NsimCrossConnectEnableDisableReply) GetMessageName() string {
+ return "nsim_cross_connect_enable_disable_reply"
+}
+func (*NsimCrossConnectEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*NsimCrossConnectEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NsimCrossConnectEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NsimCrossConnectEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// NsimOutputFeatureEnableDisable defines message 'nsim_output_feature_enable_disable'.
+type NsimOutputFeatureEnableDisable struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *NsimOutputFeatureEnableDisable) Reset() { *m = NsimOutputFeatureEnableDisable{} }
+func (*NsimOutputFeatureEnableDisable) GetMessageName() string {
+ return "nsim_output_feature_enable_disable"
+}
+func (*NsimOutputFeatureEnableDisable) GetCrcString() string { return "3865946c" }
+func (*NsimOutputFeatureEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *NsimOutputFeatureEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *NsimOutputFeatureEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *NsimOutputFeatureEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// NsimOutputFeatureEnableDisableReply defines message 'nsim_output_feature_enable_disable_reply'.
+type NsimOutputFeatureEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *NsimOutputFeatureEnableDisableReply) Reset() { *m = NsimOutputFeatureEnableDisableReply{} }
+func (*NsimOutputFeatureEnableDisableReply) GetMessageName() string {
+ return "nsim_output_feature_enable_disable_reply"
+}
+func (*NsimOutputFeatureEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*NsimOutputFeatureEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *NsimOutputFeatureEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *NsimOutputFeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_nsim_binapi_init() }
+func file_nsim_binapi_init() {
+ api.RegisterMessage((*NsimConfigure)(nil), "nsim_configure_16ed400f")
+ api.RegisterMessage((*NsimConfigureReply)(nil), "nsim_configure_reply_e8d4e804")
+ api.RegisterMessage((*NsimCrossConnectEnableDisable)(nil), "nsim_cross_connect_enable_disable_16f70bdf")
+ api.RegisterMessage((*NsimCrossConnectEnableDisableReply)(nil), "nsim_cross_connect_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*NsimOutputFeatureEnableDisable)(nil), "nsim_output_feature_enable_disable_3865946c")
+ api.RegisterMessage((*NsimOutputFeatureEnableDisableReply)(nil), "nsim_output_feature_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*NsimConfigure)(nil),
+ (*NsimConfigureReply)(nil),
+ (*NsimCrossConnectEnableDisable)(nil),
+ (*NsimCrossConnectEnableDisableReply)(nil),
+ (*NsimOutputFeatureEnableDisable)(nil),
+ (*NsimOutputFeatureEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/nsim/nsim_rpc.ba.go b/internal/testbinapi/binapi2001/nsim/nsim_rpc.ba.go
new file mode 100644
index 0000000..f35e6b3
--- /dev/null
+++ b/internal/testbinapi/binapi2001/nsim/nsim_rpc.ba.go
@@ -0,0 +1,50 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package nsim
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service nsim.
+type RPCService interface {
+ NsimConfigure(ctx context.Context, in *NsimConfigure) (*NsimConfigureReply, error)
+ NsimCrossConnectEnableDisable(ctx context.Context, in *NsimCrossConnectEnableDisable) (*NsimCrossConnectEnableDisableReply, error)
+ NsimOutputFeatureEnableDisable(ctx context.Context, in *NsimOutputFeatureEnableDisable) (*NsimOutputFeatureEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) NsimConfigure(ctx context.Context, in *NsimConfigure) (*NsimConfigureReply, error) {
+ out := new(NsimConfigureReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NsimCrossConnectEnableDisable(ctx context.Context, in *NsimCrossConnectEnableDisable) (*NsimCrossConnectEnableDisableReply, error) {
+ out := new(NsimCrossConnectEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) NsimOutputFeatureEnableDisable(ctx context.Context, in *NsimOutputFeatureEnableDisable) (*NsimOutputFeatureEnableDisableReply, error) {
+ out := new(NsimOutputFeatureEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/oddbuf/oddbuf.ba.go b/internal/testbinapi/binapi2001/oddbuf/oddbuf.ba.go
new file mode 100644
index 0000000..c2b3e5e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/oddbuf/oddbuf.ba.go
@@ -0,0 +1,370 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/oddbuf.api.json
+
+// Package oddbuf contains generated bindings for API file oddbuf.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 2 messages
+//
+package oddbuf
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "oddbuf"
+ APIVersion = "0.1.0"
+ VersionCrc = 0x570f3132
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// OddbufEnableDisable defines message 'oddbuf_enable_disable'.
+type OddbufEnableDisable struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *OddbufEnableDisable) Reset() { *m = OddbufEnableDisable{} }
+func (*OddbufEnableDisable) GetMessageName() string { return "oddbuf_enable_disable" }
+func (*OddbufEnableDisable) GetCrcString() string { return "3865946c" }
+func (*OddbufEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OddbufEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EnableDisable
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *OddbufEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *OddbufEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// OddbufEnableDisableReply defines message 'oddbuf_enable_disable_reply'.
+type OddbufEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OddbufEnableDisableReply) Reset() { *m = OddbufEnableDisableReply{} }
+func (*OddbufEnableDisableReply) GetMessageName() string { return "oddbuf_enable_disable_reply" }
+func (*OddbufEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*OddbufEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OddbufEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OddbufEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_oddbuf_binapi_init() }
+func file_oddbuf_binapi_init() {
+ api.RegisterMessage((*OddbufEnableDisable)(nil), "oddbuf_enable_disable_3865946c")
+ api.RegisterMessage((*OddbufEnableDisableReply)(nil), "oddbuf_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*OddbufEnableDisable)(nil),
+ (*OddbufEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/oddbuf/oddbuf_rpc.ba.go b/internal/testbinapi/binapi2001/oddbuf/oddbuf_rpc.ba.go
new file mode 100644
index 0000000..a8c245e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/oddbuf/oddbuf_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package oddbuf
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service oddbuf.
+type RPCService interface {
+ OddbufEnableDisable(ctx context.Context, in *OddbufEnableDisable) (*OddbufEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) OddbufEnableDisable(ctx context.Context, in *OddbufEnableDisable) (*OddbufEnableDisableReply, error) {
+ out := new(OddbufEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/one/one.ba.go b/internal/testbinapi/binapi2001/one/one.ba.go
new file mode 100644
index 0000000..a121d94
--- /dev/null
+++ b/internal/testbinapi/binapi2001/one/one.ba.go
@@ -0,0 +1,4408 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/one.api.json
+
+// Package one contains generated bindings for API file one.api.
+//
+// Contents:
+// 5 structs
+// 108 messages
+//
+package one
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "one"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xde9891c3
+)
+
+// OneAdjacency defines type 'one_adjacency'.
+type OneAdjacency struct {
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Reid []byte `binapi:"u8[16],name=reid" json:"reid,omitempty"`
+ Leid []byte `binapi:"u8[16],name=leid" json:"leid,omitempty"`
+ ReidPrefixLen uint8 `binapi:"u8,name=reid_prefix_len" json:"reid_prefix_len,omitempty"`
+ LeidPrefixLen uint8 `binapi:"u8,name=leid_prefix_len" json:"leid_prefix_len,omitempty"`
+}
+
+// OneL2ArpEntry defines type 'one_l2_arp_entry'.
+type OneL2ArpEntry struct {
+ Mac []byte `binapi:"u8[6],name=mac" json:"mac,omitempty"`
+ IP4 uint32 `binapi:"u32,name=ip4" json:"ip4,omitempty"`
+}
+
+// OneLocalLocator defines type 'one_local_locator'.
+type OneLocalLocator struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+}
+
+// OneNdpEntry defines type 'one_ndp_entry'.
+type OneNdpEntry struct {
+ Mac []byte `binapi:"u8[6],name=mac" json:"mac,omitempty"`
+ IP6 []byte `binapi:"u8[16],name=ip6" json:"ip6,omitempty"`
+}
+
+// OneRemoteLocator defines type 'one_remote_locator'.
+type OneRemoteLocator struct {
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+ Addr []byte `binapi:"u8[16],name=addr" json:"addr,omitempty"`
+}
+
+// OneAddDelAdjacency defines message 'one_add_del_adjacency'.
+type OneAddDelAdjacency struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Reid []byte `binapi:"u8[16],name=reid" json:"reid,omitempty"`
+ Leid []byte `binapi:"u8[16],name=leid" json:"leid,omitempty"`
+ ReidLen uint8 `binapi:"u8,name=reid_len" json:"reid_len,omitempty"`
+ LeidLen uint8 `binapi:"u8,name=leid_len" json:"leid_len,omitempty"`
+}
+
+func (m *OneAddDelAdjacency) Reset() { *m = OneAddDelAdjacency{} }
+func (*OneAddDelAdjacency) GetMessageName() string { return "one_add_del_adjacency" }
+func (*OneAddDelAdjacency) GetCrcString() string { return "f047390d" }
+func (*OneAddDelAdjacency) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelAdjacency) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Vni
+ size += 1 // m.EidType
+ size += 1 * 16 // m.Reid
+ size += 1 * 16 // m.Leid
+ size += 1 // m.ReidLen
+ size += 1 // m.LeidLen
+ return size
+}
+func (m *OneAddDelAdjacency) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.Reid, 16)
+ buf.EncodeBytes(m.Leid, 16)
+ buf.EncodeUint8(m.ReidLen)
+ buf.EncodeUint8(m.LeidLen)
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelAdjacency) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.EidType = buf.DecodeUint8()
+ m.Reid = make([]byte, 16)
+ copy(m.Reid, buf.DecodeBytes(len(m.Reid)))
+ m.Leid = make([]byte, 16)
+ copy(m.Leid, buf.DecodeBytes(len(m.Leid)))
+ m.ReidLen = buf.DecodeUint8()
+ m.LeidLen = buf.DecodeUint8()
+ return nil
+}
+
+// OneAddDelAdjacencyReply defines message 'one_add_del_adjacency_reply'.
+type OneAddDelAdjacencyReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneAddDelAdjacencyReply) Reset() { *m = OneAddDelAdjacencyReply{} }
+func (*OneAddDelAdjacencyReply) GetMessageName() string { return "one_add_del_adjacency_reply" }
+func (*OneAddDelAdjacencyReply) GetCrcString() string { return "e8d4e804" }
+func (*OneAddDelAdjacencyReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelAdjacencyReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneAddDelAdjacencyReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneAddDelL2ArpEntry defines message 'one_add_del_l2_arp_entry'.
+type OneAddDelL2ArpEntry struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Mac []byte `binapi:"u8[6],name=mac" json:"mac,omitempty"`
+ Bd uint32 `binapi:"u32,name=bd" json:"bd,omitempty"`
+ IP4 uint32 `binapi:"u32,name=ip4" json:"ip4,omitempty"`
+}
+
+func (m *OneAddDelL2ArpEntry) Reset() { *m = OneAddDelL2ArpEntry{} }
+func (*OneAddDelL2ArpEntry) GetMessageName() string { return "one_add_del_l2_arp_entry" }
+func (*OneAddDelL2ArpEntry) GetCrcString() string { return "a95cc2d7" }
+func (*OneAddDelL2ArpEntry) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelL2ArpEntry) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 6 // m.Mac
+ size += 4 // m.Bd
+ size += 4 // m.IP4
+ return size
+}
+func (m *OneAddDelL2ArpEntry) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.Mac, 6)
+ buf.EncodeUint32(m.Bd)
+ buf.EncodeUint32(m.IP4)
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelL2ArpEntry) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Mac = make([]byte, 6)
+ copy(m.Mac, buf.DecodeBytes(len(m.Mac)))
+ m.Bd = buf.DecodeUint32()
+ m.IP4 = buf.DecodeUint32()
+ return nil
+}
+
+// OneAddDelL2ArpEntryReply defines message 'one_add_del_l2_arp_entry_reply'.
+type OneAddDelL2ArpEntryReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneAddDelL2ArpEntryReply) Reset() { *m = OneAddDelL2ArpEntryReply{} }
+func (*OneAddDelL2ArpEntryReply) GetMessageName() string { return "one_add_del_l2_arp_entry_reply" }
+func (*OneAddDelL2ArpEntryReply) GetCrcString() string { return "e8d4e804" }
+func (*OneAddDelL2ArpEntryReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelL2ArpEntryReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneAddDelL2ArpEntryReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneAddDelLocalEid defines message 'one_add_del_local_eid'.
+type OneAddDelLocalEid struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Eid []byte `binapi:"u8[16],name=eid" json:"eid,omitempty"`
+ PrefixLen uint8 `binapi:"u8,name=prefix_len" json:"prefix_len,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ KeyID uint16 `binapi:"u16,name=key_id" json:"key_id,omitempty"`
+ Key []byte `binapi:"u8[64],name=key" json:"key,omitempty"`
+}
+
+func (m *OneAddDelLocalEid) Reset() { *m = OneAddDelLocalEid{} }
+func (*OneAddDelLocalEid) GetMessageName() string { return "one_add_del_local_eid" }
+func (*OneAddDelLocalEid) GetCrcString() string { return "e6d00717" }
+func (*OneAddDelLocalEid) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelLocalEid) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.EidType
+ size += 1 * 16 // m.Eid
+ size += 1 // m.PrefixLen
+ size += 1 * 64 // m.LocatorSetName
+ size += 4 // m.Vni
+ size += 2 // m.KeyID
+ size += 1 * 64 // m.Key
+ return size
+}
+func (m *OneAddDelLocalEid) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.Eid, 16)
+ buf.EncodeUint8(m.PrefixLen)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint16(m.KeyID)
+ buf.EncodeBytes(m.Key, 64)
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelLocalEid) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.EidType = buf.DecodeUint8()
+ m.Eid = make([]byte, 16)
+ copy(m.Eid, buf.DecodeBytes(len(m.Eid)))
+ m.PrefixLen = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ m.Vni = buf.DecodeUint32()
+ m.KeyID = buf.DecodeUint16()
+ m.Key = make([]byte, 64)
+ copy(m.Key, buf.DecodeBytes(len(m.Key)))
+ return nil
+}
+
+// OneAddDelLocalEidReply defines message 'one_add_del_local_eid_reply'.
+type OneAddDelLocalEidReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneAddDelLocalEidReply) Reset() { *m = OneAddDelLocalEidReply{} }
+func (*OneAddDelLocalEidReply) GetMessageName() string { return "one_add_del_local_eid_reply" }
+func (*OneAddDelLocalEidReply) GetCrcString() string { return "e8d4e804" }
+func (*OneAddDelLocalEidReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelLocalEidReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneAddDelLocalEidReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneAddDelLocator defines message 'one_add_del_locator'.
+type OneAddDelLocator struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+}
+
+func (m *OneAddDelLocator) Reset() { *m = OneAddDelLocator{} }
+func (*OneAddDelLocator) GetMessageName() string { return "one_add_del_locator" }
+func (*OneAddDelLocator) GetCrcString() string { return "006a4240" }
+func (*OneAddDelLocator) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelLocator) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.LocatorSetName
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Priority
+ size += 1 // m.Weight
+ return size
+}
+func (m *OneAddDelLocator) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.Priority)
+ buf.EncodeUint8(m.Weight)
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelLocator) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Priority = buf.DecodeUint8()
+ m.Weight = buf.DecodeUint8()
+ return nil
+}
+
+// OneAddDelLocatorReply defines message 'one_add_del_locator_reply'.
+type OneAddDelLocatorReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneAddDelLocatorReply) Reset() { *m = OneAddDelLocatorReply{} }
+func (*OneAddDelLocatorReply) GetMessageName() string { return "one_add_del_locator_reply" }
+func (*OneAddDelLocatorReply) GetCrcString() string { return "e8d4e804" }
+func (*OneAddDelLocatorReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelLocatorReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneAddDelLocatorReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneAddDelLocatorSet defines message 'one_add_del_locator_set'.
+type OneAddDelLocatorSet struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+ LocatorNum uint32 `binapi:"u32,name=locator_num" json:"-"`
+ Locators []OneLocalLocator `binapi:"one_local_locator[locator_num],name=locators" json:"locators,omitempty"`
+}
+
+func (m *OneAddDelLocatorSet) Reset() { *m = OneAddDelLocatorSet{} }
+func (*OneAddDelLocatorSet) GetMessageName() string { return "one_add_del_locator_set" }
+func (*OneAddDelLocatorSet) GetCrcString() string { return "2e73b050" }
+func (*OneAddDelLocatorSet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelLocatorSet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.LocatorSetName
+ size += 4 // m.LocatorNum
+ for j1 := 0; j1 < len(m.Locators); j1++ {
+ var s1 OneLocalLocator
+ _ = s1
+ if j1 < len(m.Locators) {
+ s1 = m.Locators[j1]
+ }
+ size += 4 // s1.SwIfIndex
+ size += 1 // s1.Priority
+ size += 1 // s1.Weight
+ }
+ return size
+}
+func (m *OneAddDelLocatorSet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ buf.EncodeUint32(uint32(len(m.Locators)))
+ for j0 := 0; j0 < len(m.Locators); j0++ {
+ var v0 OneLocalLocator // Locators
+ if j0 < len(m.Locators) {
+ v0 = m.Locators[j0]
+ }
+ buf.EncodeUint32(v0.SwIfIndex)
+ buf.EncodeUint8(v0.Priority)
+ buf.EncodeUint8(v0.Weight)
+ }
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelLocatorSet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ m.LocatorNum = buf.DecodeUint32()
+ m.Locators = make([]OneLocalLocator, m.LocatorNum)
+ for j0 := 0; j0 < len(m.Locators); j0++ {
+ m.Locators[j0].SwIfIndex = buf.DecodeUint32()
+ m.Locators[j0].Priority = buf.DecodeUint8()
+ m.Locators[j0].Weight = buf.DecodeUint8()
+ }
+ return nil
+}
+
+// OneAddDelLocatorSetReply defines message 'one_add_del_locator_set_reply'.
+type OneAddDelLocatorSetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ LsIndex uint32 `binapi:"u32,name=ls_index" json:"ls_index,omitempty"`
+}
+
+func (m *OneAddDelLocatorSetReply) Reset() { *m = OneAddDelLocatorSetReply{} }
+func (*OneAddDelLocatorSetReply) GetMessageName() string { return "one_add_del_locator_set_reply" }
+func (*OneAddDelLocatorSetReply) GetCrcString() string { return "b6666db4" }
+func (*OneAddDelLocatorSetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelLocatorSetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.LsIndex
+ return size
+}
+func (m *OneAddDelLocatorSetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.LsIndex = buf.DecodeUint32()
+ return nil
+}
+
+// OneAddDelMapRequestItrRlocs defines message 'one_add_del_map_request_itr_rlocs'.
+type OneAddDelMapRequestItrRlocs struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+}
+
+func (m *OneAddDelMapRequestItrRlocs) Reset() { *m = OneAddDelMapRequestItrRlocs{} }
+func (*OneAddDelMapRequestItrRlocs) GetMessageName() string {
+ return "one_add_del_map_request_itr_rlocs"
+}
+func (*OneAddDelMapRequestItrRlocs) GetCrcString() string { return "c7c6cb2f" }
+func (*OneAddDelMapRequestItrRlocs) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelMapRequestItrRlocs) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.LocatorSetName
+ return size
+}
+func (m *OneAddDelMapRequestItrRlocs) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelMapRequestItrRlocs) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ return nil
+}
+
+// OneAddDelMapRequestItrRlocsReply defines message 'one_add_del_map_request_itr_rlocs_reply'.
+type OneAddDelMapRequestItrRlocsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneAddDelMapRequestItrRlocsReply) Reset() { *m = OneAddDelMapRequestItrRlocsReply{} }
+func (*OneAddDelMapRequestItrRlocsReply) GetMessageName() string {
+ return "one_add_del_map_request_itr_rlocs_reply"
+}
+func (*OneAddDelMapRequestItrRlocsReply) GetCrcString() string { return "e8d4e804" }
+func (*OneAddDelMapRequestItrRlocsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelMapRequestItrRlocsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneAddDelMapRequestItrRlocsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneAddDelMapResolver defines message 'one_add_del_map_resolver'.
+type OneAddDelMapResolver struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+}
+
+func (m *OneAddDelMapResolver) Reset() { *m = OneAddDelMapResolver{} }
+func (*OneAddDelMapResolver) GetMessageName() string { return "one_add_del_map_resolver" }
+func (*OneAddDelMapResolver) GetCrcString() string { return "0ebcd37d" }
+func (*OneAddDelMapResolver) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelMapResolver) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ return size
+}
+func (m *OneAddDelMapResolver) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelMapResolver) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ return nil
+}
+
+// OneAddDelMapResolverReply defines message 'one_add_del_map_resolver_reply'.
+type OneAddDelMapResolverReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneAddDelMapResolverReply) Reset() { *m = OneAddDelMapResolverReply{} }
+func (*OneAddDelMapResolverReply) GetMessageName() string { return "one_add_del_map_resolver_reply" }
+func (*OneAddDelMapResolverReply) GetCrcString() string { return "e8d4e804" }
+func (*OneAddDelMapResolverReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelMapResolverReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneAddDelMapResolverReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneAddDelMapServer defines message 'one_add_del_map_server'.
+type OneAddDelMapServer struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+}
+
+func (m *OneAddDelMapServer) Reset() { *m = OneAddDelMapServer{} }
+func (*OneAddDelMapServer) GetMessageName() string { return "one_add_del_map_server" }
+func (*OneAddDelMapServer) GetCrcString() string { return "0ebcd37d" }
+func (*OneAddDelMapServer) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelMapServer) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ return size
+}
+func (m *OneAddDelMapServer) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelMapServer) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ return nil
+}
+
+// OneAddDelMapServerReply defines message 'one_add_del_map_server_reply'.
+type OneAddDelMapServerReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneAddDelMapServerReply) Reset() { *m = OneAddDelMapServerReply{} }
+func (*OneAddDelMapServerReply) GetMessageName() string { return "one_add_del_map_server_reply" }
+func (*OneAddDelMapServerReply) GetCrcString() string { return "e8d4e804" }
+func (*OneAddDelMapServerReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelMapServerReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneAddDelMapServerReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneAddDelNdpEntry defines message 'one_add_del_ndp_entry'.
+type OneAddDelNdpEntry struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Mac []byte `binapi:"u8[6],name=mac" json:"mac,omitempty"`
+ Bd uint32 `binapi:"u32,name=bd" json:"bd,omitempty"`
+ IP6 []byte `binapi:"u8[16],name=ip6" json:"ip6,omitempty"`
+}
+
+func (m *OneAddDelNdpEntry) Reset() { *m = OneAddDelNdpEntry{} }
+func (*OneAddDelNdpEntry) GetMessageName() string { return "one_add_del_ndp_entry" }
+func (*OneAddDelNdpEntry) GetCrcString() string { return "e9468fe3" }
+func (*OneAddDelNdpEntry) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelNdpEntry) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 6 // m.Mac
+ size += 4 // m.Bd
+ size += 1 * 16 // m.IP6
+ return size
+}
+func (m *OneAddDelNdpEntry) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.Mac, 6)
+ buf.EncodeUint32(m.Bd)
+ buf.EncodeBytes(m.IP6, 16)
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelNdpEntry) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Mac = make([]byte, 6)
+ copy(m.Mac, buf.DecodeBytes(len(m.Mac)))
+ m.Bd = buf.DecodeUint32()
+ m.IP6 = make([]byte, 16)
+ copy(m.IP6, buf.DecodeBytes(len(m.IP6)))
+ return nil
+}
+
+// OneAddDelNdpEntryReply defines message 'one_add_del_ndp_entry_reply'.
+type OneAddDelNdpEntryReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneAddDelNdpEntryReply) Reset() { *m = OneAddDelNdpEntryReply{} }
+func (*OneAddDelNdpEntryReply) GetMessageName() string { return "one_add_del_ndp_entry_reply" }
+func (*OneAddDelNdpEntryReply) GetCrcString() string { return "e8d4e804" }
+func (*OneAddDelNdpEntryReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelNdpEntryReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneAddDelNdpEntryReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneAddDelRemoteMapping defines message 'one_add_del_remote_mapping'.
+type OneAddDelRemoteMapping struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ IsSrcDst uint8 `binapi:"u8,name=is_src_dst" json:"is_src_dst,omitempty"`
+ DelAll uint8 `binapi:"u8,name=del_all" json:"del_all,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ Action uint8 `binapi:"u8,name=action" json:"action,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Eid []byte `binapi:"u8[16],name=eid" json:"eid,omitempty"`
+ EidLen uint8 `binapi:"u8,name=eid_len" json:"eid_len,omitempty"`
+ Seid []byte `binapi:"u8[16],name=seid" json:"seid,omitempty"`
+ SeidLen uint8 `binapi:"u8,name=seid_len" json:"seid_len,omitempty"`
+ RlocNum uint32 `binapi:"u32,name=rloc_num" json:"-"`
+ Rlocs []OneRemoteLocator `binapi:"one_remote_locator[rloc_num],name=rlocs" json:"rlocs,omitempty"`
+}
+
+func (m *OneAddDelRemoteMapping) Reset() { *m = OneAddDelRemoteMapping{} }
+func (*OneAddDelRemoteMapping) GetMessageName() string { return "one_add_del_remote_mapping" }
+func (*OneAddDelRemoteMapping) GetCrcString() string { return "0b2010ec" }
+func (*OneAddDelRemoteMapping) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAddDelRemoteMapping) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.IsSrcDst
+ size += 1 // m.DelAll
+ size += 4 // m.Vni
+ size += 1 // m.Action
+ size += 1 // m.EidType
+ size += 1 * 16 // m.Eid
+ size += 1 // m.EidLen
+ size += 1 * 16 // m.Seid
+ size += 1 // m.SeidLen
+ size += 4 // m.RlocNum
+ for j1 := 0; j1 < len(m.Rlocs); j1++ {
+ var s1 OneRemoteLocator
+ _ = s1
+ if j1 < len(m.Rlocs) {
+ s1 = m.Rlocs[j1]
+ }
+ size += 1 // s1.IsIP4
+ size += 1 // s1.Priority
+ size += 1 // s1.Weight
+ size += 1 * 16 // s1.Addr
+ }
+ return size
+}
+func (m *OneAddDelRemoteMapping) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.IsSrcDst)
+ buf.EncodeUint8(m.DelAll)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.Action)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.Eid, 16)
+ buf.EncodeUint8(m.EidLen)
+ buf.EncodeBytes(m.Seid, 16)
+ buf.EncodeUint8(m.SeidLen)
+ buf.EncodeUint32(uint32(len(m.Rlocs)))
+ for j0 := 0; j0 < len(m.Rlocs); j0++ {
+ var v0 OneRemoteLocator // Rlocs
+ if j0 < len(m.Rlocs) {
+ v0 = m.Rlocs[j0]
+ }
+ buf.EncodeUint8(v0.IsIP4)
+ buf.EncodeUint8(v0.Priority)
+ buf.EncodeUint8(v0.Weight)
+ buf.EncodeBytes(v0.Addr, 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *OneAddDelRemoteMapping) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.IsSrcDst = buf.DecodeUint8()
+ m.DelAll = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.Action = buf.DecodeUint8()
+ m.EidType = buf.DecodeUint8()
+ m.Eid = make([]byte, 16)
+ copy(m.Eid, buf.DecodeBytes(len(m.Eid)))
+ m.EidLen = buf.DecodeUint8()
+ m.Seid = make([]byte, 16)
+ copy(m.Seid, buf.DecodeBytes(len(m.Seid)))
+ m.SeidLen = buf.DecodeUint8()
+ m.RlocNum = buf.DecodeUint32()
+ m.Rlocs = make([]OneRemoteLocator, m.RlocNum)
+ for j0 := 0; j0 < len(m.Rlocs); j0++ {
+ m.Rlocs[j0].IsIP4 = buf.DecodeUint8()
+ m.Rlocs[j0].Priority = buf.DecodeUint8()
+ m.Rlocs[j0].Weight = buf.DecodeUint8()
+ m.Rlocs[j0].Addr = make([]byte, 16)
+ copy(m.Rlocs[j0].Addr, buf.DecodeBytes(len(m.Rlocs[j0].Addr)))
+ }
+ return nil
+}
+
+// OneAddDelRemoteMappingReply defines message 'one_add_del_remote_mapping_reply'.
+type OneAddDelRemoteMappingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneAddDelRemoteMappingReply) Reset() { *m = OneAddDelRemoteMappingReply{} }
+func (*OneAddDelRemoteMappingReply) GetMessageName() string {
+ return "one_add_del_remote_mapping_reply"
+}
+func (*OneAddDelRemoteMappingReply) GetCrcString() string { return "e8d4e804" }
+func (*OneAddDelRemoteMappingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAddDelRemoteMappingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneAddDelRemoteMappingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneAdjacenciesGet defines message 'one_adjacencies_get'.
+type OneAdjacenciesGet struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *OneAdjacenciesGet) Reset() { *m = OneAdjacenciesGet{} }
+func (*OneAdjacenciesGet) GetMessageName() string { return "one_adjacencies_get" }
+func (*OneAdjacenciesGet) GetCrcString() string { return "8d1f2fe9" }
+func (*OneAdjacenciesGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneAdjacenciesGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ return size
+}
+func (m *OneAdjacenciesGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *OneAdjacenciesGet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// OneAdjacenciesGetReply defines message 'one_adjacencies_get_reply'.
+type OneAdjacenciesGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ Adjacencies []OneAdjacency `binapi:"one_adjacency[count],name=adjacencies" json:"adjacencies,omitempty"`
+}
+
+func (m *OneAdjacenciesGetReply) Reset() { *m = OneAdjacenciesGetReply{} }
+func (*OneAdjacenciesGetReply) GetMessageName() string { return "one_adjacencies_get_reply" }
+func (*OneAdjacenciesGetReply) GetCrcString() string { return "60a3c592" }
+func (*OneAdjacenciesGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneAdjacenciesGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Count
+ for j1 := 0; j1 < len(m.Adjacencies); j1++ {
+ var s1 OneAdjacency
+ _ = s1
+ if j1 < len(m.Adjacencies) {
+ s1 = m.Adjacencies[j1]
+ }
+ size += 1 // s1.EidType
+ size += 1 * 16 // s1.Reid
+ size += 1 * 16 // s1.Leid
+ size += 1 // s1.ReidPrefixLen
+ size += 1 // s1.LeidPrefixLen
+ }
+ return size
+}
+func (m *OneAdjacenciesGetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 // Adjacencies
+ if j0 < len(m.Adjacencies) {
+ v0 = m.Adjacencies[j0]
+ }
+ buf.EncodeUint8(v0.EidType)
+ buf.EncodeBytes(v0.Reid, 16)
+ buf.EncodeBytes(v0.Leid, 16)
+ buf.EncodeUint8(v0.ReidPrefixLen)
+ buf.EncodeUint8(v0.LeidPrefixLen)
+ }
+ return buf.Bytes(), nil
+}
+func (m *OneAdjacenciesGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.Adjacencies = make([]OneAdjacency, m.Count)
+ for j0 := 0; j0 < len(m.Adjacencies); j0++ {
+ m.Adjacencies[j0].EidType = buf.DecodeUint8()
+ m.Adjacencies[j0].Reid = make([]byte, 16)
+ copy(m.Adjacencies[j0].Reid, buf.DecodeBytes(len(m.Adjacencies[j0].Reid)))
+ m.Adjacencies[j0].Leid = make([]byte, 16)
+ copy(m.Adjacencies[j0].Leid, buf.DecodeBytes(len(m.Adjacencies[j0].Leid)))
+ m.Adjacencies[j0].ReidPrefixLen = buf.DecodeUint8()
+ m.Adjacencies[j0].LeidPrefixLen = buf.DecodeUint8()
+ }
+ return nil
+}
+
+// OneEidTableAddDelMap defines message 'one_eid_table_add_del_map'.
+type OneEidTableAddDelMap struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"`
+ IsL2 uint8 `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
+}
+
+func (m *OneEidTableAddDelMap) Reset() { *m = OneEidTableAddDelMap{} }
+func (*OneEidTableAddDelMap) GetMessageName() string { return "one_eid_table_add_del_map" }
+func (*OneEidTableAddDelMap) GetCrcString() string { return "59e9975e" }
+func (*OneEidTableAddDelMap) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneEidTableAddDelMap) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Vni
+ size += 4 // m.DpTable
+ size += 1 // m.IsL2
+ return size
+}
+func (m *OneEidTableAddDelMap) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint32(m.DpTable)
+ buf.EncodeUint8(m.IsL2)
+ return buf.Bytes(), nil
+}
+func (m *OneEidTableAddDelMap) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.DpTable = buf.DecodeUint32()
+ m.IsL2 = buf.DecodeUint8()
+ return nil
+}
+
+// OneEidTableAddDelMapReply defines message 'one_eid_table_add_del_map_reply'.
+type OneEidTableAddDelMapReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneEidTableAddDelMapReply) Reset() { *m = OneEidTableAddDelMapReply{} }
+func (*OneEidTableAddDelMapReply) GetMessageName() string { return "one_eid_table_add_del_map_reply" }
+func (*OneEidTableAddDelMapReply) GetCrcString() string { return "e8d4e804" }
+func (*OneEidTableAddDelMapReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneEidTableAddDelMapReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneEidTableAddDelMapReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneEidTableDetails defines message 'one_eid_table_details'.
+type OneEidTableDetails struct {
+ LocatorSetIndex uint32 `binapi:"u32,name=locator_set_index" json:"locator_set_index,omitempty"`
+ Action uint8 `binapi:"u8,name=action" json:"action,omitempty"`
+ IsLocal uint8 `binapi:"u8,name=is_local" json:"is_local,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ IsSrcDst uint8 `binapi:"u8,name=is_src_dst" json:"is_src_dst,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ Eid []byte `binapi:"u8[16],name=eid" json:"eid,omitempty"`
+ EidPrefixLen uint8 `binapi:"u8,name=eid_prefix_len" json:"eid_prefix_len,omitempty"`
+ Seid []byte `binapi:"u8[16],name=seid" json:"seid,omitempty"`
+ SeidPrefixLen uint8 `binapi:"u8,name=seid_prefix_len" json:"seid_prefix_len,omitempty"`
+ TTL uint32 `binapi:"u32,name=ttl" json:"ttl,omitempty"`
+ Authoritative uint8 `binapi:"u8,name=authoritative" json:"authoritative,omitempty"`
+ KeyID uint16 `binapi:"u16,name=key_id" json:"key_id,omitempty"`
+ Key []byte `binapi:"u8[64],name=key" json:"key,omitempty"`
+}
+
+func (m *OneEidTableDetails) Reset() { *m = OneEidTableDetails{} }
+func (*OneEidTableDetails) GetMessageName() string { return "one_eid_table_details" }
+func (*OneEidTableDetails) GetCrcString() string { return "dcd9f414" }
+func (*OneEidTableDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneEidTableDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.LocatorSetIndex
+ size += 1 // m.Action
+ size += 1 // m.IsLocal
+ size += 1 // m.EidType
+ size += 1 // m.IsSrcDst
+ size += 4 // m.Vni
+ size += 1 * 16 // m.Eid
+ size += 1 // m.EidPrefixLen
+ size += 1 * 16 // m.Seid
+ size += 1 // m.SeidPrefixLen
+ size += 4 // m.TTL
+ size += 1 // m.Authoritative
+ size += 2 // m.KeyID
+ size += 1 * 64 // m.Key
+ return size
+}
+func (m *OneEidTableDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.LocatorSetIndex)
+ buf.EncodeUint8(m.Action)
+ buf.EncodeUint8(m.IsLocal)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeUint8(m.IsSrcDst)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeBytes(m.Eid, 16)
+ buf.EncodeUint8(m.EidPrefixLen)
+ buf.EncodeBytes(m.Seid, 16)
+ buf.EncodeUint8(m.SeidPrefixLen)
+ buf.EncodeUint32(m.TTL)
+ buf.EncodeUint8(m.Authoritative)
+ buf.EncodeUint16(m.KeyID)
+ buf.EncodeBytes(m.Key, 64)
+ return buf.Bytes(), nil
+}
+func (m *OneEidTableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.LocatorSetIndex = buf.DecodeUint32()
+ m.Action = buf.DecodeUint8()
+ m.IsLocal = buf.DecodeUint8()
+ m.EidType = buf.DecodeUint8()
+ m.IsSrcDst = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.Eid = make([]byte, 16)
+ copy(m.Eid, buf.DecodeBytes(len(m.Eid)))
+ m.EidPrefixLen = buf.DecodeUint8()
+ m.Seid = make([]byte, 16)
+ copy(m.Seid, buf.DecodeBytes(len(m.Seid)))
+ m.SeidPrefixLen = buf.DecodeUint8()
+ m.TTL = buf.DecodeUint32()
+ m.Authoritative = buf.DecodeUint8()
+ m.KeyID = buf.DecodeUint16()
+ m.Key = make([]byte, 64)
+ copy(m.Key, buf.DecodeBytes(len(m.Key)))
+ return nil
+}
+
+// OneEidTableDump defines message 'one_eid_table_dump'.
+type OneEidTableDump struct {
+ EidSet uint8 `binapi:"u8,name=eid_set" json:"eid_set,omitempty"`
+ PrefixLength uint8 `binapi:"u8,name=prefix_length" json:"prefix_length,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Eid []byte `binapi:"u8[16],name=eid" json:"eid,omitempty"`
+ Filter uint8 `binapi:"u8,name=filter" json:"filter,omitempty"`
+}
+
+func (m *OneEidTableDump) Reset() { *m = OneEidTableDump{} }
+func (*OneEidTableDump) GetMessageName() string { return "one_eid_table_dump" }
+func (*OneEidTableDump) GetCrcString() string { return "e0df64da" }
+func (*OneEidTableDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneEidTableDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.EidSet
+ size += 1 // m.PrefixLength
+ size += 4 // m.Vni
+ size += 1 // m.EidType
+ size += 1 * 16 // m.Eid
+ size += 1 // m.Filter
+ return size
+}
+func (m *OneEidTableDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.EidSet)
+ buf.EncodeUint8(m.PrefixLength)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.Eid, 16)
+ buf.EncodeUint8(m.Filter)
+ return buf.Bytes(), nil
+}
+func (m *OneEidTableDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EidSet = buf.DecodeUint8()
+ m.PrefixLength = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.EidType = buf.DecodeUint8()
+ m.Eid = make([]byte, 16)
+ copy(m.Eid, buf.DecodeBytes(len(m.Eid)))
+ m.Filter = buf.DecodeUint8()
+ return nil
+}
+
+// OneEidTableMapDetails defines message 'one_eid_table_map_details'.
+type OneEidTableMapDetails struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"`
+}
+
+func (m *OneEidTableMapDetails) Reset() { *m = OneEidTableMapDetails{} }
+func (*OneEidTableMapDetails) GetMessageName() string { return "one_eid_table_map_details" }
+func (*OneEidTableMapDetails) GetCrcString() string { return "0b6859e2" }
+func (*OneEidTableMapDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneEidTableMapDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ size += 4 // m.DpTable
+ return size
+}
+func (m *OneEidTableMapDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint32(m.DpTable)
+ return buf.Bytes(), nil
+}
+func (m *OneEidTableMapDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ m.DpTable = buf.DecodeUint32()
+ return nil
+}
+
+// OneEidTableMapDump defines message 'one_eid_table_map_dump'.
+type OneEidTableMapDump struct {
+ IsL2 uint8 `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
+}
+
+func (m *OneEidTableMapDump) Reset() { *m = OneEidTableMapDump{} }
+func (*OneEidTableMapDump) GetMessageName() string { return "one_eid_table_map_dump" }
+func (*OneEidTableMapDump) GetCrcString() string { return "67c54650" }
+func (*OneEidTableMapDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneEidTableMapDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsL2
+ return size
+}
+func (m *OneEidTableMapDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsL2)
+ return buf.Bytes(), nil
+}
+func (m *OneEidTableMapDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsL2 = buf.DecodeUint8()
+ return nil
+}
+
+// OneEidTableVniDetails defines message 'one_eid_table_vni_details'.
+type OneEidTableVniDetails struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *OneEidTableVniDetails) Reset() { *m = OneEidTableVniDetails{} }
+func (*OneEidTableVniDetails) GetMessageName() string { return "one_eid_table_vni_details" }
+func (*OneEidTableVniDetails) GetCrcString() string { return "64abc01e" }
+func (*OneEidTableVniDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneEidTableVniDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ return size
+}
+func (m *OneEidTableVniDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *OneEidTableVniDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// OneEidTableVniDump defines message 'one_eid_table_vni_dump'.
+type OneEidTableVniDump struct{}
+
+func (m *OneEidTableVniDump) Reset() { *m = OneEidTableVniDump{} }
+func (*OneEidTableVniDump) GetMessageName() string { return "one_eid_table_vni_dump" }
+func (*OneEidTableVniDump) GetCrcString() string { return "51077d14" }
+func (*OneEidTableVniDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneEidTableVniDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneEidTableVniDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneEidTableVniDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneEnableDisable defines message 'one_enable_disable'.
+type OneEnableDisable struct {
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *OneEnableDisable) Reset() { *m = OneEnableDisable{} }
+func (*OneEnableDisable) GetMessageName() string { return "one_enable_disable" }
+func (*OneEnableDisable) GetCrcString() string { return "eb0e943b" }
+func (*OneEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEn
+ return size
+}
+func (m *OneEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *OneEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// OneEnableDisablePetrMode defines message 'one_enable_disable_petr_mode'.
+type OneEnableDisablePetrMode struct {
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *OneEnableDisablePetrMode) Reset() { *m = OneEnableDisablePetrMode{} }
+func (*OneEnableDisablePetrMode) GetMessageName() string { return "one_enable_disable_petr_mode" }
+func (*OneEnableDisablePetrMode) GetCrcString() string { return "eb0e943b" }
+func (*OneEnableDisablePetrMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneEnableDisablePetrMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEn
+ return size
+}
+func (m *OneEnableDisablePetrMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *OneEnableDisablePetrMode) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// OneEnableDisablePetrModeReply defines message 'one_enable_disable_petr_mode_reply'.
+type OneEnableDisablePetrModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneEnableDisablePetrModeReply) Reset() { *m = OneEnableDisablePetrModeReply{} }
+func (*OneEnableDisablePetrModeReply) GetMessageName() string {
+ return "one_enable_disable_petr_mode_reply"
+}
+func (*OneEnableDisablePetrModeReply) GetCrcString() string { return "e8d4e804" }
+func (*OneEnableDisablePetrModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneEnableDisablePetrModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneEnableDisablePetrModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneEnableDisablePitrMode defines message 'one_enable_disable_pitr_mode'.
+type OneEnableDisablePitrMode struct {
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *OneEnableDisablePitrMode) Reset() { *m = OneEnableDisablePitrMode{} }
+func (*OneEnableDisablePitrMode) GetMessageName() string { return "one_enable_disable_pitr_mode" }
+func (*OneEnableDisablePitrMode) GetCrcString() string { return "eb0e943b" }
+func (*OneEnableDisablePitrMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneEnableDisablePitrMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEn
+ return size
+}
+func (m *OneEnableDisablePitrMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *OneEnableDisablePitrMode) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// OneEnableDisablePitrModeReply defines message 'one_enable_disable_pitr_mode_reply'.
+type OneEnableDisablePitrModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneEnableDisablePitrModeReply) Reset() { *m = OneEnableDisablePitrModeReply{} }
+func (*OneEnableDisablePitrModeReply) GetMessageName() string {
+ return "one_enable_disable_pitr_mode_reply"
+}
+func (*OneEnableDisablePitrModeReply) GetCrcString() string { return "e8d4e804" }
+func (*OneEnableDisablePitrModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneEnableDisablePitrModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneEnableDisablePitrModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneEnableDisableReply defines message 'one_enable_disable_reply'.
+type OneEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneEnableDisableReply) Reset() { *m = OneEnableDisableReply{} }
+func (*OneEnableDisableReply) GetMessageName() string { return "one_enable_disable_reply" }
+func (*OneEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*OneEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneEnableDisableXtrMode defines message 'one_enable_disable_xtr_mode'.
+type OneEnableDisableXtrMode struct {
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *OneEnableDisableXtrMode) Reset() { *m = OneEnableDisableXtrMode{} }
+func (*OneEnableDisableXtrMode) GetMessageName() string { return "one_enable_disable_xtr_mode" }
+func (*OneEnableDisableXtrMode) GetCrcString() string { return "eb0e943b" }
+func (*OneEnableDisableXtrMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneEnableDisableXtrMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEn
+ return size
+}
+func (m *OneEnableDisableXtrMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *OneEnableDisableXtrMode) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// OneEnableDisableXtrModeReply defines message 'one_enable_disable_xtr_mode_reply'.
+type OneEnableDisableXtrModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneEnableDisableXtrModeReply) Reset() { *m = OneEnableDisableXtrModeReply{} }
+func (*OneEnableDisableXtrModeReply) GetMessageName() string {
+ return "one_enable_disable_xtr_mode_reply"
+}
+func (*OneEnableDisableXtrModeReply) GetCrcString() string { return "e8d4e804" }
+func (*OneEnableDisableXtrModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneEnableDisableXtrModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneEnableDisableXtrModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneGetMapRequestItrRlocs defines message 'one_get_map_request_itr_rlocs'.
+type OneGetMapRequestItrRlocs struct{}
+
+func (m *OneGetMapRequestItrRlocs) Reset() { *m = OneGetMapRequestItrRlocs{} }
+func (*OneGetMapRequestItrRlocs) GetMessageName() string { return "one_get_map_request_itr_rlocs" }
+func (*OneGetMapRequestItrRlocs) GetCrcString() string { return "51077d14" }
+func (*OneGetMapRequestItrRlocs) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneGetMapRequestItrRlocs) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneGetMapRequestItrRlocs) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneGetMapRequestItrRlocs) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneGetMapRequestItrRlocsReply defines message 'one_get_map_request_itr_rlocs_reply'.
+type OneGetMapRequestItrRlocsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+}
+
+func (m *OneGetMapRequestItrRlocsReply) Reset() { *m = OneGetMapRequestItrRlocsReply{} }
+func (*OneGetMapRequestItrRlocsReply) GetMessageName() string {
+ return "one_get_map_request_itr_rlocs_reply"
+}
+func (*OneGetMapRequestItrRlocsReply) GetCrcString() string { return "9f56f6f7" }
+func (*OneGetMapRequestItrRlocsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneGetMapRequestItrRlocsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 64 // m.LocatorSetName
+ return size
+}
+func (m *OneGetMapRequestItrRlocsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ return buf.Bytes(), nil
+}
+func (m *OneGetMapRequestItrRlocsReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ return nil
+}
+
+// OneGetTransportProtocol defines message 'one_get_transport_protocol'.
+type OneGetTransportProtocol struct{}
+
+func (m *OneGetTransportProtocol) Reset() { *m = OneGetTransportProtocol{} }
+func (*OneGetTransportProtocol) GetMessageName() string { return "one_get_transport_protocol" }
+func (*OneGetTransportProtocol) GetCrcString() string { return "51077d14" }
+func (*OneGetTransportProtocol) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneGetTransportProtocol) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneGetTransportProtocol) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneGetTransportProtocol) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneGetTransportProtocolReply defines message 'one_get_transport_protocol_reply'.
+type OneGetTransportProtocolReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+}
+
+func (m *OneGetTransportProtocolReply) Reset() { *m = OneGetTransportProtocolReply{} }
+func (*OneGetTransportProtocolReply) GetMessageName() string {
+ return "one_get_transport_protocol_reply"
+}
+func (*OneGetTransportProtocolReply) GetCrcString() string { return "62a28eb3" }
+func (*OneGetTransportProtocolReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneGetTransportProtocolReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.Protocol
+ return size
+}
+func (m *OneGetTransportProtocolReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.Protocol = buf.DecodeUint8()
+ return nil
+}
+
+// OneL2ArpBdGet defines message 'one_l2_arp_bd_get'.
+type OneL2ArpBdGet struct{}
+
+func (m *OneL2ArpBdGet) Reset() { *m = OneL2ArpBdGet{} }
+func (*OneL2ArpBdGet) GetMessageName() string { return "one_l2_arp_bd_get" }
+func (*OneL2ArpBdGet) GetCrcString() string { return "51077d14" }
+func (*OneL2ArpBdGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneL2ArpBdGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneL2ArpBdGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneL2ArpBdGet) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneL2ArpBdGetReply defines message 'one_l2_arp_bd_get_reply'.
+type OneL2ArpBdGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ BridgeDomains []uint32 `binapi:"u32[count],name=bridge_domains" json:"bridge_domains,omitempty"`
+}
+
+func (m *OneL2ArpBdGetReply) Reset() { *m = OneL2ArpBdGetReply{} }
+func (*OneL2ArpBdGetReply) GetMessageName() string { return "one_l2_arp_bd_get_reply" }
+func (*OneL2ArpBdGetReply) GetCrcString() string { return "221ac888" }
+func (*OneL2ArpBdGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneL2ArpBdGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *OneL2ArpBdGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.BridgeDomains = make([]uint32, m.Count)
+ for i := 0; i < len(m.BridgeDomains); i++ {
+ m.BridgeDomains[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// OneL2ArpEntriesGet defines message 'one_l2_arp_entries_get'.
+type OneL2ArpEntriesGet struct {
+ Bd uint32 `binapi:"u32,name=bd" json:"bd,omitempty"`
+}
+
+func (m *OneL2ArpEntriesGet) Reset() { *m = OneL2ArpEntriesGet{} }
+func (*OneL2ArpEntriesGet) GetMessageName() string { return "one_l2_arp_entries_get" }
+func (*OneL2ArpEntriesGet) GetCrcString() string { return "4d418cf4" }
+func (*OneL2ArpEntriesGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneL2ArpEntriesGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bd
+ return size
+}
+func (m *OneL2ArpEntriesGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bd)
+ return buf.Bytes(), nil
+}
+func (m *OneL2ArpEntriesGet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bd = buf.DecodeUint32()
+ return nil
+}
+
+// OneL2ArpEntriesGetReply defines message 'one_l2_arp_entries_get_reply'.
+type OneL2ArpEntriesGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ Entries []OneL2ArpEntry `binapi:"one_l2_arp_entry[count],name=entries" json:"entries,omitempty"`
+}
+
+func (m *OneL2ArpEntriesGetReply) Reset() { *m = OneL2ArpEntriesGetReply{} }
+func (*OneL2ArpEntriesGetReply) GetMessageName() string { return "one_l2_arp_entries_get_reply" }
+func (*OneL2ArpEntriesGetReply) GetCrcString() string { return "88e54ded" }
+func (*OneL2ArpEntriesGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneL2ArpEntriesGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Count
+ for j1 := 0; j1 < len(m.Entries); j1++ {
+ var s1 OneL2ArpEntry
+ _ = s1
+ if j1 < len(m.Entries) {
+ s1 = m.Entries[j1]
+ }
+ size += 1 * 6 // s1.Mac
+ size += 4 // s1.IP4
+ }
+ return size
+}
+func (m *OneL2ArpEntriesGetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 // Entries
+ if j0 < len(m.Entries) {
+ v0 = m.Entries[j0]
+ }
+ buf.EncodeBytes(v0.Mac, 6)
+ buf.EncodeUint32(v0.IP4)
+ }
+ return buf.Bytes(), nil
+}
+func (m *OneL2ArpEntriesGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.Entries = make([]OneL2ArpEntry, m.Count)
+ for j0 := 0; j0 < len(m.Entries); j0++ {
+ m.Entries[j0].Mac = make([]byte, 6)
+ copy(m.Entries[j0].Mac, buf.DecodeBytes(len(m.Entries[j0].Mac)))
+ m.Entries[j0].IP4 = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// OneLocatorDetails defines message 'one_locator_details'.
+type OneLocatorDetails struct {
+ Local uint8 `binapi:"u8,name=local" json:"local,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+ Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
+ Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
+}
+
+func (m *OneLocatorDetails) Reset() { *m = OneLocatorDetails{} }
+func (*OneLocatorDetails) GetMessageName() string { return "one_locator_details" }
+func (*OneLocatorDetails) GetCrcString() string { return "b3988a30" }
+func (*OneLocatorDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneLocatorDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Local
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ size += 1 // m.Priority
+ size += 1 // m.Weight
+ return size
+}
+func (m *OneLocatorDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Local)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ buf.EncodeUint8(m.Priority)
+ buf.EncodeUint8(m.Weight)
+ return buf.Bytes(), nil
+}
+func (m *OneLocatorDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Local = buf.DecodeUint8()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ m.Priority = buf.DecodeUint8()
+ m.Weight = buf.DecodeUint8()
+ return nil
+}
+
+// OneLocatorDump defines message 'one_locator_dump'.
+type OneLocatorDump struct {
+ LsIndex uint32 `binapi:"u32,name=ls_index" json:"ls_index,omitempty"`
+ LsName []byte `binapi:"u8[64],name=ls_name" json:"ls_name,omitempty"`
+ IsIndexSet uint8 `binapi:"u8,name=is_index_set" json:"is_index_set,omitempty"`
+}
+
+func (m *OneLocatorDump) Reset() { *m = OneLocatorDump{} }
+func (*OneLocatorDump) GetMessageName() string { return "one_locator_dump" }
+func (*OneLocatorDump) GetCrcString() string { return "f27d5050" }
+func (*OneLocatorDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneLocatorDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.LsIndex
+ size += 1 * 64 // m.LsName
+ size += 1 // m.IsIndexSet
+ return size
+}
+func (m *OneLocatorDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.LsIndex)
+ buf.EncodeBytes(m.LsName, 64)
+ buf.EncodeUint8(m.IsIndexSet)
+ return buf.Bytes(), nil
+}
+func (m *OneLocatorDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.LsIndex = buf.DecodeUint32()
+ m.LsName = make([]byte, 64)
+ copy(m.LsName, buf.DecodeBytes(len(m.LsName)))
+ m.IsIndexSet = buf.DecodeUint8()
+ return nil
+}
+
+// OneLocatorSetDetails defines message 'one_locator_set_details'.
+type OneLocatorSetDetails struct {
+ LsIndex uint32 `binapi:"u32,name=ls_index" json:"ls_index,omitempty"`
+ LsName []byte `binapi:"u8[64],name=ls_name" json:"ls_name,omitempty"`
+}
+
+func (m *OneLocatorSetDetails) Reset() { *m = OneLocatorSetDetails{} }
+func (*OneLocatorSetDetails) GetMessageName() string { return "one_locator_set_details" }
+func (*OneLocatorSetDetails) GetCrcString() string { return "6b846882" }
+func (*OneLocatorSetDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneLocatorSetDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.LsIndex
+ size += 1 * 64 // m.LsName
+ return size
+}
+func (m *OneLocatorSetDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.LsIndex)
+ buf.EncodeBytes(m.LsName, 64)
+ return buf.Bytes(), nil
+}
+func (m *OneLocatorSetDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.LsIndex = buf.DecodeUint32()
+ m.LsName = make([]byte, 64)
+ copy(m.LsName, buf.DecodeBytes(len(m.LsName)))
+ return nil
+}
+
+// OneLocatorSetDump defines message 'one_locator_set_dump'.
+type OneLocatorSetDump struct {
+ Filter uint8 `binapi:"u8,name=filter" json:"filter,omitempty"`
+}
+
+func (m *OneLocatorSetDump) Reset() { *m = OneLocatorSetDump{} }
+func (*OneLocatorSetDump) GetMessageName() string { return "one_locator_set_dump" }
+func (*OneLocatorSetDump) GetCrcString() string { return "c79e8ab0" }
+func (*OneLocatorSetDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneLocatorSetDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Filter
+ return size
+}
+func (m *OneLocatorSetDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Filter)
+ return buf.Bytes(), nil
+}
+func (m *OneLocatorSetDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Filter = buf.DecodeUint8()
+ return nil
+}
+
+// OneMapRegisterEnableDisable defines message 'one_map_register_enable_disable'.
+type OneMapRegisterEnableDisable struct {
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+}
+
+func (m *OneMapRegisterEnableDisable) Reset() { *m = OneMapRegisterEnableDisable{} }
+func (*OneMapRegisterEnableDisable) GetMessageName() string { return "one_map_register_enable_disable" }
+func (*OneMapRegisterEnableDisable) GetCrcString() string { return "294103d1" }
+func (*OneMapRegisterEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneMapRegisterEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEnabled
+ return size
+}
+func (m *OneMapRegisterEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEnabled)
+ return buf.Bytes(), nil
+}
+func (m *OneMapRegisterEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEnabled = buf.DecodeUint8()
+ return nil
+}
+
+// OneMapRegisterEnableDisableReply defines message 'one_map_register_enable_disable_reply'.
+type OneMapRegisterEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneMapRegisterEnableDisableReply) Reset() { *m = OneMapRegisterEnableDisableReply{} }
+func (*OneMapRegisterEnableDisableReply) GetMessageName() string {
+ return "one_map_register_enable_disable_reply"
+}
+func (*OneMapRegisterEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*OneMapRegisterEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneMapRegisterEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneMapRegisterEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneMapRegisterFallbackThreshold defines message 'one_map_register_fallback_threshold'.
+type OneMapRegisterFallbackThreshold struct {
+ Value uint32 `binapi:"u32,name=value" json:"value,omitempty"`
+}
+
+func (m *OneMapRegisterFallbackThreshold) Reset() { *m = OneMapRegisterFallbackThreshold{} }
+func (*OneMapRegisterFallbackThreshold) GetMessageName() string {
+ return "one_map_register_fallback_threshold"
+}
+func (*OneMapRegisterFallbackThreshold) GetCrcString() string { return "f7d4a475" }
+func (*OneMapRegisterFallbackThreshold) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneMapRegisterFallbackThreshold) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Value
+ return size
+}
+func (m *OneMapRegisterFallbackThreshold) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Value)
+ return buf.Bytes(), nil
+}
+func (m *OneMapRegisterFallbackThreshold) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Value = buf.DecodeUint32()
+ return nil
+}
+
+// OneMapRegisterFallbackThresholdReply defines message 'one_map_register_fallback_threshold_reply'.
+type OneMapRegisterFallbackThresholdReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneMapRegisterFallbackThresholdReply) Reset() { *m = OneMapRegisterFallbackThresholdReply{} }
+func (*OneMapRegisterFallbackThresholdReply) GetMessageName() string {
+ return "one_map_register_fallback_threshold_reply"
+}
+func (*OneMapRegisterFallbackThresholdReply) GetCrcString() string { return "e8d4e804" }
+func (*OneMapRegisterFallbackThresholdReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneMapRegisterFallbackThresholdReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneMapRegisterFallbackThresholdReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneMapRegisterSetTTL defines message 'one_map_register_set_ttl'.
+type OneMapRegisterSetTTL struct {
+ TTL uint32 `binapi:"u32,name=ttl" json:"ttl,omitempty"`
+}
+
+func (m *OneMapRegisterSetTTL) Reset() { *m = OneMapRegisterSetTTL{} }
+func (*OneMapRegisterSetTTL) GetMessageName() string { return "one_map_register_set_ttl" }
+func (*OneMapRegisterSetTTL) GetCrcString() string { return "dd59f1f3" }
+func (*OneMapRegisterSetTTL) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneMapRegisterSetTTL) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.TTL
+ return size
+}
+func (m *OneMapRegisterSetTTL) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.TTL)
+ return buf.Bytes(), nil
+}
+func (m *OneMapRegisterSetTTL) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TTL = buf.DecodeUint32()
+ return nil
+}
+
+// OneMapRegisterSetTTLReply defines message 'one_map_register_set_ttl_reply'.
+type OneMapRegisterSetTTLReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneMapRegisterSetTTLReply) Reset() { *m = OneMapRegisterSetTTLReply{} }
+func (*OneMapRegisterSetTTLReply) GetMessageName() string { return "one_map_register_set_ttl_reply" }
+func (*OneMapRegisterSetTTLReply) GetCrcString() string { return "e8d4e804" }
+func (*OneMapRegisterSetTTLReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneMapRegisterSetTTLReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneMapRegisterSetTTLReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneMapRequestMode defines message 'one_map_request_mode'.
+type OneMapRequestMode struct {
+ Mode uint8 `binapi:"u8,name=mode" json:"mode,omitempty"`
+}
+
+func (m *OneMapRequestMode) Reset() { *m = OneMapRequestMode{} }
+func (*OneMapRequestMode) GetMessageName() string { return "one_map_request_mode" }
+func (*OneMapRequestMode) GetCrcString() string { return "f3f93ce9" }
+func (*OneMapRequestMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneMapRequestMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Mode
+ return size
+}
+func (m *OneMapRequestMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Mode)
+ return buf.Bytes(), nil
+}
+func (m *OneMapRequestMode) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Mode = buf.DecodeUint8()
+ return nil
+}
+
+// OneMapRequestModeReply defines message 'one_map_request_mode_reply'.
+type OneMapRequestModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneMapRequestModeReply) Reset() { *m = OneMapRequestModeReply{} }
+func (*OneMapRequestModeReply) GetMessageName() string { return "one_map_request_mode_reply" }
+func (*OneMapRequestModeReply) GetCrcString() string { return "e8d4e804" }
+func (*OneMapRequestModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneMapRequestModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneMapRequestModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneMapResolverDetails defines message 'one_map_resolver_details'.
+type OneMapResolverDetails struct {
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+}
+
+func (m *OneMapResolverDetails) Reset() { *m = OneMapResolverDetails{} }
+func (*OneMapResolverDetails) GetMessageName() string { return "one_map_resolver_details" }
+func (*OneMapResolverDetails) GetCrcString() string { return "60a5f5ca" }
+func (*OneMapResolverDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneMapResolverDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ return size
+}
+func (m *OneMapResolverDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *OneMapResolverDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ return nil
+}
+
+// OneMapResolverDump defines message 'one_map_resolver_dump'.
+type OneMapResolverDump struct{}
+
+func (m *OneMapResolverDump) Reset() { *m = OneMapResolverDump{} }
+func (*OneMapResolverDump) GetMessageName() string { return "one_map_resolver_dump" }
+func (*OneMapResolverDump) GetCrcString() string { return "51077d14" }
+func (*OneMapResolverDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneMapResolverDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneMapResolverDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneMapResolverDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneMapServerDetails defines message 'one_map_server_details'.
+type OneMapServerDetails struct {
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ IPAddress []byte `binapi:"u8[16],name=ip_address" json:"ip_address,omitempty"`
+}
+
+func (m *OneMapServerDetails) Reset() { *m = OneMapServerDetails{} }
+func (*OneMapServerDetails) GetMessageName() string { return "one_map_server_details" }
+func (*OneMapServerDetails) GetCrcString() string { return "60a5f5ca" }
+func (*OneMapServerDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneMapServerDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.IPAddress
+ return size
+}
+func (m *OneMapServerDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.IPAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *OneMapServerDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeUint8()
+ m.IPAddress = make([]byte, 16)
+ copy(m.IPAddress, buf.DecodeBytes(len(m.IPAddress)))
+ return nil
+}
+
+// OneMapServerDump defines message 'one_map_server_dump'.
+type OneMapServerDump struct{}
+
+func (m *OneMapServerDump) Reset() { *m = OneMapServerDump{} }
+func (*OneMapServerDump) GetMessageName() string { return "one_map_server_dump" }
+func (*OneMapServerDump) GetCrcString() string { return "51077d14" }
+func (*OneMapServerDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneMapServerDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneMapServerDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneMapServerDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneNdpBdGet defines message 'one_ndp_bd_get'.
+type OneNdpBdGet struct{}
+
+func (m *OneNdpBdGet) Reset() { *m = OneNdpBdGet{} }
+func (*OneNdpBdGet) GetMessageName() string { return "one_ndp_bd_get" }
+func (*OneNdpBdGet) GetCrcString() string { return "51077d14" }
+func (*OneNdpBdGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneNdpBdGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneNdpBdGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneNdpBdGet) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneNdpBdGetReply defines message 'one_ndp_bd_get_reply'.
+type OneNdpBdGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ BridgeDomains []uint32 `binapi:"u32[count],name=bridge_domains" json:"bridge_domains,omitempty"`
+}
+
+func (m *OneNdpBdGetReply) Reset() { *m = OneNdpBdGetReply{} }
+func (*OneNdpBdGetReply) GetMessageName() string { return "one_ndp_bd_get_reply" }
+func (*OneNdpBdGetReply) GetCrcString() string { return "221ac888" }
+func (*OneNdpBdGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneNdpBdGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *OneNdpBdGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.BridgeDomains = make([]uint32, m.Count)
+ for i := 0; i < len(m.BridgeDomains); i++ {
+ m.BridgeDomains[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// OneNdpEntriesGet defines message 'one_ndp_entries_get'.
+type OneNdpEntriesGet struct {
+ Bd uint32 `binapi:"u32,name=bd" json:"bd,omitempty"`
+}
+
+func (m *OneNdpEntriesGet) Reset() { *m = OneNdpEntriesGet{} }
+func (*OneNdpEntriesGet) GetMessageName() string { return "one_ndp_entries_get" }
+func (*OneNdpEntriesGet) GetCrcString() string { return "4d418cf4" }
+func (*OneNdpEntriesGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneNdpEntriesGet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bd
+ return size
+}
+func (m *OneNdpEntriesGet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bd)
+ return buf.Bytes(), nil
+}
+func (m *OneNdpEntriesGet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bd = buf.DecodeUint32()
+ return nil
+}
+
+// OneNdpEntriesGetReply defines message 'one_ndp_entries_get_reply'.
+type OneNdpEntriesGetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
+ Entries []OneNdpEntry `binapi:"one_ndp_entry[count],name=entries" json:"entries,omitempty"`
+}
+
+func (m *OneNdpEntriesGetReply) Reset() { *m = OneNdpEntriesGetReply{} }
+func (*OneNdpEntriesGetReply) GetMessageName() string { return "one_ndp_entries_get_reply" }
+func (*OneNdpEntriesGetReply) GetCrcString() string { return "d0822f37" }
+func (*OneNdpEntriesGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneNdpEntriesGetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Count
+ for j1 := 0; j1 < len(m.Entries); j1++ {
+ var s1 OneNdpEntry
+ _ = s1
+ if j1 < len(m.Entries) {
+ s1 = m.Entries[j1]
+ }
+ size += 1 * 6 // s1.Mac
+ size += 1 * 16 // s1.IP6
+ }
+ return size
+}
+func (m *OneNdpEntriesGetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 // Entries
+ if j0 < len(m.Entries) {
+ v0 = m.Entries[j0]
+ }
+ buf.EncodeBytes(v0.Mac, 6)
+ buf.EncodeBytes(v0.IP6, 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *OneNdpEntriesGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.Entries = make([]OneNdpEntry, m.Count)
+ for j0 := 0; j0 < len(m.Entries); j0++ {
+ m.Entries[j0].Mac = make([]byte, 6)
+ copy(m.Entries[j0].Mac, buf.DecodeBytes(len(m.Entries[j0].Mac)))
+ m.Entries[j0].IP6 = make([]byte, 16)
+ copy(m.Entries[j0].IP6, buf.DecodeBytes(len(m.Entries[j0].IP6)))
+ }
+ return nil
+}
+
+// OneNshSetLocatorSet defines message 'one_nsh_set_locator_set'.
+type OneNshSetLocatorSet struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ LsName []byte `binapi:"u8[64],name=ls_name" json:"ls_name,omitempty"`
+}
+
+func (m *OneNshSetLocatorSet) Reset() { *m = OneNshSetLocatorSet{} }
+func (*OneNshSetLocatorSet) GetMessageName() string { return "one_nsh_set_locator_set" }
+func (*OneNshSetLocatorSet) GetCrcString() string { return "7aa022dd" }
+func (*OneNshSetLocatorSet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneNshSetLocatorSet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.LsName
+ return size
+}
+func (m *OneNshSetLocatorSet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.LsName, 64)
+ return buf.Bytes(), nil
+}
+func (m *OneNshSetLocatorSet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.LsName = make([]byte, 64)
+ copy(m.LsName, buf.DecodeBytes(len(m.LsName)))
+ return nil
+}
+
+// OneNshSetLocatorSetReply defines message 'one_nsh_set_locator_set_reply'.
+type OneNshSetLocatorSetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneNshSetLocatorSetReply) Reset() { *m = OneNshSetLocatorSetReply{} }
+func (*OneNshSetLocatorSetReply) GetMessageName() string { return "one_nsh_set_locator_set_reply" }
+func (*OneNshSetLocatorSetReply) GetCrcString() string { return "e8d4e804" }
+func (*OneNshSetLocatorSetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneNshSetLocatorSetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneNshSetLocatorSetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OnePitrSetLocatorSet defines message 'one_pitr_set_locator_set'.
+type OnePitrSetLocatorSet struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ LsName []byte `binapi:"u8[64],name=ls_name" json:"ls_name,omitempty"`
+}
+
+func (m *OnePitrSetLocatorSet) Reset() { *m = OnePitrSetLocatorSet{} }
+func (*OnePitrSetLocatorSet) GetMessageName() string { return "one_pitr_set_locator_set" }
+func (*OnePitrSetLocatorSet) GetCrcString() string { return "7aa022dd" }
+func (*OnePitrSetLocatorSet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OnePitrSetLocatorSet) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.LsName
+ return size
+}
+func (m *OnePitrSetLocatorSet) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.LsName, 64)
+ return buf.Bytes(), nil
+}
+func (m *OnePitrSetLocatorSet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.LsName = make([]byte, 64)
+ copy(m.LsName, buf.DecodeBytes(len(m.LsName)))
+ return nil
+}
+
+// OnePitrSetLocatorSetReply defines message 'one_pitr_set_locator_set_reply'.
+type OnePitrSetLocatorSetReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OnePitrSetLocatorSetReply) Reset() { *m = OnePitrSetLocatorSetReply{} }
+func (*OnePitrSetLocatorSetReply) GetMessageName() string { return "one_pitr_set_locator_set_reply" }
+func (*OnePitrSetLocatorSetReply) GetCrcString() string { return "e8d4e804" }
+func (*OnePitrSetLocatorSetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OnePitrSetLocatorSetReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OnePitrSetLocatorSetReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneRlocProbeEnableDisable defines message 'one_rloc_probe_enable_disable'.
+type OneRlocProbeEnableDisable struct {
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+}
+
+func (m *OneRlocProbeEnableDisable) Reset() { *m = OneRlocProbeEnableDisable{} }
+func (*OneRlocProbeEnableDisable) GetMessageName() string { return "one_rloc_probe_enable_disable" }
+func (*OneRlocProbeEnableDisable) GetCrcString() string { return "294103d1" }
+func (*OneRlocProbeEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneRlocProbeEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEnabled
+ return size
+}
+func (m *OneRlocProbeEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEnabled)
+ return buf.Bytes(), nil
+}
+func (m *OneRlocProbeEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEnabled = buf.DecodeUint8()
+ return nil
+}
+
+// OneRlocProbeEnableDisableReply defines message 'one_rloc_probe_enable_disable_reply'.
+type OneRlocProbeEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneRlocProbeEnableDisableReply) Reset() { *m = OneRlocProbeEnableDisableReply{} }
+func (*OneRlocProbeEnableDisableReply) GetMessageName() string {
+ return "one_rloc_probe_enable_disable_reply"
+}
+func (*OneRlocProbeEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*OneRlocProbeEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneRlocProbeEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneRlocProbeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneSetTransportProtocol defines message 'one_set_transport_protocol'.
+type OneSetTransportProtocol struct {
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+}
+
+func (m *OneSetTransportProtocol) Reset() { *m = OneSetTransportProtocol{} }
+func (*OneSetTransportProtocol) GetMessageName() string { return "one_set_transport_protocol" }
+func (*OneSetTransportProtocol) GetCrcString() string { return "07b6b85f" }
+func (*OneSetTransportProtocol) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneSetTransportProtocol) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Protocol
+ return size
+}
+func (m *OneSetTransportProtocol) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.Protocol)
+ return buf.Bytes(), nil
+}
+func (m *OneSetTransportProtocol) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Protocol = buf.DecodeUint8()
+ return nil
+}
+
+// OneSetTransportProtocolReply defines message 'one_set_transport_protocol_reply'.
+type OneSetTransportProtocolReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneSetTransportProtocolReply) Reset() { *m = OneSetTransportProtocolReply{} }
+func (*OneSetTransportProtocolReply) GetMessageName() string {
+ return "one_set_transport_protocol_reply"
+}
+func (*OneSetTransportProtocolReply) GetCrcString() string { return "e8d4e804" }
+func (*OneSetTransportProtocolReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneSetTransportProtocolReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneSetTransportProtocolReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneShowPetrMode defines message 'one_show_petr_mode'.
+type OneShowPetrMode struct{}
+
+func (m *OneShowPetrMode) Reset() { *m = OneShowPetrMode{} }
+func (*OneShowPetrMode) GetMessageName() string { return "one_show_petr_mode" }
+func (*OneShowPetrMode) GetCrcString() string { return "51077d14" }
+func (*OneShowPetrMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneShowPetrMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneShowPetrMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneShowPetrMode) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneShowPetrModeReply defines message 'one_show_petr_mode_reply'.
+type OneShowPetrModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *OneShowPetrModeReply) Reset() { *m = OneShowPetrModeReply{} }
+func (*OneShowPetrModeReply) GetMessageName() string { return "one_show_petr_mode_reply" }
+func (*OneShowPetrModeReply) GetCrcString() string { return "6b4c29dc" }
+func (*OneShowPetrModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneShowPetrModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IsEn
+ return size
+}
+func (m *OneShowPetrModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *OneShowPetrModeReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// OneShowPitrMode defines message 'one_show_pitr_mode'.
+type OneShowPitrMode struct{}
+
+func (m *OneShowPitrMode) Reset() { *m = OneShowPitrMode{} }
+func (*OneShowPitrMode) GetMessageName() string { return "one_show_pitr_mode" }
+func (*OneShowPitrMode) GetCrcString() string { return "51077d14" }
+func (*OneShowPitrMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneShowPitrMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneShowPitrMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneShowPitrMode) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneShowPitrModeReply defines message 'one_show_pitr_mode_reply'.
+type OneShowPitrModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *OneShowPitrModeReply) Reset() { *m = OneShowPitrModeReply{} }
+func (*OneShowPitrModeReply) GetMessageName() string { return "one_show_pitr_mode_reply" }
+func (*OneShowPitrModeReply) GetCrcString() string { return "6b4c29dc" }
+func (*OneShowPitrModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneShowPitrModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IsEn
+ return size
+}
+func (m *OneShowPitrModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *OneShowPitrModeReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// OneShowXtrMode defines message 'one_show_xtr_mode'.
+type OneShowXtrMode struct{}
+
+func (m *OneShowXtrMode) Reset() { *m = OneShowXtrMode{} }
+func (*OneShowXtrMode) GetMessageName() string { return "one_show_xtr_mode" }
+func (*OneShowXtrMode) GetCrcString() string { return "51077d14" }
+func (*OneShowXtrMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneShowXtrMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneShowXtrMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneShowXtrMode) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneShowXtrModeReply defines message 'one_show_xtr_mode_reply'.
+type OneShowXtrModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *OneShowXtrModeReply) Reset() { *m = OneShowXtrModeReply{} }
+func (*OneShowXtrModeReply) GetMessageName() string { return "one_show_xtr_mode_reply" }
+func (*OneShowXtrModeReply) GetCrcString() string { return "6b4c29dc" }
+func (*OneShowXtrModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneShowXtrModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IsEn
+ return size
+}
+func (m *OneShowXtrModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *OneShowXtrModeReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// OneStatsDetails defines message 'one_stats_details'.
+type OneStatsDetails struct {
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ EidType uint8 `binapi:"u8,name=eid_type" json:"eid_type,omitempty"`
+ Deid []byte `binapi:"u8[16],name=deid" json:"deid,omitempty"`
+ Seid []byte `binapi:"u8[16],name=seid" json:"seid,omitempty"`
+ DeidPrefLen uint8 `binapi:"u8,name=deid_pref_len" json:"deid_pref_len,omitempty"`
+ SeidPrefLen uint8 `binapi:"u8,name=seid_pref_len" json:"seid_pref_len,omitempty"`
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ Rloc []byte `binapi:"u8[16],name=rloc" json:"rloc,omitempty"`
+ Lloc []byte `binapi:"u8[16],name=lloc" json:"lloc,omitempty"`
+ PktCount uint32 `binapi:"u32,name=pkt_count" json:"pkt_count,omitempty"`
+ Bytes uint32 `binapi:"u32,name=bytes" json:"bytes,omitempty"`
+}
+
+func (m *OneStatsDetails) Reset() { *m = OneStatsDetails{} }
+func (*OneStatsDetails) GetMessageName() string { return "one_stats_details" }
+func (*OneStatsDetails) GetCrcString() string { return "e1a34a05" }
+func (*OneStatsDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneStatsDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Vni
+ size += 1 // m.EidType
+ size += 1 * 16 // m.Deid
+ size += 1 * 16 // m.Seid
+ size += 1 // m.DeidPrefLen
+ size += 1 // m.SeidPrefLen
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.Rloc
+ size += 1 * 16 // m.Lloc
+ size += 4 // m.PktCount
+ size += 4 // m.Bytes
+ return size
+}
+func (m *OneStatsDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.EidType)
+ buf.EncodeBytes(m.Deid, 16)
+ buf.EncodeBytes(m.Seid, 16)
+ buf.EncodeUint8(m.DeidPrefLen)
+ buf.EncodeUint8(m.SeidPrefLen)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.Rloc, 16)
+ buf.EncodeBytes(m.Lloc, 16)
+ buf.EncodeUint32(m.PktCount)
+ buf.EncodeUint32(m.Bytes)
+ return buf.Bytes(), nil
+}
+func (m *OneStatsDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Vni = buf.DecodeUint32()
+ m.EidType = buf.DecodeUint8()
+ m.Deid = make([]byte, 16)
+ copy(m.Deid, buf.DecodeBytes(len(m.Deid)))
+ m.Seid = make([]byte, 16)
+ copy(m.Seid, buf.DecodeBytes(len(m.Seid)))
+ m.DeidPrefLen = buf.DecodeUint8()
+ m.SeidPrefLen = buf.DecodeUint8()
+ m.IsIP4 = buf.DecodeUint8()
+ m.Rloc = make([]byte, 16)
+ copy(m.Rloc, buf.DecodeBytes(len(m.Rloc)))
+ m.Lloc = make([]byte, 16)
+ copy(m.Lloc, buf.DecodeBytes(len(m.Lloc)))
+ m.PktCount = buf.DecodeUint32()
+ m.Bytes = buf.DecodeUint32()
+ return nil
+}
+
+// OneStatsDump defines message 'one_stats_dump'.
+type OneStatsDump struct{}
+
+func (m *OneStatsDump) Reset() { *m = OneStatsDump{} }
+func (*OneStatsDump) GetMessageName() string { return "one_stats_dump" }
+func (*OneStatsDump) GetCrcString() string { return "51077d14" }
+func (*OneStatsDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneStatsDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneStatsDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneStatsDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneStatsEnableDisable defines message 'one_stats_enable_disable'.
+type OneStatsEnableDisable struct {
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *OneStatsEnableDisable) Reset() { *m = OneStatsEnableDisable{} }
+func (*OneStatsEnableDisable) GetMessageName() string { return "one_stats_enable_disable" }
+func (*OneStatsEnableDisable) GetCrcString() string { return "eb0e943b" }
+func (*OneStatsEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneStatsEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEn
+ return size
+}
+func (m *OneStatsEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *OneStatsEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// OneStatsEnableDisableReply defines message 'one_stats_enable_disable_reply'.
+type OneStatsEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneStatsEnableDisableReply) Reset() { *m = OneStatsEnableDisableReply{} }
+func (*OneStatsEnableDisableReply) GetMessageName() string { return "one_stats_enable_disable_reply" }
+func (*OneStatsEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*OneStatsEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneStatsEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneStatsEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneStatsFlush defines message 'one_stats_flush'.
+type OneStatsFlush struct{}
+
+func (m *OneStatsFlush) Reset() { *m = OneStatsFlush{} }
+func (*OneStatsFlush) GetMessageName() string { return "one_stats_flush" }
+func (*OneStatsFlush) GetCrcString() string { return "51077d14" }
+func (*OneStatsFlush) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneStatsFlush) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *OneStatsFlush) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *OneStatsFlush) Unmarshal(b []byte) error {
+ return nil
+}
+
+// OneStatsFlushReply defines message 'one_stats_flush_reply'.
+type OneStatsFlushReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneStatsFlushReply) Reset() { *m = OneStatsFlushReply{} }
+func (*OneStatsFlushReply) GetMessageName() string { return "one_stats_flush_reply" }
+func (*OneStatsFlushReply) GetCrcString() string { return "e8d4e804" }
+func (*OneStatsFlushReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneStatsFlushReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneStatsFlushReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// OneUsePetr defines message 'one_use_petr'.
+type OneUsePetr struct {
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ Address []byte `binapi:"u8[16],name=address" json:"address,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *OneUsePetr) Reset() { *m = OneUsePetr{} }
+func (*OneUsePetr) GetMessageName() string { return "one_use_petr" }
+func (*OneUsePetr) GetCrcString() string { return "6910787d" }
+func (*OneUsePetr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *OneUsePetr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.Address
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *OneUsePetr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.Address, 16)
+ buf.EncodeUint8(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *OneUsePetr) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIP4 = buf.DecodeUint8()
+ m.Address = make([]byte, 16)
+ copy(m.Address, buf.DecodeBytes(len(m.Address)))
+ m.IsAdd = buf.DecodeUint8()
+ return nil
+}
+
+// OneUsePetrReply defines message 'one_use_petr_reply'.
+type OneUsePetrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *OneUsePetrReply) Reset() { *m = OneUsePetrReply{} }
+func (*OneUsePetrReply) GetMessageName() string { return "one_use_petr_reply" }
+func (*OneUsePetrReply) GetCrcString() string { return "e8d4e804" }
+func (*OneUsePetrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *OneUsePetrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *OneUsePetrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// ShowOneMapRegisterFallbackThreshold defines message 'show_one_map_register_fallback_threshold'.
+type ShowOneMapRegisterFallbackThreshold struct{}
+
+func (m *ShowOneMapRegisterFallbackThreshold) Reset() { *m = ShowOneMapRegisterFallbackThreshold{} }
+func (*ShowOneMapRegisterFallbackThreshold) GetMessageName() string {
+ return "show_one_map_register_fallback_threshold"
+}
+func (*ShowOneMapRegisterFallbackThreshold) GetCrcString() string { return "51077d14" }
+func (*ShowOneMapRegisterFallbackThreshold) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOneMapRegisterFallbackThreshold) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOneMapRegisterFallbackThreshold) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneMapRegisterFallbackThreshold) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOneMapRegisterFallbackThresholdReply defines message 'show_one_map_register_fallback_threshold_reply'.
+type ShowOneMapRegisterFallbackThresholdReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Value uint32 `binapi:"u32,name=value" json:"value,omitempty"`
+}
+
+func (m *ShowOneMapRegisterFallbackThresholdReply) Reset() {
+ *m = ShowOneMapRegisterFallbackThresholdReply{}
+}
+func (*ShowOneMapRegisterFallbackThresholdReply) GetMessageName() string {
+ return "show_one_map_register_fallback_threshold_reply"
+}
+func (*ShowOneMapRegisterFallbackThresholdReply) GetCrcString() string { return "c93a9113" }
+func (*ShowOneMapRegisterFallbackThresholdReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOneMapRegisterFallbackThresholdReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Value
+ return size
+}
+func (m *ShowOneMapRegisterFallbackThresholdReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.Value = buf.DecodeUint32()
+ return nil
+}
+
+// ShowOneMapRegisterState defines message 'show_one_map_register_state'.
+type ShowOneMapRegisterState struct{}
+
+func (m *ShowOneMapRegisterState) Reset() { *m = ShowOneMapRegisterState{} }
+func (*ShowOneMapRegisterState) GetMessageName() string { return "show_one_map_register_state" }
+func (*ShowOneMapRegisterState) GetCrcString() string { return "51077d14" }
+func (*ShowOneMapRegisterState) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOneMapRegisterState) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOneMapRegisterState) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneMapRegisterState) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOneMapRegisterStateReply defines message 'show_one_map_register_state_reply'.
+type ShowOneMapRegisterStateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+}
+
+func (m *ShowOneMapRegisterStateReply) Reset() { *m = ShowOneMapRegisterStateReply{} }
+func (*ShowOneMapRegisterStateReply) GetMessageName() string {
+ return "show_one_map_register_state_reply"
+}
+func (*ShowOneMapRegisterStateReply) GetCrcString() string { return "14304fbc" }
+func (*ShowOneMapRegisterStateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOneMapRegisterStateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IsEnabled
+ return size
+}
+func (m *ShowOneMapRegisterStateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.IsEnabled)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneMapRegisterStateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.IsEnabled = buf.DecodeUint8()
+ return nil
+}
+
+// ShowOneMapRegisterTTL defines message 'show_one_map_register_ttl'.
+type ShowOneMapRegisterTTL struct{}
+
+func (m *ShowOneMapRegisterTTL) Reset() { *m = ShowOneMapRegisterTTL{} }
+func (*ShowOneMapRegisterTTL) GetMessageName() string { return "show_one_map_register_ttl" }
+func (*ShowOneMapRegisterTTL) GetCrcString() string { return "51077d14" }
+func (*ShowOneMapRegisterTTL) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOneMapRegisterTTL) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOneMapRegisterTTL) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneMapRegisterTTL) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOneMapRegisterTTLReply defines message 'show_one_map_register_ttl_reply'.
+type ShowOneMapRegisterTTLReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ TTL uint32 `binapi:"u32,name=ttl" json:"ttl,omitempty"`
+}
+
+func (m *ShowOneMapRegisterTTLReply) Reset() { *m = ShowOneMapRegisterTTLReply{} }
+func (*ShowOneMapRegisterTTLReply) GetMessageName() string { return "show_one_map_register_ttl_reply" }
+func (*ShowOneMapRegisterTTLReply) GetCrcString() string { return "fa83dd66" }
+func (*ShowOneMapRegisterTTLReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOneMapRegisterTTLReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.TTL
+ return size
+}
+func (m *ShowOneMapRegisterTTLReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.TTL = buf.DecodeUint32()
+ return nil
+}
+
+// ShowOneMapRequestMode defines message 'show_one_map_request_mode'.
+type ShowOneMapRequestMode struct{}
+
+func (m *ShowOneMapRequestMode) Reset() { *m = ShowOneMapRequestMode{} }
+func (*ShowOneMapRequestMode) GetMessageName() string { return "show_one_map_request_mode" }
+func (*ShowOneMapRequestMode) GetCrcString() string { return "51077d14" }
+func (*ShowOneMapRequestMode) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOneMapRequestMode) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOneMapRequestMode) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneMapRequestMode) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOneMapRequestModeReply defines message 'show_one_map_request_mode_reply'.
+type ShowOneMapRequestModeReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Mode uint8 `binapi:"u8,name=mode" json:"mode,omitempty"`
+}
+
+func (m *ShowOneMapRequestModeReply) Reset() { *m = ShowOneMapRequestModeReply{} }
+func (*ShowOneMapRequestModeReply) GetMessageName() string { return "show_one_map_request_mode_reply" }
+func (*ShowOneMapRequestModeReply) GetCrcString() string { return "d423107c" }
+func (*ShowOneMapRequestModeReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOneMapRequestModeReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.Mode
+ return size
+}
+func (m *ShowOneMapRequestModeReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.Mode)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneMapRequestModeReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Mode = buf.DecodeUint8()
+ return nil
+}
+
+// ShowOneNshMapping defines message 'show_one_nsh_mapping'.
+type ShowOneNshMapping struct{}
+
+func (m *ShowOneNshMapping) Reset() { *m = ShowOneNshMapping{} }
+func (*ShowOneNshMapping) GetMessageName() string { return "show_one_nsh_mapping" }
+func (*ShowOneNshMapping) GetCrcString() string { return "51077d14" }
+func (*ShowOneNshMapping) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOneNshMapping) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOneNshMapping) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneNshMapping) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOneNshMappingReply defines message 'show_one_nsh_mapping_reply'.
+type ShowOneNshMappingReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IsSet uint8 `binapi:"u8,name=is_set" json:"is_set,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+}
+
+func (m *ShowOneNshMappingReply) Reset() { *m = ShowOneNshMappingReply{} }
+func (*ShowOneNshMappingReply) GetMessageName() string { return "show_one_nsh_mapping_reply" }
+func (*ShowOneNshMappingReply) GetCrcString() string { return "f2ff364e" }
+func (*ShowOneNshMappingReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOneNshMappingReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IsSet
+ size += 1 * 64 // m.LocatorSetName
+ return size
+}
+func (m *ShowOneNshMappingReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.IsSet)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneNshMappingReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.IsSet = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ return nil
+}
+
+// ShowOnePitr defines message 'show_one_pitr'.
+type ShowOnePitr struct{}
+
+func (m *ShowOnePitr) Reset() { *m = ShowOnePitr{} }
+func (*ShowOnePitr) GetMessageName() string { return "show_one_pitr" }
+func (*ShowOnePitr) GetCrcString() string { return "51077d14" }
+func (*ShowOnePitr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOnePitr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOnePitr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOnePitr) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOnePitrReply defines message 'show_one_pitr_reply'.
+type ShowOnePitrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Status uint8 `binapi:"u8,name=status" json:"status,omitempty"`
+ LocatorSetName []byte `binapi:"u8[64],name=locator_set_name" json:"locator_set_name,omitempty"`
+}
+
+func (m *ShowOnePitrReply) Reset() { *m = ShowOnePitrReply{} }
+func (*ShowOnePitrReply) GetMessageName() string { return "show_one_pitr_reply" }
+func (*ShowOnePitrReply) GetCrcString() string { return "dca512cc" }
+func (*ShowOnePitrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOnePitrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.Status
+ size += 1 * 64 // m.LocatorSetName
+ return size
+}
+func (m *ShowOnePitrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.Status)
+ buf.EncodeBytes(m.LocatorSetName, 64)
+ return buf.Bytes(), nil
+}
+func (m *ShowOnePitrReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Status = buf.DecodeUint8()
+ m.LocatorSetName = make([]byte, 64)
+ copy(m.LocatorSetName, buf.DecodeBytes(len(m.LocatorSetName)))
+ return nil
+}
+
+// ShowOneRlocProbeState defines message 'show_one_rloc_probe_state'.
+type ShowOneRlocProbeState struct{}
+
+func (m *ShowOneRlocProbeState) Reset() { *m = ShowOneRlocProbeState{} }
+func (*ShowOneRlocProbeState) GetMessageName() string { return "show_one_rloc_probe_state" }
+func (*ShowOneRlocProbeState) GetCrcString() string { return "51077d14" }
+func (*ShowOneRlocProbeState) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOneRlocProbeState) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOneRlocProbeState) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneRlocProbeState) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOneRlocProbeStateReply defines message 'show_one_rloc_probe_state_reply'.
+type ShowOneRlocProbeStateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+}
+
+func (m *ShowOneRlocProbeStateReply) Reset() { *m = ShowOneRlocProbeStateReply{} }
+func (*ShowOneRlocProbeStateReply) GetMessageName() string { return "show_one_rloc_probe_state_reply" }
+func (*ShowOneRlocProbeStateReply) GetCrcString() string { return "14304fbc" }
+func (*ShowOneRlocProbeStateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOneRlocProbeStateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IsEnabled
+ return size
+}
+func (m *ShowOneRlocProbeStateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.IsEnabled)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneRlocProbeStateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.IsEnabled = buf.DecodeUint8()
+ return nil
+}
+
+// ShowOneStatsEnableDisable defines message 'show_one_stats_enable_disable'.
+type ShowOneStatsEnableDisable struct{}
+
+func (m *ShowOneStatsEnableDisable) Reset() { *m = ShowOneStatsEnableDisable{} }
+func (*ShowOneStatsEnableDisable) GetMessageName() string { return "show_one_stats_enable_disable" }
+func (*ShowOneStatsEnableDisable) GetCrcString() string { return "51077d14" }
+func (*ShowOneStatsEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOneStatsEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOneStatsEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneStatsEnableDisable) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOneStatsEnableDisableReply defines message 'show_one_stats_enable_disable_reply'.
+type ShowOneStatsEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ IsEn uint8 `binapi:"u8,name=is_en" json:"is_en,omitempty"`
+}
+
+func (m *ShowOneStatsEnableDisableReply) Reset() { *m = ShowOneStatsEnableDisableReply{} }
+func (*ShowOneStatsEnableDisableReply) GetMessageName() string {
+ return "show_one_stats_enable_disable_reply"
+}
+func (*ShowOneStatsEnableDisableReply) GetCrcString() string { return "6b4c29dc" }
+func (*ShowOneStatsEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOneStatsEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.IsEn
+ return size
+}
+func (m *ShowOneStatsEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.IsEn)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneStatsEnableDisableReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.IsEn = buf.DecodeUint8()
+ return nil
+}
+
+// ShowOneStatus defines message 'show_one_status'.
+type ShowOneStatus struct{}
+
+func (m *ShowOneStatus) Reset() { *m = ShowOneStatus{} }
+func (*ShowOneStatus) GetMessageName() string { return "show_one_status" }
+func (*ShowOneStatus) GetCrcString() string { return "51077d14" }
+func (*ShowOneStatus) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOneStatus) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOneStatus) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneStatus) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOneStatusReply defines message 'show_one_status_reply'.
+type ShowOneStatusReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ FeatureStatus uint8 `binapi:"u8,name=feature_status" json:"feature_status,omitempty"`
+ GpeStatus uint8 `binapi:"u8,name=gpe_status" json:"gpe_status,omitempty"`
+}
+
+func (m *ShowOneStatusReply) Reset() { *m = ShowOneStatusReply{} }
+func (*ShowOneStatusReply) GetMessageName() string { return "show_one_status_reply" }
+func (*ShowOneStatusReply) GetCrcString() string { return "ddcf48ef" }
+func (*ShowOneStatusReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOneStatusReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.FeatureStatus
+ size += 1 // m.GpeStatus
+ return size
+}
+func (m *ShowOneStatusReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.FeatureStatus)
+ buf.EncodeUint8(m.GpeStatus)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneStatusReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.FeatureStatus = buf.DecodeUint8()
+ m.GpeStatus = buf.DecodeUint8()
+ return nil
+}
+
+// ShowOneUsePetr defines message 'show_one_use_petr'.
+type ShowOneUsePetr struct{}
+
+func (m *ShowOneUsePetr) Reset() { *m = ShowOneUsePetr{} }
+func (*ShowOneUsePetr) GetMessageName() string { return "show_one_use_petr" }
+func (*ShowOneUsePetr) GetCrcString() string { return "51077d14" }
+func (*ShowOneUsePetr) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ShowOneUsePetr) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ShowOneUsePetr) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneUsePetr) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ShowOneUsePetrReply defines message 'show_one_use_petr_reply'.
+type ShowOneUsePetrReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Status uint8 `binapi:"u8,name=status" json:"status,omitempty"`
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ Address []byte `binapi:"u8[16],name=address" json:"address,omitempty"`
+}
+
+func (m *ShowOneUsePetrReply) Reset() { *m = ShowOneUsePetrReply{} }
+func (*ShowOneUsePetrReply) GetMessageName() string { return "show_one_use_petr_reply" }
+func (*ShowOneUsePetrReply) GetCrcString() string { return "1eb21916" }
+func (*ShowOneUsePetrReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ShowOneUsePetrReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.Status
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.Address
+ return size
+}
+func (m *ShowOneUsePetrReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint8(m.Status)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.Address, 16)
+ return buf.Bytes(), nil
+}
+func (m *ShowOneUsePetrReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Status = buf.DecodeUint8()
+ m.IsIP4 = buf.DecodeUint8()
+ m.Address = make([]byte, 16)
+ copy(m.Address, buf.DecodeBytes(len(m.Address)))
+ return nil
+}
+
+func init() { file_one_binapi_init() }
+func file_one_binapi_init() {
+ api.RegisterMessage((*OneAddDelAdjacency)(nil), "one_add_del_adjacency_f047390d")
+ api.RegisterMessage((*OneAddDelAdjacencyReply)(nil), "one_add_del_adjacency_reply_e8d4e804")
+ api.RegisterMessage((*OneAddDelL2ArpEntry)(nil), "one_add_del_l2_arp_entry_a95cc2d7")
+ api.RegisterMessage((*OneAddDelL2ArpEntryReply)(nil), "one_add_del_l2_arp_entry_reply_e8d4e804")
+ api.RegisterMessage((*OneAddDelLocalEid)(nil), "one_add_del_local_eid_e6d00717")
+ api.RegisterMessage((*OneAddDelLocalEidReply)(nil), "one_add_del_local_eid_reply_e8d4e804")
+ api.RegisterMessage((*OneAddDelLocator)(nil), "one_add_del_locator_006a4240")
+ api.RegisterMessage((*OneAddDelLocatorReply)(nil), "one_add_del_locator_reply_e8d4e804")
+ api.RegisterMessage((*OneAddDelLocatorSet)(nil), "one_add_del_locator_set_2e73b050")
+ api.RegisterMessage((*OneAddDelLocatorSetReply)(nil), "one_add_del_locator_set_reply_b6666db4")
+ api.RegisterMessage((*OneAddDelMapRequestItrRlocs)(nil), "one_add_del_map_request_itr_rlocs_c7c6cb2f")
+ api.RegisterMessage((*OneAddDelMapRequestItrRlocsReply)(nil), "one_add_del_map_request_itr_rlocs_reply_e8d4e804")
+ api.RegisterMessage((*OneAddDelMapResolver)(nil), "one_add_del_map_resolver_0ebcd37d")
+ api.RegisterMessage((*OneAddDelMapResolverReply)(nil), "one_add_del_map_resolver_reply_e8d4e804")
+ api.RegisterMessage((*OneAddDelMapServer)(nil), "one_add_del_map_server_0ebcd37d")
+ api.RegisterMessage((*OneAddDelMapServerReply)(nil), "one_add_del_map_server_reply_e8d4e804")
+ api.RegisterMessage((*OneAddDelNdpEntry)(nil), "one_add_del_ndp_entry_e9468fe3")
+ api.RegisterMessage((*OneAddDelNdpEntryReply)(nil), "one_add_del_ndp_entry_reply_e8d4e804")
+ api.RegisterMessage((*OneAddDelRemoteMapping)(nil), "one_add_del_remote_mapping_0b2010ec")
+ api.RegisterMessage((*OneAddDelRemoteMappingReply)(nil), "one_add_del_remote_mapping_reply_e8d4e804")
+ api.RegisterMessage((*OneAdjacenciesGet)(nil), "one_adjacencies_get_8d1f2fe9")
+ api.RegisterMessage((*OneAdjacenciesGetReply)(nil), "one_adjacencies_get_reply_60a3c592")
+ api.RegisterMessage((*OneEidTableAddDelMap)(nil), "one_eid_table_add_del_map_59e9975e")
+ api.RegisterMessage((*OneEidTableAddDelMapReply)(nil), "one_eid_table_add_del_map_reply_e8d4e804")
+ api.RegisterMessage((*OneEidTableDetails)(nil), "one_eid_table_details_dcd9f414")
+ api.RegisterMessage((*OneEidTableDump)(nil), "one_eid_table_dump_e0df64da")
+ api.RegisterMessage((*OneEidTableMapDetails)(nil), "one_eid_table_map_details_0b6859e2")
+ api.RegisterMessage((*OneEidTableMapDump)(nil), "one_eid_table_map_dump_67c54650")
+ api.RegisterMessage((*OneEidTableVniDetails)(nil), "one_eid_table_vni_details_64abc01e")
+ api.RegisterMessage((*OneEidTableVniDump)(nil), "one_eid_table_vni_dump_51077d14")
+ api.RegisterMessage((*OneEnableDisable)(nil), "one_enable_disable_eb0e943b")
+ api.RegisterMessage((*OneEnableDisablePetrMode)(nil), "one_enable_disable_petr_mode_eb0e943b")
+ api.RegisterMessage((*OneEnableDisablePetrModeReply)(nil), "one_enable_disable_petr_mode_reply_e8d4e804")
+ api.RegisterMessage((*OneEnableDisablePitrMode)(nil), "one_enable_disable_pitr_mode_eb0e943b")
+ api.RegisterMessage((*OneEnableDisablePitrModeReply)(nil), "one_enable_disable_pitr_mode_reply_e8d4e804")
+ api.RegisterMessage((*OneEnableDisableReply)(nil), "one_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*OneEnableDisableXtrMode)(nil), "one_enable_disable_xtr_mode_eb0e943b")
+ api.RegisterMessage((*OneEnableDisableXtrModeReply)(nil), "one_enable_disable_xtr_mode_reply_e8d4e804")
+ api.RegisterMessage((*OneGetMapRequestItrRlocs)(nil), "one_get_map_request_itr_rlocs_51077d14")
+ api.RegisterMessage((*OneGetMapRequestItrRlocsReply)(nil), "one_get_map_request_itr_rlocs_reply_9f56f6f7")
+ api.RegisterMessage((*OneGetTransportProtocol)(nil), "one_get_transport_protocol_51077d14")
+ api.RegisterMessage((*OneGetTransportProtocolReply)(nil), "one_get_transport_protocol_reply_62a28eb3")
+ api.RegisterMessage((*OneL2ArpBdGet)(nil), "one_l2_arp_bd_get_51077d14")
+ api.RegisterMessage((*OneL2ArpBdGetReply)(nil), "one_l2_arp_bd_get_reply_221ac888")
+ api.RegisterMessage((*OneL2ArpEntriesGet)(nil), "one_l2_arp_entries_get_4d418cf4")
+ api.RegisterMessage((*OneL2ArpEntriesGetReply)(nil), "one_l2_arp_entries_get_reply_88e54ded")
+ api.RegisterMessage((*OneLocatorDetails)(nil), "one_locator_details_b3988a30")
+ api.RegisterMessage((*OneLocatorDump)(nil), "one_locator_dump_f27d5050")
+ api.RegisterMessage((*OneLocatorSetDetails)(nil), "one_locator_set_details_6b846882")
+ api.RegisterMessage((*OneLocatorSetDump)(nil), "one_locator_set_dump_c79e8ab0")
+ api.RegisterMessage((*OneMapRegisterEnableDisable)(nil), "one_map_register_enable_disable_294103d1")
+ api.RegisterMessage((*OneMapRegisterEnableDisableReply)(nil), "one_map_register_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*OneMapRegisterFallbackThreshold)(nil), "one_map_register_fallback_threshold_f7d4a475")
+ api.RegisterMessage((*OneMapRegisterFallbackThresholdReply)(nil), "one_map_register_fallback_threshold_reply_e8d4e804")
+ api.RegisterMessage((*OneMapRegisterSetTTL)(nil), "one_map_register_set_ttl_dd59f1f3")
+ api.RegisterMessage((*OneMapRegisterSetTTLReply)(nil), "one_map_register_set_ttl_reply_e8d4e804")
+ api.RegisterMessage((*OneMapRequestMode)(nil), "one_map_request_mode_f3f93ce9")
+ api.RegisterMessage((*OneMapRequestModeReply)(nil), "one_map_request_mode_reply_e8d4e804")
+ api.RegisterMessage((*OneMapResolverDetails)(nil), "one_map_resolver_details_60a5f5ca")
+ api.RegisterMessage((*OneMapResolverDump)(nil), "one_map_resolver_dump_51077d14")
+ api.RegisterMessage((*OneMapServerDetails)(nil), "one_map_server_details_60a5f5ca")
+ api.RegisterMessage((*OneMapServerDump)(nil), "one_map_server_dump_51077d14")
+ api.RegisterMessage((*OneNdpBdGet)(nil), "one_ndp_bd_get_51077d14")
+ api.RegisterMessage((*OneNdpBdGetReply)(nil), "one_ndp_bd_get_reply_221ac888")
+ api.RegisterMessage((*OneNdpEntriesGet)(nil), "one_ndp_entries_get_4d418cf4")
+ api.RegisterMessage((*OneNdpEntriesGetReply)(nil), "one_ndp_entries_get_reply_d0822f37")
+ api.RegisterMessage((*OneNshSetLocatorSet)(nil), "one_nsh_set_locator_set_7aa022dd")
+ api.RegisterMessage((*OneNshSetLocatorSetReply)(nil), "one_nsh_set_locator_set_reply_e8d4e804")
+ api.RegisterMessage((*OnePitrSetLocatorSet)(nil), "one_pitr_set_locator_set_7aa022dd")
+ api.RegisterMessage((*OnePitrSetLocatorSetReply)(nil), "one_pitr_set_locator_set_reply_e8d4e804")
+ api.RegisterMessage((*OneRlocProbeEnableDisable)(nil), "one_rloc_probe_enable_disable_294103d1")
+ api.RegisterMessage((*OneRlocProbeEnableDisableReply)(nil), "one_rloc_probe_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*OneSetTransportProtocol)(nil), "one_set_transport_protocol_07b6b85f")
+ api.RegisterMessage((*OneSetTransportProtocolReply)(nil), "one_set_transport_protocol_reply_e8d4e804")
+ api.RegisterMessage((*OneShowPetrMode)(nil), "one_show_petr_mode_51077d14")
+ api.RegisterMessage((*OneShowPetrModeReply)(nil), "one_show_petr_mode_reply_6b4c29dc")
+ api.RegisterMessage((*OneShowPitrMode)(nil), "one_show_pitr_mode_51077d14")
+ api.RegisterMessage((*OneShowPitrModeReply)(nil), "one_show_pitr_mode_reply_6b4c29dc")
+ api.RegisterMessage((*OneShowXtrMode)(nil), "one_show_xtr_mode_51077d14")
+ api.RegisterMessage((*OneShowXtrModeReply)(nil), "one_show_xtr_mode_reply_6b4c29dc")
+ api.RegisterMessage((*OneStatsDetails)(nil), "one_stats_details_e1a34a05")
+ api.RegisterMessage((*OneStatsDump)(nil), "one_stats_dump_51077d14")
+ api.RegisterMessage((*OneStatsEnableDisable)(nil), "one_stats_enable_disable_eb0e943b")
+ api.RegisterMessage((*OneStatsEnableDisableReply)(nil), "one_stats_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*OneStatsFlush)(nil), "one_stats_flush_51077d14")
+ api.RegisterMessage((*OneStatsFlushReply)(nil), "one_stats_flush_reply_e8d4e804")
+ api.RegisterMessage((*OneUsePetr)(nil), "one_use_petr_6910787d")
+ api.RegisterMessage((*OneUsePetrReply)(nil), "one_use_petr_reply_e8d4e804")
+ api.RegisterMessage((*ShowOneMapRegisterFallbackThreshold)(nil), "show_one_map_register_fallback_threshold_51077d14")
+ api.RegisterMessage((*ShowOneMapRegisterFallbackThresholdReply)(nil), "show_one_map_register_fallback_threshold_reply_c93a9113")
+ api.RegisterMessage((*ShowOneMapRegisterState)(nil), "show_one_map_register_state_51077d14")
+ api.RegisterMessage((*ShowOneMapRegisterStateReply)(nil), "show_one_map_register_state_reply_14304fbc")
+ api.RegisterMessage((*ShowOneMapRegisterTTL)(nil), "show_one_map_register_ttl_51077d14")
+ api.RegisterMessage((*ShowOneMapRegisterTTLReply)(nil), "show_one_map_register_ttl_reply_fa83dd66")
+ api.RegisterMessage((*ShowOneMapRequestMode)(nil), "show_one_map_request_mode_51077d14")
+ api.RegisterMessage((*ShowOneMapRequestModeReply)(nil), "show_one_map_request_mode_reply_d423107c")
+ api.RegisterMessage((*ShowOneNshMapping)(nil), "show_one_nsh_mapping_51077d14")
+ api.RegisterMessage((*ShowOneNshMappingReply)(nil), "show_one_nsh_mapping_reply_f2ff364e")
+ api.RegisterMessage((*ShowOnePitr)(nil), "show_one_pitr_51077d14")
+ api.RegisterMessage((*ShowOnePitrReply)(nil), "show_one_pitr_reply_dca512cc")
+ api.RegisterMessage((*ShowOneRlocProbeState)(nil), "show_one_rloc_probe_state_51077d14")
+ api.RegisterMessage((*ShowOneRlocProbeStateReply)(nil), "show_one_rloc_probe_state_reply_14304fbc")
+ api.RegisterMessage((*ShowOneStatsEnableDisable)(nil), "show_one_stats_enable_disable_51077d14")
+ api.RegisterMessage((*ShowOneStatsEnableDisableReply)(nil), "show_one_stats_enable_disable_reply_6b4c29dc")
+ api.RegisterMessage((*ShowOneStatus)(nil), "show_one_status_51077d14")
+ api.RegisterMessage((*ShowOneStatusReply)(nil), "show_one_status_reply_ddcf48ef")
+ api.RegisterMessage((*ShowOneUsePetr)(nil), "show_one_use_petr_51077d14")
+ api.RegisterMessage((*ShowOneUsePetrReply)(nil), "show_one_use_petr_reply_1eb21916")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*OneAddDelAdjacency)(nil),
+ (*OneAddDelAdjacencyReply)(nil),
+ (*OneAddDelL2ArpEntry)(nil),
+ (*OneAddDelL2ArpEntryReply)(nil),
+ (*OneAddDelLocalEid)(nil),
+ (*OneAddDelLocalEidReply)(nil),
+ (*OneAddDelLocator)(nil),
+ (*OneAddDelLocatorReply)(nil),
+ (*OneAddDelLocatorSet)(nil),
+ (*OneAddDelLocatorSetReply)(nil),
+ (*OneAddDelMapRequestItrRlocs)(nil),
+ (*OneAddDelMapRequestItrRlocsReply)(nil),
+ (*OneAddDelMapResolver)(nil),
+ (*OneAddDelMapResolverReply)(nil),
+ (*OneAddDelMapServer)(nil),
+ (*OneAddDelMapServerReply)(nil),
+ (*OneAddDelNdpEntry)(nil),
+ (*OneAddDelNdpEntryReply)(nil),
+ (*OneAddDelRemoteMapping)(nil),
+ (*OneAddDelRemoteMappingReply)(nil),
+ (*OneAdjacenciesGet)(nil),
+ (*OneAdjacenciesGetReply)(nil),
+ (*OneEidTableAddDelMap)(nil),
+ (*OneEidTableAddDelMapReply)(nil),
+ (*OneEidTableDetails)(nil),
+ (*OneEidTableDump)(nil),
+ (*OneEidTableMapDetails)(nil),
+ (*OneEidTableMapDump)(nil),
+ (*OneEidTableVniDetails)(nil),
+ (*OneEidTableVniDump)(nil),
+ (*OneEnableDisable)(nil),
+ (*OneEnableDisablePetrMode)(nil),
+ (*OneEnableDisablePetrModeReply)(nil),
+ (*OneEnableDisablePitrMode)(nil),
+ (*OneEnableDisablePitrModeReply)(nil),
+ (*OneEnableDisableReply)(nil),
+ (*OneEnableDisableXtrMode)(nil),
+ (*OneEnableDisableXtrModeReply)(nil),
+ (*OneGetMapRequestItrRlocs)(nil),
+ (*OneGetMapRequestItrRlocsReply)(nil),
+ (*OneGetTransportProtocol)(nil),
+ (*OneGetTransportProtocolReply)(nil),
+ (*OneL2ArpBdGet)(nil),
+ (*OneL2ArpBdGetReply)(nil),
+ (*OneL2ArpEntriesGet)(nil),
+ (*OneL2ArpEntriesGetReply)(nil),
+ (*OneLocatorDetails)(nil),
+ (*OneLocatorDump)(nil),
+ (*OneLocatorSetDetails)(nil),
+ (*OneLocatorSetDump)(nil),
+ (*OneMapRegisterEnableDisable)(nil),
+ (*OneMapRegisterEnableDisableReply)(nil),
+ (*OneMapRegisterFallbackThreshold)(nil),
+ (*OneMapRegisterFallbackThresholdReply)(nil),
+ (*OneMapRegisterSetTTL)(nil),
+ (*OneMapRegisterSetTTLReply)(nil),
+ (*OneMapRequestMode)(nil),
+ (*OneMapRequestModeReply)(nil),
+ (*OneMapResolverDetails)(nil),
+ (*OneMapResolverDump)(nil),
+ (*OneMapServerDetails)(nil),
+ (*OneMapServerDump)(nil),
+ (*OneNdpBdGet)(nil),
+ (*OneNdpBdGetReply)(nil),
+ (*OneNdpEntriesGet)(nil),
+ (*OneNdpEntriesGetReply)(nil),
+ (*OneNshSetLocatorSet)(nil),
+ (*OneNshSetLocatorSetReply)(nil),
+ (*OnePitrSetLocatorSet)(nil),
+ (*OnePitrSetLocatorSetReply)(nil),
+ (*OneRlocProbeEnableDisable)(nil),
+ (*OneRlocProbeEnableDisableReply)(nil),
+ (*OneSetTransportProtocol)(nil),
+ (*OneSetTransportProtocolReply)(nil),
+ (*OneShowPetrMode)(nil),
+ (*OneShowPetrModeReply)(nil),
+ (*OneShowPitrMode)(nil),
+ (*OneShowPitrModeReply)(nil),
+ (*OneShowXtrMode)(nil),
+ (*OneShowXtrModeReply)(nil),
+ (*OneStatsDetails)(nil),
+ (*OneStatsDump)(nil),
+ (*OneStatsEnableDisable)(nil),
+ (*OneStatsEnableDisableReply)(nil),
+ (*OneStatsFlush)(nil),
+ (*OneStatsFlushReply)(nil),
+ (*OneUsePetr)(nil),
+ (*OneUsePetrReply)(nil),
+ (*ShowOneMapRegisterFallbackThreshold)(nil),
+ (*ShowOneMapRegisterFallbackThresholdReply)(nil),
+ (*ShowOneMapRegisterState)(nil),
+ (*ShowOneMapRegisterStateReply)(nil),
+ (*ShowOneMapRegisterTTL)(nil),
+ (*ShowOneMapRegisterTTLReply)(nil),
+ (*ShowOneMapRequestMode)(nil),
+ (*ShowOneMapRequestModeReply)(nil),
+ (*ShowOneNshMapping)(nil),
+ (*ShowOneNshMappingReply)(nil),
+ (*ShowOnePitr)(nil),
+ (*ShowOnePitrReply)(nil),
+ (*ShowOneRlocProbeState)(nil),
+ (*ShowOneRlocProbeStateReply)(nil),
+ (*ShowOneStatsEnableDisable)(nil),
+ (*ShowOneStatsEnableDisableReply)(nil),
+ (*ShowOneStatus)(nil),
+ (*ShowOneStatusReply)(nil),
+ (*ShowOneUsePetr)(nil),
+ (*ShowOneUsePetrReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/one/one_rpc.ba.go b/internal/testbinapi/binapi2001/one/one_rpc.ba.go
new file mode 100644
index 0000000..1b18bdf
--- /dev/null
+++ b/internal/testbinapi/binapi2001/one/one_rpc.ba.go
@@ -0,0 +1,803 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package one
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service one.
+type RPCService interface {
+ OneAddDelAdjacency(ctx context.Context, in *OneAddDelAdjacency) (*OneAddDelAdjacencyReply, error)
+ OneAddDelL2ArpEntry(ctx context.Context, in *OneAddDelL2ArpEntry) (*OneAddDelL2ArpEntryReply, error)
+ OneAddDelLocalEid(ctx context.Context, in *OneAddDelLocalEid) (*OneAddDelLocalEidReply, error)
+ OneAddDelLocator(ctx context.Context, in *OneAddDelLocator) (*OneAddDelLocatorReply, error)
+ OneAddDelLocatorSet(ctx context.Context, in *OneAddDelLocatorSet) (*OneAddDelLocatorSetReply, error)
+ OneAddDelMapRequestItrRlocs(ctx context.Context, in *OneAddDelMapRequestItrRlocs) (*OneAddDelMapRequestItrRlocsReply, error)
+ OneAddDelMapResolver(ctx context.Context, in *OneAddDelMapResolver) (*OneAddDelMapResolverReply, error)
+ OneAddDelMapServer(ctx context.Context, in *OneAddDelMapServer) (*OneAddDelMapServerReply, error)
+ OneAddDelNdpEntry(ctx context.Context, in *OneAddDelNdpEntry) (*OneAddDelNdpEntryReply, error)
+ OneAddDelRemoteMapping(ctx context.Context, in *OneAddDelRemoteMapping) (*OneAddDelRemoteMappingReply, error)
+ OneAdjacenciesGet(ctx context.Context, in *OneAdjacenciesGet) (*OneAdjacenciesGetReply, error)
+ OneEidTableAddDelMap(ctx context.Context, in *OneEidTableAddDelMap) (*OneEidTableAddDelMapReply, error)
+ OneEidTableDump(ctx context.Context, in *OneEidTableDump) (RPCService_OneEidTableDumpClient, error)
+ OneEidTableMapDump(ctx context.Context, in *OneEidTableMapDump) (RPCService_OneEidTableMapDumpClient, error)
+ OneEidTableVniDump(ctx context.Context, in *OneEidTableVniDump) (RPCService_OneEidTableVniDumpClient, error)
+ OneEnableDisable(ctx context.Context, in *OneEnableDisable) (*OneEnableDisableReply, error)
+ OneEnableDisablePetrMode(ctx context.Context, in *OneEnableDisablePetrMode) (*OneEnableDisablePetrModeReply, error)
+ OneEnableDisablePitrMode(ctx context.Context, in *OneEnableDisablePitrMode) (*OneEnableDisablePitrModeReply, error)
+ OneEnableDisableXtrMode(ctx context.Context, in *OneEnableDisableXtrMode) (*OneEnableDisableXtrModeReply, error)
+ OneGetMapRequestItrRlocs(ctx context.Context, in *OneGetMapRequestItrRlocs) (*OneGetMapRequestItrRlocsReply, error)
+ OneGetTransportProtocol(ctx context.Context, in *OneGetTransportProtocol) (*OneGetTransportProtocolReply, error)
+ OneL2ArpBdGet(ctx context.Context, in *OneL2ArpBdGet) (*OneL2ArpBdGetReply, error)
+ OneL2ArpEntriesGet(ctx context.Context, in *OneL2ArpEntriesGet) (*OneL2ArpEntriesGetReply, error)
+ OneLocatorDump(ctx context.Context, in *OneLocatorDump) (RPCService_OneLocatorDumpClient, error)
+ OneLocatorSetDump(ctx context.Context, in *OneLocatorSetDump) (RPCService_OneLocatorSetDumpClient, error)
+ OneMapRegisterEnableDisable(ctx context.Context, in *OneMapRegisterEnableDisable) (*OneMapRegisterEnableDisableReply, error)
+ OneMapRegisterFallbackThreshold(ctx context.Context, in *OneMapRegisterFallbackThreshold) (*OneMapRegisterFallbackThresholdReply, error)
+ OneMapRegisterSetTTL(ctx context.Context, in *OneMapRegisterSetTTL) (*OneMapRegisterSetTTLReply, error)
+ OneMapRequestMode(ctx context.Context, in *OneMapRequestMode) (*OneMapRequestModeReply, error)
+ OneMapResolverDump(ctx context.Context, in *OneMapResolverDump) (RPCService_OneMapResolverDumpClient, error)
+ OneMapServerDump(ctx context.Context, in *OneMapServerDump) (RPCService_OneMapServerDumpClient, error)
+ OneNdpBdGet(ctx context.Context, in *OneNdpBdGet) (*OneNdpBdGetReply, error)
+ OneNdpEntriesGet(ctx context.Context, in *OneNdpEntriesGet) (*OneNdpEntriesGetReply, error)
+ OneNshSetLocatorSet(ctx context.Context, in *OneNshSetLocatorSet) (*OneNshSetLocatorSetReply, error)
+ OnePitrSetLocatorSet(ctx context.Context, in *OnePitrSetLocatorSet) (*OnePitrSetLocatorSetReply, error)
+ OneRlocProbeEnableDisable(ctx context.Context, in *OneRlocProbeEnableDisable) (*OneRlocProbeEnableDisableReply, error)
+ OneSetTransportProtocol(ctx context.Context, in *OneSetTransportProtocol) (*OneSetTransportProtocolReply, error)
+ OneShowPetrMode(ctx context.Context, in *OneShowPetrMode) (*OneShowPetrModeReply, error)
+ OneShowPitrMode(ctx context.Context, in *OneShowPitrMode) (*OneShowPitrModeReply, error)
+ OneShowXtrMode(ctx context.Context, in *OneShowXtrMode) (*OneShowXtrModeReply, error)
+ OneStatsDump(ctx context.Context, in *OneStatsDump) (RPCService_OneStatsDumpClient, error)
+ OneStatsEnableDisable(ctx context.Context, in *OneStatsEnableDisable) (*OneStatsEnableDisableReply, error)
+ OneStatsFlush(ctx context.Context, in *OneStatsFlush) (*OneStatsFlushReply, error)
+ OneUsePetr(ctx context.Context, in *OneUsePetr) (*OneUsePetrReply, error)
+ ShowOneMapRegisterFallbackThreshold(ctx context.Context, in *ShowOneMapRegisterFallbackThreshold) (*ShowOneMapRegisterFallbackThresholdReply, error)
+ ShowOneMapRegisterState(ctx context.Context, in *ShowOneMapRegisterState) (*ShowOneMapRegisterStateReply, error)
+ ShowOneMapRegisterTTL(ctx context.Context, in *ShowOneMapRegisterTTL) (*ShowOneMapRegisterTTLReply, error)
+ ShowOneMapRequestMode(ctx context.Context, in *ShowOneMapRequestMode) (*ShowOneMapRequestModeReply, error)
+ ShowOneNshMapping(ctx context.Context, in *ShowOneNshMapping) (*ShowOneNshMappingReply, error)
+ ShowOnePitr(ctx context.Context, in *ShowOnePitr) (*ShowOnePitrReply, error)
+ ShowOneRlocProbeState(ctx context.Context, in *ShowOneRlocProbeState) (*ShowOneRlocProbeStateReply, error)
+ ShowOneStatsEnableDisable(ctx context.Context, in *ShowOneStatsEnableDisable) (*ShowOneStatsEnableDisableReply, error)
+ ShowOneStatus(ctx context.Context, in *ShowOneStatus) (*ShowOneStatusReply, error)
+ ShowOneUsePetr(ctx context.Context, in *ShowOneUsePetr) (*ShowOneUsePetrReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) OneAddDelAdjacency(ctx context.Context, in *OneAddDelAdjacency) (*OneAddDelAdjacencyReply, error) {
+ out := new(OneAddDelAdjacencyReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAddDelL2ArpEntry(ctx context.Context, in *OneAddDelL2ArpEntry) (*OneAddDelL2ArpEntryReply, error) {
+ out := new(OneAddDelL2ArpEntryReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAddDelLocalEid(ctx context.Context, in *OneAddDelLocalEid) (*OneAddDelLocalEidReply, error) {
+ out := new(OneAddDelLocalEidReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAddDelLocator(ctx context.Context, in *OneAddDelLocator) (*OneAddDelLocatorReply, error) {
+ out := new(OneAddDelLocatorReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAddDelLocatorSet(ctx context.Context, in *OneAddDelLocatorSet) (*OneAddDelLocatorSetReply, error) {
+ out := new(OneAddDelLocatorSetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAddDelMapRequestItrRlocs(ctx context.Context, in *OneAddDelMapRequestItrRlocs) (*OneAddDelMapRequestItrRlocsReply, error) {
+ out := new(OneAddDelMapRequestItrRlocsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAddDelMapResolver(ctx context.Context, in *OneAddDelMapResolver) (*OneAddDelMapResolverReply, error) {
+ out := new(OneAddDelMapResolverReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAddDelMapServer(ctx context.Context, in *OneAddDelMapServer) (*OneAddDelMapServerReply, error) {
+ out := new(OneAddDelMapServerReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAddDelNdpEntry(ctx context.Context, in *OneAddDelNdpEntry) (*OneAddDelNdpEntryReply, error) {
+ out := new(OneAddDelNdpEntryReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAddDelRemoteMapping(ctx context.Context, in *OneAddDelRemoteMapping) (*OneAddDelRemoteMappingReply, error) {
+ out := new(OneAddDelRemoteMappingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneAdjacenciesGet(ctx context.Context, in *OneAdjacenciesGet) (*OneAdjacenciesGetReply, error) {
+ out := new(OneAdjacenciesGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneEidTableAddDelMap(ctx context.Context, in *OneEidTableAddDelMap) (*OneEidTableAddDelMapReply, error) {
+ out := new(OneEidTableAddDelMapReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneEidTableDump(ctx context.Context, in *OneEidTableDump) (RPCService_OneEidTableDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_OneEidTableDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_OneEidTableDumpClient interface {
+ Recv() (*OneEidTableDetails, error)
+ api.Stream
+}
+
+type serviceClient_OneEidTableDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_OneEidTableDumpClient) Recv() (*OneEidTableDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *OneEidTableDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) OneEidTableMapDump(ctx context.Context, in *OneEidTableMapDump) (RPCService_OneEidTableMapDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_OneEidTableMapDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_OneEidTableMapDumpClient interface {
+ Recv() (*OneEidTableMapDetails, error)
+ api.Stream
+}
+
+type serviceClient_OneEidTableMapDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_OneEidTableMapDumpClient) Recv() (*OneEidTableMapDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *OneEidTableMapDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) OneEidTableVniDump(ctx context.Context, in *OneEidTableVniDump) (RPCService_OneEidTableVniDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_OneEidTableVniDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_OneEidTableVniDumpClient interface {
+ Recv() (*OneEidTableVniDetails, error)
+ api.Stream
+}
+
+type serviceClient_OneEidTableVniDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_OneEidTableVniDumpClient) Recv() (*OneEidTableVniDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *OneEidTableVniDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) OneEnableDisable(ctx context.Context, in *OneEnableDisable) (*OneEnableDisableReply, error) {
+ out := new(OneEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneEnableDisablePetrMode(ctx context.Context, in *OneEnableDisablePetrMode) (*OneEnableDisablePetrModeReply, error) {
+ out := new(OneEnableDisablePetrModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneEnableDisablePitrMode(ctx context.Context, in *OneEnableDisablePitrMode) (*OneEnableDisablePitrModeReply, error) {
+ out := new(OneEnableDisablePitrModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneEnableDisableXtrMode(ctx context.Context, in *OneEnableDisableXtrMode) (*OneEnableDisableXtrModeReply, error) {
+ out := new(OneEnableDisableXtrModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneGetMapRequestItrRlocs(ctx context.Context, in *OneGetMapRequestItrRlocs) (*OneGetMapRequestItrRlocsReply, error) {
+ out := new(OneGetMapRequestItrRlocsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneGetTransportProtocol(ctx context.Context, in *OneGetTransportProtocol) (*OneGetTransportProtocolReply, error) {
+ out := new(OneGetTransportProtocolReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneL2ArpBdGet(ctx context.Context, in *OneL2ArpBdGet) (*OneL2ArpBdGetReply, error) {
+ out := new(OneL2ArpBdGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneL2ArpEntriesGet(ctx context.Context, in *OneL2ArpEntriesGet) (*OneL2ArpEntriesGetReply, error) {
+ out := new(OneL2ArpEntriesGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneLocatorDump(ctx context.Context, in *OneLocatorDump) (RPCService_OneLocatorDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_OneLocatorDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_OneLocatorDumpClient interface {
+ Recv() (*OneLocatorDetails, error)
+ api.Stream
+}
+
+type serviceClient_OneLocatorDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_OneLocatorDumpClient) Recv() (*OneLocatorDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *OneLocatorDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) OneLocatorSetDump(ctx context.Context, in *OneLocatorSetDump) (RPCService_OneLocatorSetDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_OneLocatorSetDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_OneLocatorSetDumpClient interface {
+ Recv() (*OneLocatorSetDetails, error)
+ api.Stream
+}
+
+type serviceClient_OneLocatorSetDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_OneLocatorSetDumpClient) Recv() (*OneLocatorSetDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *OneLocatorSetDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) OneMapRegisterEnableDisable(ctx context.Context, in *OneMapRegisterEnableDisable) (*OneMapRegisterEnableDisableReply, error) {
+ out := new(OneMapRegisterEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneMapRegisterFallbackThreshold(ctx context.Context, in *OneMapRegisterFallbackThreshold) (*OneMapRegisterFallbackThresholdReply, error) {
+ out := new(OneMapRegisterFallbackThresholdReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneMapRegisterSetTTL(ctx context.Context, in *OneMapRegisterSetTTL) (*OneMapRegisterSetTTLReply, error) {
+ out := new(OneMapRegisterSetTTLReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneMapRequestMode(ctx context.Context, in *OneMapRequestMode) (*OneMapRequestModeReply, error) {
+ out := new(OneMapRequestModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneMapResolverDump(ctx context.Context, in *OneMapResolverDump) (RPCService_OneMapResolverDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_OneMapResolverDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_OneMapResolverDumpClient interface {
+ Recv() (*OneMapResolverDetails, error)
+ api.Stream
+}
+
+type serviceClient_OneMapResolverDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_OneMapResolverDumpClient) Recv() (*OneMapResolverDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *OneMapResolverDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) OneMapServerDump(ctx context.Context, in *OneMapServerDump) (RPCService_OneMapServerDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_OneMapServerDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_OneMapServerDumpClient interface {
+ Recv() (*OneMapServerDetails, error)
+ api.Stream
+}
+
+type serviceClient_OneMapServerDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_OneMapServerDumpClient) Recv() (*OneMapServerDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *OneMapServerDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) OneNdpBdGet(ctx context.Context, in *OneNdpBdGet) (*OneNdpBdGetReply, error) {
+ out := new(OneNdpBdGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneNdpEntriesGet(ctx context.Context, in *OneNdpEntriesGet) (*OneNdpEntriesGetReply, error) {
+ out := new(OneNdpEntriesGetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneNshSetLocatorSet(ctx context.Context, in *OneNshSetLocatorSet) (*OneNshSetLocatorSetReply, error) {
+ out := new(OneNshSetLocatorSetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OnePitrSetLocatorSet(ctx context.Context, in *OnePitrSetLocatorSet) (*OnePitrSetLocatorSetReply, error) {
+ out := new(OnePitrSetLocatorSetReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneRlocProbeEnableDisable(ctx context.Context, in *OneRlocProbeEnableDisable) (*OneRlocProbeEnableDisableReply, error) {
+ out := new(OneRlocProbeEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneSetTransportProtocol(ctx context.Context, in *OneSetTransportProtocol) (*OneSetTransportProtocolReply, error) {
+ out := new(OneSetTransportProtocolReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneShowPetrMode(ctx context.Context, in *OneShowPetrMode) (*OneShowPetrModeReply, error) {
+ out := new(OneShowPetrModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneShowPitrMode(ctx context.Context, in *OneShowPitrMode) (*OneShowPitrModeReply, error) {
+ out := new(OneShowPitrModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneShowXtrMode(ctx context.Context, in *OneShowXtrMode) (*OneShowXtrModeReply, error) {
+ out := new(OneShowXtrModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneStatsDump(ctx context.Context, in *OneStatsDump) (RPCService_OneStatsDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_OneStatsDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_OneStatsDumpClient interface {
+ Recv() (*OneStatsDetails, error)
+ api.Stream
+}
+
+type serviceClient_OneStatsDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_OneStatsDumpClient) Recv() (*OneStatsDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *OneStatsDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) OneStatsEnableDisable(ctx context.Context, in *OneStatsEnableDisable) (*OneStatsEnableDisableReply, error) {
+ out := new(OneStatsEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneStatsFlush(ctx context.Context, in *OneStatsFlush) (*OneStatsFlushReply, error) {
+ out := new(OneStatsFlushReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) OneUsePetr(ctx context.Context, in *OneUsePetr) (*OneUsePetrReply, error) {
+ out := new(OneUsePetrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOneMapRegisterFallbackThreshold(ctx context.Context, in *ShowOneMapRegisterFallbackThreshold) (*ShowOneMapRegisterFallbackThresholdReply, error) {
+ out := new(ShowOneMapRegisterFallbackThresholdReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOneMapRegisterState(ctx context.Context, in *ShowOneMapRegisterState) (*ShowOneMapRegisterStateReply, error) {
+ out := new(ShowOneMapRegisterStateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOneMapRegisterTTL(ctx context.Context, in *ShowOneMapRegisterTTL) (*ShowOneMapRegisterTTLReply, error) {
+ out := new(ShowOneMapRegisterTTLReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOneMapRequestMode(ctx context.Context, in *ShowOneMapRequestMode) (*ShowOneMapRequestModeReply, error) {
+ out := new(ShowOneMapRequestModeReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOneNshMapping(ctx context.Context, in *ShowOneNshMapping) (*ShowOneNshMappingReply, error) {
+ out := new(ShowOneNshMappingReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOnePitr(ctx context.Context, in *ShowOnePitr) (*ShowOnePitrReply, error) {
+ out := new(ShowOnePitrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOneRlocProbeState(ctx context.Context, in *ShowOneRlocProbeState) (*ShowOneRlocProbeStateReply, error) {
+ out := new(ShowOneRlocProbeStateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOneStatsEnableDisable(ctx context.Context, in *ShowOneStatsEnableDisable) (*ShowOneStatsEnableDisableReply, error) {
+ out := new(ShowOneStatsEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOneStatus(ctx context.Context, in *ShowOneStatus) (*ShowOneStatusReply, error) {
+ out := new(ShowOneStatusReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ShowOneUsePetr(ctx context.Context, in *ShowOneUsePetr) (*ShowOneUsePetrReply, error) {
+ out := new(ShowOneUsePetrReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet.ba.go b/internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet.ba.go
new file mode 100644
index 0000000..bf0096b
--- /dev/null
+++ b/internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet.ba.go
@@ -0,0 +1,483 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/p2p_ethernet.api.json
+
+// Package p2p_ethernet contains generated bindings for API file p2p_ethernet.api.
+//
+// Contents:
+// 2 aliases
+// 6 enums
+// 4 messages
+//
+package p2p_ethernet
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "net"
+ "strconv"
+)
+
+// 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 = "p2p_ethernet"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x282f1ed1
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// P2pEthernetAdd defines message 'p2p_ethernet_add'.
+type P2pEthernetAdd struct {
+ ParentIfIndex InterfaceIndex `binapi:"interface_index,name=parent_if_index" json:"parent_if_index,omitempty"`
+ SubifID uint32 `binapi:"u32,name=subif_id" json:"subif_id,omitempty"`
+ RemoteMac MacAddress `binapi:"mac_address,name=remote_mac" json:"remote_mac,omitempty"`
+}
+
+func (m *P2pEthernetAdd) Reset() { *m = P2pEthernetAdd{} }
+func (*P2pEthernetAdd) GetMessageName() string { return "p2p_ethernet_add" }
+func (*P2pEthernetAdd) GetCrcString() string { return "eeb8e717" }
+func (*P2pEthernetAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *P2pEthernetAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ParentIfIndex
+ size += 4 // m.SubifID
+ size += 1 * 6 // m.RemoteMac
+ return size
+}
+func (m *P2pEthernetAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.ParentIfIndex))
+ buf.EncodeUint32(m.SubifID)
+ buf.EncodeBytes(m.RemoteMac[:], 6)
+ return buf.Bytes(), nil
+}
+func (m *P2pEthernetAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ParentIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.SubifID = buf.DecodeUint32()
+ copy(m.RemoteMac[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// P2pEthernetAddReply defines message 'p2p_ethernet_add_reply'.
+type P2pEthernetAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *P2pEthernetAddReply) Reset() { *m = P2pEthernetAddReply{} }
+func (*P2pEthernetAddReply) GetMessageName() string { return "p2p_ethernet_add_reply" }
+func (*P2pEthernetAddReply) GetCrcString() string { return "5383d31f" }
+func (*P2pEthernetAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *P2pEthernetAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *P2pEthernetAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// P2pEthernetDel defines message 'p2p_ethernet_del'.
+type P2pEthernetDel struct {
+ ParentIfIndex InterfaceIndex `binapi:"interface_index,name=parent_if_index" json:"parent_if_index,omitempty"`
+ RemoteMac MacAddress `binapi:"mac_address,name=remote_mac" json:"remote_mac,omitempty"`
+}
+
+func (m *P2pEthernetDel) Reset() { *m = P2pEthernetDel{} }
+func (*P2pEthernetDel) GetMessageName() string { return "p2p_ethernet_del" }
+func (*P2pEthernetDel) GetCrcString() string { return "0b62c386" }
+func (*P2pEthernetDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *P2pEthernetDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ParentIfIndex
+ size += 1 * 6 // m.RemoteMac
+ return size
+}
+func (m *P2pEthernetDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.ParentIfIndex))
+ buf.EncodeBytes(m.RemoteMac[:], 6)
+ return buf.Bytes(), nil
+}
+func (m *P2pEthernetDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ParentIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.RemoteMac[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// P2pEthernetDelReply defines message 'p2p_ethernet_del_reply'.
+type P2pEthernetDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *P2pEthernetDelReply) Reset() { *m = P2pEthernetDelReply{} }
+func (*P2pEthernetDelReply) GetMessageName() string { return "p2p_ethernet_del_reply" }
+func (*P2pEthernetDelReply) GetCrcString() string { return "e8d4e804" }
+func (*P2pEthernetDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *P2pEthernetDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *P2pEthernetDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_p2p_ethernet_binapi_init() }
+func file_p2p_ethernet_binapi_init() {
+ api.RegisterMessage((*P2pEthernetAdd)(nil), "p2p_ethernet_add_eeb8e717")
+ api.RegisterMessage((*P2pEthernetAddReply)(nil), "p2p_ethernet_add_reply_5383d31f")
+ api.RegisterMessage((*P2pEthernetDel)(nil), "p2p_ethernet_del_0b62c386")
+ api.RegisterMessage((*P2pEthernetDelReply)(nil), "p2p_ethernet_del_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*P2pEthernetAdd)(nil),
+ (*P2pEthernetAddReply)(nil),
+ (*P2pEthernetDel)(nil),
+ (*P2pEthernetDelReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet_rpc.ba.go b/internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet_rpc.ba.go
new file mode 100644
index 0000000..ed1e012
--- /dev/null
+++ b/internal/testbinapi/binapi2001/p2p_ethernet/p2p_ethernet_rpc.ba.go
@@ -0,0 +1,40 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package p2p_ethernet
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service p2p_ethernet.
+type RPCService interface {
+ P2pEthernetAdd(ctx context.Context, in *P2pEthernetAdd) (*P2pEthernetAddReply, error)
+ P2pEthernetDel(ctx context.Context, in *P2pEthernetDel) (*P2pEthernetDelReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) P2pEthernetAdd(ctx context.Context, in *P2pEthernetAdd) (*P2pEthernetAddReply, error) {
+ out := new(P2pEthernetAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) P2pEthernetDel(ctx context.Context, in *P2pEthernetDel) (*P2pEthernetDelReply, error) {
+ out := new(P2pEthernetDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/pci_types/pci_types.ba.go b/internal/testbinapi/binapi2001/pci_types/pci_types.ba.go
new file mode 100644
index 0000000..c529a67
--- /dev/null
+++ b/internal/testbinapi/binapi2001/pci_types/pci_types.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/pci_types.api.json
+
+// Package pci_types contains generated bindings for API file pci_types.api.
+//
+// Contents:
+// 1 struct
+//
+package pci_types
+
+import (
+ api "git.fd.io/govpp.git/api"
+)
+
+// 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
+
+// PciAddress defines type 'pci_address'.
+type PciAddress struct {
+ Domain uint16 `binapi:"u16,name=domain" json:"domain,omitempty"`
+ Bus uint8 `binapi:"u8,name=bus" json:"bus,omitempty"`
+ Slot uint8 `binapi:"u8,name=slot" json:"slot,omitempty"`
+ Function uint8 `binapi:"u8,name=function" json:"function,omitempty"`
+}
diff --git a/internal/testbinapi/binapi2001/pg/pg.ba.go b/internal/testbinapi/binapi2001/pg/pg.ba.go
new file mode 100644
index 0000000..283ed12
--- /dev/null
+++ b/internal/testbinapi/binapi2001/pg/pg.ba.go
@@ -0,0 +1,287 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/pg.api.json
+
+// Package pg contains generated bindings for API file pg.api.
+//
+// Contents:
+// 6 messages
+//
+package pg
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "pg"
+ APIVersion = "1.1.0"
+ VersionCrc = 0x2583e07b
+)
+
+// PgCapture defines message 'pg_capture'.
+type PgCapture struct {
+ InterfaceID uint32 `binapi:"u32,name=interface_id" json:"interface_id,omitempty"`
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+ Count uint32 `binapi:"u32,name=count" json:"count,omitempty"`
+ PcapNameLength uint32 `binapi:"u32,name=pcap_name_length" json:"-"`
+ PcapFileName []byte `binapi:"u8[pcap_name_length],name=pcap_file_name" json:"pcap_file_name,omitempty"`
+}
+
+func (m *PgCapture) Reset() { *m = PgCapture{} }
+func (*PgCapture) GetMessageName() string { return "pg_capture" }
+func (*PgCapture) GetCrcString() string { return "453da78d" }
+func (*PgCapture) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PgCapture) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.InterfaceID
+ size += 1 // m.IsEnabled
+ size += 4 // m.Count
+ size += 4 // m.PcapNameLength
+ size += 1 * len(m.PcapFileName) // m.PcapFileName
+ return size
+}
+func (m *PgCapture) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.InterfaceID)
+ buf.EncodeUint8(m.IsEnabled)
+ buf.EncodeUint32(m.Count)
+ buf.EncodeUint32(uint32(len(m.PcapFileName)))
+ buf.EncodeBytes(m.PcapFileName, 0)
+ return buf.Bytes(), nil
+}
+func (m *PgCapture) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.InterfaceID = buf.DecodeUint32()
+ m.IsEnabled = buf.DecodeUint8()
+ m.Count = buf.DecodeUint32()
+ m.PcapNameLength = buf.DecodeUint32()
+ m.PcapFileName = make([]byte, m.PcapNameLength)
+ copy(m.PcapFileName, buf.DecodeBytes(len(m.PcapFileName)))
+ return nil
+}
+
+// PgCaptureReply defines message 'pg_capture_reply'.
+type PgCaptureReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *PgCaptureReply) Reset() { *m = PgCaptureReply{} }
+func (*PgCaptureReply) GetMessageName() string { return "pg_capture_reply" }
+func (*PgCaptureReply) GetCrcString() string { return "e8d4e804" }
+func (*PgCaptureReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PgCaptureReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *PgCaptureReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// PgCreateInterface defines message 'pg_create_interface'.
+type PgCreateInterface struct {
+ InterfaceID uint32 `binapi:"u32,name=interface_id" json:"interface_id,omitempty"`
+ GsoEnabled uint8 `binapi:"u8,name=gso_enabled" json:"gso_enabled,omitempty"`
+ GsoSize uint32 `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
+}
+
+func (m *PgCreateInterface) Reset() { *m = PgCreateInterface{} }
+func (*PgCreateInterface) GetMessageName() string { return "pg_create_interface" }
+func (*PgCreateInterface) GetCrcString() string { return "b1ecff05" }
+func (*PgCreateInterface) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PgCreateInterface) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.InterfaceID
+ size += 1 // m.GsoEnabled
+ size += 4 // m.GsoSize
+ return size
+}
+func (m *PgCreateInterface) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.InterfaceID)
+ buf.EncodeUint8(m.GsoEnabled)
+ buf.EncodeUint32(m.GsoSize)
+ return buf.Bytes(), nil
+}
+func (m *PgCreateInterface) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.InterfaceID = buf.DecodeUint32()
+ m.GsoEnabled = buf.DecodeUint8()
+ m.GsoSize = buf.DecodeUint32()
+ return nil
+}
+
+// PgCreateInterfaceReply defines message 'pg_create_interface_reply'.
+type PgCreateInterfaceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *PgCreateInterfaceReply) Reset() { *m = PgCreateInterfaceReply{} }
+func (*PgCreateInterfaceReply) GetMessageName() string { return "pg_create_interface_reply" }
+func (*PgCreateInterfaceReply) GetCrcString() string { return "fda5941f" }
+func (*PgCreateInterfaceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PgCreateInterfaceReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *PgCreateInterfaceReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *PgCreateInterfaceReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// PgEnableDisable defines message 'pg_enable_disable'.
+type PgEnableDisable struct {
+ IsEnabled uint8 `binapi:"u8,name=is_enabled" json:"is_enabled,omitempty"`
+ StreamNameLength uint32 `binapi:"u32,name=stream_name_length" json:"-"`
+ StreamName []byte `binapi:"u8[stream_name_length],name=stream_name" json:"stream_name,omitempty"`
+}
+
+func (m *PgEnableDisable) Reset() { *m = PgEnableDisable{} }
+func (*PgEnableDisable) GetMessageName() string { return "pg_enable_disable" }
+func (*PgEnableDisable) GetCrcString() string { return "0cb71d10" }
+func (*PgEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PgEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEnabled
+ size += 4 // m.StreamNameLength
+ size += 1 * len(m.StreamName) // m.StreamName
+ return size
+}
+func (m *PgEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEnabled)
+ buf.EncodeUint32(uint32(len(m.StreamName)))
+ buf.EncodeBytes(m.StreamName, 0)
+ return buf.Bytes(), nil
+}
+func (m *PgEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEnabled = buf.DecodeUint8()
+ m.StreamNameLength = buf.DecodeUint32()
+ m.StreamName = make([]byte, m.StreamNameLength)
+ copy(m.StreamName, buf.DecodeBytes(len(m.StreamName)))
+ return nil
+}
+
+// PgEnableDisableReply defines message 'pg_enable_disable_reply'.
+type PgEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *PgEnableDisableReply) Reset() { *m = PgEnableDisableReply{} }
+func (*PgEnableDisableReply) GetMessageName() string { return "pg_enable_disable_reply" }
+func (*PgEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*PgEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PgEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *PgEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_pg_binapi_init() }
+func file_pg_binapi_init() {
+ api.RegisterMessage((*PgCapture)(nil), "pg_capture_453da78d")
+ api.RegisterMessage((*PgCaptureReply)(nil), "pg_capture_reply_e8d4e804")
+ api.RegisterMessage((*PgCreateInterface)(nil), "pg_create_interface_b1ecff05")
+ api.RegisterMessage((*PgCreateInterfaceReply)(nil), "pg_create_interface_reply_fda5941f")
+ api.RegisterMessage((*PgEnableDisable)(nil), "pg_enable_disable_0cb71d10")
+ api.RegisterMessage((*PgEnableDisableReply)(nil), "pg_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*PgCapture)(nil),
+ (*PgCaptureReply)(nil),
+ (*PgCreateInterface)(nil),
+ (*PgCreateInterfaceReply)(nil),
+ (*PgEnableDisable)(nil),
+ (*PgEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/pg/pg_rpc.ba.go b/internal/testbinapi/binapi2001/pg/pg_rpc.ba.go
new file mode 100644
index 0000000..1d905d0
--- /dev/null
+++ b/internal/testbinapi/binapi2001/pg/pg_rpc.ba.go
@@ -0,0 +1,50 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package pg
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service pg.
+type RPCService interface {
+ PgCapture(ctx context.Context, in *PgCapture) (*PgCaptureReply, error)
+ PgCreateInterface(ctx context.Context, in *PgCreateInterface) (*PgCreateInterfaceReply, error)
+ PgEnableDisable(ctx context.Context, in *PgEnableDisable) (*PgEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) PgCapture(ctx context.Context, in *PgCapture) (*PgCaptureReply, error) {
+ out := new(PgCaptureReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PgCreateInterface(ctx context.Context, in *PgCreateInterface) (*PgCreateInterfaceReply, error) {
+ out := new(PgCreateInterfaceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PgEnableDisable(ctx context.Context, in *PgEnableDisable) (*PgEnableDisableReply, error) {
+ out := new(PgEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/pipe/pipe.ba.go b/internal/testbinapi/binapi2001/pipe/pipe.ba.go
new file mode 100644
index 0000000..66f044c
--- /dev/null
+++ b/internal/testbinapi/binapi2001/pipe/pipe.ba.go
@@ -0,0 +1,532 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/pipe.api.json
+
+// Package pipe contains generated bindings for API file pipe.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 6 messages
+//
+package pipe
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "pipe"
+ APIVersion = "1.0.1"
+ VersionCrc = 0x1d68f11
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// PipeCreate defines message 'pipe_create'.
+type PipeCreate struct {
+ IsSpecified bool `binapi:"bool,name=is_specified" json:"is_specified,omitempty"`
+ UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
+}
+
+func (m *PipeCreate) Reset() { *m = PipeCreate{} }
+func (*PipeCreate) GetMessageName() string { return "pipe_create" }
+func (*PipeCreate) GetCrcString() string { return "bb263bd3" }
+func (*PipeCreate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PipeCreate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsSpecified
+ size += 4 // m.UserInstance
+ return size
+}
+func (m *PipeCreate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsSpecified)
+ buf.EncodeUint32(m.UserInstance)
+ return buf.Bytes(), nil
+}
+func (m *PipeCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsSpecified = buf.DecodeBool()
+ m.UserInstance = buf.DecodeUint32()
+ return nil
+}
+
+// PipeCreateReply defines message 'pipe_create_reply'.
+type PipeCreateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ PipeSwIfIndex [2]InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
+}
+
+func (m *PipeCreateReply) Reset() { *m = PipeCreateReply{} }
+func (*PipeCreateReply) GetMessageName() string { return "pipe_create_reply" }
+func (*PipeCreateReply) GetCrcString() string { return "d4c2c2b3" }
+func (*PipeCreateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PipeCreateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ for j1 := 0; j1 < 2; j1++ {
+ size += 4 // m.PipeSwIfIndex[j1]
+ }
+ return size
+}
+func (m *PipeCreateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ for j0 := 0; j0 < 2; j0++ {
+ buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
+ }
+ return buf.Bytes(), nil
+}
+func (m *PipeCreateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ for j0 := 0; j0 < 2; j0++ {
+ m.PipeSwIfIndex[j0] = InterfaceIndex(buf.DecodeUint32())
+ }
+ return nil
+}
+
+// PipeDelete defines message 'pipe_delete'.
+type PipeDelete struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *PipeDelete) Reset() { *m = PipeDelete{} }
+func (*PipeDelete) GetMessageName() string { return "pipe_delete" }
+func (*PipeDelete) GetCrcString() string { return "f9e6675e" }
+func (*PipeDelete) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PipeDelete) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *PipeDelete) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *PipeDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// PipeDeleteReply defines message 'pipe_delete_reply'.
+type PipeDeleteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *PipeDeleteReply) Reset() { *m = PipeDeleteReply{} }
+func (*PipeDeleteReply) GetMessageName() string { return "pipe_delete_reply" }
+func (*PipeDeleteReply) GetCrcString() string { return "e8d4e804" }
+func (*PipeDeleteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PipeDeleteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *PipeDeleteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// PipeDetails defines message 'pipe_details'.
+type PipeDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ PipeSwIfIndex [2]InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
+ Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
+}
+
+func (m *PipeDetails) Reset() { *m = PipeDetails{} }
+func (*PipeDetails) GetMessageName() string { return "pipe_details" }
+func (*PipeDetails) GetCrcString() string { return "43ac107a" }
+func (*PipeDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PipeDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ for j1 := 0; j1 < 2; j1++ {
+ size += 4 // m.PipeSwIfIndex[j1]
+ }
+ size += 4 // m.Instance
+ return size
+}
+func (m *PipeDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ for j0 := 0; j0 < 2; j0++ {
+ buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
+ }
+ buf.EncodeUint32(m.Instance)
+ return buf.Bytes(), nil
+}
+func (m *PipeDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ for j0 := 0; j0 < 2; j0++ {
+ m.PipeSwIfIndex[j0] = InterfaceIndex(buf.DecodeUint32())
+ }
+ m.Instance = buf.DecodeUint32()
+ return nil
+}
+
+// PipeDump defines message 'pipe_dump'.
+type PipeDump struct{}
+
+func (m *PipeDump) Reset() { *m = PipeDump{} }
+func (*PipeDump) GetMessageName() string { return "pipe_dump" }
+func (*PipeDump) GetCrcString() string { return "51077d14" }
+func (*PipeDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PipeDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *PipeDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *PipeDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_pipe_binapi_init() }
+func file_pipe_binapi_init() {
+ api.RegisterMessage((*PipeCreate)(nil), "pipe_create_bb263bd3")
+ api.RegisterMessage((*PipeCreateReply)(nil), "pipe_create_reply_d4c2c2b3")
+ api.RegisterMessage((*PipeDelete)(nil), "pipe_delete_f9e6675e")
+ api.RegisterMessage((*PipeDeleteReply)(nil), "pipe_delete_reply_e8d4e804")
+ api.RegisterMessage((*PipeDetails)(nil), "pipe_details_43ac107a")
+ api.RegisterMessage((*PipeDump)(nil), "pipe_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*PipeCreate)(nil),
+ (*PipeCreateReply)(nil),
+ (*PipeDelete)(nil),
+ (*PipeDeleteReply)(nil),
+ (*PipeDetails)(nil),
+ (*PipeDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/pipe/pipe_rpc.ba.go b/internal/testbinapi/binapi2001/pipe/pipe_rpc.ba.go
new file mode 100644
index 0000000..ce2037d
--- /dev/null
+++ b/internal/testbinapi/binapi2001/pipe/pipe_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package pipe
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service pipe.
+type RPCService interface {
+ PipeCreate(ctx context.Context, in *PipeCreate) (*PipeCreateReply, error)
+ PipeDelete(ctx context.Context, in *PipeDelete) (*PipeDeleteReply, error)
+ PipeDump(ctx context.Context, in *PipeDump) (RPCService_PipeDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) PipeCreate(ctx context.Context, in *PipeCreate) (*PipeCreateReply, error) {
+ out := new(PipeCreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PipeDelete(ctx context.Context, in *PipeDelete) (*PipeDeleteReply, error) {
+ out := new(PipeDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PipeDump(ctx context.Context, in *PipeDump) (RPCService_PipeDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_PipeDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_PipeDumpClient interface {
+ Recv() (*PipeDetails, error)
+ api.Stream
+}
+
+type serviceClient_PipeDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_PipeDumpClient) Recv() (*PipeDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *PipeDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/policer/policer.ba.go b/internal/testbinapi/binapi2001/policer/policer.ba.go
new file mode 100644
index 0000000..d5bf1d4
--- /dev/null
+++ b/internal/testbinapi/binapi2001/policer/policer.ba.go
@@ -0,0 +1,342 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/policer.api.json
+
+// Package policer contains generated bindings for API file policer.api.
+//
+// Contents:
+// 4 messages
+//
+package policer
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "policer"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x4218ed4f
+)
+
+// PolicerAddDel defines message 'policer_add_del'.
+type PolicerAddDel struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ Name []byte `binapi:"u8[64],name=name" json:"name,omitempty"`
+ Cir uint32 `binapi:"u32,name=cir" json:"cir,omitempty"`
+ Eir uint32 `binapi:"u32,name=eir" json:"eir,omitempty"`
+ Cb uint64 `binapi:"u64,name=cb" json:"cb,omitempty"`
+ Eb uint64 `binapi:"u64,name=eb" json:"eb,omitempty"`
+ RateType uint8 `binapi:"u8,name=rate_type" json:"rate_type,omitempty"`
+ RoundType uint8 `binapi:"u8,name=round_type" json:"round_type,omitempty"`
+ Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
+ ColorAware uint8 `binapi:"u8,name=color_aware" json:"color_aware,omitempty"`
+ ConformActionType uint8 `binapi:"u8,name=conform_action_type" json:"conform_action_type,omitempty"`
+ ConformDscp uint8 `binapi:"u8,name=conform_dscp" json:"conform_dscp,omitempty"`
+ ExceedActionType uint8 `binapi:"u8,name=exceed_action_type" json:"exceed_action_type,omitempty"`
+ ExceedDscp uint8 `binapi:"u8,name=exceed_dscp" json:"exceed_dscp,omitempty"`
+ ViolateActionType uint8 `binapi:"u8,name=violate_action_type" json:"violate_action_type,omitempty"`
+ ViolateDscp uint8 `binapi:"u8,name=violate_dscp" json:"violate_dscp,omitempty"`
+}
+
+func (m *PolicerAddDel) Reset() { *m = PolicerAddDel{} }
+func (*PolicerAddDel) GetMessageName() string { return "policer_add_del" }
+func (*PolicerAddDel) GetCrcString() string { return "dfea2be8" }
+func (*PolicerAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PolicerAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 * 64 // m.Name
+ size += 4 // m.Cir
+ size += 4 // m.Eir
+ size += 8 // m.Cb
+ size += 8 // m.Eb
+ size += 1 // m.RateType
+ size += 1 // m.RoundType
+ size += 1 // m.Type
+ size += 1 // m.ColorAware
+ size += 1 // m.ConformActionType
+ size += 1 // m.ConformDscp
+ size += 1 // m.ExceedActionType
+ size += 1 // m.ExceedDscp
+ size += 1 // m.ViolateActionType
+ size += 1 // m.ViolateDscp
+ return size
+}
+func (m *PolicerAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeBytes(m.Name, 64)
+ buf.EncodeUint32(m.Cir)
+ buf.EncodeUint32(m.Eir)
+ buf.EncodeUint64(m.Cb)
+ buf.EncodeUint64(m.Eb)
+ buf.EncodeUint8(m.RateType)
+ buf.EncodeUint8(m.RoundType)
+ buf.EncodeUint8(m.Type)
+ buf.EncodeUint8(m.ColorAware)
+ buf.EncodeUint8(m.ConformActionType)
+ buf.EncodeUint8(m.ConformDscp)
+ buf.EncodeUint8(m.ExceedActionType)
+ buf.EncodeUint8(m.ExceedDscp)
+ buf.EncodeUint8(m.ViolateActionType)
+ buf.EncodeUint8(m.ViolateDscp)
+ return buf.Bytes(), nil
+}
+func (m *PolicerAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.Name = make([]byte, 64)
+ copy(m.Name, buf.DecodeBytes(len(m.Name)))
+ m.Cir = buf.DecodeUint32()
+ m.Eir = buf.DecodeUint32()
+ m.Cb = buf.DecodeUint64()
+ m.Eb = buf.DecodeUint64()
+ m.RateType = buf.DecodeUint8()
+ m.RoundType = buf.DecodeUint8()
+ m.Type = buf.DecodeUint8()
+ m.ColorAware = buf.DecodeUint8()
+ m.ConformActionType = buf.DecodeUint8()
+ m.ConformDscp = buf.DecodeUint8()
+ m.ExceedActionType = buf.DecodeUint8()
+ m.ExceedDscp = buf.DecodeUint8()
+ m.ViolateActionType = buf.DecodeUint8()
+ m.ViolateDscp = buf.DecodeUint8()
+ return nil
+}
+
+// PolicerAddDelReply defines message 'policer_add_del_reply'.
+type PolicerAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
+}
+
+func (m *PolicerAddDelReply) Reset() { *m = PolicerAddDelReply{} }
+func (*PolicerAddDelReply) GetMessageName() string { return "policer_add_del_reply" }
+func (*PolicerAddDelReply) GetCrcString() string { return "a177cef2" }
+func (*PolicerAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PolicerAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.PolicerIndex
+ return size
+}
+func (m *PolicerAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.PolicerIndex = buf.DecodeUint32()
+ return nil
+}
+
+// PolicerDetails defines message 'policer_details'.
+type PolicerDetails struct {
+ Name []byte `binapi:"u8[64],name=name" json:"name,omitempty"`
+ Cir uint32 `binapi:"u32,name=cir" json:"cir,omitempty"`
+ Eir uint32 `binapi:"u32,name=eir" json:"eir,omitempty"`
+ Cb uint64 `binapi:"u64,name=cb" json:"cb,omitempty"`
+ Eb uint64 `binapi:"u64,name=eb" json:"eb,omitempty"`
+ RateType uint8 `binapi:"u8,name=rate_type" json:"rate_type,omitempty"`
+ RoundType uint8 `binapi:"u8,name=round_type" json:"round_type,omitempty"`
+ Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
+ ConformActionType uint8 `binapi:"u8,name=conform_action_type" json:"conform_action_type,omitempty"`
+ ConformDscp uint8 `binapi:"u8,name=conform_dscp" json:"conform_dscp,omitempty"`
+ ExceedActionType uint8 `binapi:"u8,name=exceed_action_type" json:"exceed_action_type,omitempty"`
+ ExceedDscp uint8 `binapi:"u8,name=exceed_dscp" json:"exceed_dscp,omitempty"`
+ ViolateActionType uint8 `binapi:"u8,name=violate_action_type" json:"violate_action_type,omitempty"`
+ ViolateDscp uint8 `binapi:"u8,name=violate_dscp" json:"violate_dscp,omitempty"`
+ SingleRate uint8 `binapi:"u8,name=single_rate" json:"single_rate,omitempty"`
+ ColorAware uint8 `binapi:"u8,name=color_aware" json:"color_aware,omitempty"`
+ Scale uint32 `binapi:"u32,name=scale" json:"scale,omitempty"`
+ CirTokensPerPeriod uint32 `binapi:"u32,name=cir_tokens_per_period" json:"cir_tokens_per_period,omitempty"`
+ PirTokensPerPeriod uint32 `binapi:"u32,name=pir_tokens_per_period" json:"pir_tokens_per_period,omitempty"`
+ CurrentLimit uint32 `binapi:"u32,name=current_limit" json:"current_limit,omitempty"`
+ CurrentBucket uint32 `binapi:"u32,name=current_bucket" json:"current_bucket,omitempty"`
+ ExtendedLimit uint32 `binapi:"u32,name=extended_limit" json:"extended_limit,omitempty"`
+ ExtendedBucket uint32 `binapi:"u32,name=extended_bucket" json:"extended_bucket,omitempty"`
+ LastUpdateTime uint64 `binapi:"u64,name=last_update_time" json:"last_update_time,omitempty"`
+}
+
+func (m *PolicerDetails) Reset() { *m = PolicerDetails{} }
+func (*PolicerDetails) GetMessageName() string { return "policer_details" }
+func (*PolicerDetails) GetCrcString() string { return "ff2765f0" }
+func (*PolicerDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PolicerDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 64 // m.Name
+ size += 4 // m.Cir
+ size += 4 // m.Eir
+ size += 8 // m.Cb
+ size += 8 // m.Eb
+ size += 1 // m.RateType
+ size += 1 // m.RoundType
+ size += 1 // m.Type
+ size += 1 // m.ConformActionType
+ size += 1 // m.ConformDscp
+ size += 1 // m.ExceedActionType
+ size += 1 // m.ExceedDscp
+ size += 1 // m.ViolateActionType
+ size += 1 // m.ViolateDscp
+ size += 1 // m.SingleRate
+ size += 1 // m.ColorAware
+ size += 4 // m.Scale
+ size += 4 // m.CirTokensPerPeriod
+ size += 4 // m.PirTokensPerPeriod
+ size += 4 // m.CurrentLimit
+ size += 4 // m.CurrentBucket
+ size += 4 // m.ExtendedLimit
+ size += 4 // m.ExtendedBucket
+ size += 8 // m.LastUpdateTime
+ return size
+}
+func (m *PolicerDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Name, 64)
+ buf.EncodeUint32(m.Cir)
+ buf.EncodeUint32(m.Eir)
+ buf.EncodeUint64(m.Cb)
+ buf.EncodeUint64(m.Eb)
+ buf.EncodeUint8(m.RateType)
+ buf.EncodeUint8(m.RoundType)
+ buf.EncodeUint8(m.Type)
+ buf.EncodeUint8(m.ConformActionType)
+ buf.EncodeUint8(m.ConformDscp)
+ buf.EncodeUint8(m.ExceedActionType)
+ buf.EncodeUint8(m.ExceedDscp)
+ buf.EncodeUint8(m.ViolateActionType)
+ buf.EncodeUint8(m.ViolateDscp)
+ buf.EncodeUint8(m.SingleRate)
+ buf.EncodeUint8(m.ColorAware)
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.Name = make([]byte, 64)
+ copy(m.Name, buf.DecodeBytes(len(m.Name)))
+ m.Cir = buf.DecodeUint32()
+ m.Eir = buf.DecodeUint32()
+ m.Cb = buf.DecodeUint64()
+ m.Eb = buf.DecodeUint64()
+ m.RateType = buf.DecodeUint8()
+ m.RoundType = buf.DecodeUint8()
+ m.Type = buf.DecodeUint8()
+ m.ConformActionType = buf.DecodeUint8()
+ m.ConformDscp = buf.DecodeUint8()
+ m.ExceedActionType = buf.DecodeUint8()
+ m.ExceedDscp = buf.DecodeUint8()
+ m.ViolateActionType = buf.DecodeUint8()
+ m.ViolateDscp = buf.DecodeUint8()
+ m.SingleRate = buf.DecodeUint8()
+ m.ColorAware = buf.DecodeUint8()
+ m.Scale = buf.DecodeUint32()
+ m.CirTokensPerPeriod = buf.DecodeUint32()
+ m.PirTokensPerPeriod = buf.DecodeUint32()
+ m.CurrentLimit = buf.DecodeUint32()
+ m.CurrentBucket = buf.DecodeUint32()
+ m.ExtendedLimit = buf.DecodeUint32()
+ m.ExtendedBucket = buf.DecodeUint32()
+ m.LastUpdateTime = buf.DecodeUint64()
+ return nil
+}
+
+// PolicerDump defines message 'policer_dump'.
+type PolicerDump struct {
+ MatchNameValid uint8 `binapi:"u8,name=match_name_valid" json:"match_name_valid,omitempty"`
+ MatchName []byte `binapi:"u8[64],name=match_name" json:"match_name,omitempty"`
+}
+
+func (m *PolicerDump) Reset() { *m = PolicerDump{} }
+func (*PolicerDump) GetMessageName() string { return "policer_dump" }
+func (*PolicerDump) GetCrcString() string { return "8be04d34" }
+func (*PolicerDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PolicerDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.MatchNameValid
+ size += 1 * 64 // m.MatchName
+ return size
+}
+func (m *PolicerDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.MatchNameValid)
+ buf.EncodeBytes(m.MatchName, 64)
+ return buf.Bytes(), nil
+}
+func (m *PolicerDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.MatchNameValid = buf.DecodeUint8()
+ m.MatchName = make([]byte, 64)
+ copy(m.MatchName, buf.DecodeBytes(len(m.MatchName)))
+ return nil
+}
+
+func init() { file_policer_binapi_init() }
+func file_policer_binapi_init() {
+ api.RegisterMessage((*PolicerAddDel)(nil), "policer_add_del_dfea2be8")
+ api.RegisterMessage((*PolicerAddDelReply)(nil), "policer_add_del_reply_a177cef2")
+ api.RegisterMessage((*PolicerDetails)(nil), "policer_details_ff2765f0")
+ api.RegisterMessage((*PolicerDump)(nil), "policer_dump_8be04d34")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*PolicerAddDel)(nil),
+ (*PolicerAddDelReply)(nil),
+ (*PolicerDetails)(nil),
+ (*PolicerDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/policer/policer_rpc.ba.go b/internal/testbinapi/binapi2001/policer/policer_rpc.ba.go
new file mode 100644
index 0000000..3a2008e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/policer/policer_rpc.ba.go
@@ -0,0 +1,73 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package policer
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service policer.
+type RPCService interface {
+ PolicerAddDel(ctx context.Context, in *PolicerAddDel) (*PolicerAddDelReply, error)
+ PolicerDump(ctx context.Context, in *PolicerDump) (RPCService_PolicerDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) PolicerAddDel(ctx context.Context, in *PolicerAddDel) (*PolicerAddDelReply, error) {
+ out := new(PolicerAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PolicerDump(ctx context.Context, in *PolicerDump) (RPCService_PolicerDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_PolicerDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_PolicerDumpClient interface {
+ Recv() (*PolicerDetails, error)
+ api.Stream
+}
+
+type serviceClient_PolicerDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_PolicerDumpClient) Recv() (*PolicerDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *PolicerDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/pot/pot.ba.go b/internal/testbinapi/binapi2001/pot/pot.ba.go
new file mode 100644
index 0000000..17f1c4d
--- /dev/null
+++ b/internal/testbinapi/binapi2001/pot/pot.ba.go
@@ -0,0 +1,387 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/pot.api.json
+
+// Package pot contains generated bindings for API file pot.api.
+//
+// Contents:
+// 8 messages
+//
+package pot
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "pot"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xa9d8e55c
+)
+
+// PotProfileActivate defines message 'pot_profile_activate'.
+type PotProfileActivate struct {
+ ID uint8 `binapi:"u8,name=id" json:"id,omitempty"`
+ ListName string `binapi:"string[],name=list_name" json:"list_name,omitempty"`
+}
+
+func (m *PotProfileActivate) Reset() { *m = PotProfileActivate{} }
+func (*PotProfileActivate) GetMessageName() string { return "pot_profile_activate" }
+func (*PotProfileActivate) GetCrcString() string { return "0770af98" }
+func (*PotProfileActivate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PotProfileActivate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.ID
+ size += 4 + len(m.ListName) // m.ListName
+ return size
+}
+func (m *PotProfileActivate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.ID)
+ buf.EncodeString(m.ListName, 0)
+ return buf.Bytes(), nil
+}
+func (m *PotProfileActivate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint8()
+ m.ListName = buf.DecodeString(0)
+ return nil
+}
+
+// PotProfileActivateReply defines message 'pot_profile_activate_reply'.
+type PotProfileActivateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *PotProfileActivateReply) Reset() { *m = PotProfileActivateReply{} }
+func (*PotProfileActivateReply) GetMessageName() string { return "pot_profile_activate_reply" }
+func (*PotProfileActivateReply) GetCrcString() string { return "e8d4e804" }
+func (*PotProfileActivateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PotProfileActivateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *PotProfileActivateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// PotProfileAdd defines message 'pot_profile_add'.
+type PotProfileAdd struct {
+ ID uint8 `binapi:"u8,name=id" json:"id,omitempty"`
+ Validator uint8 `binapi:"u8,name=validator" json:"validator,omitempty"`
+ SecretKey uint64 `binapi:"u64,name=secret_key" json:"secret_key,omitempty"`
+ SecretShare uint64 `binapi:"u64,name=secret_share" json:"secret_share,omitempty"`
+ Prime uint64 `binapi:"u64,name=prime" json:"prime,omitempty"`
+ MaxBits uint8 `binapi:"u8,name=max_bits" json:"max_bits,omitempty"`
+ Lpc uint64 `binapi:"u64,name=lpc" json:"lpc,omitempty"`
+ PolynomialPublic uint64 `binapi:"u64,name=polynomial_public" json:"polynomial_public,omitempty"`
+ ListName string `binapi:"string[],name=list_name" json:"list_name,omitempty"`
+}
+
+func (m *PotProfileAdd) Reset() { *m = PotProfileAdd{} }
+func (*PotProfileAdd) GetMessageName() string { return "pot_profile_add" }
+func (*PotProfileAdd) GetCrcString() string { return "ad5da3a3" }
+func (*PotProfileAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PotProfileAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.ID
+ size += 1 // m.Validator
+ size += 8 // m.SecretKey
+ size += 8 // m.SecretShare
+ size += 8 // m.Prime
+ size += 1 // m.MaxBits
+ size += 8 // m.Lpc
+ size += 8 // m.PolynomialPublic
+ size += 4 + len(m.ListName) // m.ListName
+ return size
+}
+func (m *PotProfileAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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
+}
+func (m *PotProfileAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint8()
+ m.Validator = buf.DecodeUint8()
+ m.SecretKey = buf.DecodeUint64()
+ m.SecretShare = buf.DecodeUint64()
+ m.Prime = buf.DecodeUint64()
+ m.MaxBits = buf.DecodeUint8()
+ m.Lpc = buf.DecodeUint64()
+ m.PolynomialPublic = buf.DecodeUint64()
+ m.ListName = buf.DecodeString(0)
+ return nil
+}
+
+// PotProfileAddReply defines message 'pot_profile_add_reply'.
+type PotProfileAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *PotProfileAddReply) Reset() { *m = PotProfileAddReply{} }
+func (*PotProfileAddReply) GetMessageName() string { return "pot_profile_add_reply" }
+func (*PotProfileAddReply) GetCrcString() string { return "e8d4e804" }
+func (*PotProfileAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PotProfileAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *PotProfileAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// PotProfileDel defines message 'pot_profile_del'.
+type PotProfileDel struct {
+ ListName string `binapi:"string[],name=list_name" json:"list_name,omitempty"`
+}
+
+func (m *PotProfileDel) Reset() { *m = PotProfileDel{} }
+func (*PotProfileDel) GetMessageName() string { return "pot_profile_del" }
+func (*PotProfileDel) GetCrcString() string { return "cd63f53b" }
+func (*PotProfileDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PotProfileDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 + len(m.ListName) // m.ListName
+ return size
+}
+func (m *PotProfileDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.ListName, 0)
+ return buf.Bytes(), nil
+}
+func (m *PotProfileDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ListName = buf.DecodeString(0)
+ return nil
+}
+
+// PotProfileDelReply defines message 'pot_profile_del_reply'.
+type PotProfileDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *PotProfileDelReply) Reset() { *m = PotProfileDelReply{} }
+func (*PotProfileDelReply) GetMessageName() string { return "pot_profile_del_reply" }
+func (*PotProfileDelReply) GetCrcString() string { return "e8d4e804" }
+func (*PotProfileDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PotProfileDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *PotProfileDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// PotProfileShowConfigDetails defines message 'pot_profile_show_config_details'.
+type PotProfileShowConfigDetails struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ ID uint8 `binapi:"u8,name=id" json:"id,omitempty"`
+ Validator uint8 `binapi:"u8,name=validator" json:"validator,omitempty"`
+ SecretKey uint64 `binapi:"u64,name=secret_key" json:"secret_key,omitempty"`
+ SecretShare uint64 `binapi:"u64,name=secret_share" json:"secret_share,omitempty"`
+ Prime uint64 `binapi:"u64,name=prime" json:"prime,omitempty"`
+ BitMask uint64 `binapi:"u64,name=bit_mask" json:"bit_mask,omitempty"`
+ Lpc uint64 `binapi:"u64,name=lpc" json:"lpc,omitempty"`
+ PolynomialPublic uint64 `binapi:"u64,name=polynomial_public" json:"polynomial_public,omitempty"`
+}
+
+func (m *PotProfileShowConfigDetails) Reset() { *m = PotProfileShowConfigDetails{} }
+func (*PotProfileShowConfigDetails) GetMessageName() string { return "pot_profile_show_config_details" }
+func (*PotProfileShowConfigDetails) GetCrcString() string { return "b7ce0618" }
+func (*PotProfileShowConfigDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PotProfileShowConfigDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.ID
+ size += 1 // m.Validator
+ size += 8 // m.SecretKey
+ size += 8 // m.SecretShare
+ size += 8 // m.Prime
+ size += 8 // m.BitMask
+ size += 8 // m.Lpc
+ size += 8 // m.PolynomialPublic
+ return size
+}
+func (m *PotProfileShowConfigDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.ID = buf.DecodeUint8()
+ m.Validator = buf.DecodeUint8()
+ m.SecretKey = buf.DecodeUint64()
+ m.SecretShare = buf.DecodeUint64()
+ m.Prime = buf.DecodeUint64()
+ m.BitMask = buf.DecodeUint64()
+ m.Lpc = buf.DecodeUint64()
+ m.PolynomialPublic = buf.DecodeUint64()
+ return nil
+}
+
+// PotProfileShowConfigDump defines message 'pot_profile_show_config_dump'.
+type PotProfileShowConfigDump struct {
+ ID uint8 `binapi:"u8,name=id" json:"id,omitempty"`
+}
+
+func (m *PotProfileShowConfigDump) Reset() { *m = PotProfileShowConfigDump{} }
+func (*PotProfileShowConfigDump) GetMessageName() string { return "pot_profile_show_config_dump" }
+func (*PotProfileShowConfigDump) GetCrcString() string { return "005b7d59" }
+func (*PotProfileShowConfigDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PotProfileShowConfigDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.ID
+ return size
+}
+func (m *PotProfileShowConfigDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.ID)
+ return buf.Bytes(), nil
+}
+func (m *PotProfileShowConfigDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint8()
+ return nil
+}
+
+func init() { file_pot_binapi_init() }
+func file_pot_binapi_init() {
+ api.RegisterMessage((*PotProfileActivate)(nil), "pot_profile_activate_0770af98")
+ api.RegisterMessage((*PotProfileActivateReply)(nil), "pot_profile_activate_reply_e8d4e804")
+ api.RegisterMessage((*PotProfileAdd)(nil), "pot_profile_add_ad5da3a3")
+ api.RegisterMessage((*PotProfileAddReply)(nil), "pot_profile_add_reply_e8d4e804")
+ api.RegisterMessage((*PotProfileDel)(nil), "pot_profile_del_cd63f53b")
+ api.RegisterMessage((*PotProfileDelReply)(nil), "pot_profile_del_reply_e8d4e804")
+ api.RegisterMessage((*PotProfileShowConfigDetails)(nil), "pot_profile_show_config_details_b7ce0618")
+ api.RegisterMessage((*PotProfileShowConfigDump)(nil), "pot_profile_show_config_dump_005b7d59")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*PotProfileActivate)(nil),
+ (*PotProfileActivateReply)(nil),
+ (*PotProfileAdd)(nil),
+ (*PotProfileAddReply)(nil),
+ (*PotProfileDel)(nil),
+ (*PotProfileDelReply)(nil),
+ (*PotProfileShowConfigDetails)(nil),
+ (*PotProfileShowConfigDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/pot/pot_rpc.ba.go b/internal/testbinapi/binapi2001/pot/pot_rpc.ba.go
new file mode 100644
index 0000000..7194482
--- /dev/null
+++ b/internal/testbinapi/binapi2001/pot/pot_rpc.ba.go
@@ -0,0 +1,93 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package pot
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service pot.
+type RPCService interface {
+ PotProfileActivate(ctx context.Context, in *PotProfileActivate) (*PotProfileActivateReply, error)
+ PotProfileAdd(ctx context.Context, in *PotProfileAdd) (*PotProfileAddReply, error)
+ PotProfileDel(ctx context.Context, in *PotProfileDel) (*PotProfileDelReply, error)
+ PotProfileShowConfigDump(ctx context.Context, in *PotProfileShowConfigDump) (RPCService_PotProfileShowConfigDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) PotProfileActivate(ctx context.Context, in *PotProfileActivate) (*PotProfileActivateReply, error) {
+ out := new(PotProfileActivateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PotProfileAdd(ctx context.Context, in *PotProfileAdd) (*PotProfileAddReply, error) {
+ out := new(PotProfileAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PotProfileDel(ctx context.Context, in *PotProfileDel) (*PotProfileDelReply, error) {
+ out := new(PotProfileDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PotProfileShowConfigDump(ctx context.Context, in *PotProfileShowConfigDump) (RPCService_PotProfileShowConfigDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_PotProfileShowConfigDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_PotProfileShowConfigDumpClient interface {
+ Recv() (*PotProfileShowConfigDetails, error)
+ api.Stream
+}
+
+type serviceClient_PotProfileShowConfigDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_PotProfileShowConfigDumpClient) Recv() (*PotProfileShowConfigDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *PotProfileShowConfigDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/pppoe/pppoe.ba.go b/internal/testbinapi/binapi2001/pppoe/pppoe.ba.go
new file mode 100644
index 0000000..281bbe0
--- /dev/null
+++ b/internal/testbinapi/binapi2001/pppoe/pppoe.ba.go
@@ -0,0 +1,1080 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/pppoe.api.json
+
+// Package pppoe contains generated bindings for API file pppoe.api.
+//
+// Contents:
+// 7 aliases
+// 10 enums
+// 6 structs
+// 1 union
+// 4 messages
+//
+package pppoe
+
+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 = "pppoe"
+ APIVersion = "2.0.0"
+ VersionCrc = 0xb83e4d5f
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// PppoeAddDelSession defines message 'pppoe_add_del_session'.
+type PppoeAddDelSession struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
+ ClientIP Address `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
+ DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
+ ClientMac MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
+}
+
+func (m *PppoeAddDelSession) Reset() { *m = PppoeAddDelSession{} }
+func (*PppoeAddDelSession) GetMessageName() string { return "pppoe_add_del_session" }
+func (*PppoeAddDelSession) GetCrcString() string { return "46ace853" }
+func (*PppoeAddDelSession) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PppoeAddDelSession) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 2 // m.SessionID
+ size += 4 // m.ClientIP.Af
+ size += 1 * 16 // m.ClientIP.Un
+ size += 4 // m.DecapVrfID
+ size += 1 * 6 // m.ClientMac
+ return size
+}
+func (m *PppoeAddDelSession) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint16(m.SessionID)
+ buf.EncodeUint32(uint32(m.ClientIP.Af))
+ buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(m.DecapVrfID)
+ buf.EncodeBytes(m.ClientMac[:], 6)
+ return buf.Bytes(), nil
+}
+func (m *PppoeAddDelSession) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SessionID = buf.DecodeUint16()
+ m.ClientIP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DecapVrfID = buf.DecodeUint32()
+ copy(m.ClientMac[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// PppoeAddDelSessionReply defines message 'pppoe_add_del_session_reply'.
+type PppoeAddDelSessionReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *PppoeAddDelSessionReply) Reset() { *m = PppoeAddDelSessionReply{} }
+func (*PppoeAddDelSessionReply) GetMessageName() string { return "pppoe_add_del_session_reply" }
+func (*PppoeAddDelSessionReply) GetCrcString() string { return "5383d31f" }
+func (*PppoeAddDelSessionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PppoeAddDelSessionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *PppoeAddDelSessionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// PppoeSessionDetails defines message 'pppoe_session_details'.
+type PppoeSessionDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
+ ClientIP Address `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
+ EncapIfIndex InterfaceIndex `binapi:"interface_index,name=encap_if_index" json:"encap_if_index,omitempty"`
+ DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
+ LocalMac MacAddress `binapi:"mac_address,name=local_mac" json:"local_mac,omitempty"`
+ ClientMac MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
+}
+
+func (m *PppoeSessionDetails) Reset() { *m = PppoeSessionDetails{} }
+func (*PppoeSessionDetails) GetMessageName() string { return "pppoe_session_details" }
+func (*PppoeSessionDetails) GetCrcString() string { return "332bc742" }
+func (*PppoeSessionDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PppoeSessionDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 2 // m.SessionID
+ size += 4 // m.ClientIP.Af
+ size += 1 * 16 // m.ClientIP.Un
+ size += 4 // m.EncapIfIndex
+ size += 4 // m.DecapVrfID
+ size += 1 * 6 // m.LocalMac
+ size += 1 * 6 // m.ClientMac
+ return size
+}
+func (m *PppoeSessionDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint16(m.SessionID)
+ buf.EncodeUint32(uint32(m.ClientIP.Af))
+ buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.EncapIfIndex))
+ buf.EncodeUint32(m.DecapVrfID)
+ buf.EncodeBytes(m.LocalMac[:], 6)
+ buf.EncodeBytes(m.ClientMac[:], 6)
+ return buf.Bytes(), nil
+}
+func (m *PppoeSessionDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.SessionID = buf.DecodeUint16()
+ m.ClientIP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.EncapIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.DecapVrfID = buf.DecodeUint32()
+ copy(m.LocalMac[:], buf.DecodeBytes(6))
+ copy(m.ClientMac[:], buf.DecodeBytes(6))
+ return nil
+}
+
+// PppoeSessionDump defines message 'pppoe_session_dump'.
+type PppoeSessionDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *PppoeSessionDump) Reset() { *m = PppoeSessionDump{} }
+func (*PppoeSessionDump) GetMessageName() string { return "pppoe_session_dump" }
+func (*PppoeSessionDump) GetCrcString() string { return "f9e6675e" }
+func (*PppoeSessionDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PppoeSessionDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *PppoeSessionDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *PppoeSessionDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+func init() { file_pppoe_binapi_init() }
+func file_pppoe_binapi_init() {
+ api.RegisterMessage((*PppoeAddDelSession)(nil), "pppoe_add_del_session_46ace853")
+ api.RegisterMessage((*PppoeAddDelSessionReply)(nil), "pppoe_add_del_session_reply_5383d31f")
+ api.RegisterMessage((*PppoeSessionDetails)(nil), "pppoe_session_details_332bc742")
+ api.RegisterMessage((*PppoeSessionDump)(nil), "pppoe_session_dump_f9e6675e")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*PppoeAddDelSession)(nil),
+ (*PppoeAddDelSessionReply)(nil),
+ (*PppoeSessionDetails)(nil),
+ (*PppoeSessionDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/pppoe/pppoe_rpc.ba.go b/internal/testbinapi/binapi2001/pppoe/pppoe_rpc.ba.go
new file mode 100644
index 0000000..7feaf6f
--- /dev/null
+++ b/internal/testbinapi/binapi2001/pppoe/pppoe_rpc.ba.go
@@ -0,0 +1,73 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package pppoe
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service pppoe.
+type RPCService interface {
+ PppoeAddDelSession(ctx context.Context, in *PppoeAddDelSession) (*PppoeAddDelSessionReply, error)
+ PppoeSessionDump(ctx context.Context, in *PppoeSessionDump) (RPCService_PppoeSessionDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) PppoeAddDelSession(ctx context.Context, in *PppoeAddDelSession) (*PppoeAddDelSessionReply, error) {
+ out := new(PppoeAddDelSessionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PppoeSessionDump(ctx context.Context, in *PppoeSessionDump) (RPCService_PppoeSessionDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_PppoeSessionDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_PppoeSessionDumpClient interface {
+ Recv() (*PppoeSessionDetails, error)
+ api.Stream
+}
+
+type serviceClient_PppoeSessionDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_PppoeSessionDumpClient) Recv() (*PppoeSessionDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *PppoeSessionDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/punt/punt.ba.go b/internal/testbinapi/binapi2001/punt/punt.ba.go
new file mode 100644
index 0000000..285aaf1
--- /dev/null
+++ b/internal/testbinapi/binapi2001/punt/punt.ba.go
@@ -0,0 +1,1110 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/punt.api.json
+
+// Package punt contains generated bindings for API file punt.api.
+//
+// Contents:
+// 5 aliases
+// 5 enums
+// 11 structs
+// 2 unions
+// 10 messages
+//
+package punt
+
+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 = "punt"
+ APIVersion = "2.2.1"
+ VersionCrc = 0x51716f7f
+)
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// PuntType defines enum 'punt_type'.
+type PuntType uint32
+
+const (
+ PUNT_API_TYPE_L4 PuntType = 1
+ PUNT_API_TYPE_IP_PROTO PuntType = 2
+ PUNT_API_TYPE_EXCEPTION PuntType = 3
+)
+
+var (
+ PuntType_name = map[uint32]string{
+ 1: "PUNT_API_TYPE_L4",
+ 2: "PUNT_API_TYPE_IP_PROTO",
+ 3: "PUNT_API_TYPE_EXCEPTION",
+ }
+ PuntType_value = map[string]uint32{
+ "PUNT_API_TYPE_L4": 1,
+ "PUNT_API_TYPE_IP_PROTO": 2,
+ "PUNT_API_TYPE_EXCEPTION": 3,
+ }
+)
+
+func (x PuntType) String() string {
+ s, ok := PuntType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "PuntType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// Punt defines type 'punt'.
+type Punt struct {
+ Type PuntType `binapi:"punt_type,name=type" json:"type,omitempty"`
+ Punt PuntUnion `binapi:"punt_union,name=punt" json:"punt,omitempty"`
+}
+
+// PuntException defines type 'punt_exception'.
+type PuntException struct {
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+}
+
+// PuntIPProto defines type 'punt_ip_proto'.
+type PuntIPProto struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
+}
+
+// PuntL4 defines type 'punt_l4'.
+type PuntL4 struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+}
+
+// PuntReason defines type 'punt_reason'.
+type PuntReason struct {
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+ Name string `binapi:"string[],name=name" json:"name,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// PuntUnion defines union 'punt_union'.
+type PuntUnion struct {
+ // Exception *PuntException
+ // L4 *PuntL4
+ // IPProto *PuntIPProto
+ XXX_UnionData [10]byte
+}
+
+func PuntUnionException(a PuntException) (u PuntUnion) {
+ u.SetException(a)
+ return
+}
+func (u *PuntUnion) SetException(a PuntException) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeUint32(a.ID)
+}
+func (u *PuntUnion) GetException() (a PuntException) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ a.ID = buf.DecodeUint32()
+ return
+}
+
+func PuntUnionL4(a PuntL4) (u PuntUnion) {
+ u.SetL4(a)
+ return
+}
+func (u *PuntUnion) SetL4(a PuntL4) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeUint32(uint32(a.Af))
+ buf.EncodeUint32(uint32(a.Protocol))
+ buf.EncodeUint16(a.Port)
+}
+func (u *PuntUnion) GetL4() (a PuntL4) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ a.Af = AddressFamily(buf.DecodeUint32())
+ a.Protocol = IPProto(buf.DecodeUint32())
+ a.Port = buf.DecodeUint16()
+ return
+}
+
+func PuntUnionIPProto(a PuntIPProto) (u PuntUnion) {
+ u.SetIPProto(a)
+ return
+}
+func (u *PuntUnion) SetIPProto(a PuntIPProto) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeUint32(uint32(a.Af))
+ buf.EncodeUint32(uint32(a.Protocol))
+}
+func (u *PuntUnion) GetIPProto() (a PuntIPProto) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ a.Af = AddressFamily(buf.DecodeUint32())
+ a.Protocol = IPProto(buf.DecodeUint32())
+ return
+}
+
+// PuntReasonDetails defines message 'punt_reason_details'.
+type PuntReasonDetails struct {
+ Reason PuntReason `binapi:"punt_reason,name=reason" json:"reason,omitempty"`
+}
+
+func (m *PuntReasonDetails) Reset() { *m = PuntReasonDetails{} }
+func (*PuntReasonDetails) GetMessageName() string { return "punt_reason_details" }
+func (*PuntReasonDetails) GetCrcString() string { return "2c9d4a40" }
+func (*PuntReasonDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PuntReasonDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Reason.ID
+ size += 4 + len(m.Reason.Name) // m.Reason.Name
+ return size
+}
+func (m *PuntReasonDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Reason.ID)
+ buf.EncodeString(m.Reason.Name, 0)
+ return buf.Bytes(), nil
+}
+func (m *PuntReasonDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Reason.ID = buf.DecodeUint32()
+ m.Reason.Name = buf.DecodeString(0)
+ return nil
+}
+
+// PuntReasonDump defines message 'punt_reason_dump'.
+type PuntReasonDump struct {
+ Reason PuntReason `binapi:"punt_reason,name=reason" json:"reason,omitempty"`
+}
+
+func (m *PuntReasonDump) Reset() { *m = PuntReasonDump{} }
+func (*PuntReasonDump) GetMessageName() string { return "punt_reason_dump" }
+func (*PuntReasonDump) GetCrcString() string { return "5c0dd4fe" }
+func (*PuntReasonDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PuntReasonDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Reason.ID
+ size += 4 + len(m.Reason.Name) // m.Reason.Name
+ return size
+}
+func (m *PuntReasonDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Reason.ID)
+ buf.EncodeString(m.Reason.Name, 0)
+ return buf.Bytes(), nil
+}
+func (m *PuntReasonDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Reason.ID = buf.DecodeUint32()
+ m.Reason.Name = buf.DecodeString(0)
+ return nil
+}
+
+// PuntSocketDeregister defines message 'punt_socket_deregister'.
+type PuntSocketDeregister struct {
+ Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
+}
+
+func (m *PuntSocketDeregister) Reset() { *m = PuntSocketDeregister{} }
+func (*PuntSocketDeregister) GetMessageName() string { return "punt_socket_deregister" }
+func (*PuntSocketDeregister) GetCrcString() string { return "98a444f4" }
+func (*PuntSocketDeregister) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PuntSocketDeregister) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Punt.Type
+ size += 1 * 10 // m.Punt.Punt
+ return size
+}
+func (m *PuntSocketDeregister) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Punt.Type))
+ buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
+ return buf.Bytes(), nil
+}
+func (m *PuntSocketDeregister) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Punt.Type = PuntType(buf.DecodeUint32())
+ copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
+ return nil
+}
+
+// PuntSocketDeregisterReply defines message 'punt_socket_deregister_reply'.
+type PuntSocketDeregisterReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *PuntSocketDeregisterReply) Reset() { *m = PuntSocketDeregisterReply{} }
+func (*PuntSocketDeregisterReply) GetMessageName() string { return "punt_socket_deregister_reply" }
+func (*PuntSocketDeregisterReply) GetCrcString() string { return "e8d4e804" }
+func (*PuntSocketDeregisterReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PuntSocketDeregisterReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *PuntSocketDeregisterReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// PuntSocketDetails defines message 'punt_socket_details'.
+type PuntSocketDetails struct {
+ Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
+ Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
+}
+
+func (m *PuntSocketDetails) Reset() { *m = PuntSocketDetails{} }
+func (*PuntSocketDetails) GetMessageName() string { return "punt_socket_details" }
+func (*PuntSocketDetails) GetCrcString() string { return "1de0ce75" }
+func (*PuntSocketDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PuntSocketDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Punt.Type
+ size += 1 * 10 // m.Punt.Punt
+ size += 108 // m.Pathname
+ return size
+}
+func (m *PuntSocketDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Punt.Type))
+ buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
+ buf.EncodeString(m.Pathname, 108)
+ return buf.Bytes(), nil
+}
+func (m *PuntSocketDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Punt.Type = PuntType(buf.DecodeUint32())
+ copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
+ m.Pathname = buf.DecodeString(108)
+ return nil
+}
+
+// PuntSocketDump defines message 'punt_socket_dump'.
+type PuntSocketDump struct {
+ Type PuntType `binapi:"punt_type,name=type" json:"type,omitempty"`
+}
+
+func (m *PuntSocketDump) Reset() { *m = PuntSocketDump{} }
+func (*PuntSocketDump) GetMessageName() string { return "punt_socket_dump" }
+func (*PuntSocketDump) GetCrcString() string { return "52974935" }
+func (*PuntSocketDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PuntSocketDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Type
+ return size
+}
+func (m *PuntSocketDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Type))
+ return buf.Bytes(), nil
+}
+func (m *PuntSocketDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Type = PuntType(buf.DecodeUint32())
+ return nil
+}
+
+// PuntSocketRegister defines message 'punt_socket_register'.
+type PuntSocketRegister struct {
+ HeaderVersion uint32 `binapi:"u32,name=header_version" json:"header_version,omitempty"`
+ Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
+ Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
+}
+
+func (m *PuntSocketRegister) Reset() { *m = PuntSocketRegister{} }
+func (*PuntSocketRegister) GetMessageName() string { return "punt_socket_register" }
+func (*PuntSocketRegister) GetCrcString() string { return "c8cd10fa" }
+func (*PuntSocketRegister) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PuntSocketRegister) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.HeaderVersion
+ size += 4 // m.Punt.Type
+ size += 1 * 10 // m.Punt.Punt
+ size += 108 // m.Pathname
+ return size
+}
+func (m *PuntSocketRegister) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.HeaderVersion)
+ buf.EncodeUint32(uint32(m.Punt.Type))
+ buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
+ buf.EncodeString(m.Pathname, 108)
+ return buf.Bytes(), nil
+}
+func (m *PuntSocketRegister) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.HeaderVersion = buf.DecodeUint32()
+ m.Punt.Type = PuntType(buf.DecodeUint32())
+ copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
+ m.Pathname = buf.DecodeString(108)
+ return nil
+}
+
+// PuntSocketRegisterReply defines message 'punt_socket_register_reply'.
+type PuntSocketRegisterReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
+}
+
+func (m *PuntSocketRegisterReply) Reset() { *m = PuntSocketRegisterReply{} }
+func (*PuntSocketRegisterReply) GetMessageName() string { return "punt_socket_register_reply" }
+func (*PuntSocketRegisterReply) GetCrcString() string { return "bd30ae90" }
+func (*PuntSocketRegisterReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PuntSocketRegisterReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 108 // m.Pathname
+ return size
+}
+func (m *PuntSocketRegisterReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.Pathname = buf.DecodeString(108)
+ return nil
+}
+
+// SetPunt defines message 'set_punt'.
+type SetPunt struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
+}
+
+func (m *SetPunt) Reset() { *m = SetPunt{} }
+func (*SetPunt) GetMessageName() string { return "set_punt" }
+func (*SetPunt) GetCrcString() string { return "83799618" }
+func (*SetPunt) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SetPunt) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Punt.Type
+ size += 1 * 10 // m.Punt.Punt
+ return size
+}
+func (m *SetPunt) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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[:], 10)
+ return buf.Bytes(), nil
+}
+func (m *SetPunt) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Punt.Type = PuntType(buf.DecodeUint32())
+ copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
+ return nil
+}
+
+// SetPuntReply defines message 'set_punt_reply'.
+type SetPuntReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SetPuntReply) Reset() { *m = SetPuntReply{} }
+func (*SetPuntReply) GetMessageName() string { return "set_punt_reply" }
+func (*SetPuntReply) GetCrcString() string { return "e8d4e804" }
+func (*SetPuntReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SetPuntReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SetPuntReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_punt_binapi_init() }
+func file_punt_binapi_init() {
+ api.RegisterMessage((*PuntReasonDetails)(nil), "punt_reason_details_2c9d4a40")
+ api.RegisterMessage((*PuntReasonDump)(nil), "punt_reason_dump_5c0dd4fe")
+ api.RegisterMessage((*PuntSocketDeregister)(nil), "punt_socket_deregister_98a444f4")
+ api.RegisterMessage((*PuntSocketDeregisterReply)(nil), "punt_socket_deregister_reply_e8d4e804")
+ api.RegisterMessage((*PuntSocketDetails)(nil), "punt_socket_details_1de0ce75")
+ api.RegisterMessage((*PuntSocketDump)(nil), "punt_socket_dump_52974935")
+ api.RegisterMessage((*PuntSocketRegister)(nil), "punt_socket_register_c8cd10fa")
+ api.RegisterMessage((*PuntSocketRegisterReply)(nil), "punt_socket_register_reply_bd30ae90")
+ api.RegisterMessage((*SetPunt)(nil), "set_punt_83799618")
+ api.RegisterMessage((*SetPuntReply)(nil), "set_punt_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*PuntReasonDetails)(nil),
+ (*PuntReasonDump)(nil),
+ (*PuntSocketDeregister)(nil),
+ (*PuntSocketDeregisterReply)(nil),
+ (*PuntSocketDetails)(nil),
+ (*PuntSocketDump)(nil),
+ (*PuntSocketRegister)(nil),
+ (*PuntSocketRegisterReply)(nil),
+ (*SetPunt)(nil),
+ (*SetPuntReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/punt/punt_rpc.ba.go b/internal/testbinapi/binapi2001/punt/punt_rpc.ba.go
new file mode 100644
index 0000000..c55a0af
--- /dev/null
+++ b/internal/testbinapi/binapi2001/punt/punt_rpc.ba.go
@@ -0,0 +1,133 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package punt
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service punt.
+type RPCService interface {
+ PuntReasonDump(ctx context.Context, in *PuntReasonDump) (RPCService_PuntReasonDumpClient, error)
+ PuntSocketDeregister(ctx context.Context, in *PuntSocketDeregister) (*PuntSocketDeregisterReply, error)
+ PuntSocketDump(ctx context.Context, in *PuntSocketDump) (RPCService_PuntSocketDumpClient, error)
+ PuntSocketRegister(ctx context.Context, in *PuntSocketRegister) (*PuntSocketRegisterReply, error)
+ SetPunt(ctx context.Context, in *SetPunt) (*SetPuntReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) PuntReasonDump(ctx context.Context, in *PuntReasonDump) (RPCService_PuntReasonDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_PuntReasonDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_PuntReasonDumpClient interface {
+ Recv() (*PuntReasonDetails, error)
+ api.Stream
+}
+
+type serviceClient_PuntReasonDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_PuntReasonDumpClient) Recv() (*PuntReasonDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *PuntReasonDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) PuntSocketDeregister(ctx context.Context, in *PuntSocketDeregister) (*PuntSocketDeregisterReply, error) {
+ out := new(PuntSocketDeregisterReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) PuntSocketDump(ctx context.Context, in *PuntSocketDump) (RPCService_PuntSocketDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_PuntSocketDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_PuntSocketDumpClient interface {
+ Recv() (*PuntSocketDetails, error)
+ api.Stream
+}
+
+type serviceClient_PuntSocketDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_PuntSocketDumpClient) Recv() (*PuntSocketDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *PuntSocketDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) PuntSocketRegister(ctx context.Context, in *PuntSocketRegister) (*PuntSocketRegisterReply, error) {
+ out := new(PuntSocketRegisterReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SetPunt(ctx context.Context, in *SetPunt) (*SetPuntReply, error) {
+ out := new(SetPuntReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/qos/qos.ba.go b/internal/testbinapi/binapi2001/qos/qos.ba.go
new file mode 100644
index 0000000..5414145
--- /dev/null
+++ b/internal/testbinapi/binapi2001/qos/qos.ba.go
@@ -0,0 +1,1633 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/qos.api.json
+
+// Package qos contains generated bindings for API file qos.api.
+//
+// Contents:
+// 6 aliases
+// 11 enums
+// 11 structs
+// 1 union
+// 19 messages
+//
+package qos
+
+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 = "qos"
+ APIVersion = "1.1.1"
+ VersionCrc = 0x86291f7f
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// QosSource defines enum 'qos_source'.
+type QosSource uint8
+
+const (
+ QOS_API_SOURCE_EXT QosSource = 0
+ QOS_API_SOURCE_VLAN QosSource = 1
+ QOS_API_SOURCE_MPLS QosSource = 2
+ QOS_API_SOURCE_IP QosSource = 3
+)
+
+var (
+ QosSource_name = map[uint8]string{
+ 0: "QOS_API_SOURCE_EXT",
+ 1: "QOS_API_SOURCE_VLAN",
+ 2: "QOS_API_SOURCE_MPLS",
+ 3: "QOS_API_SOURCE_IP",
+ }
+ QosSource_value = map[string]uint8{
+ "QOS_API_SOURCE_EXT": 0,
+ "QOS_API_SOURCE_VLAN": 1,
+ "QOS_API_SOURCE_MPLS": 2,
+ "QOS_API_SOURCE_IP": 3,
+ }
+)
+
+func (x QosSource) String() string {
+ s, ok := QosSource_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "QosSource(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// QosEgressMap defines type 'qos_egress_map'.
+type QosEgressMap struct {
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+ Rows [4]QosEgressMapRow `binapi:"qos_egress_map_row[4],name=rows" json:"rows,omitempty"`
+}
+
+// QosEgressMapRow defines type 'qos_egress_map_row'.
+type QosEgressMapRow struct {
+ Outputs []byte `binapi:"u8[256],name=outputs" json:"outputs,omitempty"`
+}
+
+// QosMark defines type 'qos_mark'.
+type QosMark struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ MapID uint32 `binapi:"u32,name=map_id" json:"map_id,omitempty"`
+ OutputSource QosSource `binapi:"qos_source,name=output_source" json:"output_source,omitempty"`
+}
+
+// QosRecord defines type 'qos_record'.
+type QosRecord struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ InputSource QosSource `binapi:"qos_source,name=input_source" json:"input_source,omitempty"`
+}
+
+// QosStore defines type 'qos_store'.
+type QosStore struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ InputSource QosSource `binapi:"qos_source,name=input_source" json:"input_source,omitempty"`
+ Value uint8 `binapi:"u8,name=value" json:"value,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// QosEgressMapDelete defines message 'qos_egress_map_delete'.
+type QosEgressMapDelete struct {
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+}
+
+func (m *QosEgressMapDelete) Reset() { *m = QosEgressMapDelete{} }
+func (*QosEgressMapDelete) GetMessageName() string { return "qos_egress_map_delete" }
+func (*QosEgressMapDelete) GetCrcString() string { return "3a91bde5" }
+func (*QosEgressMapDelete) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *QosEgressMapDelete) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ID
+ return size
+}
+func (m *QosEgressMapDelete) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ID)
+ return buf.Bytes(), nil
+}
+func (m *QosEgressMapDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint32()
+ return nil
+}
+
+// QosEgressMapDeleteReply defines message 'qos_egress_map_delete_reply'.
+type QosEgressMapDeleteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *QosEgressMapDeleteReply) Reset() { *m = QosEgressMapDeleteReply{} }
+func (*QosEgressMapDeleteReply) GetMessageName() string { return "qos_egress_map_delete_reply" }
+func (*QosEgressMapDeleteReply) GetCrcString() string { return "e8d4e804" }
+func (*QosEgressMapDeleteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosEgressMapDeleteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *QosEgressMapDeleteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// QosEgressMapDetails defines message 'qos_egress_map_details'.
+type QosEgressMapDetails struct {
+ Map QosEgressMap `binapi:"qos_egress_map,name=map" json:"map,omitempty"`
+}
+
+func (m *QosEgressMapDetails) Reset() { *m = QosEgressMapDetails{} }
+func (*QosEgressMapDetails) GetMessageName() string { return "qos_egress_map_details" }
+func (*QosEgressMapDetails) GetCrcString() string { return "46c5653c" }
+func (*QosEgressMapDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosEgressMapDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Map.ID
+ for j2 := 0; j2 < 4; j2++ {
+ size += 1 * 256 // m.Map.Rows[j2].Outputs
+ }
+ return size
+}
+func (m *QosEgressMapDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Map.ID)
+ for j1 := 0; j1 < 4; j1++ {
+ buf.EncodeBytes(m.Map.Rows[j1].Outputs, 256)
+ }
+ return buf.Bytes(), nil
+}
+func (m *QosEgressMapDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Map.ID = buf.DecodeUint32()
+ for j1 := 0; j1 < 4; j1++ {
+ m.Map.Rows[j1].Outputs = make([]byte, 256)
+ copy(m.Map.Rows[j1].Outputs, buf.DecodeBytes(len(m.Map.Rows[j1].Outputs)))
+ }
+ return nil
+}
+
+// QosEgressMapDump defines message 'qos_egress_map_dump'.
+type QosEgressMapDump struct{}
+
+func (m *QosEgressMapDump) Reset() { *m = QosEgressMapDump{} }
+func (*QosEgressMapDump) GetMessageName() string { return "qos_egress_map_dump" }
+func (*QosEgressMapDump) GetCrcString() string { return "51077d14" }
+func (*QosEgressMapDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *QosEgressMapDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *QosEgressMapDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *QosEgressMapDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// QosEgressMapUpdate defines message 'qos_egress_map_update'.
+type QosEgressMapUpdate struct {
+ Map QosEgressMap `binapi:"qos_egress_map,name=map" json:"map,omitempty"`
+}
+
+func (m *QosEgressMapUpdate) Reset() { *m = QosEgressMapUpdate{} }
+func (*QosEgressMapUpdate) GetMessageName() string { return "qos_egress_map_update" }
+func (*QosEgressMapUpdate) GetCrcString() string { return "6d1c065f" }
+func (*QosEgressMapUpdate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *QosEgressMapUpdate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Map.ID
+ for j2 := 0; j2 < 4; j2++ {
+ size += 1 * 256 // m.Map.Rows[j2].Outputs
+ }
+ return size
+}
+func (m *QosEgressMapUpdate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Map.ID)
+ for j1 := 0; j1 < 4; j1++ {
+ buf.EncodeBytes(m.Map.Rows[j1].Outputs, 256)
+ }
+ return buf.Bytes(), nil
+}
+func (m *QosEgressMapUpdate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Map.ID = buf.DecodeUint32()
+ for j1 := 0; j1 < 4; j1++ {
+ m.Map.Rows[j1].Outputs = make([]byte, 256)
+ copy(m.Map.Rows[j1].Outputs, buf.DecodeBytes(len(m.Map.Rows[j1].Outputs)))
+ }
+ return nil
+}
+
+// QosEgressMapUpdateReply defines message 'qos_egress_map_update_reply'.
+type QosEgressMapUpdateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *QosEgressMapUpdateReply) Reset() { *m = QosEgressMapUpdateReply{} }
+func (*QosEgressMapUpdateReply) GetMessageName() string { return "qos_egress_map_update_reply" }
+func (*QosEgressMapUpdateReply) GetCrcString() string { return "e8d4e804" }
+func (*QosEgressMapUpdateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosEgressMapUpdateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *QosEgressMapUpdateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// QosMarkDetails defines message 'qos_mark_details'.
+type QosMarkDetails struct {
+ Mark QosMark `binapi:"qos_mark,name=mark" json:"mark,omitempty"`
+}
+
+func (m *QosMarkDetails) Reset() { *m = QosMarkDetails{} }
+func (*QosMarkDetails) GetMessageName() string { return "qos_mark_details" }
+func (*QosMarkDetails) GetCrcString() string { return "89fe81a9" }
+func (*QosMarkDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosMarkDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Mark.SwIfIndex)
+ buf.EncodeUint32(m.Mark.MapID)
+ buf.EncodeUint8(uint8(m.Mark.OutputSource))
+ return buf.Bytes(), nil
+}
+func (m *QosMarkDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Mark.SwIfIndex = buf.DecodeUint32()
+ m.Mark.MapID = buf.DecodeUint32()
+ m.Mark.OutputSource = QosSource(buf.DecodeUint8())
+ return nil
+}
+
+// QosMarkDetailsReply defines message 'qos_mark_details_reply'.
+type QosMarkDetailsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *QosMarkDetailsReply) Reset() { *m = QosMarkDetailsReply{} }
+func (*QosMarkDetailsReply) GetMessageName() string { return "qos_mark_details_reply" }
+func (*QosMarkDetailsReply) GetCrcString() string { return "e8d4e804" }
+func (*QosMarkDetailsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosMarkDetailsReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *QosMarkDetailsReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// QosMarkDump defines message 'qos_mark_dump'.
+type QosMarkDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *QosMarkDump) Reset() { *m = QosMarkDump{} }
+func (*QosMarkDump) GetMessageName() string { return "qos_mark_dump" }
+func (*QosMarkDump) GetCrcString() string { return "f9e6675e" }
+func (*QosMarkDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *QosMarkDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *QosMarkDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *QosMarkDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// QosMarkEnableDisable defines message 'qos_mark_enable_disable'.
+type QosMarkEnableDisable struct {
+ Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
+ Mark QosMark `binapi:"qos_mark,name=mark" json:"mark,omitempty"`
+}
+
+func (m *QosMarkEnableDisable) Reset() { *m = QosMarkEnableDisable{} }
+func (*QosMarkEnableDisable) GetMessageName() string { return "qos_mark_enable_disable" }
+func (*QosMarkEnableDisable) GetCrcString() string { return "1a010f74" }
+func (*QosMarkEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *QosMarkEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ size += 4 // m.Mark.SwIfIndex
+ size += 4 // m.Mark.MapID
+ size += 1 // m.Mark.OutputSource
+ return size
+}
+func (m *QosMarkEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ buf.EncodeUint32(m.Mark.SwIfIndex)
+ buf.EncodeUint32(m.Mark.MapID)
+ buf.EncodeUint8(uint8(m.Mark.OutputSource))
+ return buf.Bytes(), nil
+}
+func (m *QosMarkEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ m.Mark.SwIfIndex = buf.DecodeUint32()
+ m.Mark.MapID = buf.DecodeUint32()
+ m.Mark.OutputSource = QosSource(buf.DecodeUint8())
+ return nil
+}
+
+// QosMarkEnableDisableReply defines message 'qos_mark_enable_disable_reply'.
+type QosMarkEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *QosMarkEnableDisableReply) Reset() { *m = QosMarkEnableDisableReply{} }
+func (*QosMarkEnableDisableReply) GetMessageName() string { return "qos_mark_enable_disable_reply" }
+func (*QosMarkEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*QosMarkEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosMarkEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *QosMarkEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// QosRecordDetails defines message 'qos_record_details'.
+type QosRecordDetails struct {
+ Record QosRecord `binapi:"qos_record,name=record" json:"record,omitempty"`
+}
+
+func (m *QosRecordDetails) Reset() { *m = QosRecordDetails{} }
+func (*QosRecordDetails) GetMessageName() string { return "qos_record_details" }
+func (*QosRecordDetails) GetCrcString() string { return "4956ccdd" }
+func (*QosRecordDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosRecordDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Record.SwIfIndex
+ size += 1 // m.Record.InputSource
+ return size
+}
+func (m *QosRecordDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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
+}
+func (m *QosRecordDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Record.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Record.InputSource = QosSource(buf.DecodeUint8())
+ return nil
+}
+
+// QosRecordDump defines message 'qos_record_dump'.
+type QosRecordDump struct{}
+
+func (m *QosRecordDump) Reset() { *m = QosRecordDump{} }
+func (*QosRecordDump) GetMessageName() string { return "qos_record_dump" }
+func (*QosRecordDump) GetCrcString() string { return "51077d14" }
+func (*QosRecordDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *QosRecordDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *QosRecordDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *QosRecordDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// QosRecordEnableDisable defines message 'qos_record_enable_disable'.
+type QosRecordEnableDisable struct {
+ Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
+ Record QosRecord `binapi:"qos_record,name=record" json:"record,omitempty"`
+}
+
+func (m *QosRecordEnableDisable) Reset() { *m = QosRecordEnableDisable{} }
+func (*QosRecordEnableDisable) GetMessageName() string { return "qos_record_enable_disable" }
+func (*QosRecordEnableDisable) GetCrcString() string { return "25b33f88" }
+func (*QosRecordEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *QosRecordEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ size += 4 // m.Record.SwIfIndex
+ size += 1 // m.Record.InputSource
+ return size
+}
+func (m *QosRecordEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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))
+ return buf.Bytes(), nil
+}
+func (m *QosRecordEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ m.Record.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Record.InputSource = QosSource(buf.DecodeUint8())
+ return nil
+}
+
+// QosRecordEnableDisableReply defines message 'qos_record_enable_disable_reply'.
+type QosRecordEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *QosRecordEnableDisableReply) Reset() { *m = QosRecordEnableDisableReply{} }
+func (*QosRecordEnableDisableReply) GetMessageName() string { return "qos_record_enable_disable_reply" }
+func (*QosRecordEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*QosRecordEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosRecordEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *QosRecordEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// QosStoreDetails defines message 'qos_store_details'.
+type QosStoreDetails struct {
+ Store QosStore `binapi:"qos_store,name=store" json:"store,omitempty"`
+}
+
+func (m *QosStoreDetails) Reset() { *m = QosStoreDetails{} }
+func (*QosStoreDetails) GetMessageName() string { return "qos_store_details" }
+func (*QosStoreDetails) GetCrcString() string { return "038a6d48" }
+func (*QosStoreDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosStoreDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Store.SwIfIndex))
+ buf.EncodeUint8(uint8(m.Store.InputSource))
+ buf.EncodeUint8(m.Store.Value)
+ return buf.Bytes(), nil
+}
+func (m *QosStoreDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Store.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Store.InputSource = QosSource(buf.DecodeUint8())
+ m.Store.Value = buf.DecodeUint8()
+ return nil
+}
+
+// QosStoreDump defines message 'qos_store_dump'.
+type QosStoreDump struct{}
+
+func (m *QosStoreDump) Reset() { *m = QosStoreDump{} }
+func (*QosStoreDump) GetMessageName() string { return "qos_store_dump" }
+func (*QosStoreDump) GetCrcString() string { return "51077d14" }
+func (*QosStoreDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *QosStoreDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *QosStoreDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *QosStoreDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// QosStoreEnableDisable defines message 'qos_store_enable_disable'.
+type QosStoreEnableDisable struct {
+ Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
+ Store QosStore `binapi:"qos_store,name=store" json:"store,omitempty"`
+}
+
+func (m *QosStoreEnableDisable) Reset() { *m = QosStoreEnableDisable{} }
+func (*QosStoreEnableDisable) GetMessageName() string { return "qos_store_enable_disable" }
+func (*QosStoreEnableDisable) GetCrcString() string { return "3507235e" }
+func (*QosStoreEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *QosStoreEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ size += 4 // m.Store.SwIfIndex
+ size += 1 // m.Store.InputSource
+ size += 1 // m.Store.Value
+ return size
+}
+func (m *QosStoreEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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(m.Store.Value)
+ return buf.Bytes(), nil
+}
+func (m *QosStoreEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ m.Store.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Store.InputSource = QosSource(buf.DecodeUint8())
+ m.Store.Value = buf.DecodeUint8()
+ return nil
+}
+
+// QosStoreEnableDisableReply defines message 'qos_store_enable_disable_reply'.
+type QosStoreEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *QosStoreEnableDisableReply) Reset() { *m = QosStoreEnableDisableReply{} }
+func (*QosStoreEnableDisableReply) GetMessageName() string { return "qos_store_enable_disable_reply" }
+func (*QosStoreEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*QosStoreEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *QosStoreEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *QosStoreEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_qos_binapi_init() }
+func file_qos_binapi_init() {
+ api.RegisterMessage((*QosEgressMapDelete)(nil), "qos_egress_map_delete_3a91bde5")
+ api.RegisterMessage((*QosEgressMapDeleteReply)(nil), "qos_egress_map_delete_reply_e8d4e804")
+ api.RegisterMessage((*QosEgressMapDetails)(nil), "qos_egress_map_details_46c5653c")
+ api.RegisterMessage((*QosEgressMapDump)(nil), "qos_egress_map_dump_51077d14")
+ api.RegisterMessage((*QosEgressMapUpdate)(nil), "qos_egress_map_update_6d1c065f")
+ api.RegisterMessage((*QosEgressMapUpdateReply)(nil), "qos_egress_map_update_reply_e8d4e804")
+ api.RegisterMessage((*QosMarkDetails)(nil), "qos_mark_details_89fe81a9")
+ api.RegisterMessage((*QosMarkDetailsReply)(nil), "qos_mark_details_reply_e8d4e804")
+ api.RegisterMessage((*QosMarkDump)(nil), "qos_mark_dump_f9e6675e")
+ api.RegisterMessage((*QosMarkEnableDisable)(nil), "qos_mark_enable_disable_1a010f74")
+ api.RegisterMessage((*QosMarkEnableDisableReply)(nil), "qos_mark_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*QosRecordDetails)(nil), "qos_record_details_4956ccdd")
+ api.RegisterMessage((*QosRecordDump)(nil), "qos_record_dump_51077d14")
+ api.RegisterMessage((*QosRecordEnableDisable)(nil), "qos_record_enable_disable_25b33f88")
+ api.RegisterMessage((*QosRecordEnableDisableReply)(nil), "qos_record_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*QosStoreDetails)(nil), "qos_store_details_038a6d48")
+ api.RegisterMessage((*QosStoreDump)(nil), "qos_store_dump_51077d14")
+ api.RegisterMessage((*QosStoreEnableDisable)(nil), "qos_store_enable_disable_3507235e")
+ api.RegisterMessage((*QosStoreEnableDisableReply)(nil), "qos_store_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*QosEgressMapDelete)(nil),
+ (*QosEgressMapDeleteReply)(nil),
+ (*QosEgressMapDetails)(nil),
+ (*QosEgressMapDump)(nil),
+ (*QosEgressMapUpdate)(nil),
+ (*QosEgressMapUpdateReply)(nil),
+ (*QosMarkDetails)(nil),
+ (*QosMarkDetailsReply)(nil),
+ (*QosMarkDump)(nil),
+ (*QosMarkEnableDisable)(nil),
+ (*QosMarkEnableDisableReply)(nil),
+ (*QosRecordDetails)(nil),
+ (*QosRecordDump)(nil),
+ (*QosRecordEnableDisable)(nil),
+ (*QosRecordEnableDisableReply)(nil),
+ (*QosStoreDetails)(nil),
+ (*QosStoreDump)(nil),
+ (*QosStoreEnableDisable)(nil),
+ (*QosStoreEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/qos/qos_rpc.ba.go b/internal/testbinapi/binapi2001/qos/qos_rpc.ba.go
new file mode 100644
index 0000000..ed5909c
--- /dev/null
+++ b/internal/testbinapi/binapi2001/qos/qos_rpc.ba.go
@@ -0,0 +1,233 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package qos
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service qos.
+type RPCService interface {
+ QosEgressMapDelete(ctx context.Context, in *QosEgressMapDelete) (*QosEgressMapDeleteReply, error)
+ QosEgressMapDump(ctx context.Context, in *QosEgressMapDump) (RPCService_QosEgressMapDumpClient, error)
+ QosEgressMapUpdate(ctx context.Context, in *QosEgressMapUpdate) (*QosEgressMapUpdateReply, error)
+ QosMarkDump(ctx context.Context, in *QosMarkDump) (RPCService_QosMarkDumpClient, error)
+ QosMarkEnableDisable(ctx context.Context, in *QosMarkEnableDisable) (*QosMarkEnableDisableReply, error)
+ QosRecordDump(ctx context.Context, in *QosRecordDump) (RPCService_QosRecordDumpClient, error)
+ QosRecordEnableDisable(ctx context.Context, in *QosRecordEnableDisable) (*QosRecordEnableDisableReply, error)
+ QosStoreDump(ctx context.Context, in *QosStoreDump) (RPCService_QosStoreDumpClient, error)
+ QosStoreEnableDisable(ctx context.Context, in *QosStoreEnableDisable) (*QosStoreEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) QosEgressMapDelete(ctx context.Context, in *QosEgressMapDelete) (*QosEgressMapDeleteReply, error) {
+ out := new(QosEgressMapDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) QosEgressMapDump(ctx context.Context, in *QosEgressMapDump) (RPCService_QosEgressMapDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_QosEgressMapDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_QosEgressMapDumpClient interface {
+ Recv() (*QosEgressMapDetails, error)
+ api.Stream
+}
+
+type serviceClient_QosEgressMapDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_QosEgressMapDumpClient) Recv() (*QosEgressMapDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *QosEgressMapDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) QosEgressMapUpdate(ctx context.Context, in *QosEgressMapUpdate) (*QosEgressMapUpdateReply, error) {
+ out := new(QosEgressMapUpdateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) QosMarkDump(ctx context.Context, in *QosMarkDump) (RPCService_QosMarkDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_QosMarkDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_QosMarkDumpClient interface {
+ Recv() (*QosMarkDetails, error)
+ api.Stream
+}
+
+type serviceClient_QosMarkDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_QosMarkDumpClient) Recv() (*QosMarkDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *QosMarkDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) QosMarkEnableDisable(ctx context.Context, in *QosMarkEnableDisable) (*QosMarkEnableDisableReply, error) {
+ out := new(QosMarkEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) QosRecordDump(ctx context.Context, in *QosRecordDump) (RPCService_QosRecordDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_QosRecordDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_QosRecordDumpClient interface {
+ Recv() (*QosRecordDetails, error)
+ api.Stream
+}
+
+type serviceClient_QosRecordDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_QosRecordDumpClient) Recv() (*QosRecordDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *QosRecordDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) QosRecordEnableDisable(ctx context.Context, in *QosRecordEnableDisable) (*QosRecordEnableDisableReply, error) {
+ out := new(QosRecordEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) QosStoreDump(ctx context.Context, in *QosStoreDump) (RPCService_QosStoreDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_QosStoreDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_QosStoreDumpClient interface {
+ Recv() (*QosStoreDetails, error)
+ api.Stream
+}
+
+type serviceClient_QosStoreDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_QosStoreDumpClient) Recv() (*QosStoreDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *QosStoreDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) QosStoreEnableDisable(ctx context.Context, in *QosStoreEnableDisable) (*QosStoreEnableDisableReply, error) {
+ out := new(QosStoreEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/rd_cp/rd_cp.ba.go b/internal/testbinapi/binapi2001/rd_cp/rd_cp.ba.go
new file mode 100644
index 0000000..db3579d
--- /dev/null
+++ b/internal/testbinapi/binapi2001/rd_cp/rd_cp.ba.go
@@ -0,0 +1,374 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/rd_cp.api.json
+
+// Package rd_cp contains generated bindings for API file rd_cp.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+// 2 messages
+//
+package rd_cp
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "rd_cp"
+ APIVersion = "1.0.1"
+ VersionCrc = 0x5269dfb9
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP6NdAddressAutoconfig defines message 'ip6_nd_address_autoconfig'.
+type IP6NdAddressAutoconfig struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+ InstallDefaultRoutes bool `binapi:"bool,name=install_default_routes" json:"install_default_routes,omitempty"`
+}
+
+func (m *IP6NdAddressAutoconfig) Reset() { *m = IP6NdAddressAutoconfig{} }
+func (*IP6NdAddressAutoconfig) GetMessageName() string { return "ip6_nd_address_autoconfig" }
+func (*IP6NdAddressAutoconfig) GetCrcString() string { return "9e14a4a7" }
+func (*IP6NdAddressAutoconfig) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *IP6NdAddressAutoconfig) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
+ size += 1 // m.InstallDefaultRoutes
+ return size
+}
+func (m *IP6NdAddressAutoconfig) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Enable)
+ buf.EncodeBool(m.InstallDefaultRoutes)
+ return buf.Bytes(), nil
+}
+func (m *IP6NdAddressAutoconfig) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Enable = buf.DecodeBool()
+ m.InstallDefaultRoutes = buf.DecodeBool()
+ return nil
+}
+
+// IP6NdAddressAutoconfigReply defines message 'ip6_nd_address_autoconfig_reply'.
+type IP6NdAddressAutoconfigReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *IP6NdAddressAutoconfigReply) Reset() { *m = IP6NdAddressAutoconfigReply{} }
+func (*IP6NdAddressAutoconfigReply) GetMessageName() string { return "ip6_nd_address_autoconfig_reply" }
+func (*IP6NdAddressAutoconfigReply) GetCrcString() string { return "e8d4e804" }
+func (*IP6NdAddressAutoconfigReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *IP6NdAddressAutoconfigReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *IP6NdAddressAutoconfigReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_rd_cp_binapi_init() }
+func file_rd_cp_binapi_init() {
+ api.RegisterMessage((*IP6NdAddressAutoconfig)(nil), "ip6_nd_address_autoconfig_9e14a4a7")
+ api.RegisterMessage((*IP6NdAddressAutoconfigReply)(nil), "ip6_nd_address_autoconfig_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*IP6NdAddressAutoconfig)(nil),
+ (*IP6NdAddressAutoconfigReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/rd_cp/rd_cp_rpc.ba.go b/internal/testbinapi/binapi2001/rd_cp/rd_cp_rpc.ba.go
new file mode 100644
index 0000000..af7ba12
--- /dev/null
+++ b/internal/testbinapi/binapi2001/rd_cp/rd_cp_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package rd_cp
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service rd_cp.
+type RPCService interface {
+ IP6NdAddressAutoconfig(ctx context.Context, in *IP6NdAddressAutoconfig) (*IP6NdAddressAutoconfigReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) IP6NdAddressAutoconfig(ctx context.Context, in *IP6NdAddressAutoconfig) (*IP6NdAddressAutoconfigReply, error) {
+ out := new(IP6NdAddressAutoconfigReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/rdma/rdma.ba.go b/internal/testbinapi/binapi2001/rdma/rdma.ba.go
new file mode 100644
index 0000000..fcbf2c2
--- /dev/null
+++ b/internal/testbinapi/binapi2001/rdma/rdma.ba.go
@@ -0,0 +1,490 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/rdma.api.json
+
+// Package rdma contains generated bindings for API file rdma.api.
+//
+// Contents:
+// 1 alias
+// 7 enums
+// 4 messages
+//
+package rdma
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "strconv"
+)
+
+// 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 = "rdma"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x5ce233e0
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RdmaMode defines enum 'rdma_mode'.
+type RdmaMode uint32
+
+const (
+ RDMA_API_MODE_AUTO RdmaMode = 0
+ RDMA_API_MODE_IBV RdmaMode = 1
+ RDMA_API_MODE_DV RdmaMode = 2
+)
+
+var (
+ RdmaMode_name = map[uint32]string{
+ 0: "RDMA_API_MODE_AUTO",
+ 1: "RDMA_API_MODE_IBV",
+ 2: "RDMA_API_MODE_DV",
+ }
+ RdmaMode_value = map[string]uint32{
+ "RDMA_API_MODE_AUTO": 0,
+ "RDMA_API_MODE_IBV": 1,
+ "RDMA_API_MODE_DV": 2,
+ }
+)
+
+func (x RdmaMode) String() string {
+ s, ok := RdmaMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RdmaMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// RdmaCreate defines message 'rdma_create'.
+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=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{} }
+func (*RdmaCreate) GetMessageName() string { return "rdma_create" }
+func (*RdmaCreate) GetCrcString() string { return "076fe418" }
+func (*RdmaCreate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *RdmaCreate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.HostIf
+ size += 64 // m.Name
+ size += 2 // m.RxqNum
+ size += 2 // m.RxqSize
+ size += 2 // m.TxqSize
+ size += 4 // m.Mode
+ return size
+}
+func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.HostIf, 64)
+ buf.EncodeString(m.Name, 64)
+ buf.EncodeUint16(m.RxqNum)
+ buf.EncodeUint16(m.RxqSize)
+ buf.EncodeUint16(m.TxqSize)
+ buf.EncodeUint32(uint32(m.Mode))
+ return buf.Bytes(), nil
+}
+func (m *RdmaCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.HostIf = buf.DecodeString(64)
+ m.Name = buf.DecodeString(64)
+ m.RxqNum = buf.DecodeUint16()
+ m.RxqSize = buf.DecodeUint16()
+ m.TxqSize = buf.DecodeUint16()
+ m.Mode = RdmaMode(buf.DecodeUint32())
+ return nil
+}
+
+// RdmaCreateReply defines message 'rdma_create_reply'.
+type RdmaCreateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *RdmaCreateReply) Reset() { *m = RdmaCreateReply{} }
+func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" }
+func (*RdmaCreateReply) GetCrcString() string { return "5383d31f" }
+func (*RdmaCreateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *RdmaCreateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// RdmaDelete defines message 'rdma_delete'.
+type RdmaDelete struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *RdmaDelete) Reset() { *m = RdmaDelete{} }
+func (*RdmaDelete) GetMessageName() string { return "rdma_delete" }
+func (*RdmaDelete) GetCrcString() string { return "f9e6675e" }
+func (*RdmaDelete) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *RdmaDelete) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *RdmaDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// RdmaDeleteReply defines message 'rdma_delete_reply'.
+type RdmaDeleteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *RdmaDeleteReply) Reset() { *m = RdmaDeleteReply{} }
+func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" }
+func (*RdmaDeleteReply) GetCrcString() string { return "e8d4e804" }
+func (*RdmaDeleteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *RdmaDeleteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_rdma_binapi_init() }
+func file_rdma_binapi_init() {
+ api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418")
+ api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f")
+ api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e")
+ api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*RdmaCreate)(nil),
+ (*RdmaCreateReply)(nil),
+ (*RdmaDelete)(nil),
+ (*RdmaDeleteReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/rdma/rdma_rpc.ba.go b/internal/testbinapi/binapi2001/rdma/rdma_rpc.ba.go
new file mode 100644
index 0000000..850f04a
--- /dev/null
+++ b/internal/testbinapi/binapi2001/rdma/rdma_rpc.ba.go
@@ -0,0 +1,40 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package rdma
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service rdma.
+type RPCService interface {
+ RdmaCreate(ctx context.Context, in *RdmaCreate) (*RdmaCreateReply, error)
+ RdmaDelete(ctx context.Context, in *RdmaDelete) (*RdmaDeleteReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) RdmaCreate(ctx context.Context, in *RdmaCreate) (*RdmaCreateReply, error) {
+ out := new(RdmaCreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) RdmaDelete(ctx context.Context, in *RdmaDelete) (*RdmaDeleteReply, error) {
+ out := new(RdmaDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/sctp/sctp.ba.go b/internal/testbinapi/binapi2001/sctp/sctp.ba.go
new file mode 100644
index 0000000..61aeab6
--- /dev/null
+++ b/internal/testbinapi/binapi2001/sctp/sctp.ba.go
@@ -0,0 +1,285 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/sctp.api.json
+
+// Package sctp contains generated bindings for API file sctp.api.
+//
+// Contents:
+// 6 messages
+//
+package sctp
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "sctp"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x35f411c4
+)
+
+// SctpAddSrcDstConnection defines message 'sctp_add_src_dst_connection'.
+type SctpAddSrcDstConnection struct {
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ SrcAddress []byte `binapi:"u8[16],name=src_address" json:"src_address,omitempty"`
+ DstAddress []byte `binapi:"u8[16],name=dst_address" json:"dst_address,omitempty"`
+}
+
+func (m *SctpAddSrcDstConnection) Reset() { *m = SctpAddSrcDstConnection{} }
+func (*SctpAddSrcDstConnection) GetMessageName() string { return "sctp_add_src_dst_connection" }
+func (*SctpAddSrcDstConnection) GetCrcString() string { return "45c59b2f" }
+func (*SctpAddSrcDstConnection) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SctpAddSrcDstConnection) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIPv6
+ size += 4 // m.VrfID
+ size += 1 * 16 // m.SrcAddress
+ size += 1 * 16 // m.DstAddress
+ return size
+}
+func (m *SctpAddSrcDstConnection) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeBytes(m.SrcAddress, 16)
+ buf.EncodeBytes(m.DstAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *SctpAddSrcDstConnection) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeUint8()
+ m.VrfID = buf.DecodeUint32()
+ m.SrcAddress = make([]byte, 16)
+ copy(m.SrcAddress, buf.DecodeBytes(len(m.SrcAddress)))
+ m.DstAddress = make([]byte, 16)
+ copy(m.DstAddress, buf.DecodeBytes(len(m.DstAddress)))
+ return nil
+}
+
+// SctpAddSrcDstConnectionReply defines message 'sctp_add_src_dst_connection_reply'.
+type SctpAddSrcDstConnectionReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SctpAddSrcDstConnectionReply) Reset() { *m = SctpAddSrcDstConnectionReply{} }
+func (*SctpAddSrcDstConnectionReply) GetMessageName() string {
+ return "sctp_add_src_dst_connection_reply"
+}
+func (*SctpAddSrcDstConnectionReply) GetCrcString() string { return "e8d4e804" }
+func (*SctpAddSrcDstConnectionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SctpAddSrcDstConnectionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SctpAddSrcDstConnectionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SctpAddSrcDstConnectionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// SctpConfig defines message 'sctp_config'.
+type SctpConfig struct {
+ NeverDelaySack uint8 `binapi:"u8,name=never_delay_sack" json:"never_delay_sack,omitempty"`
+ NeverBundle uint8 `binapi:"u8,name=never_bundle" json:"never_bundle,omitempty"`
+}
+
+func (m *SctpConfig) Reset() { *m = SctpConfig{} }
+func (*SctpConfig) GetMessageName() string { return "sctp_config" }
+func (*SctpConfig) GetCrcString() string { return "7617eced" }
+func (*SctpConfig) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SctpConfig) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.NeverDelaySack
+ size += 1 // m.NeverBundle
+ return size
+}
+func (m *SctpConfig) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.NeverDelaySack)
+ buf.EncodeUint8(m.NeverBundle)
+ return buf.Bytes(), nil
+}
+func (m *SctpConfig) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.NeverDelaySack = buf.DecodeUint8()
+ m.NeverBundle = buf.DecodeUint8()
+ return nil
+}
+
+// SctpConfigReply defines message 'sctp_config_reply'.
+type SctpConfigReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SctpConfigReply) Reset() { *m = SctpConfigReply{} }
+func (*SctpConfigReply) GetMessageName() string { return "sctp_config_reply" }
+func (*SctpConfigReply) GetCrcString() string { return "e8d4e804" }
+func (*SctpConfigReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SctpConfigReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SctpConfigReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SctpConfigReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// SctpDelSrcDstConnection defines message 'sctp_del_src_dst_connection'.
+type SctpDelSrcDstConnection struct {
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ SrcAddress []byte `binapi:"u8[16],name=src_address" json:"src_address,omitempty"`
+ DstAddress []byte `binapi:"u8[16],name=dst_address" json:"dst_address,omitempty"`
+}
+
+func (m *SctpDelSrcDstConnection) Reset() { *m = SctpDelSrcDstConnection{} }
+func (*SctpDelSrcDstConnection) GetMessageName() string { return "sctp_del_src_dst_connection" }
+func (*SctpDelSrcDstConnection) GetCrcString() string { return "45c59b2f" }
+func (*SctpDelSrcDstConnection) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SctpDelSrcDstConnection) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIPv6
+ size += 4 // m.VrfID
+ size += 1 * 16 // m.SrcAddress
+ size += 1 * 16 // m.DstAddress
+ return size
+}
+func (m *SctpDelSrcDstConnection) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeBytes(m.SrcAddress, 16)
+ buf.EncodeBytes(m.DstAddress, 16)
+ return buf.Bytes(), nil
+}
+func (m *SctpDelSrcDstConnection) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeUint8()
+ m.VrfID = buf.DecodeUint32()
+ m.SrcAddress = make([]byte, 16)
+ copy(m.SrcAddress, buf.DecodeBytes(len(m.SrcAddress)))
+ m.DstAddress = make([]byte, 16)
+ copy(m.DstAddress, buf.DecodeBytes(len(m.DstAddress)))
+ return nil
+}
+
+// SctpDelSrcDstConnectionReply defines message 'sctp_del_src_dst_connection_reply'.
+type SctpDelSrcDstConnectionReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SctpDelSrcDstConnectionReply) Reset() { *m = SctpDelSrcDstConnectionReply{} }
+func (*SctpDelSrcDstConnectionReply) GetMessageName() string {
+ return "sctp_del_src_dst_connection_reply"
+}
+func (*SctpDelSrcDstConnectionReply) GetCrcString() string { return "e8d4e804" }
+func (*SctpDelSrcDstConnectionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SctpDelSrcDstConnectionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SctpDelSrcDstConnectionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SctpDelSrcDstConnectionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_sctp_binapi_init() }
+func file_sctp_binapi_init() {
+ api.RegisterMessage((*SctpAddSrcDstConnection)(nil), "sctp_add_src_dst_connection_45c59b2f")
+ api.RegisterMessage((*SctpAddSrcDstConnectionReply)(nil), "sctp_add_src_dst_connection_reply_e8d4e804")
+ api.RegisterMessage((*SctpConfig)(nil), "sctp_config_7617eced")
+ api.RegisterMessage((*SctpConfigReply)(nil), "sctp_config_reply_e8d4e804")
+ api.RegisterMessage((*SctpDelSrcDstConnection)(nil), "sctp_del_src_dst_connection_45c59b2f")
+ api.RegisterMessage((*SctpDelSrcDstConnectionReply)(nil), "sctp_del_src_dst_connection_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SctpAddSrcDstConnection)(nil),
+ (*SctpAddSrcDstConnectionReply)(nil),
+ (*SctpConfig)(nil),
+ (*SctpConfigReply)(nil),
+ (*SctpDelSrcDstConnection)(nil),
+ (*SctpDelSrcDstConnectionReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/sctp/sctp_rpc.ba.go b/internal/testbinapi/binapi2001/sctp/sctp_rpc.ba.go
new file mode 100644
index 0000000..d5aa970
--- /dev/null
+++ b/internal/testbinapi/binapi2001/sctp/sctp_rpc.ba.go
@@ -0,0 +1,50 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package sctp
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service sctp.
+type RPCService interface {
+ SctpAddSrcDstConnection(ctx context.Context, in *SctpAddSrcDstConnection) (*SctpAddSrcDstConnectionReply, error)
+ SctpConfig(ctx context.Context, in *SctpConfig) (*SctpConfigReply, error)
+ SctpDelSrcDstConnection(ctx context.Context, in *SctpDelSrcDstConnection) (*SctpDelSrcDstConnectionReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SctpAddSrcDstConnection(ctx context.Context, in *SctpAddSrcDstConnection) (*SctpAddSrcDstConnectionReply, error) {
+ out := new(SctpAddSrcDstConnectionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SctpConfig(ctx context.Context, in *SctpConfig) (*SctpConfigReply, error) {
+ out := new(SctpConfigReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SctpDelSrcDstConnection(ctx context.Context, in *SctpDelSrcDstConnection) (*SctpDelSrcDstConnectionReply, error) {
+ out := new(SctpDelSrcDstConnectionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/session/session.ba.go b/internal/testbinapi/binapi2001/session/session.ba.go
new file mode 100644
index 0000000..7f5af5c
--- /dev/null
+++ b/internal/testbinapi/binapi2001/session/session.ba.go
@@ -0,0 +1,2026 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/session.api.json
+
+// Package session contains generated bindings for API file session.api.
+//
+// Contents:
+// 44 messages
+//
+package session
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "session"
+ APIVersion = "1.7.0"
+ VersionCrc = 0xdf888b15
+)
+
+// AppAddCertKeyPair defines message 'app_add_cert_key_pair'.
+type AppAddCertKeyPair struct {
+ CertLen uint16 `binapi:"u16,name=cert_len" json:"cert_len,omitempty"`
+ CertkeyLen uint16 `binapi:"u16,name=certkey_len" json:"-"`
+ Certkey []byte `binapi:"u8[certkey_len],name=certkey" json:"certkey,omitempty"`
+}
+
+func (m *AppAddCertKeyPair) Reset() { *m = AppAddCertKeyPair{} }
+func (*AppAddCertKeyPair) GetMessageName() string { return "app_add_cert_key_pair" }
+func (*AppAddCertKeyPair) GetCrcString() string { return "02eb8016" }
+func (*AppAddCertKeyPair) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AppAddCertKeyPair) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.CertLen)
+ buf.EncodeUint16(uint16(len(m.Certkey)))
+ 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()
+ m.Certkey = make([]byte, m.CertkeyLen)
+ copy(m.Certkey, buf.DecodeBytes(len(m.Certkey)))
+ return nil
+}
+
+// AppAddCertKeyPairReply defines message 'app_add_cert_key_pair_reply'.
+type AppAddCertKeyPairReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
+}
+
+func (m *AppAddCertKeyPairReply) Reset() { *m = AppAddCertKeyPairReply{} }
+func (*AppAddCertKeyPairReply) GetMessageName() string { return "app_add_cert_key_pair_reply" }
+func (*AppAddCertKeyPairReply) GetCrcString() string { return "b42958d0" }
+func (*AppAddCertKeyPairReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AppAddCertKeyPairReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Index
+ return size
+}
+func (m *AppAddCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.Index = buf.DecodeUint32()
+ return nil
+}
+
+// AppAttach defines message 'app_attach'.
+type AppAttach struct {
+ Options []uint64 `binapi:"u64[16],name=options" json:"options,omitempty"`
+ NamespaceIDLen uint8 `binapi:"u8,name=namespace_id_len" json:"namespace_id_len,omitempty"`
+ NamespaceID []byte `binapi:"u8[64],name=namespace_id" json:"namespace_id,omitempty"`
+}
+
+func (m *AppAttach) Reset() { *m = AppAttach{} }
+func (*AppAttach) GetMessageName() string { return "app_attach" }
+func (*AppAttach) GetCrcString() string { return "ed08f4bd" }
+func (*AppAttach) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AppAttach) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 8 * 16 // m.Options
+ size += 1 // m.NamespaceIDLen
+ size += 1 * 64 // m.NamespaceID
+ return size
+}
+func (m *AppAttach) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ for i := 0; i < 16; i++ {
+ var x uint64
+ if i < len(m.Options) {
+ x = uint64(m.Options[i])
+ }
+ buf.EncodeUint64(x)
+ }
+ buf.EncodeUint8(m.NamespaceIDLen)
+ buf.EncodeBytes(m.NamespaceID, 64)
+ return buf.Bytes(), nil
+}
+func (m *AppAttach) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Options = make([]uint64, 16)
+ for i := 0; i < len(m.Options); i++ {
+ m.Options[i] = buf.DecodeUint64()
+ }
+ m.NamespaceIDLen = buf.DecodeUint8()
+ m.NamespaceID = make([]byte, 64)
+ copy(m.NamespaceID, buf.DecodeBytes(len(m.NamespaceID)))
+ return nil
+}
+
+// AppAttachReply defines message 'app_attach_reply'.
+type AppAttachReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ AppMq uint64 `binapi:"u64,name=app_mq" json:"app_mq,omitempty"`
+ VppCtrlMq uint64 `binapi:"u64,name=vpp_ctrl_mq" json:"vpp_ctrl_mq,omitempty"`
+ VppCtrlMqThread uint8 `binapi:"u8,name=vpp_ctrl_mq_thread" json:"vpp_ctrl_mq_thread,omitempty"`
+ AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
+ NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
+ FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
+ SegmentSize uint32 `binapi:"u32,name=segment_size" json:"segment_size,omitempty"`
+ SegmentNameLength uint8 `binapi:"u8,name=segment_name_length" json:"segment_name_length,omitempty"`
+ SegmentName []byte `binapi:"u8[128],name=segment_name" json:"segment_name,omitempty"`
+ SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
+}
+
+func (m *AppAttachReply) Reset() { *m = AppAttachReply{} }
+func (*AppAttachReply) GetMessageName() string { return "app_attach_reply" }
+func (*AppAttachReply) GetCrcString() string { return "0112f647" }
+func (*AppAttachReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AppAttachReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 8 // m.AppMq
+ size += 8 // m.VppCtrlMq
+ size += 1 // m.VppCtrlMqThread
+ size += 4 // m.AppIndex
+ size += 1 // m.NFds
+ size += 1 // m.FdFlags
+ size += 4 // m.SegmentSize
+ size += 1 // m.SegmentNameLength
+ size += 1 * 128 // m.SegmentName
+ size += 8 // m.SegmentHandle
+ return size
+}
+func (m *AppAttachReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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.EncodeUint8(m.SegmentNameLength)
+ buf.EncodeBytes(m.SegmentName, 128)
+ buf.EncodeUint64(m.SegmentHandle)
+ return buf.Bytes(), nil
+}
+func (m *AppAttachReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.AppMq = buf.DecodeUint64()
+ m.VppCtrlMq = buf.DecodeUint64()
+ m.VppCtrlMqThread = buf.DecodeUint8()
+ m.AppIndex = buf.DecodeUint32()
+ m.NFds = buf.DecodeUint8()
+ m.FdFlags = buf.DecodeUint8()
+ m.SegmentSize = buf.DecodeUint32()
+ m.SegmentNameLength = buf.DecodeUint8()
+ m.SegmentName = make([]byte, 128)
+ copy(m.SegmentName, buf.DecodeBytes(len(m.SegmentName)))
+ m.SegmentHandle = buf.DecodeUint64()
+ return nil
+}
+
+// AppCutThroughRegistrationAdd defines message 'app_cut_through_registration_add'.
+type AppCutThroughRegistrationAdd struct {
+ EvtQAddress uint64 `binapi:"u64,name=evt_q_address" json:"evt_q_address,omitempty"`
+ PeerEvtQAddress uint64 `binapi:"u64,name=peer_evt_q_address" json:"peer_evt_q_address,omitempty"`
+ WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
+ NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
+ FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
+}
+
+func (m *AppCutThroughRegistrationAdd) Reset() { *m = AppCutThroughRegistrationAdd{} }
+func (*AppCutThroughRegistrationAdd) GetMessageName() string {
+ return "app_cut_through_registration_add"
+}
+func (*AppCutThroughRegistrationAdd) GetCrcString() string { return "6d73b1b9" }
+func (*AppCutThroughRegistrationAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AppCutThroughRegistrationAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 8 // m.EvtQAddress
+ size += 8 // m.PeerEvtQAddress
+ size += 4 // m.WrkIndex
+ size += 1 // m.NFds
+ size += 1 // m.FdFlags
+ return size
+}
+func (m *AppCutThroughRegistrationAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint64(m.EvtQAddress)
+ buf.EncodeUint64(m.PeerEvtQAddress)
+ buf.EncodeUint32(m.WrkIndex)
+ buf.EncodeUint8(m.NFds)
+ buf.EncodeUint8(m.FdFlags)
+ return buf.Bytes(), nil
+}
+func (m *AppCutThroughRegistrationAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EvtQAddress = buf.DecodeUint64()
+ m.PeerEvtQAddress = buf.DecodeUint64()
+ m.WrkIndex = buf.DecodeUint32()
+ m.NFds = buf.DecodeUint8()
+ m.FdFlags = buf.DecodeUint8()
+ return nil
+}
+
+// AppCutThroughRegistrationAddReply defines message 'app_cut_through_registration_add_reply'.
+type AppCutThroughRegistrationAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *AppCutThroughRegistrationAddReply) Reset() { *m = AppCutThroughRegistrationAddReply{} }
+func (*AppCutThroughRegistrationAddReply) GetMessageName() string {
+ return "app_cut_through_registration_add_reply"
+}
+func (*AppCutThroughRegistrationAddReply) GetCrcString() string { return "e8d4e804" }
+func (*AppCutThroughRegistrationAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AppCutThroughRegistrationAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *AppCutThroughRegistrationAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *AppCutThroughRegistrationAddReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// AppDelCertKeyPair defines message 'app_del_cert_key_pair'.
+type AppDelCertKeyPair struct {
+ Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
+}
+
+func (m *AppDelCertKeyPair) Reset() { *m = AppDelCertKeyPair{} }
+func (*AppDelCertKeyPair) GetMessageName() string { return "app_del_cert_key_pair" }
+func (*AppDelCertKeyPair) GetCrcString() string { return "8ac76db6" }
+func (*AppDelCertKeyPair) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AppDelCertKeyPair) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Index
+ return size
+}
+func (m *AppDelCertKeyPair) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Index)
+ return buf.Bytes(), nil
+}
+func (m *AppDelCertKeyPair) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Index = buf.DecodeUint32()
+ return nil
+}
+
+// AppDelCertKeyPairReply defines message 'app_del_cert_key_pair_reply'.
+type AppDelCertKeyPairReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *AppDelCertKeyPairReply) Reset() { *m = AppDelCertKeyPairReply{} }
+func (*AppDelCertKeyPairReply) GetMessageName() string { return "app_del_cert_key_pair_reply" }
+func (*AppDelCertKeyPairReply) GetCrcString() string { return "e8d4e804" }
+func (*AppDelCertKeyPairReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AppDelCertKeyPairReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *AppDelCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// AppNamespaceAddDel defines message 'app_namespace_add_del'.
+type AppNamespaceAddDel struct {
+ Secret uint64 `binapi:"u64,name=secret" json:"secret,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" 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"`
+ NamespaceIDLen uint8 `binapi:"u8,name=namespace_id_len" json:"namespace_id_len,omitempty"`
+ NamespaceID []byte `binapi:"u8[64],name=namespace_id" json:"namespace_id,omitempty"`
+}
+
+func (m *AppNamespaceAddDel) Reset() { *m = AppNamespaceAddDel{} }
+func (*AppNamespaceAddDel) GetMessageName() string { return "app_namespace_add_del" }
+func (*AppNamespaceAddDel) GetCrcString() string { return "dd074c65" }
+func (*AppNamespaceAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AppNamespaceAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 8 // m.Secret
+ size += 4 // m.SwIfIndex
+ size += 4 // m.IP4FibID
+ size += 4 // m.IP6FibID
+ size += 1 // m.NamespaceIDLen
+ size += 1 * 64 // m.NamespaceID
+ return size
+}
+func (m *AppNamespaceAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint64(m.Secret)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.IP4FibID)
+ buf.EncodeUint32(m.IP6FibID)
+ buf.EncodeUint8(m.NamespaceIDLen)
+ buf.EncodeBytes(m.NamespaceID, 64)
+ return buf.Bytes(), nil
+}
+func (m *AppNamespaceAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Secret = buf.DecodeUint64()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.IP4FibID = buf.DecodeUint32()
+ m.IP6FibID = buf.DecodeUint32()
+ m.NamespaceIDLen = buf.DecodeUint8()
+ m.NamespaceID = make([]byte, 64)
+ copy(m.NamespaceID, buf.DecodeBytes(len(m.NamespaceID)))
+ return nil
+}
+
+// AppNamespaceAddDelReply defines message 'app_namespace_add_del_reply'.
+type AppNamespaceAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
+}
+
+func (m *AppNamespaceAddDelReply) Reset() { *m = AppNamespaceAddDelReply{} }
+func (*AppNamespaceAddDelReply) GetMessageName() string { return "app_namespace_add_del_reply" }
+func (*AppNamespaceAddDelReply) GetCrcString() string { return "85137120" }
+func (*AppNamespaceAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AppNamespaceAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.AppnsIndex
+ return size
+}
+func (m *AppNamespaceAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.AppnsIndex = buf.DecodeUint32()
+ return nil
+}
+
+// AppWorkerAddDel defines message 'app_worker_add_del'.
+type AppWorkerAddDel struct {
+ AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
+ WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *AppWorkerAddDel) Reset() { *m = AppWorkerAddDel{} }
+func (*AppWorkerAddDel) GetMessageName() string { return "app_worker_add_del" }
+func (*AppWorkerAddDel) GetCrcString() string { return "6d2b2279" }
+func (*AppWorkerAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AppWorkerAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.AppIndex
+ size += 4 // m.WrkIndex
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *AppWorkerAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.AppIndex)
+ buf.EncodeUint32(m.WrkIndex)
+ buf.EncodeUint8(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *AppWorkerAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.AppIndex = buf.DecodeUint32()
+ m.WrkIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeUint8()
+ return nil
+}
+
+// AppWorkerAddDelReply defines message 'app_worker_add_del_reply'.
+type AppWorkerAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
+ AppEventQueueAddress uint64 `binapi:"u64,name=app_event_queue_address" json:"app_event_queue_address,omitempty"`
+ NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
+ FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
+ SegmentNameLength uint8 `binapi:"u8,name=segment_name_length" json:"segment_name_length,omitempty"`
+ SegmentName []byte `binapi:"u8[128],name=segment_name" json:"segment_name,omitempty"`
+ SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *AppWorkerAddDelReply) Reset() { *m = AppWorkerAddDelReply{} }
+func (*AppWorkerAddDelReply) GetMessageName() string { return "app_worker_add_del_reply" }
+func (*AppWorkerAddDelReply) GetCrcString() string { return "56b21abc" }
+func (*AppWorkerAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AppWorkerAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.WrkIndex
+ size += 8 // m.AppEventQueueAddress
+ size += 1 // m.NFds
+ size += 1 // m.FdFlags
+ size += 1 // m.SegmentNameLength
+ size += 1 * 128 // m.SegmentName
+ size += 8 // m.SegmentHandle
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *AppWorkerAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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.EncodeUint8(m.SegmentNameLength)
+ buf.EncodeBytes(m.SegmentName, 128)
+ buf.EncodeUint64(m.SegmentHandle)
+ buf.EncodeUint8(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *AppWorkerAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.WrkIndex = buf.DecodeUint32()
+ m.AppEventQueueAddress = buf.DecodeUint64()
+ m.NFds = buf.DecodeUint8()
+ m.FdFlags = buf.DecodeUint8()
+ m.SegmentNameLength = buf.DecodeUint8()
+ m.SegmentName = make([]byte, 128)
+ copy(m.SegmentName, buf.DecodeBytes(len(m.SegmentName)))
+ m.SegmentHandle = buf.DecodeUint64()
+ m.IsAdd = buf.DecodeUint8()
+ return nil
+}
+
+// ApplicationAttach defines message 'application_attach'.
+type ApplicationAttach struct {
+ InitialSegmentSize uint32 `binapi:"u32,name=initial_segment_size" json:"initial_segment_size,omitempty"`
+ Options []uint64 `binapi:"u64[16],name=options" json:"options,omitempty"`
+ NamespaceIDLen uint8 `binapi:"u8,name=namespace_id_len" json:"namespace_id_len,omitempty"`
+ NamespaceID []byte `binapi:"u8[64],name=namespace_id" json:"namespace_id,omitempty"`
+}
+
+func (m *ApplicationAttach) Reset() { *m = ApplicationAttach{} }
+func (*ApplicationAttach) GetMessageName() string { return "application_attach" }
+func (*ApplicationAttach) GetCrcString() string { return "81d4f974" }
+func (*ApplicationAttach) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ApplicationAttach) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.InitialSegmentSize
+ size += 8 * 16 // m.Options
+ size += 1 // m.NamespaceIDLen
+ size += 1 * 64 // m.NamespaceID
+ return size
+}
+func (m *ApplicationAttach) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.InitialSegmentSize)
+ for i := 0; i < 16; i++ {
+ var x uint64
+ if i < len(m.Options) {
+ x = uint64(m.Options[i])
+ }
+ buf.EncodeUint64(x)
+ }
+ buf.EncodeUint8(m.NamespaceIDLen)
+ buf.EncodeBytes(m.NamespaceID, 64)
+ return buf.Bytes(), nil
+}
+func (m *ApplicationAttach) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.InitialSegmentSize = buf.DecodeUint32()
+ m.Options = make([]uint64, 16)
+ for i := 0; i < len(m.Options); i++ {
+ m.Options[i] = buf.DecodeUint64()
+ }
+ m.NamespaceIDLen = buf.DecodeUint8()
+ m.NamespaceID = make([]byte, 64)
+ copy(m.NamespaceID, buf.DecodeBytes(len(m.NamespaceID)))
+ return nil
+}
+
+// ApplicationAttachReply defines message 'application_attach_reply'.
+type ApplicationAttachReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ AppEventQueueAddress uint64 `binapi:"u64,name=app_event_queue_address" json:"app_event_queue_address,omitempty"`
+ NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
+ FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
+ SegmentSize uint32 `binapi:"u32,name=segment_size" json:"segment_size,omitempty"`
+ SegmentNameLength uint8 `binapi:"u8,name=segment_name_length" json:"segment_name_length,omitempty"`
+ SegmentName []byte `binapi:"u8[128],name=segment_name" json:"segment_name,omitempty"`
+ AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
+ SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
+}
+
+func (m *ApplicationAttachReply) Reset() { *m = ApplicationAttachReply{} }
+func (*ApplicationAttachReply) GetMessageName() string { return "application_attach_reply" }
+func (*ApplicationAttachReply) GetCrcString() string { return "581866e8" }
+func (*ApplicationAttachReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ApplicationAttachReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 8 // m.AppEventQueueAddress
+ size += 1 // m.NFds
+ size += 1 // m.FdFlags
+ size += 4 // m.SegmentSize
+ size += 1 // m.SegmentNameLength
+ size += 1 * 128 // m.SegmentName
+ size += 4 // m.AppIndex
+ size += 8 // m.SegmentHandle
+ return size
+}
+func (m *ApplicationAttachReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint64(m.AppEventQueueAddress)
+ buf.EncodeUint8(m.NFds)
+ buf.EncodeUint8(m.FdFlags)
+ buf.EncodeUint32(m.SegmentSize)
+ buf.EncodeUint8(m.SegmentNameLength)
+ buf.EncodeBytes(m.SegmentName, 128)
+ buf.EncodeUint32(m.AppIndex)
+ buf.EncodeUint64(m.SegmentHandle)
+ return buf.Bytes(), nil
+}
+func (m *ApplicationAttachReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.AppEventQueueAddress = buf.DecodeUint64()
+ m.NFds = buf.DecodeUint8()
+ m.FdFlags = buf.DecodeUint8()
+ m.SegmentSize = buf.DecodeUint32()
+ m.SegmentNameLength = buf.DecodeUint8()
+ m.SegmentName = make([]byte, 128)
+ copy(m.SegmentName, buf.DecodeBytes(len(m.SegmentName)))
+ m.AppIndex = buf.DecodeUint32()
+ m.SegmentHandle = buf.DecodeUint64()
+ return nil
+}
+
+// ApplicationDetach defines message 'application_detach'.
+type ApplicationDetach struct{}
+
+func (m *ApplicationDetach) Reset() { *m = ApplicationDetach{} }
+func (*ApplicationDetach) GetMessageName() string { return "application_detach" }
+func (*ApplicationDetach) GetCrcString() string { return "51077d14" }
+func (*ApplicationDetach) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ApplicationDetach) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *ApplicationDetach) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *ApplicationDetach) Unmarshal(b []byte) error {
+ return nil
+}
+
+// ApplicationDetachReply defines message 'application_detach_reply'.
+type ApplicationDetachReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ApplicationDetachReply) Reset() { *m = ApplicationDetachReply{} }
+func (*ApplicationDetachReply) GetMessageName() string { return "application_detach_reply" }
+func (*ApplicationDetachReply) GetCrcString() string { return "e8d4e804" }
+func (*ApplicationDetachReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ApplicationDetachReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ApplicationDetachReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// ApplicationTLSCertAdd defines message 'application_tls_cert_add'.
+type ApplicationTLSCertAdd struct {
+ AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
+ CertLen uint16 `binapi:"u16,name=cert_len" json:"-"`
+ Cert []byte `binapi:"u8[cert_len],name=cert" json:"cert,omitempty"`
+}
+
+func (m *ApplicationTLSCertAdd) Reset() { *m = ApplicationTLSCertAdd{} }
+func (*ApplicationTLSCertAdd) GetMessageName() string { return "application_tls_cert_add" }
+func (*ApplicationTLSCertAdd) GetCrcString() string { return "3f5cfe45" }
+func (*ApplicationTLSCertAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ApplicationTLSCertAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.AppIndex)
+ buf.EncodeUint16(uint16(len(m.Cert)))
+ 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()
+ m.Cert = make([]byte, m.CertLen)
+ copy(m.Cert, buf.DecodeBytes(len(m.Cert)))
+ return nil
+}
+
+// ApplicationTLSCertAddReply defines message 'application_tls_cert_add_reply'.
+type ApplicationTLSCertAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ApplicationTLSCertAddReply) Reset() { *m = ApplicationTLSCertAddReply{} }
+func (*ApplicationTLSCertAddReply) GetMessageName() string { return "application_tls_cert_add_reply" }
+func (*ApplicationTLSCertAddReply) GetCrcString() string { return "e8d4e804" }
+func (*ApplicationTLSCertAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ApplicationTLSCertAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ApplicationTLSCertAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// ApplicationTLSKeyAdd defines message 'application_tls_key_add'.
+type ApplicationTLSKeyAdd struct {
+ AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
+ KeyLen uint16 `binapi:"u16,name=key_len" json:"-"`
+ Key []byte `binapi:"u8[key_len],name=key" json:"key,omitempty"`
+}
+
+func (m *ApplicationTLSKeyAdd) Reset() { *m = ApplicationTLSKeyAdd{} }
+func (*ApplicationTLSKeyAdd) GetMessageName() string { return "application_tls_key_add" }
+func (*ApplicationTLSKeyAdd) GetCrcString() string { return "5eaf70cd" }
+func (*ApplicationTLSKeyAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ApplicationTLSKeyAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ 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) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.AppIndex)
+ buf.EncodeUint16(uint16(len(m.Key)))
+ 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()
+ m.Key = make([]byte, m.KeyLen)
+ copy(m.Key, buf.DecodeBytes(len(m.Key)))
+ return nil
+}
+
+// ApplicationTLSKeyAddReply defines message 'application_tls_key_add_reply'.
+type ApplicationTLSKeyAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ApplicationTLSKeyAddReply) Reset() { *m = ApplicationTLSKeyAddReply{} }
+func (*ApplicationTLSKeyAddReply) GetMessageName() string { return "application_tls_key_add_reply" }
+func (*ApplicationTLSKeyAddReply) GetCrcString() string { return "e8d4e804" }
+func (*ApplicationTLSKeyAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ApplicationTLSKeyAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ApplicationTLSKeyAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// BindSock defines message 'bind_sock'.
+type BindSock struct {
+ WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
+ Vrf uint32 `binapi:"u32,name=vrf" json:"vrf,omitempty"`
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ IP []byte `binapi:"u8[16],name=ip" json:"ip,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
+ Options []uint64 `binapi:"u64[16],name=options" json:"options,omitempty"`
+}
+
+func (m *BindSock) Reset() { *m = BindSock{} }
+func (*BindSock) GetMessageName() string { return "bind_sock" }
+func (*BindSock) GetCrcString() string { return "0394633f" }
+func (*BindSock) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BindSock) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.WrkIndex
+ size += 4 // m.Vrf
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.IP
+ size += 2 // m.Port
+ size += 1 // m.Proto
+ size += 8 * 16 // m.Options
+ return size
+}
+func (m *BindSock) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.WrkIndex)
+ buf.EncodeUint32(m.Vrf)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.IP, 16)
+ buf.EncodeUint16(m.Port)
+ buf.EncodeUint8(m.Proto)
+ for i := 0; i < 16; i++ {
+ var x uint64
+ if i < len(m.Options) {
+ x = uint64(m.Options[i])
+ }
+ buf.EncodeUint64(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *BindSock) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.WrkIndex = buf.DecodeUint32()
+ m.Vrf = buf.DecodeUint32()
+ m.IsIP4 = buf.DecodeUint8()
+ m.IP = make([]byte, 16)
+ copy(m.IP, buf.DecodeBytes(len(m.IP)))
+ m.Port = buf.DecodeUint16()
+ m.Proto = buf.DecodeUint8()
+ m.Options = make([]uint64, 16)
+ for i := 0; i < len(m.Options); i++ {
+ m.Options[i] = buf.DecodeUint64()
+ }
+ return nil
+}
+
+// BindSockReply defines message 'bind_sock_reply'.
+type BindSockReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BindSockReply) Reset() { *m = BindSockReply{} }
+func (*BindSockReply) GetMessageName() string { return "bind_sock_reply" }
+func (*BindSockReply) GetCrcString() string { return "e8d4e804" }
+func (*BindSockReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BindSockReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BindSockReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *BindSockReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// BindURI defines message 'bind_uri'.
+type BindURI struct {
+ AcceptCookie uint32 `binapi:"u32,name=accept_cookie" json:"accept_cookie,omitempty"`
+ URI []byte `binapi:"u8[128],name=uri" json:"uri,omitempty"`
+}
+
+func (m *BindURI) Reset() { *m = BindURI{} }
+func (*BindURI) GetMessageName() string { return "bind_uri" }
+func (*BindURI) GetCrcString() string { return "fae140cb" }
+func (*BindURI) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BindURI) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.AcceptCookie
+ size += 1 * 128 // m.URI
+ return size
+}
+func (m *BindURI) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.AcceptCookie)
+ buf.EncodeBytes(m.URI, 128)
+ return buf.Bytes(), nil
+}
+func (m *BindURI) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.AcceptCookie = buf.DecodeUint32()
+ m.URI = make([]byte, 128)
+ copy(m.URI, buf.DecodeBytes(len(m.URI)))
+ return nil
+}
+
+// BindURIReply defines message 'bind_uri_reply'.
+type BindURIReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BindURIReply) Reset() { *m = BindURIReply{} }
+func (*BindURIReply) GetMessageName() string { return "bind_uri_reply" }
+func (*BindURIReply) GetCrcString() string { return "e8d4e804" }
+func (*BindURIReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BindURIReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *BindURIReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *BindURIReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// ConnectSock defines message 'connect_sock'.
+type ConnectSock struct {
+ WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
+ ClientQueueAddress uint64 `binapi:"u64,name=client_queue_address" json:"client_queue_address,omitempty"`
+ Options []uint64 `binapi:"u64[16],name=options" json:"options,omitempty"`
+ Vrf uint32 `binapi:"u32,name=vrf" json:"vrf,omitempty"`
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ IP []byte `binapi:"u8[16],name=ip" json:"ip,omitempty"`
+ Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
+ Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
+ ParentHandle uint64 `binapi:"u64,name=parent_handle" json:"parent_handle,omitempty"`
+ HostnameLen uint8 `binapi:"u8,name=hostname_len" json:"-"`
+ Hostname []byte `binapi:"u8[hostname_len],name=hostname" json:"hostname,omitempty"`
+}
+
+func (m *ConnectSock) Reset() { *m = ConnectSock{} }
+func (*ConnectSock) GetMessageName() string { return "connect_sock" }
+func (*ConnectSock) GetCrcString() string { return "d2b460ca" }
+func (*ConnectSock) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ConnectSock) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.WrkIndex
+ size += 8 // m.ClientQueueAddress
+ size += 8 * 16 // m.Options
+ size += 4 // m.Vrf
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.IP
+ size += 2 // m.Port
+ size += 1 // m.Proto
+ size += 8 // m.ParentHandle
+ size += 1 // m.HostnameLen
+ size += 1 * len(m.Hostname) // m.Hostname
+ return size
+}
+func (m *ConnectSock) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.WrkIndex)
+ buf.EncodeUint64(m.ClientQueueAddress)
+ for i := 0; i < 16; i++ {
+ var x uint64
+ if i < len(m.Options) {
+ x = uint64(m.Options[i])
+ }
+ buf.EncodeUint64(x)
+ }
+ buf.EncodeUint32(m.Vrf)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.IP, 16)
+ buf.EncodeUint16(m.Port)
+ buf.EncodeUint8(m.Proto)
+ buf.EncodeUint64(m.ParentHandle)
+ buf.EncodeUint8(uint8(len(m.Hostname)))
+ buf.EncodeBytes(m.Hostname, 0)
+ return buf.Bytes(), nil
+}
+func (m *ConnectSock) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.WrkIndex = buf.DecodeUint32()
+ m.ClientQueueAddress = buf.DecodeUint64()
+ m.Options = make([]uint64, 16)
+ for i := 0; i < len(m.Options); i++ {
+ m.Options[i] = buf.DecodeUint64()
+ }
+ m.Vrf = buf.DecodeUint32()
+ m.IsIP4 = buf.DecodeUint8()
+ m.IP = make([]byte, 16)
+ copy(m.IP, buf.DecodeBytes(len(m.IP)))
+ m.Port = buf.DecodeUint16()
+ m.Proto = buf.DecodeUint8()
+ m.ParentHandle = buf.DecodeUint64()
+ m.HostnameLen = buf.DecodeUint8()
+ m.Hostname = make([]byte, m.HostnameLen)
+ copy(m.Hostname, buf.DecodeBytes(len(m.Hostname)))
+ return nil
+}
+
+// ConnectSockReply defines message 'connect_sock_reply'.
+type ConnectSockReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ConnectSockReply) Reset() { *m = ConnectSockReply{} }
+func (*ConnectSockReply) GetMessageName() string { return "connect_sock_reply" }
+func (*ConnectSockReply) GetCrcString() string { return "e8d4e804" }
+func (*ConnectSockReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ConnectSockReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ConnectSockReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *ConnectSockReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// ConnectURI defines message 'connect_uri'.
+type ConnectURI struct {
+ ClientQueueAddress uint64 `binapi:"u64,name=client_queue_address" json:"client_queue_address,omitempty"`
+ Options []uint64 `binapi:"u64[16],name=options" json:"options,omitempty"`
+ URI []byte `binapi:"u8[128],name=uri" json:"uri,omitempty"`
+}
+
+func (m *ConnectURI) Reset() { *m = ConnectURI{} }
+func (*ConnectURI) GetMessageName() string { return "connect_uri" }
+func (*ConnectURI) GetCrcString() string { return "a36143d6" }
+func (*ConnectURI) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ConnectURI) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 8 // m.ClientQueueAddress
+ size += 8 * 16 // m.Options
+ size += 1 * 128 // m.URI
+ return size
+}
+func (m *ConnectURI) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint64(m.ClientQueueAddress)
+ for i := 0; i < 16; i++ {
+ var x uint64
+ if i < len(m.Options) {
+ x = uint64(m.Options[i])
+ }
+ buf.EncodeUint64(x)
+ }
+ buf.EncodeBytes(m.URI, 128)
+ return buf.Bytes(), nil
+}
+func (m *ConnectURI) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ClientQueueAddress = buf.DecodeUint64()
+ m.Options = make([]uint64, 16)
+ for i := 0; i < len(m.Options); i++ {
+ m.Options[i] = buf.DecodeUint64()
+ }
+ m.URI = make([]byte, 128)
+ copy(m.URI, buf.DecodeBytes(len(m.URI)))
+ return nil
+}
+
+// ConnectURIReply defines message 'connect_uri_reply'.
+type ConnectURIReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ConnectURIReply) Reset() { *m = ConnectURIReply{} }
+func (*ConnectURIReply) GetMessageName() string { return "connect_uri_reply" }
+func (*ConnectURIReply) GetCrcString() string { return "e8d4e804" }
+func (*ConnectURIReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ConnectURIReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ConnectURIReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *ConnectURIReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// DisconnectSession defines message 'disconnect_session'.
+type DisconnectSession struct {
+ Handle uint64 `binapi:"u64,name=handle" json:"handle,omitempty"`
+}
+
+func (m *DisconnectSession) Reset() { *m = DisconnectSession{} }
+func (*DisconnectSession) GetMessageName() string { return "disconnect_session" }
+func (*DisconnectSession) GetCrcString() string { return "7279205b" }
+func (*DisconnectSession) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DisconnectSession) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 8 // m.Handle
+ return size
+}
+func (m *DisconnectSession) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint64(m.Handle)
+ return buf.Bytes(), nil
+}
+func (m *DisconnectSession) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Handle = buf.DecodeUint64()
+ return nil
+}
+
+// DisconnectSessionReply defines message 'disconnect_session_reply'.
+type DisconnectSessionReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Handle uint64 `binapi:"u64,name=handle" json:"handle,omitempty"`
+}
+
+func (m *DisconnectSessionReply) Reset() { *m = DisconnectSessionReply{} }
+func (*DisconnectSessionReply) GetMessageName() string { return "disconnect_session_reply" }
+func (*DisconnectSessionReply) GetCrcString() string { return "d6960a03" }
+func (*DisconnectSessionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DisconnectSessionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 8 // m.Handle
+ return size
+}
+func (m *DisconnectSessionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint64(m.Handle)
+ return buf.Bytes(), nil
+}
+func (m *DisconnectSessionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Handle = buf.DecodeUint64()
+ return nil
+}
+
+// MapAnotherSegment defines message 'map_another_segment'.
+type MapAnotherSegment struct {
+ FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
+ SegmentSize uint32 `binapi:"u32,name=segment_size" json:"segment_size,omitempty"`
+ SegmentName []byte `binapi:"u8[128],name=segment_name" json:"segment_name,omitempty"`
+ SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
+}
+
+func (m *MapAnotherSegment) Reset() { *m = MapAnotherSegment{} }
+func (*MapAnotherSegment) GetMessageName() string { return "map_another_segment" }
+func (*MapAnotherSegment) GetCrcString() string { return "dc2d630b" }
+func (*MapAnotherSegment) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *MapAnotherSegment) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.FdFlags
+ size += 4 // m.SegmentSize
+ size += 1 * 128 // m.SegmentName
+ size += 8 // m.SegmentHandle
+ return size
+}
+func (m *MapAnotherSegment) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.FdFlags)
+ buf.EncodeUint32(m.SegmentSize)
+ buf.EncodeBytes(m.SegmentName, 128)
+ buf.EncodeUint64(m.SegmentHandle)
+ return buf.Bytes(), nil
+}
+func (m *MapAnotherSegment) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.FdFlags = buf.DecodeUint8()
+ m.SegmentSize = buf.DecodeUint32()
+ m.SegmentName = make([]byte, 128)
+ copy(m.SegmentName, buf.DecodeBytes(len(m.SegmentName)))
+ m.SegmentHandle = buf.DecodeUint64()
+ return nil
+}
+
+// MapAnotherSegmentReply defines message 'map_another_segment_reply'.
+type MapAnotherSegmentReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MapAnotherSegmentReply) Reset() { *m = MapAnotherSegmentReply{} }
+func (*MapAnotherSegmentReply) GetMessageName() string { return "map_another_segment_reply" }
+func (*MapAnotherSegmentReply) GetCrcString() string { return "e8d4e804" }
+func (*MapAnotherSegmentReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *MapAnotherSegmentReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *MapAnotherSegmentReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *MapAnotherSegmentReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// SessionEnableDisable defines message 'session_enable_disable'.
+type SessionEnableDisable struct {
+ IsEnable uint8 `binapi:"u8,name=is_enable" json:"is_enable,omitempty"`
+}
+
+func (m *SessionEnableDisable) Reset() { *m = SessionEnableDisable{} }
+func (*SessionEnableDisable) GetMessageName() string { return "session_enable_disable" }
+func (*SessionEnableDisable) GetCrcString() string { return "30ac9be7" }
+func (*SessionEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SessionEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEnable
+ return size
+}
+func (m *SessionEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsEnable)
+ return buf.Bytes(), nil
+}
+func (m *SessionEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEnable = buf.DecodeUint8()
+ return nil
+}
+
+// SessionEnableDisableReply defines message 'session_enable_disable_reply'.
+type SessionEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SessionEnableDisableReply) Reset() { *m = SessionEnableDisableReply{} }
+func (*SessionEnableDisableReply) GetMessageName() string { return "session_enable_disable_reply" }
+func (*SessionEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*SessionEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SessionEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SessionEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SessionRuleAddDel defines message 'session_rule_add_del'.
+type SessionRuleAddDel struct {
+ TransportProto uint8 `binapi:"u8,name=transport_proto" json:"transport_proto,omitempty"`
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ LclIP []byte `binapi:"u8[16],name=lcl_ip" json:"lcl_ip,omitempty"`
+ LclPlen uint8 `binapi:"u8,name=lcl_plen" json:"lcl_plen,omitempty"`
+ RmtIP []byte `binapi:"u8[16],name=rmt_ip" json:"rmt_ip,omitempty"`
+ RmtPlen uint8 `binapi:"u8,name=rmt_plen" json:"rmt_plen,omitempty"`
+ LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
+ RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
+ ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
+ Scope uint8 `binapi:"u8,name=scope" json:"scope,omitempty"`
+ Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *SessionRuleAddDel) Reset() { *m = SessionRuleAddDel{} }
+func (*SessionRuleAddDel) GetMessageName() string { return "session_rule_add_del" }
+func (*SessionRuleAddDel) GetCrcString() string { return "4ab2eb06" }
+func (*SessionRuleAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SessionRuleAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.TransportProto
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.LclIP
+ size += 1 // m.LclPlen
+ size += 1 * 16 // m.RmtIP
+ size += 1 // m.RmtPlen
+ size += 2 // m.LclPort
+ size += 2 // m.RmtPort
+ size += 4 // m.ActionIndex
+ size += 1 // m.IsAdd
+ size += 4 // m.AppnsIndex
+ size += 1 // m.Scope
+ size += 1 * 64 // m.Tag
+ return size
+}
+func (m *SessionRuleAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.TransportProto)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.LclIP, 16)
+ buf.EncodeUint8(m.LclPlen)
+ buf.EncodeBytes(m.RmtIP, 16)
+ buf.EncodeUint8(m.RmtPlen)
+ buf.EncodeUint16(m.LclPort)
+ buf.EncodeUint16(m.RmtPort)
+ buf.EncodeUint32(m.ActionIndex)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint32(m.AppnsIndex)
+ buf.EncodeUint8(m.Scope)
+ buf.EncodeBytes(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *SessionRuleAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TransportProto = buf.DecodeUint8()
+ m.IsIP4 = buf.DecodeUint8()
+ m.LclIP = make([]byte, 16)
+ copy(m.LclIP, buf.DecodeBytes(len(m.LclIP)))
+ m.LclPlen = buf.DecodeUint8()
+ m.RmtIP = make([]byte, 16)
+ copy(m.RmtIP, buf.DecodeBytes(len(m.RmtIP)))
+ m.RmtPlen = buf.DecodeUint8()
+ m.LclPort = buf.DecodeUint16()
+ m.RmtPort = buf.DecodeUint16()
+ m.ActionIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeUint8()
+ m.AppnsIndex = buf.DecodeUint32()
+ m.Scope = buf.DecodeUint8()
+ m.Tag = make([]byte, 64)
+ copy(m.Tag, buf.DecodeBytes(len(m.Tag)))
+ return nil
+}
+
+// SessionRuleAddDelReply defines message 'session_rule_add_del_reply'.
+type SessionRuleAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SessionRuleAddDelReply) Reset() { *m = SessionRuleAddDelReply{} }
+func (*SessionRuleAddDelReply) GetMessageName() string { return "session_rule_add_del_reply" }
+func (*SessionRuleAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*SessionRuleAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SessionRuleAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SessionRuleAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SessionRulesDetails defines message 'session_rules_details'.
+type SessionRulesDetails struct {
+ TransportProto uint8 `binapi:"u8,name=transport_proto" json:"transport_proto,omitempty"`
+ IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
+ LclIP []byte `binapi:"u8[16],name=lcl_ip" json:"lcl_ip,omitempty"`
+ LclPlen uint8 `binapi:"u8,name=lcl_plen" json:"lcl_plen,omitempty"`
+ RmtIP []byte `binapi:"u8[16],name=rmt_ip" json:"rmt_ip,omitempty"`
+ RmtPlen uint8 `binapi:"u8,name=rmt_plen" json:"rmt_plen,omitempty"`
+ LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
+ RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
+ ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
+ AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
+ Scope uint8 `binapi:"u8,name=scope" json:"scope,omitempty"`
+ Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *SessionRulesDetails) Reset() { *m = SessionRulesDetails{} }
+func (*SessionRulesDetails) GetMessageName() string { return "session_rules_details" }
+func (*SessionRulesDetails) GetCrcString() string { return "a52b0e96" }
+func (*SessionRulesDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SessionRulesDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.TransportProto
+ size += 1 // m.IsIP4
+ size += 1 * 16 // m.LclIP
+ size += 1 // m.LclPlen
+ size += 1 * 16 // m.RmtIP
+ size += 1 // m.RmtPlen
+ size += 2 // m.LclPort
+ size += 2 // m.RmtPort
+ size += 4 // m.ActionIndex
+ size += 4 // m.AppnsIndex
+ size += 1 // m.Scope
+ size += 1 * 64 // m.Tag
+ return size
+}
+func (m *SessionRulesDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.TransportProto)
+ buf.EncodeUint8(m.IsIP4)
+ buf.EncodeBytes(m.LclIP, 16)
+ buf.EncodeUint8(m.LclPlen)
+ buf.EncodeBytes(m.RmtIP, 16)
+ buf.EncodeUint8(m.RmtPlen)
+ buf.EncodeUint16(m.LclPort)
+ buf.EncodeUint16(m.RmtPort)
+ buf.EncodeUint32(m.ActionIndex)
+ buf.EncodeUint32(m.AppnsIndex)
+ buf.EncodeUint8(m.Scope)
+ buf.EncodeBytes(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *SessionRulesDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TransportProto = buf.DecodeUint8()
+ m.IsIP4 = buf.DecodeUint8()
+ m.LclIP = make([]byte, 16)
+ copy(m.LclIP, buf.DecodeBytes(len(m.LclIP)))
+ m.LclPlen = buf.DecodeUint8()
+ m.RmtIP = make([]byte, 16)
+ copy(m.RmtIP, buf.DecodeBytes(len(m.RmtIP)))
+ m.RmtPlen = buf.DecodeUint8()
+ m.LclPort = buf.DecodeUint16()
+ m.RmtPort = buf.DecodeUint16()
+ m.ActionIndex = buf.DecodeUint32()
+ m.AppnsIndex = buf.DecodeUint32()
+ m.Scope = buf.DecodeUint8()
+ m.Tag = make([]byte, 64)
+ copy(m.Tag, buf.DecodeBytes(len(m.Tag)))
+ return nil
+}
+
+// SessionRulesDump defines message 'session_rules_dump'.
+type SessionRulesDump struct{}
+
+func (m *SessionRulesDump) Reset() { *m = SessionRulesDump{} }
+func (*SessionRulesDump) GetMessageName() string { return "session_rules_dump" }
+func (*SessionRulesDump) GetCrcString() string { return "51077d14" }
+func (*SessionRulesDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SessionRulesDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *SessionRulesDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *SessionRulesDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// UnbindSock defines message 'unbind_sock'.
+type UnbindSock struct {
+ WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
+ Handle uint64 `binapi:"u64,name=handle" json:"handle,omitempty"`
+}
+
+func (m *UnbindSock) Reset() { *m = UnbindSock{} }
+func (*UnbindSock) GetMessageName() string { return "unbind_sock" }
+func (*UnbindSock) GetCrcString() string { return "08880908" }
+func (*UnbindSock) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *UnbindSock) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.WrkIndex
+ size += 8 // m.Handle
+ return size
+}
+func (m *UnbindSock) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.WrkIndex)
+ buf.EncodeUint64(m.Handle)
+ return buf.Bytes(), nil
+}
+func (m *UnbindSock) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.WrkIndex = buf.DecodeUint32()
+ m.Handle = buf.DecodeUint64()
+ return nil
+}
+
+// UnbindSockReply defines message 'unbind_sock_reply'.
+type UnbindSockReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *UnbindSockReply) Reset() { *m = UnbindSockReply{} }
+func (*UnbindSockReply) GetMessageName() string { return "unbind_sock_reply" }
+func (*UnbindSockReply) GetCrcString() string { return "e8d4e804" }
+func (*UnbindSockReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *UnbindSockReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *UnbindSockReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *UnbindSockReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// UnbindURI defines message 'unbind_uri'.
+type UnbindURI struct {
+ URI []byte `binapi:"u8[128],name=uri" json:"uri,omitempty"`
+}
+
+func (m *UnbindURI) Reset() { *m = UnbindURI{} }
+func (*UnbindURI) GetMessageName() string { return "unbind_uri" }
+func (*UnbindURI) GetCrcString() string { return "294cf07d" }
+func (*UnbindURI) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *UnbindURI) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 128 // m.URI
+ return size
+}
+func (m *UnbindURI) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.URI, 128)
+ return buf.Bytes(), nil
+}
+func (m *UnbindURI) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.URI = make([]byte, 128)
+ copy(m.URI, buf.DecodeBytes(len(m.URI)))
+ return nil
+}
+
+// UnbindURIReply defines message 'unbind_uri_reply'.
+type UnbindURIReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *UnbindURIReply) Reset() { *m = UnbindURIReply{} }
+func (*UnbindURIReply) GetMessageName() string { return "unbind_uri_reply" }
+func (*UnbindURIReply) GetCrcString() string { return "e8d4e804" }
+func (*UnbindURIReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *UnbindURIReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *UnbindURIReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *UnbindURIReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+// UnmapSegment defines message 'unmap_segment'.
+type UnmapSegment struct {
+ SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
+}
+
+func (m *UnmapSegment) Reset() { *m = UnmapSegment{} }
+func (*UnmapSegment) GetMessageName() string { return "unmap_segment" }
+func (*UnmapSegment) GetCrcString() string { return "f77096f6" }
+func (*UnmapSegment) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *UnmapSegment) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 8 // m.SegmentHandle
+ return size
+}
+func (m *UnmapSegment) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint64(m.SegmentHandle)
+ return buf.Bytes(), nil
+}
+func (m *UnmapSegment) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SegmentHandle = buf.DecodeUint64()
+ return nil
+}
+
+// UnmapSegmentReply defines message 'unmap_segment_reply'.
+type UnmapSegmentReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *UnmapSegmentReply) Reset() { *m = UnmapSegmentReply{} }
+func (*UnmapSegmentReply) GetMessageName() string { return "unmap_segment_reply" }
+func (*UnmapSegmentReply) GetCrcString() string { return "e8d4e804" }
+func (*UnmapSegmentReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *UnmapSegmentReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *UnmapSegmentReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *UnmapSegmentReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_session_binapi_init() }
+func file_session_binapi_init() {
+ api.RegisterMessage((*AppAddCertKeyPair)(nil), "app_add_cert_key_pair_02eb8016")
+ api.RegisterMessage((*AppAddCertKeyPairReply)(nil), "app_add_cert_key_pair_reply_b42958d0")
+ api.RegisterMessage((*AppAttach)(nil), "app_attach_ed08f4bd")
+ api.RegisterMessage((*AppAttachReply)(nil), "app_attach_reply_0112f647")
+ api.RegisterMessage((*AppCutThroughRegistrationAdd)(nil), "app_cut_through_registration_add_6d73b1b9")
+ api.RegisterMessage((*AppCutThroughRegistrationAddReply)(nil), "app_cut_through_registration_add_reply_e8d4e804")
+ api.RegisterMessage((*AppDelCertKeyPair)(nil), "app_del_cert_key_pair_8ac76db6")
+ api.RegisterMessage((*AppDelCertKeyPairReply)(nil), "app_del_cert_key_pair_reply_e8d4e804")
+ api.RegisterMessage((*AppNamespaceAddDel)(nil), "app_namespace_add_del_dd074c65")
+ api.RegisterMessage((*AppNamespaceAddDelReply)(nil), "app_namespace_add_del_reply_85137120")
+ api.RegisterMessage((*AppWorkerAddDel)(nil), "app_worker_add_del_6d2b2279")
+ api.RegisterMessage((*AppWorkerAddDelReply)(nil), "app_worker_add_del_reply_56b21abc")
+ api.RegisterMessage((*ApplicationAttach)(nil), "application_attach_81d4f974")
+ api.RegisterMessage((*ApplicationAttachReply)(nil), "application_attach_reply_581866e8")
+ api.RegisterMessage((*ApplicationDetach)(nil), "application_detach_51077d14")
+ api.RegisterMessage((*ApplicationDetachReply)(nil), "application_detach_reply_e8d4e804")
+ api.RegisterMessage((*ApplicationTLSCertAdd)(nil), "application_tls_cert_add_3f5cfe45")
+ api.RegisterMessage((*ApplicationTLSCertAddReply)(nil), "application_tls_cert_add_reply_e8d4e804")
+ api.RegisterMessage((*ApplicationTLSKeyAdd)(nil), "application_tls_key_add_5eaf70cd")
+ api.RegisterMessage((*ApplicationTLSKeyAddReply)(nil), "application_tls_key_add_reply_e8d4e804")
+ api.RegisterMessage((*BindSock)(nil), "bind_sock_0394633f")
+ api.RegisterMessage((*BindSockReply)(nil), "bind_sock_reply_e8d4e804")
+ api.RegisterMessage((*BindURI)(nil), "bind_uri_fae140cb")
+ api.RegisterMessage((*BindURIReply)(nil), "bind_uri_reply_e8d4e804")
+ api.RegisterMessage((*ConnectSock)(nil), "connect_sock_d2b460ca")
+ api.RegisterMessage((*ConnectSockReply)(nil), "connect_sock_reply_e8d4e804")
+ api.RegisterMessage((*ConnectURI)(nil), "connect_uri_a36143d6")
+ api.RegisterMessage((*ConnectURIReply)(nil), "connect_uri_reply_e8d4e804")
+ api.RegisterMessage((*DisconnectSession)(nil), "disconnect_session_7279205b")
+ api.RegisterMessage((*DisconnectSessionReply)(nil), "disconnect_session_reply_d6960a03")
+ api.RegisterMessage((*MapAnotherSegment)(nil), "map_another_segment_dc2d630b")
+ api.RegisterMessage((*MapAnotherSegmentReply)(nil), "map_another_segment_reply_e8d4e804")
+ api.RegisterMessage((*SessionEnableDisable)(nil), "session_enable_disable_30ac9be7")
+ api.RegisterMessage((*SessionEnableDisableReply)(nil), "session_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*SessionRuleAddDel)(nil), "session_rule_add_del_4ab2eb06")
+ api.RegisterMessage((*SessionRuleAddDelReply)(nil), "session_rule_add_del_reply_e8d4e804")
+ api.RegisterMessage((*SessionRulesDetails)(nil), "session_rules_details_a52b0e96")
+ api.RegisterMessage((*SessionRulesDump)(nil), "session_rules_dump_51077d14")
+ api.RegisterMessage((*UnbindSock)(nil), "unbind_sock_08880908")
+ api.RegisterMessage((*UnbindSockReply)(nil), "unbind_sock_reply_e8d4e804")
+ api.RegisterMessage((*UnbindURI)(nil), "unbind_uri_294cf07d")
+ api.RegisterMessage((*UnbindURIReply)(nil), "unbind_uri_reply_e8d4e804")
+ api.RegisterMessage((*UnmapSegment)(nil), "unmap_segment_f77096f6")
+ api.RegisterMessage((*UnmapSegmentReply)(nil), "unmap_segment_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*AppAddCertKeyPair)(nil),
+ (*AppAddCertKeyPairReply)(nil),
+ (*AppAttach)(nil),
+ (*AppAttachReply)(nil),
+ (*AppCutThroughRegistrationAdd)(nil),
+ (*AppCutThroughRegistrationAddReply)(nil),
+ (*AppDelCertKeyPair)(nil),
+ (*AppDelCertKeyPairReply)(nil),
+ (*AppNamespaceAddDel)(nil),
+ (*AppNamespaceAddDelReply)(nil),
+ (*AppWorkerAddDel)(nil),
+ (*AppWorkerAddDelReply)(nil),
+ (*ApplicationAttach)(nil),
+ (*ApplicationAttachReply)(nil),
+ (*ApplicationDetach)(nil),
+ (*ApplicationDetachReply)(nil),
+ (*ApplicationTLSCertAdd)(nil),
+ (*ApplicationTLSCertAddReply)(nil),
+ (*ApplicationTLSKeyAdd)(nil),
+ (*ApplicationTLSKeyAddReply)(nil),
+ (*BindSock)(nil),
+ (*BindSockReply)(nil),
+ (*BindURI)(nil),
+ (*BindURIReply)(nil),
+ (*ConnectSock)(nil),
+ (*ConnectSockReply)(nil),
+ (*ConnectURI)(nil),
+ (*ConnectURIReply)(nil),
+ (*DisconnectSession)(nil),
+ (*DisconnectSessionReply)(nil),
+ (*MapAnotherSegment)(nil),
+ (*MapAnotherSegmentReply)(nil),
+ (*SessionEnableDisable)(nil),
+ (*SessionEnableDisableReply)(nil),
+ (*SessionRuleAddDel)(nil),
+ (*SessionRuleAddDelReply)(nil),
+ (*SessionRulesDetails)(nil),
+ (*SessionRulesDump)(nil),
+ (*UnbindSock)(nil),
+ (*UnbindSockReply)(nil),
+ (*UnbindURI)(nil),
+ (*UnbindURIReply)(nil),
+ (*UnmapSegment)(nil),
+ (*UnmapSegmentReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/session/session_rpc.ba.go b/internal/testbinapi/binapi2001/session/session_rpc.ba.go
new file mode 100644
index 0000000..519aa06
--- /dev/null
+++ b/internal/testbinapi/binapi2001/session/session_rpc.ba.go
@@ -0,0 +1,273 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package session
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service session.
+type RPCService interface {
+ AppAddCertKeyPair(ctx context.Context, in *AppAddCertKeyPair) (*AppAddCertKeyPairReply, error)
+ AppAttach(ctx context.Context, in *AppAttach) (*AppAttachReply, error)
+ AppCutThroughRegistrationAdd(ctx context.Context, in *AppCutThroughRegistrationAdd) (*AppCutThroughRegistrationAddReply, error)
+ AppDelCertKeyPair(ctx context.Context, in *AppDelCertKeyPair) (*AppDelCertKeyPairReply, error)
+ AppNamespaceAddDel(ctx context.Context, in *AppNamespaceAddDel) (*AppNamespaceAddDelReply, error)
+ AppWorkerAddDel(ctx context.Context, in *AppWorkerAddDel) (*AppWorkerAddDelReply, error)
+ ApplicationAttach(ctx context.Context, in *ApplicationAttach) (*ApplicationAttachReply, error)
+ ApplicationDetach(ctx context.Context, in *ApplicationDetach) (*ApplicationDetachReply, error)
+ ApplicationTLSCertAdd(ctx context.Context, in *ApplicationTLSCertAdd) (*ApplicationTLSCertAddReply, error)
+ ApplicationTLSKeyAdd(ctx context.Context, in *ApplicationTLSKeyAdd) (*ApplicationTLSKeyAddReply, error)
+ BindSock(ctx context.Context, in *BindSock) (*BindSockReply, error)
+ BindURI(ctx context.Context, in *BindURI) (*BindURIReply, error)
+ ConnectSock(ctx context.Context, in *ConnectSock) (*ConnectSockReply, error)
+ ConnectURI(ctx context.Context, in *ConnectURI) (*ConnectURIReply, error)
+ DisconnectSession(ctx context.Context, in *DisconnectSession) (*DisconnectSessionReply, error)
+ MapAnotherSegment(ctx context.Context, in *MapAnotherSegment) (*MapAnotherSegmentReply, error)
+ SessionEnableDisable(ctx context.Context, in *SessionEnableDisable) (*SessionEnableDisableReply, error)
+ SessionRuleAddDel(ctx context.Context, in *SessionRuleAddDel) (*SessionRuleAddDelReply, error)
+ SessionRulesDump(ctx context.Context, in *SessionRulesDump) (RPCService_SessionRulesDumpClient, error)
+ UnbindSock(ctx context.Context, in *UnbindSock) (*UnbindSockReply, error)
+ UnbindURI(ctx context.Context, in *UnbindURI) (*UnbindURIReply, error)
+ UnmapSegment(ctx context.Context, in *UnmapSegment) (*UnmapSegmentReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) AppAddCertKeyPair(ctx context.Context, in *AppAddCertKeyPair) (*AppAddCertKeyPairReply, error) {
+ out := new(AppAddCertKeyPairReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) AppAttach(ctx context.Context, in *AppAttach) (*AppAttachReply, error) {
+ out := new(AppAttachReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) AppCutThroughRegistrationAdd(ctx context.Context, in *AppCutThroughRegistrationAdd) (*AppCutThroughRegistrationAddReply, error) {
+ out := new(AppCutThroughRegistrationAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) AppDelCertKeyPair(ctx context.Context, in *AppDelCertKeyPair) (*AppDelCertKeyPairReply, error) {
+ out := new(AppDelCertKeyPairReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) AppNamespaceAddDel(ctx context.Context, in *AppNamespaceAddDel) (*AppNamespaceAddDelReply, error) {
+ out := new(AppNamespaceAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) AppWorkerAddDel(ctx context.Context, in *AppWorkerAddDel) (*AppWorkerAddDelReply, error) {
+ out := new(AppWorkerAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ApplicationAttach(ctx context.Context, in *ApplicationAttach) (*ApplicationAttachReply, error) {
+ out := new(ApplicationAttachReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ApplicationDetach(ctx context.Context, in *ApplicationDetach) (*ApplicationDetachReply, error) {
+ out := new(ApplicationDetachReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ApplicationTLSCertAdd(ctx context.Context, in *ApplicationTLSCertAdd) (*ApplicationTLSCertAddReply, error) {
+ out := new(ApplicationTLSCertAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ApplicationTLSKeyAdd(ctx context.Context, in *ApplicationTLSKeyAdd) (*ApplicationTLSKeyAddReply, error) {
+ out := new(ApplicationTLSKeyAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BindSock(ctx context.Context, in *BindSock) (*BindSockReply, error) {
+ out := new(BindSockReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BindURI(ctx context.Context, in *BindURI) (*BindURIReply, error) {
+ out := new(BindURIReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ConnectSock(ctx context.Context, in *ConnectSock) (*ConnectSockReply, error) {
+ out := new(ConnectSockReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ConnectURI(ctx context.Context, in *ConnectURI) (*ConnectURIReply, error) {
+ out := new(ConnectURIReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DisconnectSession(ctx context.Context, in *DisconnectSession) (*DisconnectSessionReply, error) {
+ out := new(DisconnectSessionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) MapAnotherSegment(ctx context.Context, in *MapAnotherSegment) (*MapAnotherSegmentReply, error) {
+ out := new(MapAnotherSegmentReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SessionEnableDisable(ctx context.Context, in *SessionEnableDisable) (*SessionEnableDisableReply, error) {
+ out := new(SessionEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SessionRuleAddDel(ctx context.Context, in *SessionRuleAddDel) (*SessionRuleAddDelReply, error) {
+ out := new(SessionRuleAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SessionRulesDump(ctx context.Context, in *SessionRulesDump) (RPCService_SessionRulesDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SessionRulesDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SessionRulesDumpClient interface {
+ Recv() (*SessionRulesDetails, error)
+ api.Stream
+}
+
+type serviceClient_SessionRulesDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SessionRulesDumpClient) Recv() (*SessionRulesDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SessionRulesDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) UnbindSock(ctx context.Context, in *UnbindSock) (*UnbindSockReply, error) {
+ out := new(UnbindSockReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) UnbindURI(ctx context.Context, in *UnbindURI) (*UnbindURIReply, error) {
+ out := new(UnbindURIReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) UnmapSegment(ctx context.Context, in *UnmapSegment) (*UnmapSegmentReply, error) {
+ out := new(UnmapSegmentReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/span/span.ba.go b/internal/testbinapi/binapi2001/span/span.ba.go
new file mode 100644
index 0000000..31e9044
--- /dev/null
+++ b/internal/testbinapi/binapi2001/span/span.ba.go
@@ -0,0 +1,207 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/span.api.json
+
+// Package span contains generated bindings for API file span.api.
+//
+// Contents:
+// 4 messages
+//
+package span
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "span"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x10769b5
+)
+
+// SwInterfaceSpanDetails defines message 'sw_interface_span_details'.
+type SwInterfaceSpanDetails struct {
+ SwIfIndexFrom uint32 `binapi:"u32,name=sw_if_index_from" json:"sw_if_index_from,omitempty"`
+ SwIfIndexTo uint32 `binapi:"u32,name=sw_if_index_to" json:"sw_if_index_to,omitempty"`
+ State uint8 `binapi:"u8,name=state" json:"state,omitempty"`
+ IsL2 uint8 `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
+}
+
+func (m *SwInterfaceSpanDetails) Reset() { *m = SwInterfaceSpanDetails{} }
+func (*SwInterfaceSpanDetails) GetMessageName() string { return "sw_interface_span_details" }
+func (*SwInterfaceSpanDetails) GetCrcString() string { return "23966371" }
+func (*SwInterfaceSpanDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSpanDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndexFrom
+ size += 4 // m.SwIfIndexTo
+ size += 1 // m.State
+ size += 1 // m.IsL2
+ return size
+}
+func (m *SwInterfaceSpanDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndexFrom)
+ buf.EncodeUint32(m.SwIfIndexTo)
+ buf.EncodeUint8(m.State)
+ buf.EncodeUint8(m.IsL2)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSpanDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndexFrom = buf.DecodeUint32()
+ m.SwIfIndexTo = buf.DecodeUint32()
+ m.State = buf.DecodeUint8()
+ m.IsL2 = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceSpanDump defines message 'sw_interface_span_dump'.
+type SwInterfaceSpanDump struct {
+ IsL2 uint8 `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
+}
+
+func (m *SwInterfaceSpanDump) Reset() { *m = SwInterfaceSpanDump{} }
+func (*SwInterfaceSpanDump) GetMessageName() string { return "sw_interface_span_dump" }
+func (*SwInterfaceSpanDump) GetCrcString() string { return "67c54650" }
+func (*SwInterfaceSpanDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSpanDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsL2
+ return size
+}
+func (m *SwInterfaceSpanDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsL2)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSpanDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsL2 = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceSpanEnableDisable defines message 'sw_interface_span_enable_disable'.
+type SwInterfaceSpanEnableDisable struct {
+ SwIfIndexFrom uint32 `binapi:"u32,name=sw_if_index_from" json:"sw_if_index_from,omitempty"`
+ SwIfIndexTo uint32 `binapi:"u32,name=sw_if_index_to" json:"sw_if_index_to,omitempty"`
+ State uint8 `binapi:"u8,name=state" json:"state,omitempty"`
+ IsL2 uint8 `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
+}
+
+func (m *SwInterfaceSpanEnableDisable) Reset() { *m = SwInterfaceSpanEnableDisable{} }
+func (*SwInterfaceSpanEnableDisable) GetMessageName() string {
+ return "sw_interface_span_enable_disable"
+}
+func (*SwInterfaceSpanEnableDisable) GetCrcString() string { return "7216258d" }
+func (*SwInterfaceSpanEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSpanEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndexFrom
+ size += 4 // m.SwIfIndexTo
+ size += 1 // m.State
+ size += 1 // m.IsL2
+ return size
+}
+func (m *SwInterfaceSpanEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndexFrom)
+ buf.EncodeUint32(m.SwIfIndexTo)
+ buf.EncodeUint8(m.State)
+ buf.EncodeUint8(m.IsL2)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSpanEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndexFrom = buf.DecodeUint32()
+ m.SwIfIndexTo = buf.DecodeUint32()
+ m.State = buf.DecodeUint8()
+ m.IsL2 = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceSpanEnableDisableReply defines message 'sw_interface_span_enable_disable_reply'.
+type SwInterfaceSpanEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSpanEnableDisableReply) Reset() { *m = SwInterfaceSpanEnableDisableReply{} }
+func (*SwInterfaceSpanEnableDisableReply) GetMessageName() string {
+ return "sw_interface_span_enable_disable_reply"
+}
+func (*SwInterfaceSpanEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSpanEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSpanEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSpanEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_span_binapi_init() }
+func file_span_binapi_init() {
+ api.RegisterMessage((*SwInterfaceSpanDetails)(nil), "sw_interface_span_details_23966371")
+ api.RegisterMessage((*SwInterfaceSpanDump)(nil), "sw_interface_span_dump_67c54650")
+ api.RegisterMessage((*SwInterfaceSpanEnableDisable)(nil), "sw_interface_span_enable_disable_7216258d")
+ api.RegisterMessage((*SwInterfaceSpanEnableDisableReply)(nil), "sw_interface_span_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SwInterfaceSpanDetails)(nil),
+ (*SwInterfaceSpanDump)(nil),
+ (*SwInterfaceSpanEnableDisable)(nil),
+ (*SwInterfaceSpanEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/span/span_rpc.ba.go b/internal/testbinapi/binapi2001/span/span_rpc.ba.go
new file mode 100644
index 0000000..44f5c73
--- /dev/null
+++ b/internal/testbinapi/binapi2001/span/span_rpc.ba.go
@@ -0,0 +1,73 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package span
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service span.
+type RPCService interface {
+ SwInterfaceSpanDump(ctx context.Context, in *SwInterfaceSpanDump) (RPCService_SwInterfaceSpanDumpClient, error)
+ SwInterfaceSpanEnableDisable(ctx context.Context, in *SwInterfaceSpanEnableDisable) (*SwInterfaceSpanEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SwInterfaceSpanDump(ctx context.Context, in *SwInterfaceSpanDump) (RPCService_SwInterfaceSpanDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwInterfaceSpanDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwInterfaceSpanDumpClient interface {
+ Recv() (*SwInterfaceSpanDetails, error)
+ api.Stream
+}
+
+type serviceClient_SwInterfaceSpanDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwInterfaceSpanDumpClient) Recv() (*SwInterfaceSpanDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwInterfaceSpanDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) SwInterfaceSpanEnableDisable(ctx context.Context, in *SwInterfaceSpanEnableDisable) (*SwInterfaceSpanEnableDisableReply, error) {
+ out := new(SwInterfaceSpanEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/sr/sr.ba.go b/internal/testbinapi/binapi2001/sr/sr.ba.go
index b0e423b..1a13b5a 100644
--- a/internal/testbinapi/binapi2001/sr/sr.ba.go
+++ b/internal/testbinapi/binapi2001/sr/sr.ba.go
@@ -1,70 +1,52 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.4.0-dev
-// VPP: 20.01-45~g7a071e370~b63
-// source: /usr/share/vpp/api/core/sr.api.json
-
-/*
-Package sr contains generated code for VPP binary API defined by sr.api (version 1.2.0).
-
-It consists of:
- 20 messages
- 3 types
-*/
+// VPP: 20.01
+// source: .vppapi/core/sr.api.json
+
+// Package sr contains generated bindings for API file sr.api.
+//
+// Contents:
+// 3 structs
+// 20 messages
+//
package sr
import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "math"
- "strconv"
-
api "git.fd.io/govpp.git/api"
codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
)
// 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 // please upgrade the GoVPP api package
+const _ = api.GoVppAPIPackageIsVersion2
const (
- // ModuleName is the name of this module.
- ModuleName = "sr"
- // APIVersion is the API version of this module.
+ APIFile = "sr"
APIVersion = "1.2.0"
- // VersionCrc is the CRC of this module.
VersionCrc = 0xbf277f96
)
-// SrIP6Address represents VPP binary API type 'sr_ip6_address'.
+// SrIP6Address defines type 'sr_ip6_address'.
type SrIP6Address struct {
- Data []byte `binapi:"u8[16],name=data" json:"data,omitempty" struc:"[16]byte"`
+ Data []byte `binapi:"u8[16],name=data" json:"data,omitempty"`
}
-func (*SrIP6Address) GetTypeName() string { return "sr_ip6_address" }
-
-// Srv6Sid represents VPP binary API type 'srv6_sid'.
+// Srv6Sid defines type 'srv6_sid'.
type Srv6Sid struct {
- Addr []byte `binapi:"u8[16],name=addr" json:"addr,omitempty" struc:"[16]byte"`
+ Addr []byte `binapi:"u8[16],name=addr" json:"addr,omitempty"`
}
-func (*Srv6Sid) GetTypeName() string { return "srv6_sid" }
-
-// Srv6SidList represents VPP binary API type 'srv6_sid_list'.
+// Srv6SidList defines type 'srv6_sid_list'.
type Srv6SidList struct {
NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
- Sids [16]Srv6Sid `binapi:"srv6_sid[16],name=sids" json:"sids,omitempty" struc:"[16]Srv6Sid"`
+ Sids [16]Srv6Sid `binapi:"srv6_sid[16],name=sids" json:"sids,omitempty"`
}
-func (*Srv6SidList) GetTypeName() string { return "srv6_sid_list" }
-
-// SrLocalsidAddDel represents VPP binary API message 'sr_localsid_add_del'.
+// SrLocalsidAddDel defines message 'sr_localsid_add_del'.
type SrLocalsidAddDel struct {
IsDel uint8 `binapi:"u8,name=is_del" json:"is_del,omitempty"`
Localsid Srv6Sid `binapi:"srv6_sid,name=localsid" json:"localsid,omitempty"`
@@ -73,570 +55,302 @@ type SrLocalsidAddDel struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" 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"`
- NhAddr6 []byte `binapi:"u8[16],name=nh_addr6" json:"nh_addr6,omitempty" struc:"[16]byte"`
- NhAddr4 []byte `binapi:"u8[4],name=nh_addr4" json:"nh_addr4,omitempty" struc:"[4]byte"`
+ NhAddr6 []byte `binapi:"u8[16],name=nh_addr6" json:"nh_addr6,omitempty"`
+ NhAddr4 []byte `binapi:"u8[4],name=nh_addr4" json:"nh_addr4,omitempty"`
}
-func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} }
-func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
-func (*SrLocalsidAddDel) GetCrcString() string { return "b30489eb" }
-func (*SrLocalsidAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} }
+func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
+func (*SrLocalsidAddDel) GetCrcString() string { return "b30489eb" }
+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
- // field[1] m.IsDel
- size += 1
- // field[1] m.Localsid
- // field[2] m.Localsid.Addr
- size += 16
- // field[1] m.EndPsp
- size += 1
- // field[1] m.Behavior
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.VlanIndex
- size += 4
- // field[1] m.FibTable
- size += 4
- // field[1] m.NhAddr6
- size += 16
- // field[1] m.NhAddr4
- size += 4
+ size += 1 // m.IsDel
+ size += 1 * 16 // m.Localsid.Addr
+ size += 1 // m.EndPsp
+ size += 1 // m.Behavior
+ size += 4 // m.SwIfIndex
+ size += 4 // m.VlanIndex
+ size += 4 // m.FibTable
+ size += 1 * 16 // m.NhAddr6
+ size += 1 * 4 // m.NhAddr4
return size
}
func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsDel
- buf[pos] = uint8(m.IsDel)
- pos += 1
- // field[1] m.Localsid
- // field[2] m.Localsid.Addr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.Localsid.Addr) {
- x = uint8(m.Localsid.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.EndPsp
- buf[pos] = uint8(m.EndPsp)
- pos += 1
- // field[1] m.Behavior
- buf[pos] = uint8(m.Behavior)
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.VlanIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.VlanIndex))
- pos += 4
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.NhAddr6
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.NhAddr6) {
- x = uint8(m.NhAddr6[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.NhAddr4
- for i := 0; i < 4; i++ {
- var x uint8
- if i < len(m.NhAddr4) {
- x = uint8(m.NhAddr4[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SrLocalsidAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsDel
- m.IsDel = uint8(tmp[pos])
- pos += 1
- // field[1] m.Localsid
- // field[2] m.Localsid.Addr
- m.Localsid.Addr = make([]uint8, 16)
- for i := 0; i < len(m.Localsid.Addr); i++ {
- m.Localsid.Addr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.EndPsp
- m.EndPsp = uint8(tmp[pos])
- pos += 1
- // field[1] m.Behavior
- m.Behavior = uint8(tmp[pos])
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VlanIndex
- m.VlanIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NhAddr6
- m.NhAddr6 = make([]uint8, 16)
- for i := 0; i < len(m.NhAddr6); i++ {
- m.NhAddr6[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.NhAddr4
- m.NhAddr4 = make([]uint8, 4)
- for i := 0; i < len(m.NhAddr4); i++ {
- m.NhAddr4[i] = uint8(tmp[pos])
- pos += 1
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsDel)
+ buf.EncodeBytes(m.Localsid.Addr, 16)
+ buf.EncodeUint8(m.EndPsp)
+ buf.EncodeUint8(m.Behavior)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.VlanIndex)
+ buf.EncodeUint32(m.FibTable)
+ buf.EncodeBytes(m.NhAddr6, 16)
+ buf.EncodeBytes(m.NhAddr4, 4)
+ return buf.Bytes(), nil
+}
+func (m *SrLocalsidAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsDel = buf.DecodeUint8()
+ m.Localsid.Addr = make([]byte, 16)
+ copy(m.Localsid.Addr, buf.DecodeBytes(len(m.Localsid.Addr)))
+ m.EndPsp = buf.DecodeUint8()
+ m.Behavior = buf.DecodeUint8()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.VlanIndex = buf.DecodeUint32()
+ m.FibTable = buf.DecodeUint32()
+ m.NhAddr6 = make([]byte, 16)
+ copy(m.NhAddr6, buf.DecodeBytes(len(m.NhAddr6)))
+ m.NhAddr4 = make([]byte, 4)
+ copy(m.NhAddr4, buf.DecodeBytes(len(m.NhAddr4)))
return nil
}
-// SrLocalsidAddDelReply represents VPP binary API message 'sr_localsid_add_del_reply'.
+// SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'.
type SrLocalsidAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SrLocalsidAddDelReply) Reset() { *m = SrLocalsidAddDelReply{} }
-func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
-func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrLocalsidAddDelReply) Reset() { *m = SrLocalsidAddDelReply{} }
+func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
+func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SrLocalsidAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// SrLocalsidsDetails represents VPP binary API message 'sr_localsids_details'.
+// SrLocalsidsDetails defines message 'sr_localsids_details'.
type SrLocalsidsDetails struct {
Addr Srv6Sid `binapi:"srv6_sid,name=addr" json:"addr,omitempty"`
EndPsp uint8 `binapi:"u8,name=end_psp" json:"end_psp,omitempty"`
Behavior uint16 `binapi:"u16,name=behavior" json:"behavior,omitempty"`
FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
- XconnectNhAddr6 []byte `binapi:"u8[16],name=xconnect_nh_addr6" json:"xconnect_nh_addr6,omitempty" struc:"[16]byte"`
- XconnectNhAddr4 []byte `binapi:"u8[4],name=xconnect_nh_addr4" json:"xconnect_nh_addr4,omitempty" struc:"[4]byte"`
+ XconnectNhAddr6 []byte `binapi:"u8[16],name=xconnect_nh_addr6" json:"xconnect_nh_addr6,omitempty"`
+ XconnectNhAddr4 []byte `binapi:"u8[4],name=xconnect_nh_addr4" json:"xconnect_nh_addr4,omitempty"`
XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
}
-func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} }
-func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
-func (*SrLocalsidsDetails) GetCrcString() string { return "0791babc" }
-func (*SrLocalsidsDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} }
+func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
+func (*SrLocalsidsDetails) GetCrcString() string { return "0791babc" }
+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
- // field[1] m.Addr
- // field[2] m.Addr.Addr
- size += 16
- // field[1] m.EndPsp
- size += 1
- // field[1] m.Behavior
- size += 2
- // field[1] m.FibTable
- size += 4
- // field[1] m.VlanIndex
- size += 4
- // field[1] m.XconnectNhAddr6
- size += 16
- // field[1] m.XconnectNhAddr4
- size += 4
- // field[1] m.XconnectIfaceOrVrfTable
- size += 4
+ size += 1 * 16 // m.Addr.Addr
+ size += 1 // m.EndPsp
+ size += 2 // m.Behavior
+ size += 4 // m.FibTable
+ size += 4 // m.VlanIndex
+ size += 1 * 16 // m.XconnectNhAddr6
+ size += 1 * 4 // m.XconnectNhAddr4
+ size += 4 // m.XconnectIfaceOrVrfTable
return size
}
func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Addr
- // field[2] m.Addr.Addr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.Addr.Addr) {
- x = uint8(m.Addr.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.EndPsp
- buf[pos] = uint8(m.EndPsp)
- pos += 1
- // field[1] m.Behavior
- o.PutUint16(buf[pos:pos+2], uint16(m.Behavior))
- pos += 2
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.VlanIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.VlanIndex))
- pos += 4
- // field[1] m.XconnectNhAddr6
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.XconnectNhAddr6) {
- x = uint8(m.XconnectNhAddr6[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.XconnectNhAddr4
- for i := 0; i < 4; i++ {
- var x uint8
- if i < len(m.XconnectNhAddr4) {
- x = uint8(m.XconnectNhAddr4[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.XconnectIfaceOrVrfTable
- o.PutUint32(buf[pos:pos+4], uint32(m.XconnectIfaceOrVrfTable))
- pos += 4
- return buf, nil
-}
-func (m *SrLocalsidsDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Addr
- // field[2] m.Addr.Addr
- m.Addr.Addr = make([]uint8, 16)
- for i := 0; i < len(m.Addr.Addr); i++ {
- m.Addr.Addr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.EndPsp
- m.EndPsp = uint8(tmp[pos])
- pos += 1
- // field[1] m.Behavior
- m.Behavior = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VlanIndex
- m.VlanIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.XconnectNhAddr6
- m.XconnectNhAddr6 = make([]uint8, 16)
- for i := 0; i < len(m.XconnectNhAddr6); i++ {
- m.XconnectNhAddr6[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.XconnectNhAddr4
- m.XconnectNhAddr4 = make([]uint8, 4)
- for i := 0; i < len(m.XconnectNhAddr4); i++ {
- m.XconnectNhAddr4[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.XconnectIfaceOrVrfTable
- m.XconnectIfaceOrVrfTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Addr.Addr, 16)
+ buf.EncodeUint8(m.EndPsp)
+ buf.EncodeUint16(m.Behavior)
+ buf.EncodeUint32(m.FibTable)
+ buf.EncodeUint32(m.VlanIndex)
+ buf.EncodeBytes(m.XconnectNhAddr6, 16)
+ buf.EncodeBytes(m.XconnectNhAddr4, 4)
+ buf.EncodeUint32(m.XconnectIfaceOrVrfTable)
+ return buf.Bytes(), nil
+}
+func (m *SrLocalsidsDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Addr.Addr = make([]byte, 16)
+ copy(m.Addr.Addr, buf.DecodeBytes(len(m.Addr.Addr)))
+ m.EndPsp = buf.DecodeUint8()
+ m.Behavior = buf.DecodeUint16()
+ m.FibTable = buf.DecodeUint32()
+ m.VlanIndex = buf.DecodeUint32()
+ m.XconnectNhAddr6 = make([]byte, 16)
+ copy(m.XconnectNhAddr6, buf.DecodeBytes(len(m.XconnectNhAddr6)))
+ m.XconnectNhAddr4 = make([]byte, 4)
+ copy(m.XconnectNhAddr4, buf.DecodeBytes(len(m.XconnectNhAddr4)))
+ m.XconnectIfaceOrVrfTable = buf.DecodeUint32()
return nil
}
-// SrLocalsidsDump represents VPP binary API message 'sr_localsids_dump'.
+// SrLocalsidsDump defines message 'sr_localsids_dump'.
type SrLocalsidsDump struct{}
-func (m *SrLocalsidsDump) Reset() { *m = SrLocalsidsDump{} }
-func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
-func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" }
-func (*SrLocalsidsDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrLocalsidsDump) Reset() { *m = SrLocalsidsDump{} }
+func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
+func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *SrLocalsidsDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *SrLocalsidsDump) Unmarshal(b []byte) error {
return nil
}
-// SrPoliciesDetails represents VPP binary API message 'sr_policies_details'.
+// SrPoliciesDetails defines message 'sr_policies_details'.
type SrPoliciesDetails struct {
Bsid Srv6Sid `binapi:"srv6_sid,name=bsid" json:"bsid,omitempty"`
Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
IsEncap uint8 `binapi:"u8,name=is_encap" json:"is_encap,omitempty"`
FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
- NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"num_sid_lists,omitempty" struc:"sizeof=SidLists"`
+ NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"`
SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
}
-func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} }
-func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
-func (*SrPoliciesDetails) GetCrcString() string { return "5087f460" }
-func (*SrPoliciesDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} }
+func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
+func (*SrPoliciesDetails) GetCrcString() string { return "5087f460" }
+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
- // field[1] m.Bsid
- // field[2] m.Bsid.Addr
- size += 16
- // field[1] m.Type
- size += 1
- // field[1] m.IsEncap
- size += 1
- // field[1] m.FibTable
- size += 4
- // field[1] m.NumSidLists
- size += 1
- // field[1] m.SidLists
+ size += 1 * 16 // m.Bsid.Addr
+ size += 1 // m.Type
+ size += 1 // m.IsEncap
+ size += 4 // m.FibTable
+ size += 1 // m.NumSidLists
for j1 := 0; j1 < len(m.SidLists); j1++ {
var s1 Srv6SidList
_ = s1
if j1 < len(m.SidLists) {
s1 = m.SidLists[j1]
}
- // field[2] s1.NumSids
- size += 1
- // field[2] s1.Weight
- size += 4
- // field[2] s1.Sids
+ size += 1 // s1.NumSids
+ size += 4 // s1.Weight
for j2 := 0; j2 < 16; j2++ {
- var s2 Srv6Sid
- _ = s2
- if j2 < len(s1.Sids) {
- s2 = s1.Sids[j2]
- }
- // field[3] s2.Addr
- size += 16
+ size += 1 * 16 // s1.Sids[j2].Addr
}
}
return size
}
func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Bsid
- // field[2] m.Bsid.Addr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.Bsid.Addr) {
- x = uint8(m.Bsid.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Type
- buf[pos] = uint8(m.Type)
- pos += 1
- // field[1] m.IsEncap
- buf[pos] = uint8(m.IsEncap)
- pos += 1
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.NumSidLists
- buf[pos] = uint8(len(m.SidLists))
- pos += 1
- // field[1] m.SidLists
- for j1 := 0; j1 < len(m.SidLists); j1++ {
- var v1 Srv6SidList
- if j1 < len(m.SidLists) {
- v1 = m.SidLists[j1]
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.Bsid.Addr, 16)
+ buf.EncodeUint8(m.Type)
+ buf.EncodeUint8(m.IsEncap)
+ buf.EncodeUint32(m.FibTable)
+ buf.EncodeUint8(uint8(len(m.SidLists)))
+ for j0 := 0; j0 < len(m.SidLists); j0++ {
+ var v0 Srv6SidList // SidLists
+ if j0 < len(m.SidLists) {
+ v0 = m.SidLists[j0]
}
- // field[2] v1.NumSids
- buf[pos] = uint8(v1.NumSids)
- pos += 1
- // field[2] v1.Weight
- o.PutUint32(buf[pos:pos+4], uint32(v1.Weight))
- pos += 4
- // field[2] v1.Sids
- for j2 := 0; j2 < 16; j2++ {
- var v2 Srv6Sid
- if j2 < len(v1.Sids) {
- v2 = v1.Sids[j2]
- }
- // field[3] v2.Addr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v2.Addr) {
- x = uint8(v2.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
+ buf.EncodeUint8(v0.NumSids)
+ buf.EncodeUint32(v0.Weight)
+ for j1 := 0; j1 < 16; j1++ {
+ buf.EncodeBytes(v0.Sids[j1].Addr, 16)
}
}
- return buf, nil
-}
-func (m *SrPoliciesDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Bsid
- // field[2] m.Bsid.Addr
- m.Bsid.Addr = make([]uint8, 16)
- for i := 0; i < len(m.Bsid.Addr); i++ {
- m.Bsid.Addr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Type
- m.Type = uint8(tmp[pos])
- pos += 1
- // field[1] m.IsEncap
- m.IsEncap = uint8(tmp[pos])
- pos += 1
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NumSidLists
- m.NumSidLists = uint8(tmp[pos])
- pos += 1
- // field[1] m.SidLists
- m.SidLists = make([]Srv6SidList, int(m.NumSidLists))
- for j1 := 0; j1 < int(m.NumSidLists); j1++ {
- // field[2] m.SidLists[j1].NumSids
- m.SidLists[j1].NumSids = uint8(tmp[pos])
- pos += 1
- // field[2] m.SidLists[j1].Weight
- m.SidLists[j1].Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.SidLists[j1].Sids
- for j2 := 0; j2 < 16; j2++ {
- // field[3] m.SidLists[j1].Sids[j2].Addr
- m.SidLists[j1].Sids[j2].Addr = make([]uint8, 16)
- for i := 0; i < len(m.SidLists[j1].Sids[j2].Addr); i++ {
- m.SidLists[j1].Sids[j2].Addr[i] = uint8(tmp[pos])
- pos += 1
- }
+ return buf.Bytes(), nil
+}
+func (m *SrPoliciesDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bsid.Addr = make([]byte, 16)
+ copy(m.Bsid.Addr, buf.DecodeBytes(len(m.Bsid.Addr)))
+ m.Type = buf.DecodeUint8()
+ m.IsEncap = buf.DecodeUint8()
+ m.FibTable = buf.DecodeUint32()
+ m.NumSidLists = buf.DecodeUint8()
+ 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()
+ for j1 := 0; j1 < 16; j1++ {
+ m.SidLists[j0].Sids[j1].Addr = make([]byte, 16)
+ copy(m.SidLists[j0].Sids[j1].Addr, buf.DecodeBytes(len(m.SidLists[j0].Sids[j1].Addr)))
}
}
return nil
}
-// SrPoliciesDump represents VPP binary API message 'sr_policies_dump'.
+// SrPoliciesDump defines message 'sr_policies_dump'.
type SrPoliciesDump struct{}
-func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} }
-func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
-func (*SrPoliciesDump) GetCrcString() string { return "51077d14" }
-func (*SrPoliciesDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} }
+func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
+func (*SrPoliciesDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *SrPoliciesDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *SrPoliciesDump) Unmarshal(b []byte) error {
return nil
}
-// SrPolicyAdd represents VPP binary API message 'sr_policy_add'.
+// SrPolicyAdd defines message 'sr_policy_add'.
type SrPolicyAdd struct {
- BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty" struc:"[16]byte"`
+ BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty"`
Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
IsEncap uint8 `binapi:"u8,name=is_encap" json:"is_encap,omitempty"`
Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
@@ -644,304 +358,170 @@ type SrPolicyAdd struct {
Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
}
-func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} }
-func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
-func (*SrPolicyAdd) GetCrcString() string { return "4b6e2484" }
-func (*SrPolicyAdd) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} }
+func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
+func (*SrPolicyAdd) GetCrcString() string { return "4b6e2484" }
+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
- // field[1] m.BsidAddr
- size += 16
- // field[1] m.Weight
- size += 4
- // field[1] m.IsEncap
- size += 1
- // field[1] m.Type
- size += 1
- // field[1] m.FibTable
- size += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- size += 1
- // field[2] m.Sids.Weight
- size += 4
- // field[2] m.Sids.Sids
+ size += 1 * 16 // m.BsidAddr
+ size += 4 // m.Weight
+ size += 1 // m.IsEncap
+ size += 1 // m.Type
+ size += 4 // m.FibTable
+ size += 1 // m.Sids.NumSids
+ size += 4 // m.Sids.Weight
for j2 := 0; j2 < 16; j2++ {
- var s2 Srv6Sid
- _ = s2
- if j2 < len(m.Sids.Sids) {
- s2 = m.Sids.Sids[j2]
- }
- // field[3] s2.Addr
- size += 16
+ size += 1 * 16 // m.Sids.Sids[j2].Addr
}
return size
}
func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.BsidAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.BsidAddr) {
- x = uint8(m.BsidAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Weight
- o.PutUint32(buf[pos:pos+4], uint32(m.Weight))
- pos += 4
- // field[1] m.IsEncap
- buf[pos] = uint8(m.IsEncap)
- pos += 1
- // field[1] m.Type
- buf[pos] = uint8(m.Type)
- pos += 1
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- buf[pos] = uint8(m.Sids.NumSids)
- pos += 1
- // field[2] m.Sids.Weight
- o.PutUint32(buf[pos:pos+4], uint32(m.Sids.Weight))
- pos += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- var v2 Srv6Sid
- if j2 < len(m.Sids.Sids) {
- v2 = m.Sids.Sids[j2]
- }
- // field[3] v2.Addr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v2.Addr) {
- x = uint8(v2.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- }
- return buf, nil
-}
-func (m *SrPolicyAdd) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.BsidAddr
- m.BsidAddr = make([]uint8, 16)
- for i := 0; i < len(m.BsidAddr); i++ {
- m.BsidAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Weight
- m.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsEncap
- m.IsEncap = uint8(tmp[pos])
- pos += 1
- // field[1] m.Type
- m.Type = uint8(tmp[pos])
- pos += 1
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- m.Sids.NumSids = uint8(tmp[pos])
- pos += 1
- // field[2] m.Sids.Weight
- m.Sids.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- // field[3] m.Sids.Sids[j2].Addr
- m.Sids.Sids[j2].Addr = make([]uint8, 16)
- for i := 0; i < len(m.Sids.Sids[j2].Addr); i++ {
- m.Sids.Sids[j2].Addr[i] = uint8(tmp[pos])
- pos += 1
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.BsidAddr, 16)
+ buf.EncodeUint32(m.Weight)
+ buf.EncodeUint8(m.IsEncap)
+ buf.EncodeUint8(m.Type)
+ buf.EncodeUint32(m.FibTable)
+ buf.EncodeUint8(m.Sids.NumSids)
+ buf.EncodeUint32(m.Sids.Weight)
+ for j1 := 0; j1 < 16; j1++ {
+ buf.EncodeBytes(m.Sids.Sids[j1].Addr, 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *SrPolicyAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BsidAddr = make([]byte, 16)
+ copy(m.BsidAddr, buf.DecodeBytes(len(m.BsidAddr)))
+ m.Weight = buf.DecodeUint32()
+ m.IsEncap = buf.DecodeUint8()
+ m.Type = buf.DecodeUint8()
+ m.FibTable = buf.DecodeUint32()
+ m.Sids.NumSids = buf.DecodeUint8()
+ m.Sids.Weight = buf.DecodeUint32()
+ for j1 := 0; j1 < 16; j1++ {
+ m.Sids.Sids[j1].Addr = make([]byte, 16)
+ copy(m.Sids.Sids[j1].Addr, buf.DecodeBytes(len(m.Sids.Sids[j1].Addr)))
}
return nil
}
-// SrPolicyAddReply represents VPP binary API message 'sr_policy_add_reply'.
+// SrPolicyAddReply defines message 'sr_policy_add_reply'.
type SrPolicyAddReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SrPolicyAddReply) Reset() { *m = SrPolicyAddReply{} }
-func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
-func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" }
-func (*SrPolicyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrPolicyAddReply) Reset() { *m = SrPolicyAddReply{} }
+func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
+func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SrPolicyAddReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// SrPolicyDel represents VPP binary API message 'sr_policy_del'.
+// SrPolicyDel defines message 'sr_policy_del'.
type SrPolicyDel struct {
BsidAddr Srv6Sid `binapi:"srv6_sid,name=bsid_addr" json:"bsid_addr,omitempty"`
SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
}
-func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} }
-func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
-func (*SrPolicyDel) GetCrcString() string { return "e4133171" }
-func (*SrPolicyDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} }
+func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
+func (*SrPolicyDel) GetCrcString() string { return "e4133171" }
+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
- // field[1] m.BsidAddr
- // field[2] m.BsidAddr.Addr
- size += 16
- // field[1] m.SrPolicyIndex
- size += 4
+ size += 1 * 16 // m.BsidAddr.Addr
+ size += 4 // m.SrPolicyIndex
return size
}
func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.BsidAddr
- // field[2] m.BsidAddr.Addr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.BsidAddr.Addr) {
- x = uint8(m.BsidAddr.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SrPolicyIndex))
- pos += 4
- return buf, nil
-}
-func (m *SrPolicyDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.BsidAddr
- // field[2] m.BsidAddr.Addr
- m.BsidAddr.Addr = make([]uint8, 16)
- for i := 0; i < len(m.BsidAddr.Addr); i++ {
- m.BsidAddr.Addr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- m.SrPolicyIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.BsidAddr.Addr, 16)
+ buf.EncodeUint32(m.SrPolicyIndex)
+ return buf.Bytes(), nil
+}
+func (m *SrPolicyDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BsidAddr.Addr = make([]byte, 16)
+ copy(m.BsidAddr.Addr, buf.DecodeBytes(len(m.BsidAddr.Addr)))
+ m.SrPolicyIndex = buf.DecodeUint32()
return nil
}
-// SrPolicyDelReply represents VPP binary API message 'sr_policy_del_reply'.
+// SrPolicyDelReply defines message 'sr_policy_del_reply'.
type SrPolicyDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SrPolicyDelReply) Reset() { *m = SrPolicyDelReply{} }
-func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
-func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" }
-func (*SrPolicyDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrPolicyDelReply) Reset() { *m = SrPolicyDelReply{} }
+func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
+func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SrPolicyDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// SrPolicyMod represents VPP binary API message 'sr_policy_mod'.
+// SrPolicyMod defines message 'sr_policy_mod'.
type SrPolicyMod struct {
- BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty" struc:"[16]byte"`
+ BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty"`
SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
Operation uint8 `binapi:"u8,name=operation" json:"operation,omitempty"`
@@ -950,732 +530,432 @@ type SrPolicyMod struct {
Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
}
-func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} }
-func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
-func (*SrPolicyMod) GetCrcString() string { return "c1dfaee0" }
-func (*SrPolicyMod) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} }
+func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
+func (*SrPolicyMod) GetCrcString() string { return "c1dfaee0" }
+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
- // field[1] m.BsidAddr
- size += 16
- // field[1] m.SrPolicyIndex
- size += 4
- // field[1] m.FibTable
- size += 4
- // field[1] m.Operation
- size += 1
- // field[1] m.SlIndex
- size += 4
- // field[1] m.Weight
- size += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- size += 1
- // field[2] m.Sids.Weight
- size += 4
- // field[2] m.Sids.Sids
+ size += 1 * 16 // m.BsidAddr
+ size += 4 // m.SrPolicyIndex
+ size += 4 // m.FibTable
+ size += 1 // m.Operation
+ size += 4 // m.SlIndex
+ size += 4 // m.Weight
+ size += 1 // m.Sids.NumSids
+ size += 4 // m.Sids.Weight
for j2 := 0; j2 < 16; j2++ {
- var s2 Srv6Sid
- _ = s2
- if j2 < len(m.Sids.Sids) {
- s2 = m.Sids.Sids[j2]
- }
- // field[3] s2.Addr
- size += 16
+ size += 1 * 16 // m.Sids.Sids[j2].Addr
}
return size
}
func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.BsidAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.BsidAddr) {
- x = uint8(m.BsidAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SrPolicyIndex))
- pos += 4
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.Operation
- buf[pos] = uint8(m.Operation)
- pos += 1
- // field[1] m.SlIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SlIndex))
- pos += 4
- // field[1] m.Weight
- o.PutUint32(buf[pos:pos+4], uint32(m.Weight))
- pos += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- buf[pos] = uint8(m.Sids.NumSids)
- pos += 1
- // field[2] m.Sids.Weight
- o.PutUint32(buf[pos:pos+4], uint32(m.Sids.Weight))
- pos += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- var v2 Srv6Sid
- if j2 < len(m.Sids.Sids) {
- v2 = m.Sids.Sids[j2]
- }
- // field[3] v2.Addr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v2.Addr) {
- x = uint8(v2.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- }
- return buf, nil
-}
-func (m *SrPolicyMod) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.BsidAddr
- m.BsidAddr = make([]uint8, 16)
- for i := 0; i < len(m.BsidAddr); i++ {
- m.BsidAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- m.SrPolicyIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Operation
- m.Operation = uint8(tmp[pos])
- pos += 1
- // field[1] m.SlIndex
- m.SlIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Weight
- m.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- m.Sids.NumSids = uint8(tmp[pos])
- pos += 1
- // field[2] m.Sids.Weight
- m.Sids.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- // field[3] m.Sids.Sids[j2].Addr
- m.Sids.Sids[j2].Addr = make([]uint8, 16)
- for i := 0; i < len(m.Sids.Sids[j2].Addr); i++ {
- m.Sids.Sids[j2].Addr[i] = uint8(tmp[pos])
- pos += 1
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.BsidAddr, 16)
+ buf.EncodeUint32(m.SrPolicyIndex)
+ buf.EncodeUint32(m.FibTable)
+ buf.EncodeUint8(m.Operation)
+ buf.EncodeUint32(m.SlIndex)
+ buf.EncodeUint32(m.Weight)
+ buf.EncodeUint8(m.Sids.NumSids)
+ buf.EncodeUint32(m.Sids.Weight)
+ for j1 := 0; j1 < 16; j1++ {
+ buf.EncodeBytes(m.Sids.Sids[j1].Addr, 16)
+ }
+ return buf.Bytes(), nil
+}
+func (m *SrPolicyMod) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.BsidAddr = make([]byte, 16)
+ copy(m.BsidAddr, buf.DecodeBytes(len(m.BsidAddr)))
+ m.SrPolicyIndex = buf.DecodeUint32()
+ m.FibTable = buf.DecodeUint32()
+ m.Operation = buf.DecodeUint8()
+ m.SlIndex = buf.DecodeUint32()
+ m.Weight = buf.DecodeUint32()
+ m.Sids.NumSids = buf.DecodeUint8()
+ m.Sids.Weight = buf.DecodeUint32()
+ for j1 := 0; j1 < 16; j1++ {
+ m.Sids.Sids[j1].Addr = make([]byte, 16)
+ copy(m.Sids.Sids[j1].Addr, buf.DecodeBytes(len(m.Sids.Sids[j1].Addr)))
}
return nil
}
-// SrPolicyModReply represents VPP binary API message 'sr_policy_mod_reply'.
+// SrPolicyModReply defines message 'sr_policy_mod_reply'.
type SrPolicyModReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SrPolicyModReply) Reset() { *m = SrPolicyModReply{} }
-func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
-func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" }
-func (*SrPolicyModReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrPolicyModReply) Reset() { *m = SrPolicyModReply{} }
+func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
+func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SrPolicyModReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// SrSetEncapHopLimit represents VPP binary API message 'sr_set_encap_hop_limit'.
+// SrSetEncapHopLimit defines message 'sr_set_encap_hop_limit'.
type SrSetEncapHopLimit struct {
HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
}
-func (m *SrSetEncapHopLimit) Reset() { *m = SrSetEncapHopLimit{} }
-func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
-func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" }
-func (*SrSetEncapHopLimit) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrSetEncapHopLimit) Reset() { *m = SrSetEncapHopLimit{} }
+func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
+func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" }
+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
- // field[1] m.HopLimit
- size += 1
+ size += 1 // m.HopLimit
return size
}
func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.HopLimit
- buf[pos] = uint8(m.HopLimit)
- pos += 1
- return buf, nil
-}
-func (m *SrSetEncapHopLimit) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.HopLimit
- m.HopLimit = uint8(tmp[pos])
- pos += 1
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.HopLimit)
+ return buf.Bytes(), nil
+}
+func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.HopLimit = buf.DecodeUint8()
return nil
}
-// SrSetEncapHopLimitReply represents VPP binary API message 'sr_set_encap_hop_limit_reply'.
+// SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'.
type SrSetEncapHopLimitReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SrSetEncapHopLimitReply) Reset() { *m = SrSetEncapHopLimitReply{} }
-func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
-func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" }
-func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrSetEncapHopLimitReply) Reset() { *m = SrSetEncapHopLimitReply{} }
+func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
+func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SrSetEncapHopLimitReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// SrSetEncapSource represents VPP binary API message 'sr_set_encap_source'.
+// SrSetEncapSource defines message 'sr_set_encap_source'.
type SrSetEncapSource struct {
- EncapsSource []byte `binapi:"u8[16],name=encaps_source" json:"encaps_source,omitempty" struc:"[16]byte"`
+ EncapsSource []byte `binapi:"u8[16],name=encaps_source" json:"encaps_source,omitempty"`
}
-func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} }
-func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
-func (*SrSetEncapSource) GetCrcString() string { return "d05bb4de" }
-func (*SrSetEncapSource) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} }
+func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
+func (*SrSetEncapSource) GetCrcString() string { return "d05bb4de" }
+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
- // field[1] m.EncapsSource
- size += 16
+ size += 1 * 16 // m.EncapsSource
return size
}
func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.EncapsSource
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.EncapsSource) {
- x = uint8(m.EncapsSource[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SrSetEncapSource) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.EncapsSource
- m.EncapsSource = make([]uint8, 16)
- for i := 0; i < len(m.EncapsSource); i++ {
- m.EncapsSource[i] = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.EncapsSource, 16)
+ return buf.Bytes(), nil
+}
+func (m *SrSetEncapSource) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EncapsSource = make([]byte, 16)
+ copy(m.EncapsSource, buf.DecodeBytes(len(m.EncapsSource)))
return nil
}
-// SrSetEncapSourceReply represents VPP binary API message 'sr_set_encap_source_reply'.
+// SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'.
type SrSetEncapSourceReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SrSetEncapSourceReply) Reset() { *m = SrSetEncapSourceReply{} }
-func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
-func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" }
-func (*SrSetEncapSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrSetEncapSourceReply) Reset() { *m = SrSetEncapSourceReply{} }
+func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
+func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SrSetEncapSourceReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// SrSteeringAddDel represents VPP binary API message 'sr_steering_add_del'.
+// SrSteeringAddDel defines message 'sr_steering_add_del'.
type SrSteeringAddDel struct {
IsDel uint8 `binapi:"u8,name=is_del" json:"is_del,omitempty"`
- BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty" struc:"[16]byte"`
+ BsidAddr []byte `binapi:"u8[16],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"`
- PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty" struc:"[16]byte"`
+ PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty"`
MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"`
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
TrafficType uint8 `binapi:"u8,name=traffic_type" json:"traffic_type,omitempty"`
}
-func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} }
-func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
-func (*SrSteeringAddDel) GetCrcString() string { return "28b5dcab" }
-func (*SrSteeringAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} }
+func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
+func (*SrSteeringAddDel) GetCrcString() string { return "28b5dcab" }
+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
- // field[1] m.IsDel
- size += 1
- // field[1] m.BsidAddr
- size += 16
- // field[1] m.SrPolicyIndex
- size += 4
- // field[1] m.TableID
- size += 4
- // field[1] m.PrefixAddr
- size += 16
- // field[1] m.MaskWidth
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.TrafficType
- size += 1
+ size += 1 // m.IsDel
+ size += 1 * 16 // m.BsidAddr
+ size += 4 // m.SrPolicyIndex
+ size += 4 // m.TableID
+ size += 1 * 16 // m.PrefixAddr
+ size += 4 // m.MaskWidth
+ size += 4 // m.SwIfIndex
+ size += 1 // m.TrafficType
return size
}
func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsDel
- buf[pos] = uint8(m.IsDel)
- pos += 1
- // field[1] m.BsidAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.BsidAddr) {
- x = uint8(m.BsidAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SrPolicyIndex))
- pos += 4
- // field[1] m.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.TableID))
- pos += 4
- // field[1] m.PrefixAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.PrefixAddr) {
- x = uint8(m.PrefixAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.MaskWidth
- o.PutUint32(buf[pos:pos+4], uint32(m.MaskWidth))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.TrafficType
- buf[pos] = uint8(m.TrafficType)
- pos += 1
- return buf, nil
-}
-func (m *SrSteeringAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsDel
- m.IsDel = uint8(tmp[pos])
- pos += 1
- // field[1] m.BsidAddr
- m.BsidAddr = make([]uint8, 16)
- for i := 0; i < len(m.BsidAddr); i++ {
- m.BsidAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- m.SrPolicyIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TableID
- m.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.PrefixAddr
- m.PrefixAddr = make([]uint8, 16)
- for i := 0; i < len(m.PrefixAddr); i++ {
- m.PrefixAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.MaskWidth
- m.MaskWidth = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TrafficType
- m.TrafficType = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsDel)
+ buf.EncodeBytes(m.BsidAddr, 16)
+ buf.EncodeUint32(m.SrPolicyIndex)
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeBytes(m.PrefixAddr, 16)
+ buf.EncodeUint32(m.MaskWidth)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.TrafficType)
+ return buf.Bytes(), nil
+}
+func (m *SrSteeringAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsDel = buf.DecodeUint8()
+ m.BsidAddr = make([]byte, 16)
+ copy(m.BsidAddr, buf.DecodeBytes(len(m.BsidAddr)))
+ m.SrPolicyIndex = buf.DecodeUint32()
+ m.TableID = buf.DecodeUint32()
+ m.PrefixAddr = make([]byte, 16)
+ copy(m.PrefixAddr, buf.DecodeBytes(len(m.PrefixAddr)))
+ m.MaskWidth = buf.DecodeUint32()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.TrafficType = buf.DecodeUint8()
return nil
}
-// SrSteeringAddDelReply represents VPP binary API message 'sr_steering_add_del_reply'.
+// SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'.
type SrSteeringAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SrSteeringAddDelReply) Reset() { *m = SrSteeringAddDelReply{} }
-func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
-func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*SrSteeringAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrSteeringAddDelReply) Reset() { *m = SrSteeringAddDelReply{} }
+func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
+func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
+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
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SrSteeringAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
return nil
}
-// SrSteeringPolDetails represents VPP binary API message 'sr_steering_pol_details'.
+// SrSteeringPolDetails defines message 'sr_steering_pol_details'.
type SrSteeringPolDetails struct {
TrafficType uint8 `binapi:"u8,name=traffic_type" json:"traffic_type,omitempty"`
FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
- PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty" struc:"[16]byte"`
+ PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty"`
MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"`
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
Bsid Srv6Sid `binapi:"srv6_sid,name=bsid" json:"bsid,omitempty"`
}
-func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} }
-func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
-func (*SrSteeringPolDetails) GetCrcString() string { return "5627d483" }
-func (*SrSteeringPolDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} }
+func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
+func (*SrSteeringPolDetails) GetCrcString() string { return "5627d483" }
+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
- // field[1] m.TrafficType
- size += 1
- // field[1] m.FibTable
- size += 4
- // field[1] m.PrefixAddr
- size += 16
- // field[1] m.MaskWidth
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Bsid
- // field[2] m.Bsid.Addr
- size += 16
+ size += 1 // m.TrafficType
+ size += 4 // m.FibTable
+ size += 1 * 16 // m.PrefixAddr
+ size += 4 // m.MaskWidth
+ size += 4 // m.SwIfIndex
+ size += 1 * 16 // m.Bsid.Addr
return size
}
func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.TrafficType
- buf[pos] = uint8(m.TrafficType)
- pos += 1
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.PrefixAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.PrefixAddr) {
- x = uint8(m.PrefixAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.MaskWidth
- o.PutUint32(buf[pos:pos+4], uint32(m.MaskWidth))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Bsid
- // field[2] m.Bsid.Addr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.Bsid.Addr) {
- x = uint8(m.Bsid.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SrSteeringPolDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.TrafficType
- m.TrafficType = uint8(tmp[pos])
- pos += 1
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.PrefixAddr
- m.PrefixAddr = make([]uint8, 16)
- for i := 0; i < len(m.PrefixAddr); i++ {
- m.PrefixAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.MaskWidth
- m.MaskWidth = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Bsid
- // field[2] m.Bsid.Addr
- m.Bsid.Addr = make([]uint8, 16)
- for i := 0; i < len(m.Bsid.Addr); i++ {
- m.Bsid.Addr[i] = uint8(tmp[pos])
- pos += 1
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.TrafficType)
+ buf.EncodeUint32(m.FibTable)
+ buf.EncodeBytes(m.PrefixAddr, 16)
+ buf.EncodeUint32(m.MaskWidth)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeBytes(m.Bsid.Addr, 16)
+ return buf.Bytes(), nil
+}
+func (m *SrSteeringPolDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TrafficType = buf.DecodeUint8()
+ m.FibTable = buf.DecodeUint32()
+ m.PrefixAddr = make([]byte, 16)
+ copy(m.PrefixAddr, buf.DecodeBytes(len(m.PrefixAddr)))
+ m.MaskWidth = buf.DecodeUint32()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Bsid.Addr = make([]byte, 16)
+ copy(m.Bsid.Addr, buf.DecodeBytes(len(m.Bsid.Addr)))
return nil
}
-// SrSteeringPolDump represents VPP binary API message 'sr_steering_pol_dump'.
+// SrSteeringPolDump defines message 'sr_steering_pol_dump'.
type SrSteeringPolDump struct{}
-func (m *SrSteeringPolDump) Reset() { *m = SrSteeringPolDump{} }
-func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
-func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" }
-func (*SrSteeringPolDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SrSteeringPolDump) Reset() { *m = SrSteeringPolDump{} }
+func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
+func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *SrSteeringPolDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *SrSteeringPolDump) Unmarshal(b []byte) error {
return nil
}
func init() { file_sr_binapi_init() }
func file_sr_binapi_init() {
- api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr.SrLocalsidAddDel")
- api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr.SrLocalsidAddDelReply")
- api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr.SrLocalsidsDetails")
- api.RegisterMessage((*SrLocalsidsDump)(nil), "sr.SrLocalsidsDump")
- api.RegisterMessage((*SrPoliciesDetails)(nil), "sr.SrPoliciesDetails")
- api.RegisterMessage((*SrPoliciesDump)(nil), "sr.SrPoliciesDump")
- api.RegisterMessage((*SrPolicyAdd)(nil), "sr.SrPolicyAdd")
- api.RegisterMessage((*SrPolicyAddReply)(nil), "sr.SrPolicyAddReply")
- api.RegisterMessage((*SrPolicyDel)(nil), "sr.SrPolicyDel")
- api.RegisterMessage((*SrPolicyDelReply)(nil), "sr.SrPolicyDelReply")
- api.RegisterMessage((*SrPolicyMod)(nil), "sr.SrPolicyMod")
- api.RegisterMessage((*SrPolicyModReply)(nil), "sr.SrPolicyModReply")
- api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr.SrSetEncapHopLimit")
- api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr.SrSetEncapHopLimitReply")
- api.RegisterMessage((*SrSetEncapSource)(nil), "sr.SrSetEncapSource")
- api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr.SrSetEncapSourceReply")
- api.RegisterMessage((*SrSteeringAddDel)(nil), "sr.SrSteeringAddDel")
- api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr.SrSteeringAddDelReply")
- api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr.SrSteeringPolDetails")
- api.RegisterMessage((*SrSteeringPolDump)(nil), "sr.SrSteeringPolDump")
+ api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr_localsid_add_del_b30489eb")
+ api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr_localsid_add_del_reply_e8d4e804")
+ api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr_localsids_details_0791babc")
+ api.RegisterMessage((*SrLocalsidsDump)(nil), "sr_localsids_dump_51077d14")
+ api.RegisterMessage((*SrPoliciesDetails)(nil), "sr_policies_details_5087f460")
+ api.RegisterMessage((*SrPoliciesDump)(nil), "sr_policies_dump_51077d14")
+ api.RegisterMessage((*SrPolicyAdd)(nil), "sr_policy_add_4b6e2484")
+ api.RegisterMessage((*SrPolicyAddReply)(nil), "sr_policy_add_reply_e8d4e804")
+ api.RegisterMessage((*SrPolicyDel)(nil), "sr_policy_del_e4133171")
+ api.RegisterMessage((*SrPolicyDelReply)(nil), "sr_policy_del_reply_e8d4e804")
+ api.RegisterMessage((*SrPolicyMod)(nil), "sr_policy_mod_c1dfaee0")
+ api.RegisterMessage((*SrPolicyModReply)(nil), "sr_policy_mod_reply_e8d4e804")
+ api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr_set_encap_hop_limit_aa75d7d0")
+ api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr_set_encap_hop_limit_reply_e8d4e804")
+ api.RegisterMessage((*SrSetEncapSource)(nil), "sr_set_encap_source_d05bb4de")
+ api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr_set_encap_source_reply_e8d4e804")
+ api.RegisterMessage((*SrSteeringAddDel)(nil), "sr_steering_add_del_28b5dcab")
+ api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr_steering_add_del_reply_e8d4e804")
+ api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr_steering_pol_details_5627d483")
+ api.RegisterMessage((*SrSteeringPolDump)(nil), "sr_steering_pol_dump_51077d14")
}
// Messages returns list of all messages in this module.
@@ -1703,14 +983,3 @@ func AllMessages() []api.Message {
(*SrSteeringPolDump)(nil),
}
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
diff --git a/internal/testbinapi/binapi2001/sr/sr_rpc.ba.go b/internal/testbinapi/binapi2001/sr/sr_rpc.ba.go
index aeb3cde..51adb98 100644
--- a/internal/testbinapi/binapi2001/sr/sr_rpc.ba.go
+++ b/internal/testbinapi/binapi2001/sr/sr_rpc.ba.go
@@ -4,123 +4,124 @@ package sr
import (
"context"
- "io"
-
+ "fmt"
api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
)
-// RPCService represents RPC service API for sr module.
+// RPCService defines RPC service sr.
type RPCService interface {
- DumpSrLocalsids(ctx context.Context, in *SrLocalsidsDump) (RPCService_DumpSrLocalsidsClient, error)
- DumpSrPolicies(ctx context.Context, in *SrPoliciesDump) (RPCService_DumpSrPoliciesClient, error)
- DumpSrSteeringPol(ctx context.Context, in *SrSteeringPolDump) (RPCService_DumpSrSteeringPolClient, error)
SrLocalsidAddDel(ctx context.Context, in *SrLocalsidAddDel) (*SrLocalsidAddDelReply, error)
+ SrLocalsidsDump(ctx context.Context, in *SrLocalsidsDump) (RPCService_SrLocalsidsDumpClient, error)
+ SrPoliciesDump(ctx context.Context, in *SrPoliciesDump) (RPCService_SrPoliciesDumpClient, error)
SrPolicyAdd(ctx context.Context, in *SrPolicyAdd) (*SrPolicyAddReply, error)
SrPolicyDel(ctx context.Context, in *SrPolicyDel) (*SrPolicyDelReply, error)
SrPolicyMod(ctx context.Context, in *SrPolicyMod) (*SrPolicyModReply, error)
SrSetEncapHopLimit(ctx context.Context, in *SrSetEncapHopLimit) (*SrSetEncapHopLimitReply, error)
SrSetEncapSource(ctx context.Context, in *SrSetEncapSource) (*SrSetEncapSourceReply, error)
SrSteeringAddDel(ctx context.Context, in *SrSteeringAddDel) (*SrSteeringAddDelReply, error)
+ SrSteeringPolDump(ctx context.Context, in *SrSteeringPolDump) (RPCService_SrSteeringPolDumpClient, error)
}
type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpSrLocalsids(ctx context.Context, in *SrLocalsidsDump) (RPCService_DumpSrLocalsidsClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSrLocalsidsClient{stream}
- return x, nil
+ conn api.Connection
}
-type RPCService_DumpSrLocalsidsClient interface {
- Recv() (*SrLocalsidsDetails, error)
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
}
-type serviceClient_DumpSrLocalsidsClient struct {
- api.MultiRequestCtx
+func (c *serviceClient) SrLocalsidAddDel(ctx context.Context, in *SrLocalsidAddDel) (*SrLocalsidAddDelReply, error) {
+ out := new(SrLocalsidAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
}
-func (c *serviceClient_DumpSrLocalsidsClient) Recv() (*SrLocalsidsDetails, error) {
- m := new(SrLocalsidsDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient) SrLocalsidsDump(ctx context.Context, in *SrLocalsidsDump) (RPCService_SrLocalsidsDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
if err != nil {
return nil, err
}
- if stop {
- return nil, io.EOF
+ x := &serviceClient_SrLocalsidsDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
}
- return m, nil
-}
-
-func (c *serviceClient) DumpSrPolicies(ctx context.Context, in *SrPoliciesDump) (RPCService_DumpSrPoliciesClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSrPoliciesClient{stream}
return x, nil
}
-type RPCService_DumpSrPoliciesClient interface {
- Recv() (*SrPoliciesDetails, error)
+type RPCService_SrLocalsidsDumpClient interface {
+ Recv() (*SrLocalsidsDetails, error)
+ api.Stream
}
-type serviceClient_DumpSrPoliciesClient struct {
- api.MultiRequestCtx
+type serviceClient_SrLocalsidsDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpSrPoliciesClient) Recv() (*SrPoliciesDetails, error) {
- m := new(SrPoliciesDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_SrLocalsidsDumpClient) Recv() (*SrLocalsidsDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *SrLocalsidsDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
}
-func (c *serviceClient) DumpSrSteeringPol(ctx context.Context, in *SrSteeringPolDump) (RPCService_DumpSrSteeringPolClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSrSteeringPolClient{stream}
+func (c *serviceClient) SrPoliciesDump(ctx context.Context, in *SrPoliciesDump) (RPCService_SrPoliciesDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SrPoliciesDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
return x, nil
}
-type RPCService_DumpSrSteeringPolClient interface {
- Recv() (*SrSteeringPolDetails, error)
+type RPCService_SrPoliciesDumpClient interface {
+ Recv() (*SrPoliciesDetails, error)
+ api.Stream
}
-type serviceClient_DumpSrSteeringPolClient struct {
- api.MultiRequestCtx
+type serviceClient_SrPoliciesDumpClient struct {
+ api.Stream
}
-func (c *serviceClient_DumpSrSteeringPolClient) Recv() (*SrSteeringPolDetails, error) {
- m := new(SrSteeringPolDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
+func (c *serviceClient_SrPoliciesDumpClient) Recv() (*SrPoliciesDetails, error) {
+ msg, err := c.Stream.RecvMsg()
if err != nil {
return nil, err
}
- if stop {
+ switch m := msg.(type) {
+ case *SrPoliciesDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
}
- return m, nil
-}
-
-func (c *serviceClient) SrLocalsidAddDel(ctx context.Context, in *SrLocalsidAddDel) (*SrLocalsidAddDelReply, error) {
- out := new(SrLocalsidAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
}
func (c *serviceClient) SrPolicyAdd(ctx context.Context, in *SrPolicyAdd) (*SrPolicyAddReply, error) {
out := new(SrPolicyAddReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -129,7 +130,7 @@ func (c *serviceClient) SrPolicyAdd(ctx context.Context, in *SrPolicyAdd) (*SrPo
func (c *serviceClient) SrPolicyDel(ctx context.Context, in *SrPolicyDel) (*SrPolicyDelReply, error) {
out := new(SrPolicyDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -138,7 +139,7 @@ func (c *serviceClient) SrPolicyDel(ctx context.Context, in *SrPolicyDel) (*SrPo
func (c *serviceClient) SrPolicyMod(ctx context.Context, in *SrPolicyMod) (*SrPolicyModReply, error) {
out := new(SrPolicyModReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -147,7 +148,7 @@ func (c *serviceClient) SrPolicyMod(ctx context.Context, in *SrPolicyMod) (*SrPo
func (c *serviceClient) SrSetEncapHopLimit(ctx context.Context, in *SrSetEncapHopLimit) (*SrSetEncapHopLimitReply, error) {
out := new(SrSetEncapHopLimitReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -156,7 +157,7 @@ func (c *serviceClient) SrSetEncapHopLimit(ctx context.Context, in *SrSetEncapHo
func (c *serviceClient) SrSetEncapSource(ctx context.Context, in *SrSetEncapSource) (*SrSetEncapSourceReply, error) {
out := new(SrSetEncapSourceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -165,14 +166,48 @@ func (c *serviceClient) SrSetEncapSource(ctx context.Context, in *SrSetEncapSour
func (c *serviceClient) SrSteeringAddDel(ctx context.Context, in *SrSteeringAddDel) (*SrSteeringAddDelReply, error) {
out := new(SrSteeringAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
+func (c *serviceClient) SrSteeringPolDump(ctx context.Context, in *SrSteeringPolDump) (RPCService_SrSteeringPolDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SrSteeringPolDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SrSteeringPolDumpClient interface {
+ Recv() (*SrSteeringPolDetails, error)
+ api.Stream
+}
+
+type serviceClient_SrSteeringPolDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SrSteeringPolDumpClient) Recv() (*SrSteeringPolDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SrSteeringPolDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go b/internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go
new file mode 100644
index 0000000..2c8f388
--- /dev/null
+++ b/internal/testbinapi/binapi2001/sr_mpls/sr_mpls.ba.go
@@ -0,0 +1,502 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/sr_mpls.api.json
+
+// Package sr_mpls contains generated bindings for API file sr_mpls.api.
+//
+// Contents:
+// 10 messages
+//
+package sr_mpls
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "sr_mpls"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x933a0861
+)
+
+// SrMplsPolicyAdd defines message 'sr_mpls_policy_add'.
+type SrMplsPolicyAdd struct {
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+ Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
+ Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
+ NSegments uint8 `binapi:"u8,name=n_segments" json:"-"`
+ Segments []uint32 `binapi:"u32[n_segments],name=segments" json:"segments,omitempty"`
+}
+
+func (m *SrMplsPolicyAdd) Reset() { *m = SrMplsPolicyAdd{} }
+func (*SrMplsPolicyAdd) GetMessageName() string { return "sr_mpls_policy_add" }
+func (*SrMplsPolicyAdd) GetCrcString() string { return "6f5b21cc" }
+func (*SrMplsPolicyAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsPolicyAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bsid
+ size += 4 // m.Weight
+ size += 1 // m.Type
+ size += 1 // m.NSegments
+ size += 4 * len(m.Segments) // m.Segments
+ return size
+}
+func (m *SrMplsPolicyAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bsid)
+ buf.EncodeUint32(m.Weight)
+ buf.EncodeUint8(m.Type)
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bsid = buf.DecodeUint32()
+ m.Weight = buf.DecodeUint32()
+ m.Type = buf.DecodeUint8()
+ m.NSegments = buf.DecodeUint8()
+ m.Segments = make([]uint32, m.NSegments)
+ for i := 0; i < len(m.Segments); i++ {
+ m.Segments[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// SrMplsPolicyAddReply defines message 'sr_mpls_policy_add_reply'.
+type SrMplsPolicyAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsPolicyAddReply) Reset() { *m = SrMplsPolicyAddReply{} }
+func (*SrMplsPolicyAddReply) GetMessageName() string { return "sr_mpls_policy_add_reply" }
+func (*SrMplsPolicyAddReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsPolicyAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsPolicyAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsPolicyAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SrMplsPolicyAssignEndpointColor defines message 'sr_mpls_policy_assign_endpoint_color'.
+type SrMplsPolicyAssignEndpointColor struct {
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+ Endpoint []byte `binapi:"u8[16],name=endpoint" json:"endpoint,omitempty"`
+ EndpointType uint8 `binapi:"u8,name=endpoint_type" json:"endpoint_type,omitempty"`
+ Color uint32 `binapi:"u32,name=color" json:"color,omitempty"`
+}
+
+func (m *SrMplsPolicyAssignEndpointColor) Reset() { *m = SrMplsPolicyAssignEndpointColor{} }
+func (*SrMplsPolicyAssignEndpointColor) GetMessageName() string {
+ return "sr_mpls_policy_assign_endpoint_color"
+}
+func (*SrMplsPolicyAssignEndpointColor) GetCrcString() string { return "6c82a6da" }
+func (*SrMplsPolicyAssignEndpointColor) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsPolicyAssignEndpointColor) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bsid
+ size += 1 * 16 // m.Endpoint
+ size += 1 // m.EndpointType
+ size += 4 // m.Color
+ return size
+}
+func (m *SrMplsPolicyAssignEndpointColor) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bsid)
+ buf.EncodeBytes(m.Endpoint, 16)
+ buf.EncodeUint8(m.EndpointType)
+ buf.EncodeUint32(m.Color)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyAssignEndpointColor) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bsid = buf.DecodeUint32()
+ m.Endpoint = make([]byte, 16)
+ copy(m.Endpoint, buf.DecodeBytes(len(m.Endpoint)))
+ m.EndpointType = buf.DecodeUint8()
+ m.Color = buf.DecodeUint32()
+ return nil
+}
+
+// SrMplsPolicyAssignEndpointColorReply defines message 'sr_mpls_policy_assign_endpoint_color_reply'.
+type SrMplsPolicyAssignEndpointColorReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsPolicyAssignEndpointColorReply) Reset() { *m = SrMplsPolicyAssignEndpointColorReply{} }
+func (*SrMplsPolicyAssignEndpointColorReply) GetMessageName() string {
+ return "sr_mpls_policy_assign_endpoint_color_reply"
+}
+func (*SrMplsPolicyAssignEndpointColorReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsPolicyAssignEndpointColorReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsPolicyAssignEndpointColorReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsPolicyAssignEndpointColorReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SrMplsPolicyDel defines message 'sr_mpls_policy_del'.
+type SrMplsPolicyDel struct {
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+}
+
+func (m *SrMplsPolicyDel) Reset() { *m = SrMplsPolicyDel{} }
+func (*SrMplsPolicyDel) GetMessageName() string { return "sr_mpls_policy_del" }
+func (*SrMplsPolicyDel) GetCrcString() string { return "e29d34fa" }
+func (*SrMplsPolicyDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsPolicyDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bsid
+ return size
+}
+func (m *SrMplsPolicyDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bsid)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bsid = buf.DecodeUint32()
+ return nil
+}
+
+// SrMplsPolicyDelReply defines message 'sr_mpls_policy_del_reply'.
+type SrMplsPolicyDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsPolicyDelReply) Reset() { *m = SrMplsPolicyDelReply{} }
+func (*SrMplsPolicyDelReply) GetMessageName() string { return "sr_mpls_policy_del_reply" }
+func (*SrMplsPolicyDelReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsPolicyDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsPolicyDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsPolicyDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SrMplsPolicyMod defines message 'sr_mpls_policy_mod'.
+type SrMplsPolicyMod struct {
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+ Operation uint8 `binapi:"u8,name=operation" json:"operation,omitempty"`
+ SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
+ Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
+ NSegments uint8 `binapi:"u8,name=n_segments" json:"-"`
+ Segments []uint32 `binapi:"u32[n_segments],name=segments" json:"segments,omitempty"`
+}
+
+func (m *SrMplsPolicyMod) Reset() { *m = SrMplsPolicyMod{} }
+func (*SrMplsPolicyMod) GetMessageName() string { return "sr_mpls_policy_mod" }
+func (*SrMplsPolicyMod) GetCrcString() string { return "09d338ac" }
+func (*SrMplsPolicyMod) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsPolicyMod) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Bsid
+ size += 1 // m.Operation
+ size += 4 // m.SlIndex
+ size += 4 // m.Weight
+ size += 1 // m.NSegments
+ size += 4 * len(m.Segments) // m.Segments
+ return size
+}
+func (m *SrMplsPolicyMod) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Bsid)
+ buf.EncodeUint8(m.Operation)
+ 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(x)
+ }
+ return buf.Bytes(), nil
+}
+func (m *SrMplsPolicyMod) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Bsid = buf.DecodeUint32()
+ m.Operation = buf.DecodeUint8()
+ m.SlIndex = buf.DecodeUint32()
+ m.Weight = buf.DecodeUint32()
+ m.NSegments = buf.DecodeUint8()
+ m.Segments = make([]uint32, m.NSegments)
+ for i := 0; i < len(m.Segments); i++ {
+ m.Segments[i] = buf.DecodeUint32()
+ }
+ return nil
+}
+
+// SrMplsPolicyModReply defines message 'sr_mpls_policy_mod_reply'.
+type SrMplsPolicyModReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsPolicyModReply) Reset() { *m = SrMplsPolicyModReply{} }
+func (*SrMplsPolicyModReply) GetMessageName() string { return "sr_mpls_policy_mod_reply" }
+func (*SrMplsPolicyModReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsPolicyModReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsPolicyModReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsPolicyModReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SrMplsSteeringAddDel defines message 'sr_mpls_steering_add_del'.
+type SrMplsSteeringAddDel struct {
+ IsDel uint8 `binapi:"u8,name=is_del" json:"is_del,omitempty"`
+ Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty"`
+ MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"`
+ TrafficType uint8 `binapi:"u8,name=traffic_type" json:"traffic_type,omitempty"`
+ NextHop []byte `binapi:"u8[16],name=next_hop" json:"next_hop,omitempty"`
+ NhType uint8 `binapi:"u8,name=nh_type" json:"nh_type,omitempty"`
+ Color uint32 `binapi:"u32,name=color" json:"color,omitempty"`
+ CoBits uint8 `binapi:"u8,name=co_bits" json:"co_bits,omitempty"`
+ VPNLabel uint32 `binapi:"u32,name=vpn_label" json:"vpn_label,omitempty"`
+}
+
+func (m *SrMplsSteeringAddDel) Reset() { *m = SrMplsSteeringAddDel{} }
+func (*SrMplsSteeringAddDel) GetMessageName() string { return "sr_mpls_steering_add_del" }
+func (*SrMplsSteeringAddDel) GetCrcString() string { return "1591f94a" }
+func (*SrMplsSteeringAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SrMplsSteeringAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsDel
+ size += 4 // m.Bsid
+ size += 4 // m.TableID
+ size += 1 * 16 // m.PrefixAddr
+ size += 4 // m.MaskWidth
+ size += 1 // m.TrafficType
+ size += 1 * 16 // m.NextHop
+ size += 1 // m.NhType
+ size += 4 // m.Color
+ size += 1 // m.CoBits
+ size += 4 // m.VPNLabel
+ return size
+}
+func (m *SrMplsSteeringAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsDel)
+ buf.EncodeUint32(m.Bsid)
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeBytes(m.PrefixAddr, 16)
+ buf.EncodeUint32(m.MaskWidth)
+ buf.EncodeUint8(m.TrafficType)
+ buf.EncodeBytes(m.NextHop, 16)
+ buf.EncodeUint8(m.NhType)
+ buf.EncodeUint32(m.Color)
+ buf.EncodeUint8(m.CoBits)
+ buf.EncodeUint32(m.VPNLabel)
+ return buf.Bytes(), nil
+}
+func (m *SrMplsSteeringAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsDel = buf.DecodeUint8()
+ m.Bsid = buf.DecodeUint32()
+ m.TableID = buf.DecodeUint32()
+ m.PrefixAddr = make([]byte, 16)
+ copy(m.PrefixAddr, buf.DecodeBytes(len(m.PrefixAddr)))
+ m.MaskWidth = buf.DecodeUint32()
+ m.TrafficType = buf.DecodeUint8()
+ m.NextHop = make([]byte, 16)
+ copy(m.NextHop, buf.DecodeBytes(len(m.NextHop)))
+ m.NhType = buf.DecodeUint8()
+ m.Color = buf.DecodeUint32()
+ m.CoBits = buf.DecodeUint8()
+ m.VPNLabel = buf.DecodeUint32()
+ return nil
+}
+
+// SrMplsSteeringAddDelReply defines message 'sr_mpls_steering_add_del_reply'.
+type SrMplsSteeringAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SrMplsSteeringAddDelReply) Reset() { *m = SrMplsSteeringAddDelReply{} }
+func (*SrMplsSteeringAddDelReply) GetMessageName() string { return "sr_mpls_steering_add_del_reply" }
+func (*SrMplsSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*SrMplsSteeringAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SrMplsSteeringAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SrMplsSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_sr_mpls_binapi_init() }
+func file_sr_mpls_binapi_init() {
+ api.RegisterMessage((*SrMplsPolicyAdd)(nil), "sr_mpls_policy_add_6f5b21cc")
+ api.RegisterMessage((*SrMplsPolicyAddReply)(nil), "sr_mpls_policy_add_reply_e8d4e804")
+ api.RegisterMessage((*SrMplsPolicyAssignEndpointColor)(nil), "sr_mpls_policy_assign_endpoint_color_6c82a6da")
+ api.RegisterMessage((*SrMplsPolicyAssignEndpointColorReply)(nil), "sr_mpls_policy_assign_endpoint_color_reply_e8d4e804")
+ api.RegisterMessage((*SrMplsPolicyDel)(nil), "sr_mpls_policy_del_e29d34fa")
+ api.RegisterMessage((*SrMplsPolicyDelReply)(nil), "sr_mpls_policy_del_reply_e8d4e804")
+ api.RegisterMessage((*SrMplsPolicyMod)(nil), "sr_mpls_policy_mod_09d338ac")
+ api.RegisterMessage((*SrMplsPolicyModReply)(nil), "sr_mpls_policy_mod_reply_e8d4e804")
+ api.RegisterMessage((*SrMplsSteeringAddDel)(nil), "sr_mpls_steering_add_del_1591f94a")
+ api.RegisterMessage((*SrMplsSteeringAddDelReply)(nil), "sr_mpls_steering_add_del_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SrMplsPolicyAdd)(nil),
+ (*SrMplsPolicyAddReply)(nil),
+ (*SrMplsPolicyAssignEndpointColor)(nil),
+ (*SrMplsPolicyAssignEndpointColorReply)(nil),
+ (*SrMplsPolicyDel)(nil),
+ (*SrMplsPolicyDelReply)(nil),
+ (*SrMplsPolicyMod)(nil),
+ (*SrMplsPolicyModReply)(nil),
+ (*SrMplsSteeringAddDel)(nil),
+ (*SrMplsSteeringAddDelReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/sr_mpls/sr_mpls_rpc.ba.go b/internal/testbinapi/binapi2001/sr_mpls/sr_mpls_rpc.ba.go
new file mode 100644
index 0000000..8669e70
--- /dev/null
+++ b/internal/testbinapi/binapi2001/sr_mpls/sr_mpls_rpc.ba.go
@@ -0,0 +1,70 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package sr_mpls
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service sr_mpls.
+type RPCService interface {
+ SrMplsPolicyAdd(ctx context.Context, in *SrMplsPolicyAdd) (*SrMplsPolicyAddReply, error)
+ SrMplsPolicyAssignEndpointColor(ctx context.Context, in *SrMplsPolicyAssignEndpointColor) (*SrMplsPolicyAssignEndpointColorReply, error)
+ SrMplsPolicyDel(ctx context.Context, in *SrMplsPolicyDel) (*SrMplsPolicyDelReply, error)
+ SrMplsPolicyMod(ctx context.Context, in *SrMplsPolicyMod) (*SrMplsPolicyModReply, error)
+ SrMplsSteeringAddDel(ctx context.Context, in *SrMplsSteeringAddDel) (*SrMplsSteeringAddDelReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SrMplsPolicyAdd(ctx context.Context, in *SrMplsPolicyAdd) (*SrMplsPolicyAddReply, error) {
+ out := new(SrMplsPolicyAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SrMplsPolicyAssignEndpointColor(ctx context.Context, in *SrMplsPolicyAssignEndpointColor) (*SrMplsPolicyAssignEndpointColorReply, error) {
+ out := new(SrMplsPolicyAssignEndpointColorReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SrMplsPolicyDel(ctx context.Context, in *SrMplsPolicyDel) (*SrMplsPolicyDelReply, error) {
+ out := new(SrMplsPolicyDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SrMplsPolicyMod(ctx context.Context, in *SrMplsPolicyMod) (*SrMplsPolicyModReply, error) {
+ out := new(SrMplsPolicyModReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SrMplsSteeringAddDel(ctx context.Context, in *SrMplsSteeringAddDel) (*SrMplsSteeringAddDelReply, error) {
+ out := new(SrMplsSteeringAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/stn/stn.ba.go b/internal/testbinapi/binapi2001/stn/stn.ba.go
new file mode 100644
index 0000000..25b7dcd
--- /dev/null
+++ b/internal/testbinapi/binapi2001/stn/stn.ba.go
@@ -0,0 +1,1012 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/stn.api.json
+
+// Package stn contains generated bindings for API file stn.api.
+//
+// Contents:
+// 6 aliases
+// 10 enums
+// 6 structs
+// 1 union
+// 4 messages
+//
+package stn
+
+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 = "stn"
+ APIVersion = "2.0.0"
+ VersionCrc = 0x619d8f3
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// StnAddDelRule defines message 'stn_add_del_rule'.
+type StnAddDelRule struct {
+ IPAddress Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *StnAddDelRule) Reset() { *m = StnAddDelRule{} }
+func (*StnAddDelRule) GetMessageName() string { return "stn_add_del_rule" }
+func (*StnAddDelRule) GetCrcString() string { return "53f751e6" }
+func (*StnAddDelRule) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *StnAddDelRule) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.IPAddress.Af
+ size += 1 * 16 // m.IPAddress.Un
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *StnAddDelRule) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.IPAddress.Af))
+ buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *StnAddDelRule) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IPAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsAdd = buf.DecodeBool()
+ return nil
+}
+
+// StnAddDelRuleReply defines message 'stn_add_del_rule_reply'.
+type StnAddDelRuleReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *StnAddDelRuleReply) Reset() { *m = StnAddDelRuleReply{} }
+func (*StnAddDelRuleReply) GetMessageName() string { return "stn_add_del_rule_reply" }
+func (*StnAddDelRuleReply) GetCrcString() string { return "e8d4e804" }
+func (*StnAddDelRuleReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *StnAddDelRuleReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *StnAddDelRuleReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// StnRulesDetails defines message 'stn_rules_details'.
+type StnRulesDetails struct {
+ IPAddress Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *StnRulesDetails) Reset() { *m = StnRulesDetails{} }
+func (*StnRulesDetails) GetMessageName() string { return "stn_rules_details" }
+func (*StnRulesDetails) GetCrcString() string { return "b0f6606c" }
+func (*StnRulesDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *StnRulesDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.IPAddress.Af
+ size += 1 * 16 // m.IPAddress.Un
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *StnRulesDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.IPAddress.Af))
+ buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *StnRulesDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IPAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// StnRulesDump defines message 'stn_rules_dump'.
+type StnRulesDump struct{}
+
+func (m *StnRulesDump) Reset() { *m = StnRulesDump{} }
+func (*StnRulesDump) GetMessageName() string { return "stn_rules_dump" }
+func (*StnRulesDump) GetCrcString() string { return "51077d14" }
+func (*StnRulesDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *StnRulesDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *StnRulesDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *StnRulesDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_stn_binapi_init() }
+func file_stn_binapi_init() {
+ api.RegisterMessage((*StnAddDelRule)(nil), "stn_add_del_rule_53f751e6")
+ api.RegisterMessage((*StnAddDelRuleReply)(nil), "stn_add_del_rule_reply_e8d4e804")
+ api.RegisterMessage((*StnRulesDetails)(nil), "stn_rules_details_b0f6606c")
+ api.RegisterMessage((*StnRulesDump)(nil), "stn_rules_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*StnAddDelRule)(nil),
+ (*StnAddDelRuleReply)(nil),
+ (*StnRulesDetails)(nil),
+ (*StnRulesDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/stn/stn_rpc.ba.go b/internal/testbinapi/binapi2001/stn/stn_rpc.ba.go
new file mode 100644
index 0000000..b638e8e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/stn/stn_rpc.ba.go
@@ -0,0 +1,73 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package stn
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service stn.
+type RPCService interface {
+ StnAddDelRule(ctx context.Context, in *StnAddDelRule) (*StnAddDelRuleReply, error)
+ StnRulesDump(ctx context.Context, in *StnRulesDump) (RPCService_StnRulesDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) StnAddDelRule(ctx context.Context, in *StnAddDelRule) (*StnAddDelRuleReply, error) {
+ out := new(StnAddDelRuleReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) StnRulesDump(ctx context.Context, in *StnRulesDump) (RPCService_StnRulesDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_StnRulesDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_StnRulesDumpClient interface {
+ Recv() (*StnRulesDetails, error)
+ api.Stream
+}
+
+type serviceClient_StnRulesDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_StnRulesDumpClient) Recv() (*StnRulesDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *StnRulesDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/svs/svs.ba.go b/internal/testbinapi/binapi2001/svs/svs.ba.go
new file mode 100644
index 0000000..7c3d7c6
--- /dev/null
+++ b/internal/testbinapi/binapi2001/svs/svs.ba.go
@@ -0,0 +1,1248 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/svs.api.json
+
+// Package svs contains generated bindings for API file svs.api.
+//
+// Contents:
+// 6 aliases
+// 10 enums
+// 6 structs
+// 1 union
+// 10 messages
+//
+package svs
+
+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 = "svs"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xf870d4cb
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// SvsDetails defines message 'svs_details'.
+type SvsDetails struct {
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+}
+
+func (m *SvsDetails) Reset() { *m = SvsDetails{} }
+func (*SvsDetails) GetMessageName() string { return "svs_details" }
+func (*SvsDetails) GetCrcString() string { return "b8523d64" }
+func (*SvsDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SvsDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.TableID
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Af
+ return size
+}
+func (m *SvsDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Af))
+ return buf.Bytes(), nil
+}
+func (m *SvsDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TableID = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Af = AddressFamily(buf.DecodeUint32())
+ return nil
+}
+
+// SvsDump defines message 'svs_dump'.
+type SvsDump struct{}
+
+func (m *SvsDump) Reset() { *m = SvsDump{} }
+func (*SvsDump) GetMessageName() string { return "svs_dump" }
+func (*SvsDump) GetCrcString() string { return "51077d14" }
+func (*SvsDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SvsDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *SvsDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *SvsDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// SvsEnableDisable defines message 'svs_enable_disable'.
+type SvsEnableDisable struct {
+ IsEnable bool `binapi:"bool,name=is_enable" json:"is_enable,omitempty"`
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *SvsEnableDisable) Reset() { *m = SvsEnableDisable{} }
+func (*SvsEnableDisable) GetMessageName() string { return "svs_enable_disable" }
+func (*SvsEnableDisable) GetCrcString() string { return "634b89d2" }
+func (*SvsEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SvsEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsEnable
+ size += 4 // m.Af
+ size += 4 // m.TableID
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *SvsEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsEnable)
+ buf.EncodeUint32(uint32(m.Af))
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *SvsEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsEnable = buf.DecodeBool()
+ m.Af = AddressFamily(buf.DecodeUint32())
+ m.TableID = buf.DecodeUint32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// SvsEnableDisableReply defines message 'svs_enable_disable_reply'.
+type SvsEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SvsEnableDisableReply) Reset() { *m = SvsEnableDisableReply{} }
+func (*SvsEnableDisableReply) GetMessageName() string { return "svs_enable_disable_reply" }
+func (*SvsEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*SvsEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SvsEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SvsEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SvsPluginGetVersion defines message 'svs_plugin_get_version'.
+type SvsPluginGetVersion struct{}
+
+func (m *SvsPluginGetVersion) Reset() { *m = SvsPluginGetVersion{} }
+func (*SvsPluginGetVersion) GetMessageName() string { return "svs_plugin_get_version" }
+func (*SvsPluginGetVersion) GetCrcString() string { return "51077d14" }
+func (*SvsPluginGetVersion) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SvsPluginGetVersion) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *SvsPluginGetVersion) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *SvsPluginGetVersion) Unmarshal(b []byte) error {
+ return nil
+}
+
+// SvsPluginGetVersionReply defines message 'svs_plugin_get_version_reply'.
+type SvsPluginGetVersionReply struct {
+ Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
+ Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
+}
+
+func (m *SvsPluginGetVersionReply) Reset() { *m = SvsPluginGetVersionReply{} }
+func (*SvsPluginGetVersionReply) GetMessageName() string { return "svs_plugin_get_version_reply" }
+func (*SvsPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
+func (*SvsPluginGetVersionReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SvsPluginGetVersionReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Major
+ size += 4 // m.Minor
+ return size
+}
+func (m *SvsPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Major)
+ buf.EncodeUint32(m.Minor)
+ return buf.Bytes(), nil
+}
+func (m *SvsPluginGetVersionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Major = buf.DecodeUint32()
+ m.Minor = buf.DecodeUint32()
+ return nil
+}
+
+// SvsRouteAddDel defines message 'svs_route_add_del'.
+type SvsRouteAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ SourceTableID uint32 `binapi:"u32,name=source_table_id" json:"source_table_id,omitempty"`
+}
+
+func (m *SvsRouteAddDel) Reset() { *m = SvsRouteAddDel{} }
+func (*SvsRouteAddDel) GetMessageName() string { return "svs_route_add_del" }
+func (*SvsRouteAddDel) GetCrcString() string { return "d39e31fc" }
+func (*SvsRouteAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SvsRouteAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Prefix.Address.Af
+ size += 1 * 16 // m.Prefix.Address.Un
+ size += 1 // m.Prefix.Len
+ size += 4 // m.TableID
+ size += 4 // m.SourceTableID
+ return size
+}
+func (m *SvsRouteAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.Prefix.Address.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
+ m.TableID = buf.DecodeUint32()
+ m.SourceTableID = buf.DecodeUint32()
+ return nil
+}
+
+// SvsRouteAddDelReply defines message 'svs_route_add_del_reply'.
+type SvsRouteAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SvsRouteAddDelReply) Reset() { *m = SvsRouteAddDelReply{} }
+func (*SvsRouteAddDelReply) GetMessageName() string { return "svs_route_add_del_reply" }
+func (*SvsRouteAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*SvsRouteAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SvsRouteAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SvsRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SvsTableAddDel defines message 'svs_table_add_del'.
+type SvsTableAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+}
+
+func (m *SvsTableAddDel) Reset() { *m = SvsTableAddDel{} }
+func (*SvsTableAddDel) GetMessageName() string { return "svs_table_add_del" }
+func (*SvsTableAddDel) GetCrcString() string { return "7d21cb2a" }
+func (*SvsTableAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SvsTableAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Af
+ size += 4 // m.TableID
+ return size
+}
+func (m *SvsTableAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.Af))
+ buf.EncodeUint32(m.TableID)
+ return buf.Bytes(), nil
+}
+func (m *SvsTableAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Af = AddressFamily(buf.DecodeUint32())
+ m.TableID = buf.DecodeUint32()
+ return nil
+}
+
+// SvsTableAddDelReply defines message 'svs_table_add_del_reply'.
+type SvsTableAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SvsTableAddDelReply) Reset() { *m = SvsTableAddDelReply{} }
+func (*SvsTableAddDelReply) GetMessageName() string { return "svs_table_add_del_reply" }
+func (*SvsTableAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*SvsTableAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SvsTableAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SvsTableAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_svs_binapi_init() }
+func file_svs_binapi_init() {
+ api.RegisterMessage((*SvsDetails)(nil), "svs_details_b8523d64")
+ api.RegisterMessage((*SvsDump)(nil), "svs_dump_51077d14")
+ api.RegisterMessage((*SvsEnableDisable)(nil), "svs_enable_disable_634b89d2")
+ api.RegisterMessage((*SvsEnableDisableReply)(nil), "svs_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*SvsPluginGetVersion)(nil), "svs_plugin_get_version_51077d14")
+ api.RegisterMessage((*SvsPluginGetVersionReply)(nil), "svs_plugin_get_version_reply_9b32cf86")
+ api.RegisterMessage((*SvsRouteAddDel)(nil), "svs_route_add_del_d39e31fc")
+ api.RegisterMessage((*SvsRouteAddDelReply)(nil), "svs_route_add_del_reply_e8d4e804")
+ api.RegisterMessage((*SvsTableAddDel)(nil), "svs_table_add_del_7d21cb2a")
+ api.RegisterMessage((*SvsTableAddDelReply)(nil), "svs_table_add_del_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SvsDetails)(nil),
+ (*SvsDump)(nil),
+ (*SvsEnableDisable)(nil),
+ (*SvsEnableDisableReply)(nil),
+ (*SvsPluginGetVersion)(nil),
+ (*SvsPluginGetVersionReply)(nil),
+ (*SvsRouteAddDel)(nil),
+ (*SvsRouteAddDelReply)(nil),
+ (*SvsTableAddDel)(nil),
+ (*SvsTableAddDelReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/svs/svs_rpc.ba.go b/internal/testbinapi/binapi2001/svs/svs_rpc.ba.go
new file mode 100644
index 0000000..7b4b13a
--- /dev/null
+++ b/internal/testbinapi/binapi2001/svs/svs_rpc.ba.go
@@ -0,0 +1,103 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package svs
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service svs.
+type RPCService interface {
+ SvsDump(ctx context.Context, in *SvsDump) (RPCService_SvsDumpClient, error)
+ SvsEnableDisable(ctx context.Context, in *SvsEnableDisable) (*SvsEnableDisableReply, error)
+ SvsPluginGetVersion(ctx context.Context, in *SvsPluginGetVersion) (*SvsPluginGetVersionReply, error)
+ SvsRouteAddDel(ctx context.Context, in *SvsRouteAddDel) (*SvsRouteAddDelReply, error)
+ SvsTableAddDel(ctx context.Context, in *SvsTableAddDel) (*SvsTableAddDelReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SvsDump(ctx context.Context, in *SvsDump) (RPCService_SvsDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SvsDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SvsDumpClient interface {
+ Recv() (*SvsDetails, error)
+ api.Stream
+}
+
+type serviceClient_SvsDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SvsDumpClient) Recv() (*SvsDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SvsDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) SvsEnableDisable(ctx context.Context, in *SvsEnableDisable) (*SvsEnableDisableReply, error) {
+ out := new(SvsEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SvsPluginGetVersion(ctx context.Context, in *SvsPluginGetVersion) (*SvsPluginGetVersionReply, error) {
+ out := new(SvsPluginGetVersionReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SvsRouteAddDel(ctx context.Context, in *SvsRouteAddDel) (*SvsRouteAddDelReply, error) {
+ out := new(SvsRouteAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SvsTableAddDel(ctx context.Context, in *SvsTableAddDel) (*SvsTableAddDelReply, error) {
+ out := new(SvsTableAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/syslog/syslog.ba.go b/internal/testbinapi/binapi2001/syslog/syslog.ba.go
new file mode 100644
index 0000000..c9fd0f7
--- /dev/null
+++ b/internal/testbinapi/binapi2001/syslog/syslog.ba.go
@@ -0,0 +1,959 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/syslog.api.json
+
+// Package syslog contains generated bindings for API file syslog.api.
+//
+// Contents:
+// 5 aliases
+// 5 enums
+// 6 structs
+// 1 union
+// 8 messages
+//
+package syslog
+
+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 = "syslog"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xb0790f43
+)
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SyslogSeverity defines enum 'syslog_severity'.
+type SyslogSeverity uint32
+
+const (
+ SYSLOG_API_SEVERITY_EMERG SyslogSeverity = 0
+ SYSLOG_API_SEVERITY_ALERT SyslogSeverity = 1
+ SYSLOG_API_SEVERITY_CRIT SyslogSeverity = 2
+ SYSLOG_API_SEVERITY_ERR SyslogSeverity = 3
+ SYSLOG_API_SEVERITY_WARN SyslogSeverity = 4
+ SYSLOG_API_SEVERITY_NOTICE SyslogSeverity = 5
+ SYSLOG_API_SEVERITY_INFO SyslogSeverity = 6
+ SYSLOG_API_SEVERITY_DBG SyslogSeverity = 7
+)
+
+var (
+ SyslogSeverity_name = map[uint32]string{
+ 0: "SYSLOG_API_SEVERITY_EMERG",
+ 1: "SYSLOG_API_SEVERITY_ALERT",
+ 2: "SYSLOG_API_SEVERITY_CRIT",
+ 3: "SYSLOG_API_SEVERITY_ERR",
+ 4: "SYSLOG_API_SEVERITY_WARN",
+ 5: "SYSLOG_API_SEVERITY_NOTICE",
+ 6: "SYSLOG_API_SEVERITY_INFO",
+ 7: "SYSLOG_API_SEVERITY_DBG",
+ }
+ SyslogSeverity_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SyslogSeverity) String() string {
+ s, ok := SyslogSeverity_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "SyslogSeverity(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// SyslogGetFilter defines message 'syslog_get_filter'.
+type SyslogGetFilter struct{}
+
+func (m *SyslogGetFilter) Reset() { *m = SyslogGetFilter{} }
+func (*SyslogGetFilter) GetMessageName() string { return "syslog_get_filter" }
+func (*SyslogGetFilter) GetCrcString() string { return "51077d14" }
+func (*SyslogGetFilter) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SyslogGetFilter) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *SyslogGetFilter) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *SyslogGetFilter) Unmarshal(b []byte) error {
+ return nil
+}
+
+// SyslogGetFilterReply defines message 'syslog_get_filter_reply'.
+type SyslogGetFilterReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Severity SyslogSeverity `binapi:"syslog_severity,name=severity" json:"severity,omitempty"`
+}
+
+func (m *SyslogGetFilterReply) Reset() { *m = SyslogGetFilterReply{} }
+func (*SyslogGetFilterReply) GetMessageName() string { return "syslog_get_filter_reply" }
+func (*SyslogGetFilterReply) GetCrcString() string { return "eb1833f8" }
+func (*SyslogGetFilterReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SyslogGetFilterReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.Severity
+ return size
+}
+func (m *SyslogGetFilterReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.Severity = SyslogSeverity(buf.DecodeUint32())
+ return nil
+}
+
+// SyslogGetSender defines message 'syslog_get_sender'.
+type SyslogGetSender struct{}
+
+func (m *SyslogGetSender) Reset() { *m = SyslogGetSender{} }
+func (*SyslogGetSender) GetMessageName() string { return "syslog_get_sender" }
+func (*SyslogGetSender) GetCrcString() string { return "51077d14" }
+func (*SyslogGetSender) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SyslogGetSender) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *SyslogGetSender) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *SyslogGetSender) Unmarshal(b []byte) error {
+ return nil
+}
+
+// SyslogGetSenderReply defines message 'syslog_get_sender_reply'.
+type SyslogGetSenderReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SrcAddress IP4Address `binapi:"ip4_address,name=src_address" json:"src_address,omitempty"`
+ CollectorAddress IP4Address `binapi:"ip4_address,name=collector_address" json:"collector_address,omitempty"`
+ CollectorPort uint16 `binapi:"u16,name=collector_port" json:"collector_port,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ MaxMsgSize uint32 `binapi:"u32,name=max_msg_size" json:"max_msg_size,omitempty"`
+}
+
+func (m *SyslogGetSenderReply) Reset() { *m = SyslogGetSenderReply{} }
+func (*SyslogGetSenderReply) GetMessageName() string { return "syslog_get_sender_reply" }
+func (*SyslogGetSenderReply) GetCrcString() string { return "d3da60ac" }
+func (*SyslogGetSenderReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SyslogGetSenderReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 * 4 // m.SrcAddress
+ size += 1 * 4 // m.CollectorAddress
+ size += 2 // m.CollectorPort
+ size += 4 // m.VrfID
+ size += 4 // m.MaxMsgSize
+ return size
+}
+func (m *SyslogGetSenderReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeBytes(m.SrcAddress[:], 4)
+ buf.EncodeBytes(m.CollectorAddress[:], 4)
+ 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 = buf.DecodeInt32()
+ copy(m.SrcAddress[:], buf.DecodeBytes(4))
+ copy(m.CollectorAddress[:], buf.DecodeBytes(4))
+ m.CollectorPort = buf.DecodeUint16()
+ m.VrfID = buf.DecodeUint32()
+ m.MaxMsgSize = buf.DecodeUint32()
+ return nil
+}
+
+// SyslogSetFilter defines message 'syslog_set_filter'.
+type SyslogSetFilter struct {
+ Severity SyslogSeverity `binapi:"syslog_severity,name=severity" json:"severity,omitempty"`
+}
+
+func (m *SyslogSetFilter) Reset() { *m = SyslogSetFilter{} }
+func (*SyslogSetFilter) GetMessageName() string { return "syslog_set_filter" }
+func (*SyslogSetFilter) GetCrcString() string { return "571348c3" }
+func (*SyslogSetFilter) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SyslogSetFilter) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Severity
+ return size
+}
+func (m *SyslogSetFilter) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Severity))
+ return buf.Bytes(), nil
+}
+func (m *SyslogSetFilter) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Severity = SyslogSeverity(buf.DecodeUint32())
+ return nil
+}
+
+// SyslogSetFilterReply defines message 'syslog_set_filter_reply'.
+type SyslogSetFilterReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SyslogSetFilterReply) Reset() { *m = SyslogSetFilterReply{} }
+func (*SyslogSetFilterReply) GetMessageName() string { return "syslog_set_filter_reply" }
+func (*SyslogSetFilterReply) GetCrcString() string { return "e8d4e804" }
+func (*SyslogSetFilterReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SyslogSetFilterReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SyslogSetFilterReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SyslogSetSender defines message 'syslog_set_sender'.
+type SyslogSetSender struct {
+ SrcAddress IP4Address `binapi:"ip4_address,name=src_address" json:"src_address,omitempty"`
+ CollectorAddress IP4Address `binapi:"ip4_address,name=collector_address" json:"collector_address,omitempty"`
+ CollectorPort uint16 `binapi:"u16,name=collector_port" json:"collector_port,omitempty"`
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ MaxMsgSize uint32 `binapi:"u32,name=max_msg_size" json:"max_msg_size,omitempty"`
+}
+
+func (m *SyslogSetSender) Reset() { *m = SyslogSetSender{} }
+func (*SyslogSetSender) GetMessageName() string { return "syslog_set_sender" }
+func (*SyslogSetSender) GetCrcString() string { return "bb641285" }
+func (*SyslogSetSender) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SyslogSetSender) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 * 4 // m.SrcAddress
+ size += 1 * 4 // m.CollectorAddress
+ size += 2 // m.CollectorPort
+ size += 4 // m.VrfID
+ size += 4 // m.MaxMsgSize
+ return size
+}
+func (m *SyslogSetSender) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.SrcAddress[:], 4)
+ buf.EncodeBytes(m.CollectorAddress[:], 4)
+ buf.EncodeUint16(m.CollectorPort)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeUint32(m.MaxMsgSize)
+ return buf.Bytes(), nil
+}
+func (m *SyslogSetSender) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ copy(m.SrcAddress[:], buf.DecodeBytes(4))
+ copy(m.CollectorAddress[:], buf.DecodeBytes(4))
+ m.CollectorPort = buf.DecodeUint16()
+ m.VrfID = buf.DecodeUint32()
+ m.MaxMsgSize = buf.DecodeUint32()
+ return nil
+}
+
+// SyslogSetSenderReply defines message 'syslog_set_sender_reply'.
+type SyslogSetSenderReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SyslogSetSenderReply) Reset() { *m = SyslogSetSenderReply{} }
+func (*SyslogSetSenderReply) GetMessageName() string { return "syslog_set_sender_reply" }
+func (*SyslogSetSenderReply) GetCrcString() string { return "e8d4e804" }
+func (*SyslogSetSenderReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SyslogSetSenderReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SyslogSetSenderReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_syslog_binapi_init() }
+func file_syslog_binapi_init() {
+ api.RegisterMessage((*SyslogGetFilter)(nil), "syslog_get_filter_51077d14")
+ api.RegisterMessage((*SyslogGetFilterReply)(nil), "syslog_get_filter_reply_eb1833f8")
+ api.RegisterMessage((*SyslogGetSender)(nil), "syslog_get_sender_51077d14")
+ api.RegisterMessage((*SyslogGetSenderReply)(nil), "syslog_get_sender_reply_d3da60ac")
+ api.RegisterMessage((*SyslogSetFilter)(nil), "syslog_set_filter_571348c3")
+ api.RegisterMessage((*SyslogSetFilterReply)(nil), "syslog_set_filter_reply_e8d4e804")
+ api.RegisterMessage((*SyslogSetSender)(nil), "syslog_set_sender_bb641285")
+ api.RegisterMessage((*SyslogSetSenderReply)(nil), "syslog_set_sender_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SyslogGetFilter)(nil),
+ (*SyslogGetFilterReply)(nil),
+ (*SyslogGetSender)(nil),
+ (*SyslogGetSenderReply)(nil),
+ (*SyslogSetFilter)(nil),
+ (*SyslogSetFilterReply)(nil),
+ (*SyslogSetSender)(nil),
+ (*SyslogSetSenderReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/syslog/syslog_rpc.ba.go b/internal/testbinapi/binapi2001/syslog/syslog_rpc.ba.go
new file mode 100644
index 0000000..a1f4a27
--- /dev/null
+++ b/internal/testbinapi/binapi2001/syslog/syslog_rpc.ba.go
@@ -0,0 +1,60 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package syslog
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service syslog.
+type RPCService interface {
+ SyslogGetFilter(ctx context.Context, in *SyslogGetFilter) (*SyslogGetFilterReply, error)
+ SyslogGetSender(ctx context.Context, in *SyslogGetSender) (*SyslogGetSenderReply, error)
+ SyslogSetFilter(ctx context.Context, in *SyslogSetFilter) (*SyslogSetFilterReply, error)
+ SyslogSetSender(ctx context.Context, in *SyslogSetSender) (*SyslogSetSenderReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SyslogGetFilter(ctx context.Context, in *SyslogGetFilter) (*SyslogGetFilterReply, error) {
+ out := new(SyslogGetFilterReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SyslogGetSender(ctx context.Context, in *SyslogGetSender) (*SyslogGetSenderReply, error) {
+ out := new(SyslogGetSenderReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SyslogSetFilter(ctx context.Context, in *SyslogSetFilter) (*SyslogSetFilterReply, error) {
+ out := new(SyslogSetFilterReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SyslogSetSender(ctx context.Context, in *SyslogSetSender) (*SyslogSetSenderReply, error) {
+ out := new(SyslogSetSenderReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/tapv2/tapv2.ba.go b/internal/testbinapi/binapi2001/tapv2/tapv2.ba.go
new file mode 100644
index 0000000..36898ea
--- /dev/null
+++ b/internal/testbinapi/binapi2001/tapv2/tapv2.ba.go
@@ -0,0 +1,1310 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/tapv2.api.json
+
+// Package tapv2 contains generated bindings for API file tapv2.api.
+//
+// Contents:
+// 7 aliases
+// 11 enums
+// 6 structs
+// 1 union
+// 6 messages
+//
+package tapv2
+
+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 = "tapv2"
+ APIVersion = "3.0.0"
+ VersionCrc = 0x7d58f9a4
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// TapFlags defines enum 'tap_flags'.
+type TapFlags uint32
+
+const (
+ TAP_FLAG_GSO TapFlags = 1
+ TAP_FLAG_CSUM_OFFLOAD TapFlags = 2
+)
+
+var (
+ TapFlags_name = map[uint32]string{
+ 1: "TAP_FLAG_GSO",
+ 2: "TAP_FLAG_CSUM_OFFLOAD",
+ }
+ TapFlags_value = map[string]uint32{
+ "TAP_FLAG_GSO": 1,
+ "TAP_FLAG_CSUM_OFFLOAD": 2,
+ }
+)
+
+func (x TapFlags) String() string {
+ s, ok := TapFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := TapFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "TapFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// SwInterfaceTapV2Details defines message 'sw_interface_tap_v2_details'.
+type SwInterfaceTapV2Details struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+ TxRingSz uint16 `binapi:"u16,name=tx_ring_sz" json:"tx_ring_sz,omitempty"`
+ RxRingSz uint16 `binapi:"u16,name=rx_ring_sz" json:"rx_ring_sz,omitempty"`
+ HostMtuSize uint32 `binapi:"u32,name=host_mtu_size" json:"host_mtu_size,omitempty"`
+ HostMacAddr MacAddress `binapi:"mac_address,name=host_mac_addr" json:"host_mac_addr,omitempty"`
+ HostIP4Prefix IP4AddressWithPrefix `binapi:"ip4_address_with_prefix,name=host_ip4_prefix" json:"host_ip4_prefix,omitempty"`
+ HostIP6Prefix IP6AddressWithPrefix `binapi:"ip6_address_with_prefix,name=host_ip6_prefix" json:"host_ip6_prefix,omitempty"`
+ TapFlags TapFlags `binapi:"tap_flags,name=tap_flags" json:"tap_flags,omitempty"`
+ DevName string `binapi:"string[64],name=dev_name" json:"dev_name,omitempty"`
+ HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
+ HostNamespace string `binapi:"string[64],name=host_namespace" json:"host_namespace,omitempty"`
+ HostBridge string `binapi:"string[64],name=host_bridge" json:"host_bridge,omitempty"`
+}
+
+func (m *SwInterfaceTapV2Details) Reset() { *m = SwInterfaceTapV2Details{} }
+func (*SwInterfaceTapV2Details) GetMessageName() string { return "sw_interface_tap_v2_details" }
+func (*SwInterfaceTapV2Details) GetCrcString() string { return "e53c16de" }
+func (*SwInterfaceTapV2Details) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceTapV2Details) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.ID
+ size += 2 // m.TxRingSz
+ size += 2 // m.RxRingSz
+ size += 4 // m.HostMtuSize
+ size += 1 * 6 // m.HostMacAddr
+ size += 1 * 4 // m.HostIP4Prefix.Address
+ size += 1 // m.HostIP4Prefix.Len
+ size += 1 * 16 // m.HostIP6Prefix.Address
+ size += 1 // m.HostIP6Prefix.Len
+ size += 4 // m.TapFlags
+ size += 64 // m.DevName
+ size += 64 // m.HostIfName
+ size += 64 // m.HostNamespace
+ size += 64 // m.HostBridge
+ return size
+}
+func (m *SwInterfaceTapV2Details) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(m.HostIP4Prefix.Len)
+ buf.EncodeBytes(m.HostIP6Prefix.Address[:], 16)
+ buf.EncodeUint8(m.HostIP6Prefix.Len)
+ buf.EncodeUint32(uint32(m.TapFlags))
+ buf.EncodeString(m.DevName, 64)
+ buf.EncodeString(m.HostIfName, 64)
+ buf.EncodeString(m.HostNamespace, 64)
+ buf.EncodeString(m.HostBridge, 64)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceTapV2Details) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.ID = buf.DecodeUint32()
+ m.TxRingSz = buf.DecodeUint16()
+ m.RxRingSz = buf.DecodeUint16()
+ m.HostMtuSize = buf.DecodeUint32()
+ copy(m.HostMacAddr[:], buf.DecodeBytes(6))
+ copy(m.HostIP4Prefix.Address[:], buf.DecodeBytes(4))
+ m.HostIP4Prefix.Len = buf.DecodeUint8()
+ copy(m.HostIP6Prefix.Address[:], buf.DecodeBytes(16))
+ m.HostIP6Prefix.Len = buf.DecodeUint8()
+ m.TapFlags = TapFlags(buf.DecodeUint32())
+ m.DevName = buf.DecodeString(64)
+ m.HostIfName = buf.DecodeString(64)
+ m.HostNamespace = buf.DecodeString(64)
+ m.HostBridge = buf.DecodeString(64)
+ return nil
+}
+
+// SwInterfaceTapV2Dump defines message 'sw_interface_tap_v2_dump'.
+type SwInterfaceTapV2Dump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
+}
+
+func (m *SwInterfaceTapV2Dump) Reset() { *m = SwInterfaceTapV2Dump{} }
+func (*SwInterfaceTapV2Dump) GetMessageName() string { return "sw_interface_tap_v2_dump" }
+func (*SwInterfaceTapV2Dump) GetCrcString() string { return "f9e6675e" }
+func (*SwInterfaceTapV2Dump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceTapV2Dump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *SwInterfaceTapV2Dump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceTapV2Dump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// TapCreateV2 defines message 'tap_create_v2'.
+type TapCreateV2 struct {
+ 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 MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ NumRxQueues uint8 `binapi:"u8,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"`
+ TxRingSz uint16 `binapi:"u16,name=tx_ring_sz" json:"tx_ring_sz,omitempty"`
+ RxRingSz uint16 `binapi:"u16,name=rx_ring_sz" 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"`
+ HostMacAddr MacAddress `binapi:"mac_address,name=host_mac_addr" json:"host_mac_addr,omitempty"`
+ HostIP4PrefixSet bool `binapi:"bool,name=host_ip4_prefix_set" json:"host_ip4_prefix_set,omitempty"`
+ HostIP4Prefix IP4AddressWithPrefix `binapi:"ip4_address_with_prefix,name=host_ip4_prefix" json:"host_ip4_prefix,omitempty"`
+ HostIP6PrefixSet bool `binapi:"bool,name=host_ip6_prefix_set" json:"host_ip6_prefix_set,omitempty"`
+ HostIP6Prefix IP6AddressWithPrefix `binapi:"ip6_address_with_prefix,name=host_ip6_prefix" json:"host_ip6_prefix,omitempty"`
+ HostIP4GwSet bool `binapi:"bool,name=host_ip4_gw_set" json:"host_ip4_gw_set,omitempty"`
+ HostIP4Gw IP4Address `binapi:"ip4_address,name=host_ip4_gw" json:"host_ip4_gw,omitempty"`
+ HostIP6GwSet bool `binapi:"bool,name=host_ip6_gw_set" json:"host_ip6_gw_set,omitempty"`
+ HostIP6Gw IP6Address `binapi:"ip6_address,name=host_ip6_gw" json:"host_ip6_gw,omitempty"`
+ TapFlags TapFlags `binapi:"tap_flags,name=tap_flags" json:"tap_flags,omitempty"`
+ HostNamespaceSet bool `binapi:"bool,name=host_namespace_set" json:"host_namespace_set,omitempty"`
+ HostNamespace string `binapi:"string[64],name=host_namespace" json:"host_namespace,omitempty"`
+ HostIfNameSet bool `binapi:"bool,name=host_if_name_set" json:"host_if_name_set,omitempty"`
+ HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
+ HostBridgeSet bool `binapi:"bool,name=host_bridge_set" json:"host_bridge_set,omitempty"`
+ HostBridge string `binapi:"string[64],name=host_bridge" json:"host_bridge,omitempty"`
+ Tag string `binapi:"string[],name=tag" json:"tag,omitempty"`
+}
+
+func (m *TapCreateV2) Reset() { *m = TapCreateV2{} }
+func (*TapCreateV2) GetMessageName() string { return "tap_create_v2" }
+func (*TapCreateV2) GetCrcString() string { return "445835fd" }
+func (*TapCreateV2) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *TapCreateV2) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ID
+ size += 1 // m.UseRandomMac
+ size += 1 * 6 // m.MacAddress
+ size += 1 // m.NumRxQueues
+ size += 2 // m.TxRingSz
+ size += 2 // m.RxRingSz
+ size += 1 // m.HostMtuSet
+ size += 4 // m.HostMtuSize
+ size += 1 // m.HostMacAddrSet
+ size += 1 * 6 // m.HostMacAddr
+ size += 1 // m.HostIP4PrefixSet
+ size += 1 * 4 // m.HostIP4Prefix.Address
+ size += 1 // m.HostIP4Prefix.Len
+ size += 1 // m.HostIP6PrefixSet
+ size += 1 * 16 // m.HostIP6Prefix.Address
+ size += 1 // m.HostIP6Prefix.Len
+ size += 1 // m.HostIP4GwSet
+ size += 1 * 4 // m.HostIP4Gw
+ size += 1 // m.HostIP6GwSet
+ size += 1 * 16 // m.HostIP6Gw
+ size += 4 // m.TapFlags
+ size += 1 // m.HostNamespaceSet
+ size += 64 // m.HostNamespace
+ size += 1 // m.HostIfNameSet
+ size += 64 // m.HostIfName
+ size += 1 // m.HostBridgeSet
+ size += 64 // m.HostBridge
+ size += 4 + len(m.Tag) // m.Tag
+ return size
+}
+func (m *TapCreateV2) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ID)
+ buf.EncodeBool(m.UseRandomMac)
+ buf.EncodeBytes(m.MacAddress[:], 6)
+ buf.EncodeUint8(m.NumRxQueues)
+ buf.EncodeUint16(m.TxRingSz)
+ buf.EncodeUint16(m.RxRingSz)
+ buf.EncodeBool(m.HostMtuSet)
+ 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(m.HostIP4Prefix.Len)
+ buf.EncodeBool(m.HostIP6PrefixSet)
+ buf.EncodeBytes(m.HostIP6Prefix.Address[:], 16)
+ buf.EncodeUint8(m.HostIP6Prefix.Len)
+ buf.EncodeBool(m.HostIP4GwSet)
+ buf.EncodeBytes(m.HostIP4Gw[:], 4)
+ buf.EncodeBool(m.HostIP6GwSet)
+ buf.EncodeBytes(m.HostIP6Gw[:], 16)
+ buf.EncodeUint32(uint32(m.TapFlags))
+ buf.EncodeBool(m.HostNamespaceSet)
+ buf.EncodeString(m.HostNamespace, 64)
+ buf.EncodeBool(m.HostIfNameSet)
+ buf.EncodeString(m.HostIfName, 64)
+ buf.EncodeBool(m.HostBridgeSet)
+ buf.EncodeString(m.HostBridge, 64)
+ buf.EncodeString(m.Tag, 0)
+ return buf.Bytes(), nil
+}
+func (m *TapCreateV2) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint32()
+ m.UseRandomMac = buf.DecodeBool()
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ m.NumRxQueues = buf.DecodeUint8()
+ m.TxRingSz = buf.DecodeUint16()
+ m.RxRingSz = buf.DecodeUint16()
+ m.HostMtuSet = buf.DecodeBool()
+ m.HostMtuSize = buf.DecodeUint32()
+ m.HostMacAddrSet = buf.DecodeBool()
+ copy(m.HostMacAddr[:], buf.DecodeBytes(6))
+ m.HostIP4PrefixSet = buf.DecodeBool()
+ copy(m.HostIP4Prefix.Address[:], buf.DecodeBytes(4))
+ m.HostIP4Prefix.Len = buf.DecodeUint8()
+ m.HostIP6PrefixSet = buf.DecodeBool()
+ copy(m.HostIP6Prefix.Address[:], buf.DecodeBytes(16))
+ m.HostIP6Prefix.Len = buf.DecodeUint8()
+ m.HostIP4GwSet = buf.DecodeBool()
+ copy(m.HostIP4Gw[:], buf.DecodeBytes(4))
+ m.HostIP6GwSet = buf.DecodeBool()
+ copy(m.HostIP6Gw[:], buf.DecodeBytes(16))
+ m.TapFlags = TapFlags(buf.DecodeUint32())
+ m.HostNamespaceSet = buf.DecodeBool()
+ m.HostNamespace = buf.DecodeString(64)
+ m.HostIfNameSet = buf.DecodeBool()
+ m.HostIfName = buf.DecodeString(64)
+ m.HostBridgeSet = buf.DecodeBool()
+ m.HostBridge = buf.DecodeString(64)
+ m.Tag = buf.DecodeString(0)
+ return nil
+}
+
+// TapCreateV2Reply defines message 'tap_create_v2_reply'.
+type TapCreateV2Reply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *TapCreateV2Reply) Reset() { *m = TapCreateV2Reply{} }
+func (*TapCreateV2Reply) GetMessageName() string { return "tap_create_v2_reply" }
+func (*TapCreateV2Reply) GetCrcString() string { return "5383d31f" }
+func (*TapCreateV2Reply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *TapCreateV2Reply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *TapCreateV2Reply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// TapDeleteV2 defines message 'tap_delete_v2'.
+type TapDeleteV2 struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *TapDeleteV2) Reset() { *m = TapDeleteV2{} }
+func (*TapDeleteV2) GetMessageName() string { return "tap_delete_v2" }
+func (*TapDeleteV2) GetCrcString() string { return "f9e6675e" }
+func (*TapDeleteV2) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *TapDeleteV2) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *TapDeleteV2) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *TapDeleteV2) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// TapDeleteV2Reply defines message 'tap_delete_v2_reply'.
+type TapDeleteV2Reply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *TapDeleteV2Reply) Reset() { *m = TapDeleteV2Reply{} }
+func (*TapDeleteV2Reply) GetMessageName() string { return "tap_delete_v2_reply" }
+func (*TapDeleteV2Reply) GetCrcString() string { return "e8d4e804" }
+func (*TapDeleteV2Reply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *TapDeleteV2Reply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *TapDeleteV2Reply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_tapv2_binapi_init() }
+func file_tapv2_binapi_init() {
+ api.RegisterMessage((*SwInterfaceTapV2Details)(nil), "sw_interface_tap_v2_details_e53c16de")
+ api.RegisterMessage((*SwInterfaceTapV2Dump)(nil), "sw_interface_tap_v2_dump_f9e6675e")
+ api.RegisterMessage((*TapCreateV2)(nil), "tap_create_v2_445835fd")
+ api.RegisterMessage((*TapCreateV2Reply)(nil), "tap_create_v2_reply_5383d31f")
+ api.RegisterMessage((*TapDeleteV2)(nil), "tap_delete_v2_f9e6675e")
+ api.RegisterMessage((*TapDeleteV2Reply)(nil), "tap_delete_v2_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SwInterfaceTapV2Details)(nil),
+ (*SwInterfaceTapV2Dump)(nil),
+ (*TapCreateV2)(nil),
+ (*TapCreateV2Reply)(nil),
+ (*TapDeleteV2)(nil),
+ (*TapDeleteV2Reply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/tapv2/tapv2_rpc.ba.go b/internal/testbinapi/binapi2001/tapv2/tapv2_rpc.ba.go
new file mode 100644
index 0000000..b6c5349
--- /dev/null
+++ b/internal/testbinapi/binapi2001/tapv2/tapv2_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package tapv2
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service tapv2.
+type RPCService interface {
+ SwInterfaceTapV2Dump(ctx context.Context, in *SwInterfaceTapV2Dump) (RPCService_SwInterfaceTapV2DumpClient, error)
+ TapCreateV2(ctx context.Context, in *TapCreateV2) (*TapCreateV2Reply, error)
+ TapDeleteV2(ctx context.Context, in *TapDeleteV2) (*TapDeleteV2Reply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SwInterfaceTapV2Dump(ctx context.Context, in *SwInterfaceTapV2Dump) (RPCService_SwInterfaceTapV2DumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwInterfaceTapV2DumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwInterfaceTapV2DumpClient interface {
+ Recv() (*SwInterfaceTapV2Details, error)
+ api.Stream
+}
+
+type serviceClient_SwInterfaceTapV2DumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwInterfaceTapV2DumpClient) Recv() (*SwInterfaceTapV2Details, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwInterfaceTapV2Details:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) TapCreateV2(ctx context.Context, in *TapCreateV2) (*TapCreateV2Reply, error) {
+ out := new(TapCreateV2Reply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) TapDeleteV2(ctx context.Context, in *TapDeleteV2) (*TapDeleteV2Reply, error) {
+ out := new(TapDeleteV2Reply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/tcp/tcp.ba.go b/internal/testbinapi/binapi2001/tcp/tcp.ba.go
new file mode 100644
index 0000000..05fcf37
--- /dev/null
+++ b/internal/testbinapi/binapi2001/tcp/tcp.ba.go
@@ -0,0 +1,692 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/tcp.api.json
+
+// Package tcp contains generated bindings for API file tcp.api.
+//
+// Contents:
+// 5 aliases
+// 4 enums
+// 6 structs
+// 1 union
+// 2 messages
+//
+package tcp
+
+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 = "tcp"
+ APIVersion = "2.0.0"
+ VersionCrc = 0x4d731ac5
+)
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// TCPConfigureSrcAddresses defines message 'tcp_configure_src_addresses'.
+type TCPConfigureSrcAddresses struct {
+ VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
+ FirstAddress Address `binapi:"address,name=first_address" json:"first_address,omitempty"`
+ LastAddress Address `binapi:"address,name=last_address" json:"last_address,omitempty"`
+}
+
+func (m *TCPConfigureSrcAddresses) Reset() { *m = TCPConfigureSrcAddresses{} }
+func (*TCPConfigureSrcAddresses) GetMessageName() string { return "tcp_configure_src_addresses" }
+func (*TCPConfigureSrcAddresses) GetCrcString() string { return "4b02b946" }
+func (*TCPConfigureSrcAddresses) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *TCPConfigureSrcAddresses) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.VrfID
+ size += 4 // m.FirstAddress.Af
+ size += 1 * 16 // m.FirstAddress.Un
+ size += 4 // m.LastAddress.Af
+ size += 1 * 16 // m.LastAddress.Un
+ return size
+}
+func (m *TCPConfigureSrcAddresses) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeUint32(uint32(m.FirstAddress.Af))
+ buf.EncodeBytes(m.FirstAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.LastAddress.Af))
+ buf.EncodeBytes(m.LastAddress.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *TCPConfigureSrcAddresses) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.VrfID = buf.DecodeUint32()
+ m.FirstAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.FirstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.LastAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.LastAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// TCPConfigureSrcAddressesReply defines message 'tcp_configure_src_addresses_reply'.
+type TCPConfigureSrcAddressesReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *TCPConfigureSrcAddressesReply) Reset() { *m = TCPConfigureSrcAddressesReply{} }
+func (*TCPConfigureSrcAddressesReply) GetMessageName() string {
+ return "tcp_configure_src_addresses_reply"
+}
+func (*TCPConfigureSrcAddressesReply) GetCrcString() string { return "e8d4e804" }
+func (*TCPConfigureSrcAddressesReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *TCPConfigureSrcAddressesReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *TCPConfigureSrcAddressesReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_tcp_binapi_init() }
+func file_tcp_binapi_init() {
+ api.RegisterMessage((*TCPConfigureSrcAddresses)(nil), "tcp_configure_src_addresses_4b02b946")
+ api.RegisterMessage((*TCPConfigureSrcAddressesReply)(nil), "tcp_configure_src_addresses_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*TCPConfigureSrcAddresses)(nil),
+ (*TCPConfigureSrcAddressesReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/tcp/tcp_rpc.ba.go b/internal/testbinapi/binapi2001/tcp/tcp_rpc.ba.go
new file mode 100644
index 0000000..8be3619
--- /dev/null
+++ b/internal/testbinapi/binapi2001/tcp/tcp_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package tcp
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service tcp.
+type RPCService interface {
+ TCPConfigureSrcAddresses(ctx context.Context, in *TCPConfigureSrcAddresses) (*TCPConfigureSrcAddressesReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) TCPConfigureSrcAddresses(ctx context.Context, in *TCPConfigureSrcAddresses) (*TCPConfigureSrcAddressesReply, error) {
+ out := new(TCPConfigureSrcAddressesReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/tls_openssl/tls_openssl.ba.go b/internal/testbinapi/binapi2001/tls_openssl/tls_openssl.ba.go
new file mode 100644
index 0000000..96a66c0
--- /dev/null
+++ b/internal/testbinapi/binapi2001/tls_openssl/tls_openssl.ba.go
@@ -0,0 +1,124 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/tls_openssl.api.json
+
+// Package tls_openssl contains generated bindings for API file tls_openssl.api.
+//
+// Contents:
+// 2 messages
+//
+package tls_openssl
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "tls_openssl"
+ APIVersion = "2.0.0"
+ VersionCrc = 0x7386fbcd
+)
+
+// TLSOpensslSetEngine defines message 'tls_openssl_set_engine'.
+type TLSOpensslSetEngine struct {
+ AsyncEnable uint32 `binapi:"u32,name=async_enable" json:"async_enable,omitempty"`
+ Engine []byte `binapi:"u8[64],name=engine" json:"engine,omitempty"`
+ Algorithm []byte `binapi:"u8[64],name=algorithm" json:"algorithm,omitempty"`
+ Ciphers []byte `binapi:"u8[64],name=ciphers" json:"ciphers,omitempty"`
+}
+
+func (m *TLSOpensslSetEngine) Reset() { *m = TLSOpensslSetEngine{} }
+func (*TLSOpensslSetEngine) GetMessageName() string { return "tls_openssl_set_engine" }
+func (*TLSOpensslSetEngine) GetCrcString() string { return "e34d95c1" }
+func (*TLSOpensslSetEngine) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *TLSOpensslSetEngine) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.AsyncEnable
+ size += 1 * 64 // m.Engine
+ size += 1 * 64 // m.Algorithm
+ size += 1 * 64 // m.Ciphers
+ return size
+}
+func (m *TLSOpensslSetEngine) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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()
+ 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
+}
+
+// TLSOpensslSetEngineReply defines message 'tls_openssl_set_engine_reply'.
+type TLSOpensslSetEngineReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *TLSOpensslSetEngineReply) Reset() { *m = TLSOpensslSetEngineReply{} }
+func (*TLSOpensslSetEngineReply) GetMessageName() string { return "tls_openssl_set_engine_reply" }
+func (*TLSOpensslSetEngineReply) GetCrcString() string { return "e8d4e804" }
+func (*TLSOpensslSetEngineReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *TLSOpensslSetEngineReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *TLSOpensslSetEngineReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_tls_openssl_binapi_init() }
+func file_tls_openssl_binapi_init() {
+ api.RegisterMessage((*TLSOpensslSetEngine)(nil), "tls_openssl_set_engine_e34d95c1")
+ api.RegisterMessage((*TLSOpensslSetEngineReply)(nil), "tls_openssl_set_engine_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*TLSOpensslSetEngine)(nil),
+ (*TLSOpensslSetEngineReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/tls_openssl/tls_openssl_rpc.ba.go b/internal/testbinapi/binapi2001/tls_openssl/tls_openssl_rpc.ba.go
new file mode 100644
index 0000000..2575bf2
--- /dev/null
+++ b/internal/testbinapi/binapi2001/tls_openssl/tls_openssl_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package tls_openssl
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service tls_openssl.
+type RPCService interface {
+ TLSOpensslSetEngine(ctx context.Context, in *TLSOpensslSetEngine) (*TLSOpensslSetEngineReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) TLSOpensslSetEngine(ctx context.Context, in *TLSOpensslSetEngine) (*TLSOpensslSetEngineReply, error) {
+ out := new(TLSOpensslSetEngineReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/trace/trace.ba.go b/internal/testbinapi/binapi2001/trace/trace.ba.go
new file mode 100644
index 0000000..210021d
--- /dev/null
+++ b/internal/testbinapi/binapi2001/trace/trace.ba.go
@@ -0,0 +1,273 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/trace.api.json
+
+// Package trace contains generated bindings for API file trace.api.
+//
+// Contents:
+// 6 messages
+//
+package trace
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "trace"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x397cbf90
+)
+
+// TraceProfileAdd defines message 'trace_profile_add'.
+type TraceProfileAdd struct {
+ TraceType uint8 `binapi:"u8,name=trace_type" json:"trace_type,omitempty"`
+ NumElts uint8 `binapi:"u8,name=num_elts" json:"num_elts,omitempty"`
+ TraceTsp uint8 `binapi:"u8,name=trace_tsp" json:"trace_tsp,omitempty"`
+ NodeID uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"`
+ AppData uint32 `binapi:"u32,name=app_data" json:"app_data,omitempty"`
+}
+
+func (m *TraceProfileAdd) Reset() { *m = TraceProfileAdd{} }
+func (*TraceProfileAdd) GetMessageName() string { return "trace_profile_add" }
+func (*TraceProfileAdd) GetCrcString() string { return "de08aa6d" }
+func (*TraceProfileAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *TraceProfileAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.TraceType
+ size += 1 // m.NumElts
+ size += 1 // m.TraceTsp
+ size += 4 // m.NodeID
+ size += 4 // m.AppData
+ return size
+}
+func (m *TraceProfileAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.TraceType = buf.DecodeUint8()
+ m.NumElts = buf.DecodeUint8()
+ m.TraceTsp = buf.DecodeUint8()
+ m.NodeID = buf.DecodeUint32()
+ m.AppData = buf.DecodeUint32()
+ return nil
+}
+
+// TraceProfileAddReply defines message 'trace_profile_add_reply'.
+type TraceProfileAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *TraceProfileAddReply) Reset() { *m = TraceProfileAddReply{} }
+func (*TraceProfileAddReply) GetMessageName() string { return "trace_profile_add_reply" }
+func (*TraceProfileAddReply) GetCrcString() string { return "e8d4e804" }
+func (*TraceProfileAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *TraceProfileAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *TraceProfileAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// TraceProfileDel defines message 'trace_profile_del'.
+type TraceProfileDel struct{}
+
+func (m *TraceProfileDel) Reset() { *m = TraceProfileDel{} }
+func (*TraceProfileDel) GetMessageName() string { return "trace_profile_del" }
+func (*TraceProfileDel) GetCrcString() string { return "51077d14" }
+func (*TraceProfileDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *TraceProfileDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *TraceProfileDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *TraceProfileDel) Unmarshal(b []byte) error {
+ return nil
+}
+
+// TraceProfileDelReply defines message 'trace_profile_del_reply'.
+type TraceProfileDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *TraceProfileDelReply) Reset() { *m = TraceProfileDelReply{} }
+func (*TraceProfileDelReply) GetMessageName() string { return "trace_profile_del_reply" }
+func (*TraceProfileDelReply) GetCrcString() string { return "e8d4e804" }
+func (*TraceProfileDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *TraceProfileDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *TraceProfileDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// TraceProfileShowConfig defines message 'trace_profile_show_config'.
+type TraceProfileShowConfig struct{}
+
+func (m *TraceProfileShowConfig) Reset() { *m = TraceProfileShowConfig{} }
+func (*TraceProfileShowConfig) GetMessageName() string { return "trace_profile_show_config" }
+func (*TraceProfileShowConfig) GetCrcString() string { return "51077d14" }
+func (*TraceProfileShowConfig) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *TraceProfileShowConfig) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *TraceProfileShowConfig) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *TraceProfileShowConfig) Unmarshal(b []byte) error {
+ return nil
+}
+
+// TraceProfileShowConfigReply defines message 'trace_profile_show_config_reply'.
+type TraceProfileShowConfigReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ TraceType uint8 `binapi:"u8,name=trace_type" json:"trace_type,omitempty"`
+ NumElts uint8 `binapi:"u8,name=num_elts" json:"num_elts,omitempty"`
+ TraceTsp uint8 `binapi:"u8,name=trace_tsp" json:"trace_tsp,omitempty"`
+ NodeID uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"`
+ AppData uint32 `binapi:"u32,name=app_data" json:"app_data,omitempty"`
+}
+
+func (m *TraceProfileShowConfigReply) Reset() { *m = TraceProfileShowConfigReply{} }
+func (*TraceProfileShowConfigReply) GetMessageName() string { return "trace_profile_show_config_reply" }
+func (*TraceProfileShowConfigReply) GetCrcString() string { return "0f1d374c" }
+func (*TraceProfileShowConfigReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *TraceProfileShowConfigReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 1 // m.TraceType
+ size += 1 // m.NumElts
+ size += 1 // m.TraceTsp
+ size += 4 // m.NodeID
+ size += 4 // m.AppData
+ return size
+}
+func (m *TraceProfileShowConfigReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.TraceType = buf.DecodeUint8()
+ m.NumElts = buf.DecodeUint8()
+ m.TraceTsp = buf.DecodeUint8()
+ m.NodeID = buf.DecodeUint32()
+ m.AppData = buf.DecodeUint32()
+ return nil
+}
+
+func init() { file_trace_binapi_init() }
+func file_trace_binapi_init() {
+ api.RegisterMessage((*TraceProfileAdd)(nil), "trace_profile_add_de08aa6d")
+ api.RegisterMessage((*TraceProfileAddReply)(nil), "trace_profile_add_reply_e8d4e804")
+ api.RegisterMessage((*TraceProfileDel)(nil), "trace_profile_del_51077d14")
+ api.RegisterMessage((*TraceProfileDelReply)(nil), "trace_profile_del_reply_e8d4e804")
+ api.RegisterMessage((*TraceProfileShowConfig)(nil), "trace_profile_show_config_51077d14")
+ api.RegisterMessage((*TraceProfileShowConfigReply)(nil), "trace_profile_show_config_reply_0f1d374c")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*TraceProfileAdd)(nil),
+ (*TraceProfileAddReply)(nil),
+ (*TraceProfileDel)(nil),
+ (*TraceProfileDelReply)(nil),
+ (*TraceProfileShowConfig)(nil),
+ (*TraceProfileShowConfigReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/trace/trace_rpc.ba.go b/internal/testbinapi/binapi2001/trace/trace_rpc.ba.go
new file mode 100644
index 0000000..f0f2ca7
--- /dev/null
+++ b/internal/testbinapi/binapi2001/trace/trace_rpc.ba.go
@@ -0,0 +1,50 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package trace
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service trace.
+type RPCService interface {
+ TraceProfileAdd(ctx context.Context, in *TraceProfileAdd) (*TraceProfileAddReply, error)
+ TraceProfileDel(ctx context.Context, in *TraceProfileDel) (*TraceProfileDelReply, error)
+ TraceProfileShowConfig(ctx context.Context, in *TraceProfileShowConfig) (*TraceProfileShowConfigReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) TraceProfileAdd(ctx context.Context, in *TraceProfileAdd) (*TraceProfileAddReply, error) {
+ out := new(TraceProfileAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) TraceProfileDel(ctx context.Context, in *TraceProfileDel) (*TraceProfileDelReply, error) {
+ out := new(TraceProfileDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) TraceProfileShowConfig(ctx context.Context, in *TraceProfileShowConfig) (*TraceProfileShowConfigReply, error) {
+ out := new(TraceProfileShowConfigReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/udp/udp.ba.go b/internal/testbinapi/binapi2001/udp/udp.ba.go
new file mode 100644
index 0000000..31cb6ed
--- /dev/null
+++ b/internal/testbinapi/binapi2001/udp/udp.ba.go
@@ -0,0 +1,866 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/udp.api.json
+
+// Package udp contains generated bindings for API file udp.api.
+//
+// Contents:
+// 5 aliases
+// 4 enums
+// 7 structs
+// 1 union
+// 6 messages
+//
+package udp
+
+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 = "udp"
+ APIVersion = "1.1.0"
+ VersionCrc = 0xa6b4c475
+)
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// UDPEncap defines type 'udp_encap'.
+type UDPEncap struct {
+ TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
+ SrcPort uint16 `binapi:"u16,name=src_port" json:"src_port,omitempty"`
+ DstPort uint16 `binapi:"u16,name=dst_port" json:"dst_port,omitempty"`
+ SrcIP Address `binapi:"address,name=src_ip" json:"src_ip,omitempty"`
+ DstIP Address `binapi:"address,name=dst_ip" json:"dst_ip,omitempty"`
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// UDPEncapAdd defines message 'udp_encap_add'.
+type UDPEncapAdd struct {
+ UDPEncap UDPEncap `binapi:"udp_encap,name=udp_encap" json:"udp_encap,omitempty"`
+}
+
+func (m *UDPEncapAdd) Reset() { *m = UDPEncapAdd{} }
+func (*UDPEncapAdd) GetMessageName() string { return "udp_encap_add" }
+func (*UDPEncapAdd) GetCrcString() string { return "61d5fc48" }
+func (*UDPEncapAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *UDPEncapAdd) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.UDPEncap.TableID
+ size += 2 // m.UDPEncap.SrcPort
+ size += 2 // m.UDPEncap.DstPort
+ size += 4 // m.UDPEncap.SrcIP.Af
+ size += 1 * 16 // m.UDPEncap.SrcIP.Un
+ size += 4 // m.UDPEncap.DstIP.Af
+ size += 1 * 16 // m.UDPEncap.DstIP.Un
+ size += 4 // m.UDPEncap.ID
+ return size
+}
+func (m *UDPEncapAdd) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.UDPEncap.TableID)
+ buf.EncodeUint16(m.UDPEncap.SrcPort)
+ buf.EncodeUint16(m.UDPEncap.DstPort)
+ buf.EncodeUint32(uint32(m.UDPEncap.SrcIP.Af))
+ buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.UDPEncap.DstIP.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.UDPEncap.TableID = buf.DecodeUint32()
+ m.UDPEncap.SrcPort = buf.DecodeUint16()
+ m.UDPEncap.DstPort = buf.DecodeUint16()
+ m.UDPEncap.SrcIP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.UDPEncap.DstIP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.UDPEncap.DstIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.UDPEncap.ID = buf.DecodeUint32()
+ return nil
+}
+
+// UDPEncapAddReply defines message 'udp_encap_add_reply'.
+type UDPEncapAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+}
+
+func (m *UDPEncapAddReply) Reset() { *m = UDPEncapAddReply{} }
+func (*UDPEncapAddReply) GetMessageName() string { return "udp_encap_add_reply" }
+func (*UDPEncapAddReply) GetCrcString() string { return "e2fc8294" }
+func (*UDPEncapAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *UDPEncapAddReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.ID
+ return size
+}
+func (m *UDPEncapAddReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.ID = buf.DecodeUint32()
+ return nil
+}
+
+// UDPEncapDel defines message 'udp_encap_del'.
+type UDPEncapDel struct {
+ ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
+}
+
+func (m *UDPEncapDel) Reset() { *m = UDPEncapDel{} }
+func (*UDPEncapDel) GetMessageName() string { return "udp_encap_del" }
+func (*UDPEncapDel) GetCrcString() string { return "3a91bde5" }
+func (*UDPEncapDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *UDPEncapDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.ID
+ return size
+}
+func (m *UDPEncapDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ID)
+ return buf.Bytes(), nil
+}
+func (m *UDPEncapDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint32()
+ return nil
+}
+
+// UDPEncapDelReply defines message 'udp_encap_del_reply'.
+type UDPEncapDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *UDPEncapDelReply) Reset() { *m = UDPEncapDelReply{} }
+func (*UDPEncapDelReply) GetMessageName() string { return "udp_encap_del_reply" }
+func (*UDPEncapDelReply) GetCrcString() string { return "e8d4e804" }
+func (*UDPEncapDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *UDPEncapDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *UDPEncapDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// UDPEncapDetails defines message 'udp_encap_details'.
+type UDPEncapDetails struct {
+ UDPEncap UDPEncap `binapi:"udp_encap,name=udp_encap" json:"udp_encap,omitempty"`
+}
+
+func (m *UDPEncapDetails) Reset() { *m = UDPEncapDetails{} }
+func (*UDPEncapDetails) GetMessageName() string { return "udp_encap_details" }
+func (*UDPEncapDetails) GetCrcString() string { return "87c82821" }
+func (*UDPEncapDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *UDPEncapDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.UDPEncap.TableID
+ size += 2 // m.UDPEncap.SrcPort
+ size += 2 // m.UDPEncap.DstPort
+ size += 4 // m.UDPEncap.SrcIP.Af
+ size += 1 * 16 // m.UDPEncap.SrcIP.Un
+ size += 4 // m.UDPEncap.DstIP.Af
+ size += 1 * 16 // m.UDPEncap.DstIP.Un
+ size += 4 // m.UDPEncap.ID
+ return size
+}
+func (m *UDPEncapDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.UDPEncap.TableID)
+ buf.EncodeUint16(m.UDPEncap.SrcPort)
+ buf.EncodeUint16(m.UDPEncap.DstPort)
+ buf.EncodeUint32(uint32(m.UDPEncap.SrcIP.Af))
+ buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.UDPEncap.DstIP.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.UDPEncap.TableID = buf.DecodeUint32()
+ m.UDPEncap.SrcPort = buf.DecodeUint16()
+ m.UDPEncap.DstPort = buf.DecodeUint16()
+ m.UDPEncap.SrcIP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.UDPEncap.DstIP.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.UDPEncap.DstIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.UDPEncap.ID = buf.DecodeUint32()
+ return nil
+}
+
+// UDPEncapDump defines message 'udp_encap_dump'.
+type UDPEncapDump struct{}
+
+func (m *UDPEncapDump) Reset() { *m = UDPEncapDump{} }
+func (*UDPEncapDump) GetMessageName() string { return "udp_encap_dump" }
+func (*UDPEncapDump) GetCrcString() string { return "51077d14" }
+func (*UDPEncapDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *UDPEncapDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *UDPEncapDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *UDPEncapDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_udp_binapi_init() }
+func file_udp_binapi_init() {
+ api.RegisterMessage((*UDPEncapAdd)(nil), "udp_encap_add_61d5fc48")
+ api.RegisterMessage((*UDPEncapAddReply)(nil), "udp_encap_add_reply_e2fc8294")
+ api.RegisterMessage((*UDPEncapDel)(nil), "udp_encap_del_3a91bde5")
+ api.RegisterMessage((*UDPEncapDelReply)(nil), "udp_encap_del_reply_e8d4e804")
+ api.RegisterMessage((*UDPEncapDetails)(nil), "udp_encap_details_87c82821")
+ api.RegisterMessage((*UDPEncapDump)(nil), "udp_encap_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*UDPEncapAdd)(nil),
+ (*UDPEncapAddReply)(nil),
+ (*UDPEncapDel)(nil),
+ (*UDPEncapDelReply)(nil),
+ (*UDPEncapDetails)(nil),
+ (*UDPEncapDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/udp/udp_rpc.ba.go b/internal/testbinapi/binapi2001/udp/udp_rpc.ba.go
new file mode 100644
index 0000000..4057867
--- /dev/null
+++ b/internal/testbinapi/binapi2001/udp/udp_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package udp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service udp.
+type RPCService interface {
+ UDPEncapAdd(ctx context.Context, in *UDPEncapAdd) (*UDPEncapAddReply, error)
+ UDPEncapDel(ctx context.Context, in *UDPEncapDel) (*UDPEncapDelReply, error)
+ UDPEncapDump(ctx context.Context, in *UDPEncapDump) (RPCService_UDPEncapDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) UDPEncapAdd(ctx context.Context, in *UDPEncapAdd) (*UDPEncapAddReply, error) {
+ out := new(UDPEncapAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) UDPEncapDel(ctx context.Context, in *UDPEncapDel) (*UDPEncapDelReply, error) {
+ out := new(UDPEncapDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) UDPEncapDump(ctx context.Context, in *UDPEncapDump) (RPCService_UDPEncapDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_UDPEncapDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_UDPEncapDumpClient interface {
+ Recv() (*UDPEncapDetails, error)
+ api.Stream
+}
+
+type serviceClient_UDPEncapDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_UDPEncapDumpClient) Recv() (*UDPEncapDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *UDPEncapDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/udp_ping/udp_ping.ba.go b/internal/testbinapi/binapi2001/udp_ping/udp_ping.ba.go
new file mode 100644
index 0000000..2b8ccad
--- /dev/null
+++ b/internal/testbinapi/binapi2001/udp_ping/udp_ping.ba.go
@@ -0,0 +1,789 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/udp_ping.api.json
+
+// Package udp_ping contains generated bindings for API file udp_ping.api.
+//
+// Contents:
+// 5 aliases
+// 4 enums
+// 6 structs
+// 1 union
+// 4 messages
+//
+package udp_ping
+
+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 = "udp_ping"
+ APIVersion = "3.0.0"
+ VersionCrc = 0x5a416f51
+)
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// UDPPingAddDel defines message 'udp_ping_add_del'.
+type UDPPingAddDel struct {
+ SrcIPAddress Address `binapi:"address,name=src_ip_address" json:"src_ip_address,omitempty"`
+ DstIPAddress Address `binapi:"address,name=dst_ip_address" json:"dst_ip_address,omitempty"`
+ StartSrcPort uint16 `binapi:"u16,name=start_src_port" json:"start_src_port,omitempty"`
+ EndSrcPort uint16 `binapi:"u16,name=end_src_port" json:"end_src_port,omitempty"`
+ StartDstPort uint16 `binapi:"u16,name=start_dst_port" json:"start_dst_port,omitempty"`
+ EndDstPort uint16 `binapi:"u16,name=end_dst_port" json:"end_dst_port,omitempty"`
+ Interval uint16 `binapi:"u16,name=interval" json:"interval,omitempty"`
+ Dis uint8 `binapi:"u8,name=dis" json:"dis,omitempty"`
+ FaultDet uint8 `binapi:"u8,name=fault_det" json:"fault_det,omitempty"`
+ Reserve []byte `binapi:"u8[3],name=reserve" json:"reserve,omitempty"`
+}
+
+func (m *UDPPingAddDel) Reset() { *m = UDPPingAddDel{} }
+func (*UDPPingAddDel) GetMessageName() string { return "udp_ping_add_del" }
+func (*UDPPingAddDel) GetCrcString() string { return "c692b188" }
+func (*UDPPingAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *UDPPingAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SrcIPAddress.Af
+ size += 1 * 16 // m.SrcIPAddress.Un
+ size += 4 // m.DstIPAddress.Af
+ size += 1 * 16 // m.DstIPAddress.Un
+ size += 2 // m.StartSrcPort
+ size += 2 // m.EndSrcPort
+ size += 2 // m.StartDstPort
+ size += 2 // m.EndDstPort
+ size += 2 // m.Interval
+ size += 1 // m.Dis
+ size += 1 // m.FaultDet
+ size += 1 * 3 // m.Reserve
+ return size
+}
+func (m *UDPPingAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SrcIPAddress.Af))
+ buf.EncodeBytes(m.SrcIPAddress.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.DstIPAddress.Af))
+ 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 {
+ buf := codec.NewBuffer(b)
+ m.SrcIPAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.SrcIPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DstIPAddress.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.DstIPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.StartSrcPort = buf.DecodeUint16()
+ m.EndSrcPort = buf.DecodeUint16()
+ m.StartDstPort = buf.DecodeUint16()
+ m.EndDstPort = buf.DecodeUint16()
+ m.Interval = buf.DecodeUint16()
+ m.Dis = buf.DecodeUint8()
+ m.FaultDet = buf.DecodeUint8()
+ m.Reserve = make([]byte, 3)
+ copy(m.Reserve, buf.DecodeBytes(len(m.Reserve)))
+ return nil
+}
+
+// UDPPingAddDelReply defines message 'udp_ping_add_del_reply'.
+type UDPPingAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *UDPPingAddDelReply) Reset() { *m = UDPPingAddDelReply{} }
+func (*UDPPingAddDelReply) GetMessageName() string { return "udp_ping_add_del_reply" }
+func (*UDPPingAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*UDPPingAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *UDPPingAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *UDPPingAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// UDPPingExport defines message 'udp_ping_export'.
+type UDPPingExport struct {
+ Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
+}
+
+func (m *UDPPingExport) Reset() { *m = UDPPingExport{} }
+func (*UDPPingExport) GetMessageName() string { return "udp_ping_export" }
+func (*UDPPingExport) GetCrcString() string { return "b3e225d2" }
+func (*UDPPingExport) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *UDPPingExport) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.Enable
+ return size
+}
+func (m *UDPPingExport) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *UDPPingExport) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// UDPPingExportReply defines message 'udp_ping_export_reply'.
+type UDPPingExportReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *UDPPingExportReply) Reset() { *m = UDPPingExportReply{} }
+func (*UDPPingExportReply) GetMessageName() string { return "udp_ping_export_reply" }
+func (*UDPPingExportReply) GetCrcString() string { return "e8d4e804" }
+func (*UDPPingExportReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *UDPPingExportReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *UDPPingExportReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_udp_ping_binapi_init() }
+func file_udp_ping_binapi_init() {
+ api.RegisterMessage((*UDPPingAddDel)(nil), "udp_ping_add_del_c692b188")
+ api.RegisterMessage((*UDPPingAddDelReply)(nil), "udp_ping_add_del_reply_e8d4e804")
+ api.RegisterMessage((*UDPPingExport)(nil), "udp_ping_export_b3e225d2")
+ api.RegisterMessage((*UDPPingExportReply)(nil), "udp_ping_export_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*UDPPingAddDel)(nil),
+ (*UDPPingAddDelReply)(nil),
+ (*UDPPingExport)(nil),
+ (*UDPPingExportReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/udp_ping/udp_ping_rpc.ba.go b/internal/testbinapi/binapi2001/udp_ping/udp_ping_rpc.ba.go
new file mode 100644
index 0000000..eae0ab4
--- /dev/null
+++ b/internal/testbinapi/binapi2001/udp_ping/udp_ping_rpc.ba.go
@@ -0,0 +1,40 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package udp_ping
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service udp_ping.
+type RPCService interface {
+ UDPPingAddDel(ctx context.Context, in *UDPPingAddDel) (*UDPPingAddDelReply, error)
+ UDPPingExport(ctx context.Context, in *UDPPingExport) (*UDPPingExportReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) UDPPingAddDel(ctx context.Context, in *UDPPingAddDel) (*UDPPingAddDelReply, error) {
+ out := new(UDPPingAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) UDPPingExport(ctx context.Context, in *UDPPingExport) (*UDPPingExportReply, error) {
+ out := new(UDPPingExportReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/vhost_user/vhost_user.ba.go b/internal/testbinapi/binapi2001/vhost_user/vhost_user.ba.go
new file mode 100644
index 0000000..cd5a64a
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vhost_user/vhost_user.ba.go
@@ -0,0 +1,792 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/vhost_user.api.json
+
+// Package vhost_user contains generated bindings for API file vhost_user.api.
+//
+// Contents:
+// 2 aliases
+// 8 enums
+// 8 messages
+//
+package vhost_user
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "net"
+ "strconv"
+)
+
+// 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 = "vhost_user"
+ APIVersion = "4.0.0"
+ VersionCrc = 0xb547a33d
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// VirtioNetFeaturesFirst32 defines enum 'virtio_net_features_first_32'.
+type VirtioNetFeaturesFirst32 uint32
+
+const (
+ VIRTIO_NET_F_API_CSUM VirtioNetFeaturesFirst32 = 1
+ VIRTIO_NET_F_API_GUEST_CSUM VirtioNetFeaturesFirst32 = 2
+ VIRTIO_NET_F_API_GUEST_TSO4 VirtioNetFeaturesFirst32 = 128
+ VIRTIO_NET_F_API_GUEST_TSO6 VirtioNetFeaturesFirst32 = 256
+ VIRTIO_NET_F_API_GUEST_UFO VirtioNetFeaturesFirst32 = 1024
+ VIRTIO_NET_F_API_HOST_TSO4 VirtioNetFeaturesFirst32 = 2048
+ VIRTIO_NET_F_API_HOST_TSO6 VirtioNetFeaturesFirst32 = 4096
+ VIRTIO_NET_F_API_HOST_UFO VirtioNetFeaturesFirst32 = 16384
+ VIRTIO_NET_F_API_MRG_RXBUF VirtioNetFeaturesFirst32 = 32768
+ VIRTIO_NET_F_API_CTRL_VQ VirtioNetFeaturesFirst32 = 131072
+ VIRTIO_NET_F_API_GUEST_ANNOUNCE VirtioNetFeaturesFirst32 = 2097152
+ VIRTIO_NET_F_API_MQ VirtioNetFeaturesFirst32 = 4194304
+ VHOST_F_API_LOG_ALL VirtioNetFeaturesFirst32 = 67108864
+ VIRTIO_F_API_ANY_LAYOUT VirtioNetFeaturesFirst32 = 134217728
+ VIRTIO_F_API_INDIRECT_DESC VirtioNetFeaturesFirst32 = 268435456
+ VHOST_USER_F_API_PROTOCOL_FEATURES VirtioNetFeaturesFirst32 = 1073741824
+)
+
+var (
+ VirtioNetFeaturesFirst32_name = map[uint32]string{
+ 1: "VIRTIO_NET_F_API_CSUM",
+ 2: "VIRTIO_NET_F_API_GUEST_CSUM",
+ 128: "VIRTIO_NET_F_API_GUEST_TSO4",
+ 256: "VIRTIO_NET_F_API_GUEST_TSO6",
+ 1024: "VIRTIO_NET_F_API_GUEST_UFO",
+ 2048: "VIRTIO_NET_F_API_HOST_TSO4",
+ 4096: "VIRTIO_NET_F_API_HOST_TSO6",
+ 16384: "VIRTIO_NET_F_API_HOST_UFO",
+ 32768: "VIRTIO_NET_F_API_MRG_RXBUF",
+ 131072: "VIRTIO_NET_F_API_CTRL_VQ",
+ 2097152: "VIRTIO_NET_F_API_GUEST_ANNOUNCE",
+ 4194304: "VIRTIO_NET_F_API_MQ",
+ 67108864: "VHOST_F_API_LOG_ALL",
+ 134217728: "VIRTIO_F_API_ANY_LAYOUT",
+ 268435456: "VIRTIO_F_API_INDIRECT_DESC",
+ 1073741824: "VHOST_USER_F_API_PROTOCOL_FEATURES",
+ }
+ VirtioNetFeaturesFirst32_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x VirtioNetFeaturesFirst32) String() string {
+ s, ok := VirtioNetFeaturesFirst32_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "VirtioNetFeaturesFirst32(" + strconv.Itoa(int(x)) + ")"
+}
+
+// VirtioNetFeaturesLast32 defines enum 'virtio_net_features_last_32'.
+type VirtioNetFeaturesLast32 uint32
+
+const (
+ VIRTIO_F_API_VERSION_1 VirtioNetFeaturesLast32 = 1
+)
+
+var (
+ VirtioNetFeaturesLast32_name = map[uint32]string{
+ 1: "VIRTIO_F_API_VERSION_1",
+ }
+ VirtioNetFeaturesLast32_value = map[string]uint32{
+ "VIRTIO_F_API_VERSION_1": 1,
+ }
+)
+
+func (x VirtioNetFeaturesLast32) String() string {
+ s, ok := VirtioNetFeaturesLast32_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "VirtioNetFeaturesLast32(" + strconv.Itoa(int(x)) + ")"
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// CreateVhostUserIf defines message 'create_vhost_user_if'.
+type CreateVhostUserIf struct {
+ IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
+ SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
+ Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
+ DisableMrgRxbuf bool `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"`
+ DisableIndirectDesc bool `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"`
+ EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
+ CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
+ UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *CreateVhostUserIf) Reset() { *m = CreateVhostUserIf{} }
+func (*CreateVhostUserIf) GetMessageName() string { return "create_vhost_user_if" }
+func (*CreateVhostUserIf) GetCrcString() string { return "591ee951" }
+func (*CreateVhostUserIf) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CreateVhostUserIf) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsServer
+ size += 256 // m.SockFilename
+ size += 1 // m.Renumber
+ size += 1 // m.DisableMrgRxbuf
+ size += 1 // m.DisableIndirectDesc
+ size += 1 // m.EnableGso
+ size += 4 // m.CustomDevInstance
+ size += 1 // m.UseCustomMac
+ size += 1 * 6 // m.MacAddress
+ size += 64 // m.Tag
+ return size
+}
+func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsServer)
+ buf.EncodeString(m.SockFilename, 256)
+ buf.EncodeBool(m.Renumber)
+ buf.EncodeBool(m.DisableMrgRxbuf)
+ buf.EncodeBool(m.DisableIndirectDesc)
+ buf.EncodeBool(m.EnableGso)
+ buf.EncodeUint32(m.CustomDevInstance)
+ buf.EncodeBool(m.UseCustomMac)
+ buf.EncodeBytes(m.MacAddress[:], 6)
+ buf.EncodeString(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *CreateVhostUserIf) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsServer = buf.DecodeBool()
+ m.SockFilename = buf.DecodeString(256)
+ m.Renumber = buf.DecodeBool()
+ m.DisableMrgRxbuf = buf.DecodeBool()
+ m.DisableIndirectDesc = buf.DecodeBool()
+ m.EnableGso = buf.DecodeBool()
+ m.CustomDevInstance = buf.DecodeUint32()
+ m.UseCustomMac = buf.DecodeBool()
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// CreateVhostUserIfReply defines message 'create_vhost_user_if_reply'.
+type CreateVhostUserIfReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *CreateVhostUserIfReply) Reset() { *m = CreateVhostUserIfReply{} }
+func (*CreateVhostUserIfReply) GetMessageName() string { return "create_vhost_user_if_reply" }
+func (*CreateVhostUserIfReply) GetCrcString() string { return "5383d31f" }
+func (*CreateVhostUserIfReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CreateVhostUserIfReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// DeleteVhostUserIf defines message 'delete_vhost_user_if'.
+type DeleteVhostUserIf struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *DeleteVhostUserIf) Reset() { *m = DeleteVhostUserIf{} }
+func (*DeleteVhostUserIf) GetMessageName() string { return "delete_vhost_user_if" }
+func (*DeleteVhostUserIf) GetCrcString() string { return "f9e6675e" }
+func (*DeleteVhostUserIf) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *DeleteVhostUserIf) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *DeleteVhostUserIf) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'.
+type DeleteVhostUserIfReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *DeleteVhostUserIfReply) Reset() { *m = DeleteVhostUserIfReply{} }
+func (*DeleteVhostUserIfReply) GetMessageName() string { return "delete_vhost_user_if_reply" }
+func (*DeleteVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
+func (*DeleteVhostUserIfReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *DeleteVhostUserIfReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// ModifyVhostUserIf defines message 'modify_vhost_user_if'.
+type ModifyVhostUserIf struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
+ SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
+ Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
+ EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
+ CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
+}
+
+func (m *ModifyVhostUserIf) Reset() { *m = ModifyVhostUserIf{} }
+func (*ModifyVhostUserIf) GetMessageName() string { return "modify_vhost_user_if" }
+func (*ModifyVhostUserIf) GetCrcString() string { return "fcfeaf16" }
+func (*ModifyVhostUserIf) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *ModifyVhostUserIf) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsServer
+ size += 256 // m.SockFilename
+ size += 1 // m.Renumber
+ size += 1 // m.EnableGso
+ size += 4 // m.CustomDevInstance
+ return size
+}
+func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ 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.EncodeUint32(m.CustomDevInstance)
+ return buf.Bytes(), nil
+}
+func (m *ModifyVhostUserIf) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsServer = buf.DecodeBool()
+ m.SockFilename = buf.DecodeString(256)
+ m.Renumber = buf.DecodeBool()
+ m.EnableGso = buf.DecodeBool()
+ m.CustomDevInstance = buf.DecodeUint32()
+ return nil
+}
+
+// ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'.
+type ModifyVhostUserIfReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *ModifyVhostUserIfReply) Reset() { *m = ModifyVhostUserIfReply{} }
+func (*ModifyVhostUserIfReply) GetMessageName() string { return "modify_vhost_user_if_reply" }
+func (*ModifyVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
+func (*ModifyVhostUserIfReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *ModifyVhostUserIfReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceVhostUserDetails defines message 'sw_interface_vhost_user_details'.
+type SwInterfaceVhostUserDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
+ VirtioNetHdrSz uint32 `binapi:"u32,name=virtio_net_hdr_sz" json:"virtio_net_hdr_sz,omitempty"`
+ FeaturesFirst32 VirtioNetFeaturesFirst32 `binapi:"virtio_net_features_first_32,name=features_first_32" json:"features_first_32,omitempty"`
+ FeaturesLast32 VirtioNetFeaturesLast32 `binapi:"virtio_net_features_last_32,name=features_last_32" json:"features_last_32,omitempty"`
+ IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
+ SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
+ NumRegions uint32 `binapi:"u32,name=num_regions" json:"num_regions,omitempty"`
+ SockErrno int32 `binapi:"i32,name=sock_errno" json:"sock_errno,omitempty"`
+}
+
+func (m *SwInterfaceVhostUserDetails) Reset() { *m = SwInterfaceVhostUserDetails{} }
+func (*SwInterfaceVhostUserDetails) GetMessageName() string { return "sw_interface_vhost_user_details" }
+func (*SwInterfaceVhostUserDetails) GetCrcString() string { return "98530df1" }
+func (*SwInterfaceVhostUserDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceVhostUserDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 64 // m.InterfaceName
+ size += 4 // m.VirtioNetHdrSz
+ size += 4 // m.FeaturesFirst32
+ size += 4 // m.FeaturesLast32
+ size += 1 // m.IsServer
+ size += 256 // m.SockFilename
+ size += 4 // m.NumRegions
+ size += 4 // m.SockErrno
+ return size
+}
+func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeString(m.InterfaceName, 64)
+ 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(m.NumRegions)
+ buf.EncodeInt32(m.SockErrno)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.InterfaceName = buf.DecodeString(64)
+ m.VirtioNetHdrSz = buf.DecodeUint32()
+ m.FeaturesFirst32 = VirtioNetFeaturesFirst32(buf.DecodeUint32())
+ m.FeaturesLast32 = VirtioNetFeaturesLast32(buf.DecodeUint32())
+ m.IsServer = buf.DecodeBool()
+ m.SockFilename = buf.DecodeString(256)
+ m.NumRegions = buf.DecodeUint32()
+ m.SockErrno = buf.DecodeInt32()
+ return nil
+}
+
+// SwInterfaceVhostUserDump defines message 'sw_interface_vhost_user_dump'.
+type SwInterfaceVhostUserDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
+}
+
+func (m *SwInterfaceVhostUserDump) Reset() { *m = SwInterfaceVhostUserDump{} }
+func (*SwInterfaceVhostUserDump) GetMessageName() string { return "sw_interface_vhost_user_dump" }
+func (*SwInterfaceVhostUserDump) GetCrcString() string { return "f9e6675e" }
+func (*SwInterfaceVhostUserDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceVhostUserDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+func init() { file_vhost_user_binapi_init() }
+func file_vhost_user_binapi_init() {
+ api.RegisterMessage((*CreateVhostUserIf)(nil), "create_vhost_user_if_591ee951")
+ api.RegisterMessage((*CreateVhostUserIfReply)(nil), "create_vhost_user_if_reply_5383d31f")
+ api.RegisterMessage((*DeleteVhostUserIf)(nil), "delete_vhost_user_if_f9e6675e")
+ api.RegisterMessage((*DeleteVhostUserIfReply)(nil), "delete_vhost_user_if_reply_e8d4e804")
+ api.RegisterMessage((*ModifyVhostUserIf)(nil), "modify_vhost_user_if_fcfeaf16")
+ api.RegisterMessage((*ModifyVhostUserIfReply)(nil), "modify_vhost_user_if_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceVhostUserDetails)(nil), "sw_interface_vhost_user_details_98530df1")
+ api.RegisterMessage((*SwInterfaceVhostUserDump)(nil), "sw_interface_vhost_user_dump_f9e6675e")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*CreateVhostUserIf)(nil),
+ (*CreateVhostUserIfReply)(nil),
+ (*DeleteVhostUserIf)(nil),
+ (*DeleteVhostUserIfReply)(nil),
+ (*ModifyVhostUserIf)(nil),
+ (*ModifyVhostUserIfReply)(nil),
+ (*SwInterfaceVhostUserDetails)(nil),
+ (*SwInterfaceVhostUserDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vhost_user/vhost_user_rpc.ba.go b/internal/testbinapi/binapi2001/vhost_user/vhost_user_rpc.ba.go
new file mode 100644
index 0000000..91132eb
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vhost_user/vhost_user_rpc.ba.go
@@ -0,0 +1,93 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package vhost_user
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service vhost_user.
+type RPCService interface {
+ CreateVhostUserIf(ctx context.Context, in *CreateVhostUserIf) (*CreateVhostUserIfReply, error)
+ DeleteVhostUserIf(ctx context.Context, in *DeleteVhostUserIf) (*DeleteVhostUserIfReply, error)
+ ModifyVhostUserIf(ctx context.Context, in *ModifyVhostUserIf) (*ModifyVhostUserIfReply, error)
+ SwInterfaceVhostUserDump(ctx context.Context, in *SwInterfaceVhostUserDump) (RPCService_SwInterfaceVhostUserDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) CreateVhostUserIf(ctx context.Context, in *CreateVhostUserIf) (*CreateVhostUserIfReply, error) {
+ out := new(CreateVhostUserIfReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) DeleteVhostUserIf(ctx context.Context, in *DeleteVhostUserIf) (*DeleteVhostUserIfReply, error) {
+ out := new(DeleteVhostUserIfReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) ModifyVhostUserIf(ctx context.Context, in *ModifyVhostUserIf) (*ModifyVhostUserIfReply, error) {
+ out := new(ModifyVhostUserIfReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) SwInterfaceVhostUserDump(ctx context.Context, in *SwInterfaceVhostUserDump) (RPCService_SwInterfaceVhostUserDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwInterfaceVhostUserDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwInterfaceVhostUserDumpClient interface {
+ Recv() (*SwInterfaceVhostUserDetails, error)
+ api.Stream
+}
+
+type serviceClient_SwInterfaceVhostUserDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwInterfaceVhostUserDumpClient) Recv() (*SwInterfaceVhostUserDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwInterfaceVhostUserDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/virtio/virtio.ba.go b/internal/testbinapi/binapi2001/virtio/virtio.ba.go
new file mode 100644
index 0000000..e4b9c08
--- /dev/null
+++ b/internal/testbinapi/binapi2001/virtio/virtio.ba.go
@@ -0,0 +1,602 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/virtio.api.json
+
+// Package virtio contains generated bindings for API file virtio.api.
+//
+// Contents:
+// 2 aliases
+// 6 enums
+// 1 struct
+// 6 messages
+//
+package virtio
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "net"
+ "strconv"
+)
+
+// 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 = "virtio"
+ APIVersion = "2.0.0"
+ VersionCrc = 0xb64fcf02
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// PciAddress defines type 'pci_address'.
+type PciAddress struct {
+ Domain uint16 `binapi:"u16,name=domain" json:"domain,omitempty"`
+ Bus uint8 `binapi:"u8,name=bus" json:"bus,omitempty"`
+ Slot uint8 `binapi:"u8,name=slot" json:"slot,omitempty"`
+ Function uint8 `binapi:"u8,name=function" json:"function,omitempty"`
+}
+
+// SwInterfaceVirtioPciDetails defines message 'sw_interface_virtio_pci_details'.
+type SwInterfaceVirtioPciDetails struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ PciAddr PciAddress `binapi:"pci_address,name=pci_addr" json:"pci_addr,omitempty"`
+ MacAddr MacAddress `binapi:"mac_address,name=mac_addr" json:"mac_addr,omitempty"`
+ TxRingSz uint16 `binapi:"u16,name=tx_ring_sz" json:"tx_ring_sz,omitempty"`
+ RxRingSz uint16 `binapi:"u16,name=rx_ring_sz" json:"rx_ring_sz,omitempty"`
+ Features uint64 `binapi:"u64,name=features" json:"features,omitempty"`
+}
+
+func (m *SwInterfaceVirtioPciDetails) Reset() { *m = SwInterfaceVirtioPciDetails{} }
+func (*SwInterfaceVirtioPciDetails) GetMessageName() string { return "sw_interface_virtio_pci_details" }
+func (*SwInterfaceVirtioPciDetails) GetCrcString() string { return "16187f3a" }
+func (*SwInterfaceVirtioPciDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceVirtioPciDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 2 // m.PciAddr.Domain
+ size += 1 // m.PciAddr.Bus
+ size += 1 // m.PciAddr.Slot
+ size += 1 // m.PciAddr.Function
+ size += 1 * 6 // m.MacAddr
+ size += 2 // m.TxRingSz
+ size += 2 // m.RxRingSz
+ size += 8 // m.Features
+ return size
+}
+func (m *SwInterfaceVirtioPciDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ 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(m.TxRingSz)
+ buf.EncodeUint16(m.RxRingSz)
+ buf.EncodeUint64(m.Features)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceVirtioPciDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.PciAddr.Domain = buf.DecodeUint16()
+ m.PciAddr.Bus = buf.DecodeUint8()
+ m.PciAddr.Slot = buf.DecodeUint8()
+ m.PciAddr.Function = buf.DecodeUint8()
+ copy(m.MacAddr[:], buf.DecodeBytes(6))
+ m.TxRingSz = buf.DecodeUint16()
+ m.RxRingSz = buf.DecodeUint16()
+ m.Features = buf.DecodeUint64()
+ return nil
+}
+
+// SwInterfaceVirtioPciDump defines message 'sw_interface_virtio_pci_dump'.
+type SwInterfaceVirtioPciDump struct{}
+
+func (m *SwInterfaceVirtioPciDump) Reset() { *m = SwInterfaceVirtioPciDump{} }
+func (*SwInterfaceVirtioPciDump) GetMessageName() string { return "sw_interface_virtio_pci_dump" }
+func (*SwInterfaceVirtioPciDump) GetCrcString() string { return "51077d14" }
+func (*SwInterfaceVirtioPciDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceVirtioPciDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *SwInterfaceVirtioPciDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceVirtioPciDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// VirtioPciCreate defines message 'virtio_pci_create'.
+type VirtioPciCreate struct {
+ PciAddr PciAddress `binapi:"pci_address,name=pci_addr" json:"pci_addr,omitempty"`
+ UseRandomMac bool `binapi:"bool,name=use_random_mac" json:"use_random_mac,omitempty"`
+ MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ GsoEnabled bool `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
+ ChecksumOffloadEnabled bool `binapi:"bool,name=checksum_offload_enabled" json:"checksum_offload_enabled,omitempty"`
+ Features uint64 `binapi:"u64,name=features" json:"features,omitempty"`
+}
+
+func (m *VirtioPciCreate) Reset() { *m = VirtioPciCreate{} }
+func (*VirtioPciCreate) GetMessageName() string { return "virtio_pci_create" }
+func (*VirtioPciCreate) GetCrcString() string { return "a9f1370c" }
+func (*VirtioPciCreate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VirtioPciCreate) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.PciAddr.Domain
+ size += 1 // m.PciAddr.Bus
+ size += 1 // m.PciAddr.Slot
+ size += 1 // m.PciAddr.Function
+ size += 1 // m.UseRandomMac
+ size += 1 * 6 // m.MacAddress
+ size += 1 // m.GsoEnabled
+ size += 1 // m.ChecksumOffloadEnabled
+ size += 8 // m.Features
+ return size
+}
+func (m *VirtioPciCreate) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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(m.Features)
+ return buf.Bytes(), nil
+}
+func (m *VirtioPciCreate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PciAddr.Domain = buf.DecodeUint16()
+ m.PciAddr.Bus = buf.DecodeUint8()
+ m.PciAddr.Slot = buf.DecodeUint8()
+ m.PciAddr.Function = buf.DecodeUint8()
+ m.UseRandomMac = buf.DecodeBool()
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ m.GsoEnabled = buf.DecodeBool()
+ m.ChecksumOffloadEnabled = buf.DecodeBool()
+ m.Features = buf.DecodeUint64()
+ return nil
+}
+
+// VirtioPciCreateReply defines message 'virtio_pci_create_reply'.
+type VirtioPciCreateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *VirtioPciCreateReply) Reset() { *m = VirtioPciCreateReply{} }
+func (*VirtioPciCreateReply) GetMessageName() string { return "virtio_pci_create_reply" }
+func (*VirtioPciCreateReply) GetCrcString() string { return "5383d31f" }
+func (*VirtioPciCreateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VirtioPciCreateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *VirtioPciCreateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// VirtioPciDelete defines message 'virtio_pci_delete'.
+type VirtioPciDelete struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *VirtioPciDelete) Reset() { *m = VirtioPciDelete{} }
+func (*VirtioPciDelete) GetMessageName() string { return "virtio_pci_delete" }
+func (*VirtioPciDelete) GetCrcString() string { return "f9e6675e" }
+func (*VirtioPciDelete) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VirtioPciDelete) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *VirtioPciDelete) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *VirtioPciDelete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// VirtioPciDeleteReply defines message 'virtio_pci_delete_reply'.
+type VirtioPciDeleteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *VirtioPciDeleteReply) Reset() { *m = VirtioPciDeleteReply{} }
+func (*VirtioPciDeleteReply) GetMessageName() string { return "virtio_pci_delete_reply" }
+func (*VirtioPciDeleteReply) GetCrcString() string { return "e8d4e804" }
+func (*VirtioPciDeleteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VirtioPciDeleteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *VirtioPciDeleteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_virtio_binapi_init() }
+func file_virtio_binapi_init() {
+ api.RegisterMessage((*SwInterfaceVirtioPciDetails)(nil), "sw_interface_virtio_pci_details_16187f3a")
+ api.RegisterMessage((*SwInterfaceVirtioPciDump)(nil), "sw_interface_virtio_pci_dump_51077d14")
+ api.RegisterMessage((*VirtioPciCreate)(nil), "virtio_pci_create_a9f1370c")
+ api.RegisterMessage((*VirtioPciCreateReply)(nil), "virtio_pci_create_reply_5383d31f")
+ api.RegisterMessage((*VirtioPciDelete)(nil), "virtio_pci_delete_f9e6675e")
+ api.RegisterMessage((*VirtioPciDeleteReply)(nil), "virtio_pci_delete_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SwInterfaceVirtioPciDetails)(nil),
+ (*SwInterfaceVirtioPciDump)(nil),
+ (*VirtioPciCreate)(nil),
+ (*VirtioPciCreateReply)(nil),
+ (*VirtioPciDelete)(nil),
+ (*VirtioPciDeleteReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/virtio/virtio_rpc.ba.go b/internal/testbinapi/binapi2001/virtio/virtio_rpc.ba.go
new file mode 100644
index 0000000..86f86fe
--- /dev/null
+++ b/internal/testbinapi/binapi2001/virtio/virtio_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package virtio
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service virtio.
+type RPCService interface {
+ SwInterfaceVirtioPciDump(ctx context.Context, in *SwInterfaceVirtioPciDump) (RPCService_SwInterfaceVirtioPciDumpClient, error)
+ VirtioPciCreate(ctx context.Context, in *VirtioPciCreate) (*VirtioPciCreateReply, error)
+ VirtioPciDelete(ctx context.Context, in *VirtioPciDelete) (*VirtioPciDeleteReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SwInterfaceVirtioPciDump(ctx context.Context, in *SwInterfaceVirtioPciDump) (RPCService_SwInterfaceVirtioPciDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_SwInterfaceVirtioPciDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_SwInterfaceVirtioPciDumpClient interface {
+ Recv() (*SwInterfaceVirtioPciDetails, error)
+ api.Stream
+}
+
+type serviceClient_SwInterfaceVirtioPciDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_SwInterfaceVirtioPciDumpClient) Recv() (*SwInterfaceVirtioPciDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *SwInterfaceVirtioPciDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) VirtioPciCreate(ctx context.Context, in *VirtioPciCreate) (*VirtioPciCreateReply, error) {
+ out := new(VirtioPciCreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VirtioPciDelete(ctx context.Context, in *VirtioPciDelete) (*VirtioPciDeleteReply, error) {
+ out := new(VirtioPciDeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
diff --git a/internal/testbinapi/binapi2001/virtio_types/virtio_types.ba.go b/internal/testbinapi/binapi2001/virtio_types/virtio_types.ba.go
new file mode 100644
index 0000000..3715966
--- /dev/null
+++ b/internal/testbinapi/binapi2001/virtio_types/virtio_types.ba.go
@@ -0,0 +1,116 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/virtio_types.api.json
+
+// Package virtio_types contains generated bindings for API file virtio_types.api.
+//
+// Contents:
+// 2 enums
+//
+package virtio_types
+
+import (
+ api "git.fd.io/govpp.git/api"
+ "strconv"
+)
+
+// 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
+
+// VirtioNetFeaturesFirst32 defines enum 'virtio_net_features_first_32'.
+type VirtioNetFeaturesFirst32 uint32
+
+const (
+ VIRTIO_NET_F_API_CSUM VirtioNetFeaturesFirst32 = 1
+ VIRTIO_NET_F_API_GUEST_CSUM VirtioNetFeaturesFirst32 = 2
+ VIRTIO_NET_F_API_GUEST_TSO4 VirtioNetFeaturesFirst32 = 128
+ VIRTIO_NET_F_API_GUEST_TSO6 VirtioNetFeaturesFirst32 = 256
+ VIRTIO_NET_F_API_GUEST_UFO VirtioNetFeaturesFirst32 = 1024
+ VIRTIO_NET_F_API_HOST_TSO4 VirtioNetFeaturesFirst32 = 2048
+ VIRTIO_NET_F_API_HOST_TSO6 VirtioNetFeaturesFirst32 = 4096
+ VIRTIO_NET_F_API_HOST_UFO VirtioNetFeaturesFirst32 = 16384
+ VIRTIO_NET_F_API_MRG_RXBUF VirtioNetFeaturesFirst32 = 32768
+ VIRTIO_NET_F_API_CTRL_VQ VirtioNetFeaturesFirst32 = 131072
+ VIRTIO_NET_F_API_GUEST_ANNOUNCE VirtioNetFeaturesFirst32 = 2097152
+ VIRTIO_NET_F_API_MQ VirtioNetFeaturesFirst32 = 4194304
+ VHOST_F_API_LOG_ALL VirtioNetFeaturesFirst32 = 67108864
+ VIRTIO_F_API_ANY_LAYOUT VirtioNetFeaturesFirst32 = 134217728
+ VIRTIO_F_API_INDIRECT_DESC VirtioNetFeaturesFirst32 = 268435456
+ VHOST_USER_F_API_PROTOCOL_FEATURES VirtioNetFeaturesFirst32 = 1073741824
+)
+
+var (
+ VirtioNetFeaturesFirst32_name = map[uint32]string{
+ 1: "VIRTIO_NET_F_API_CSUM",
+ 2: "VIRTIO_NET_F_API_GUEST_CSUM",
+ 128: "VIRTIO_NET_F_API_GUEST_TSO4",
+ 256: "VIRTIO_NET_F_API_GUEST_TSO6",
+ 1024: "VIRTIO_NET_F_API_GUEST_UFO",
+ 2048: "VIRTIO_NET_F_API_HOST_TSO4",
+ 4096: "VIRTIO_NET_F_API_HOST_TSO6",
+ 16384: "VIRTIO_NET_F_API_HOST_UFO",
+ 32768: "VIRTIO_NET_F_API_MRG_RXBUF",
+ 131072: "VIRTIO_NET_F_API_CTRL_VQ",
+ 2097152: "VIRTIO_NET_F_API_GUEST_ANNOUNCE",
+ 4194304: "VIRTIO_NET_F_API_MQ",
+ 67108864: "VHOST_F_API_LOG_ALL",
+ 134217728: "VIRTIO_F_API_ANY_LAYOUT",
+ 268435456: "VIRTIO_F_API_INDIRECT_DESC",
+ 1073741824: "VHOST_USER_F_API_PROTOCOL_FEATURES",
+ }
+ VirtioNetFeaturesFirst32_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x VirtioNetFeaturesFirst32) String() string {
+ s, ok := VirtioNetFeaturesFirst32_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "VirtioNetFeaturesFirst32(" + strconv.Itoa(int(x)) + ")"
+}
+
+// VirtioNetFeaturesLast32 defines enum 'virtio_net_features_last_32'.
+type VirtioNetFeaturesLast32 uint32
+
+const (
+ VIRTIO_F_API_VERSION_1 VirtioNetFeaturesLast32 = 1
+)
+
+var (
+ VirtioNetFeaturesLast32_name = map[uint32]string{
+ 1: "VIRTIO_F_API_VERSION_1",
+ }
+ VirtioNetFeaturesLast32_value = map[string]uint32{
+ "VIRTIO_F_API_VERSION_1": 1,
+ }
+)
+
+func (x VirtioNetFeaturesLast32) String() string {
+ s, ok := VirtioNetFeaturesLast32_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "VirtioNetFeaturesLast32(" + strconv.Itoa(int(x)) + ")"
+}
diff --git a/internal/testbinapi/binapi2001/vmxnet3/vmxnet3.ba.go b/internal/testbinapi/binapi2001/vmxnet3/vmxnet3.ba.go
new file mode 100644
index 0000000..7986818
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vmxnet3/vmxnet3.ba.go
@@ -0,0 +1,677 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/vmxnet3.api.json
+
+// Package vmxnet3 contains generated bindings for API file vmxnet3.api.
+//
+// Contents:
+// 2 aliases
+// 6 enums
+// 2 structs
+// 6 messages
+//
+package vmxnet3
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+ "net"
+ "strconv"
+)
+
+// 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 = "vmxnet3"
+ APIVersion = "1.1.0"
+ VersionCrc = 0xe89a60f7
+)
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// MacAddress defines alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ copy(macaddr[:], mac[:])
+ return macaddr, nil
+}
+func (x MacAddress) ToMAC() net.HardwareAddr {
+ return net.HardwareAddr(x[:])
+}
+func (x MacAddress) String() string {
+ return x.ToMAC().String()
+}
+func (x *MacAddress) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *MacAddress) UnmarshalText(text []byte) error {
+ mac, err := ParseMacAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Vmxnet3RxList defines type 'vmxnet3_rx_list'.
+type Vmxnet3RxList struct {
+ RxQsize uint16 `binapi:"u16,name=rx_qsize" json:"rx_qsize,omitempty"`
+ RxFill []uint16 `binapi:"u16[2],name=rx_fill" json:"rx_fill,omitempty"`
+ RxNext uint16 `binapi:"u16,name=rx_next" json:"rx_next,omitempty"`
+ RxProduce []uint16 `binapi:"u16[2],name=rx_produce" json:"rx_produce,omitempty"`
+ RxConsume []uint16 `binapi:"u16[2],name=rx_consume" json:"rx_consume,omitempty"`
+}
+
+// Vmxnet3TxList defines type 'vmxnet3_tx_list'.
+type Vmxnet3TxList struct {
+ TxQsize uint16 `binapi:"u16,name=tx_qsize" json:"tx_qsize,omitempty"`
+ TxNext uint16 `binapi:"u16,name=tx_next" json:"tx_next,omitempty"`
+ TxProduce uint16 `binapi:"u16,name=tx_produce" json:"tx_produce,omitempty"`
+ TxConsume uint16 `binapi:"u16,name=tx_consume" json:"tx_consume,omitempty"`
+}
+
+// Vmxnet3Create defines message 'vmxnet3_create'.
+type Vmxnet3Create struct {
+ PciAddr uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
+ EnableElog int32 `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
+ RxqSize uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
+ RxqNum uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
+ TxqSize uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
+ TxqNum uint16 `binapi:"u16,name=txq_num" json:"txq_num,omitempty"`
+ Bind uint8 `binapi:"u8,name=bind" json:"bind,omitempty"`
+ EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
+}
+
+func (m *Vmxnet3Create) Reset() { *m = Vmxnet3Create{} }
+func (*Vmxnet3Create) GetMessageName() string { return "vmxnet3_create" }
+func (*Vmxnet3Create) GetCrcString() string { return "71a07314" }
+func (*Vmxnet3Create) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Vmxnet3Create) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.PciAddr
+ size += 4 // m.EnableElog
+ size += 2 // m.RxqSize
+ size += 2 // m.RxqNum
+ size += 2 // m.TxqSize
+ size += 2 // m.TxqNum
+ size += 1 // m.Bind
+ size += 1 // m.EnableGso
+ return size
+}
+func (m *Vmxnet3Create) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.RxqSize = buf.DecodeUint16()
+ m.RxqNum = buf.DecodeUint16()
+ m.TxqSize = buf.DecodeUint16()
+ m.TxqNum = buf.DecodeUint16()
+ m.Bind = buf.DecodeUint8()
+ m.EnableGso = buf.DecodeBool()
+ return nil
+}
+
+// Vmxnet3CreateReply defines message 'vmxnet3_create_reply'.
+type Vmxnet3CreateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Vmxnet3CreateReply) Reset() { *m = Vmxnet3CreateReply{} }
+func (*Vmxnet3CreateReply) GetMessageName() string { return "vmxnet3_create_reply" }
+func (*Vmxnet3CreateReply) GetCrcString() string { return "5383d31f" }
+func (*Vmxnet3CreateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Vmxnet3CreateReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Vmxnet3CreateReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Vmxnet3Delete defines message 'vmxnet3_delete'.
+type Vmxnet3Delete struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *Vmxnet3Delete) Reset() { *m = Vmxnet3Delete{} }
+func (*Vmxnet3Delete) GetMessageName() string { return "vmxnet3_delete" }
+func (*Vmxnet3Delete) GetCrcString() string { return "f9e6675e" }
+func (*Vmxnet3Delete) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Vmxnet3Delete) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *Vmxnet3Delete) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *Vmxnet3Delete) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// Vmxnet3DeleteReply defines message 'vmxnet3_delete_reply'.
+type Vmxnet3DeleteReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *Vmxnet3DeleteReply) Reset() { *m = Vmxnet3DeleteReply{} }
+func (*Vmxnet3DeleteReply) GetMessageName() string { return "vmxnet3_delete_reply" }
+func (*Vmxnet3DeleteReply) GetCrcString() string { return "e8d4e804" }
+func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Vmxnet3DeleteReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *Vmxnet3DeleteReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// Vmxnet3Details defines message 'vmxnet3_details'.
+type Vmxnet3Details struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IfName string `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
+ HwAddr MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
+ PciAddr uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
+ Version uint8 `binapi:"u8,name=version" json:"version,omitempty"`
+ AdminUpDown bool `binapi:"bool,name=admin_up_down" json:"admin_up_down,omitempty"`
+ RxCount uint8 `binapi:"u8,name=rx_count" json:"rx_count,omitempty"`
+ RxList [16]Vmxnet3RxList `binapi:"vmxnet3_rx_list[16],name=rx_list" json:"rx_list,omitempty"`
+ TxCount uint8 `binapi:"u8,name=tx_count" json:"tx_count,omitempty"`
+ TxList [8]Vmxnet3TxList `binapi:"vmxnet3_tx_list[8],name=tx_list" json:"tx_list,omitempty"`
+}
+
+func (m *Vmxnet3Details) Reset() { *m = Vmxnet3Details{} }
+func (*Vmxnet3Details) GetMessageName() string { return "vmxnet3_details" }
+func (*Vmxnet3Details) GetCrcString() string { return "829ba055" }
+func (*Vmxnet3Details) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *Vmxnet3Details) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 64 // m.IfName
+ size += 1 * 6 // m.HwAddr
+ size += 4 // m.PciAddr
+ size += 1 // m.Version
+ size += 1 // m.AdminUpDown
+ size += 1 // m.RxCount
+ for j1 := 0; j1 < 16; j1++ {
+ 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++ {
+ 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) {
+ if b == nil {
+ 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(m.PciAddr)
+ buf.EncodeUint8(m.Version)
+ buf.EncodeBool(m.AdminUpDown)
+ buf.EncodeUint8(m.RxCount)
+ for j0 := 0; j0 < 16; j0++ {
+ buf.EncodeUint16(m.RxList[j0].RxQsize)
+ for i := 0; i < 2; i++ {
+ var x uint16
+ if i < len(m.RxList[j0].RxFill) {
+ x = uint16(m.RxList[j0].RxFill[i])
+ }
+ buf.EncodeUint16(x)
+ }
+ buf.EncodeUint16(m.RxList[j0].RxNext)
+ for i := 0; i < 2; i++ {
+ var x uint16
+ if i < len(m.RxList[j0].RxProduce) {
+ x = uint16(m.RxList[j0].RxProduce[i])
+ }
+ buf.EncodeUint16(x)
+ }
+ for i := 0; i < 2; i++ {
+ var x uint16
+ if i < len(m.RxList[j0].RxConsume) {
+ x = uint16(m.RxList[j0].RxConsume[i])
+ }
+ buf.EncodeUint16(x)
+ }
+ }
+ buf.EncodeUint8(m.TxCount)
+ for j0 := 0; j0 < 8; j0++ {
+ 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
+}
+func (m *Vmxnet3Details) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IfName = buf.DecodeString(64)
+ copy(m.HwAddr[:], buf.DecodeBytes(6))
+ m.PciAddr = buf.DecodeUint32()
+ m.Version = buf.DecodeUint8()
+ m.AdminUpDown = buf.DecodeBool()
+ m.RxCount = buf.DecodeUint8()
+ for j0 := 0; j0 < 16; j0++ {
+ m.RxList[j0].RxQsize = buf.DecodeUint16()
+ m.RxList[j0].RxFill = make([]uint16, 2)
+ for i := 0; i < len(m.RxList[j0].RxFill); i++ {
+ m.RxList[j0].RxFill[i] = buf.DecodeUint16()
+ }
+ m.RxList[j0].RxNext = buf.DecodeUint16()
+ m.RxList[j0].RxProduce = make([]uint16, 2)
+ for i := 0; i < len(m.RxList[j0].RxProduce); i++ {
+ m.RxList[j0].RxProduce[i] = buf.DecodeUint16()
+ }
+ m.RxList[j0].RxConsume = make([]uint16, 2)
+ for i := 0; i < len(m.RxList[j0].RxConsume); i++ {
+ m.RxList[j0].RxConsume[i] = buf.DecodeUint16()
+ }
+ }
+ m.TxCount = buf.DecodeUint8()
+ for j0 := 0; j0 < 8; j0++ {
+ m.TxList[j0].TxQsize = buf.DecodeUint16()
+ m.TxList[j0].TxNext = buf.DecodeUint16()
+ m.TxList[j0].TxProduce = buf.DecodeUint16()
+ m.TxList[j0].TxConsume = buf.DecodeUint16()
+ }
+ return nil
+}
+
+// Vmxnet3Dump defines message 'vmxnet3_dump'.
+type Vmxnet3Dump struct{}
+
+func (m *Vmxnet3Dump) Reset() { *m = Vmxnet3Dump{} }
+func (*Vmxnet3Dump) GetMessageName() string { return "vmxnet3_dump" }
+func (*Vmxnet3Dump) GetCrcString() string { return "51077d14" }
+func (*Vmxnet3Dump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *Vmxnet3Dump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ return size
+}
+func (m *Vmxnet3Dump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
+}
+func (m *Vmxnet3Dump) Unmarshal(b []byte) error {
+ return nil
+}
+
+func init() { file_vmxnet3_binapi_init() }
+func file_vmxnet3_binapi_init() {
+ api.RegisterMessage((*Vmxnet3Create)(nil), "vmxnet3_create_71a07314")
+ api.RegisterMessage((*Vmxnet3CreateReply)(nil), "vmxnet3_create_reply_5383d31f")
+ api.RegisterMessage((*Vmxnet3Delete)(nil), "vmxnet3_delete_f9e6675e")
+ api.RegisterMessage((*Vmxnet3DeleteReply)(nil), "vmxnet3_delete_reply_e8d4e804")
+ api.RegisterMessage((*Vmxnet3Details)(nil), "vmxnet3_details_829ba055")
+ api.RegisterMessage((*Vmxnet3Dump)(nil), "vmxnet3_dump_51077d14")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*Vmxnet3Create)(nil),
+ (*Vmxnet3CreateReply)(nil),
+ (*Vmxnet3Delete)(nil),
+ (*Vmxnet3DeleteReply)(nil),
+ (*Vmxnet3Details)(nil),
+ (*Vmxnet3Dump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vmxnet3/vmxnet3_rpc.ba.go b/internal/testbinapi/binapi2001/vmxnet3/vmxnet3_rpc.ba.go
new file mode 100644
index 0000000..4d072ce
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vmxnet3/vmxnet3_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package vmxnet3
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service vmxnet3.
+type RPCService interface {
+ Vmxnet3Create(ctx context.Context, in *Vmxnet3Create) (*Vmxnet3CreateReply, error)
+ Vmxnet3Delete(ctx context.Context, in *Vmxnet3Delete) (*Vmxnet3DeleteReply, error)
+ Vmxnet3Dump(ctx context.Context, in *Vmxnet3Dump) (RPCService_Vmxnet3DumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) Vmxnet3Create(ctx context.Context, in *Vmxnet3Create) (*Vmxnet3CreateReply, error) {
+ out := new(Vmxnet3CreateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Vmxnet3Delete(ctx context.Context, in *Vmxnet3Delete) (*Vmxnet3DeleteReply, error) {
+ out := new(Vmxnet3DeleteReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) Vmxnet3Dump(ctx context.Context, in *Vmxnet3Dump) (RPCService_Vmxnet3DumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_Vmxnet3DumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_Vmxnet3DumpClient interface {
+ Recv() (*Vmxnet3Details, error)
+ api.Stream
+}
+
+type serviceClient_Vmxnet3DumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_Vmxnet3DumpClient) Recv() (*Vmxnet3Details, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *Vmxnet3Details:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vpe/vpe.ba.go b/internal/testbinapi/binapi2001/vpe/vpe.ba.go
index e12bca4..f970104 100644
--- a/internal/testbinapi/binapi2001/vpe/vpe.ba.go
+++ b/internal/testbinapi/binapi2001/vpe/vpe.ba.go
@@ -1,49 +1,38 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.4.0-dev
-// VPP: 20.01-45~g7a071e370~b63
-// source: /usr/share/vpp/api/core/vpe.api.json
-
-/*
-Package vpe contains generated code for VPP binary API defined by vpe.api (version 1.6.0).
-
-It consists of:
- 2 aliases
- 1 enum
- 26 messages
- 2 types
-*/
+// VPP: 20.01
+// source: .vppapi/core/vpe.api.json
+
+// Package vpe contains generated bindings for API file vpe.api.
+//
+// Contents:
+// 2 aliases
+// 1 enum
+// 2 structs
+// 26 messages
+//
package vpe
import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "math"
- "strconv"
-
api "git.fd.io/govpp.git/api"
codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
+ "strconv"
)
// 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 // please upgrade the GoVPP api package
+const _ = api.GoVppAPIPackageIsVersion2
const (
- // ModuleName is the name of this module.
- ModuleName = "vpe"
- // APIVersion is the API version of this module.
+ APIFile = "vpe"
APIVersion = "1.6.0"
- // VersionCrc is the CRC of this module.
VersionCrc = 0xc6c0bcf6
)
-// LogLevel represents VPP binary API enum 'log_level'.
+// LogLevel defines enum 'log_level'.
type LogLevel uint32
const (
@@ -91,1570 +80,1017 @@ func (x LogLevel) String() string {
return "LogLevel(" + strconv.Itoa(int(x)) + ")"
}
-// Timedelta represents VPP binary API alias 'timedelta'.
+// Timedelta defines alias 'timedelta'.
type Timedelta float64
-// Timestamp represents VPP binary API alias 'timestamp'.
+// Timestamp defines alias 'timestamp'.
type Timestamp float64
-// ThreadData represents VPP binary API type 'thread_data'.
+// ThreadData defines type 'thread_data'.
type ThreadData struct {
ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
- Name []byte `binapi:"u8[64],name=name" json:"name,omitempty" struc:"[64]byte"`
- Type []byte `binapi:"u8[64],name=type" json:"type,omitempty" struc:"[64]byte"`
+ Name []byte `binapi:"u8[64],name=name" json:"name,omitempty"`
+ Type []byte `binapi:"u8[64],name=type" json:"type,omitempty"`
PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
CPUID uint32 `binapi:"u32,name=cpu_id" json:"cpu_id,omitempty"`
Core uint32 `binapi:"u32,name=core" json:"core,omitempty"`
CPUSocket uint32 `binapi:"u32,name=cpu_socket" json:"cpu_socket,omitempty"`
}
-func (*ThreadData) GetTypeName() string { return "thread_data" }
-
-// Version represents VPP binary API type 'version'.
+// Version defines type 'version'.
type Version struct {
Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
Patch uint32 `binapi:"u32,name=patch" json:"patch,omitempty"`
- PreRelease []byte `binapi:"u8[17],name=pre_release" json:"pre_release,omitempty" struc:"[17]byte"`
- BuildMetadata []byte `binapi:"u8[17],name=build_metadata" json:"build_metadata,omitempty" struc:"[17]byte"`
+ PreRelease []byte `binapi:"u8[17],name=pre_release" json:"pre_release,omitempty"`
+ BuildMetadata []byte `binapi:"u8[17],name=build_metadata" json:"build_metadata,omitempty"`
}
-func (*Version) GetTypeName() string { return "version" }
-
-// AddNodeNext represents VPP binary API message 'add_node_next'.
+// AddNodeNext defines message 'add_node_next'.
type AddNodeNext struct {
- NodeName []byte `binapi:"u8[64],name=node_name" json:"node_name,omitempty" struc:"[64]byte"`
- NextName []byte `binapi:"u8[64],name=next_name" json:"next_name,omitempty" struc:"[64]byte"`
+ NodeName []byte `binapi:"u8[64],name=node_name" json:"node_name,omitempty"`
+ NextName []byte `binapi:"u8[64],name=next_name" json:"next_name,omitempty"`
}
-func (m *AddNodeNext) Reset() { *m = AddNodeNext{} }
-func (*AddNodeNext) GetMessageName() string { return "add_node_next" }
-func (*AddNodeNext) GetCrcString() string { return "9ab92f7a" }
-func (*AddNodeNext) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *AddNodeNext) Reset() { *m = AddNodeNext{} }
+func (*AddNodeNext) GetMessageName() string { return "add_node_next" }
+func (*AddNodeNext) GetCrcString() string { return "9ab92f7a" }
+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
- // field[1] m.NodeName
- size += 64
- // field[1] m.NextName
- size += 64
+ size += 1 * 64 // m.NodeName
+ size += 1 * 64 // m.NextName
return size
}
func (m *AddNodeNext) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.NodeName
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.NodeName) {
- x = uint8(m.NodeName[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.NextName
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.NextName) {
- x = uint8(m.NextName[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *AddNodeNext) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.NodeName
- m.NodeName = make([]uint8, 64)
- for i := 0; i < len(m.NodeName); i++ {
- m.NodeName[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.NextName
- m.NextName = make([]uint8, 64)
- for i := 0; i < len(m.NextName); i++ {
- m.NextName[i] = uint8(tmp[pos])
- pos += 1
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.NodeName, 64)
+ buf.EncodeBytes(m.NextName, 64)
+ return buf.Bytes(), nil
+}
+func (m *AddNodeNext) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.NodeName = make([]byte, 64)
+ copy(m.NodeName, buf.DecodeBytes(len(m.NodeName)))
+ m.NextName = make([]byte, 64)
+ copy(m.NextName, buf.DecodeBytes(len(m.NextName)))
return nil
}
-// AddNodeNextReply represents VPP binary API message 'add_node_next_reply'.
+// AddNodeNextReply defines message 'add_node_next_reply'.
type AddNodeNextReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
NextIndex uint32 `binapi:"u32,name=next_index" json:"next_index,omitempty"`
}
-func (m *AddNodeNextReply) Reset() { *m = AddNodeNextReply{} }
-func (*AddNodeNextReply) GetMessageName() string { return "add_node_next_reply" }
-func (*AddNodeNextReply) GetCrcString() string { return "2ed75f32" }
-func (*AddNodeNextReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *AddNodeNextReply) Reset() { *m = AddNodeNextReply{} }
+func (*AddNodeNextReply) GetMessageName() string { return "add_node_next_reply" }
+func (*AddNodeNextReply) GetCrcString() string { return "2ed75f32" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.NextIndex
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.NextIndex
return size
}
func (m *AddNodeNextReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.NextIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.NextIndex))
- pos += 4
- return buf, nil
-}
-func (m *AddNodeNextReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NextIndex
- m.NextIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
+ m.NextIndex = buf.DecodeUint32()
return nil
}
-// Cli represents VPP binary API message 'cli'.
+// Cli defines message 'cli'.
type Cli struct {
CmdInShmem uint64 `binapi:"u64,name=cmd_in_shmem" json:"cmd_in_shmem,omitempty"`
}
-func (m *Cli) Reset() { *m = Cli{} }
-func (*Cli) GetMessageName() string { return "cli" }
-func (*Cli) GetCrcString() string { return "23bfbfff" }
-func (*Cli) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *Cli) Reset() { *m = Cli{} }
+func (*Cli) GetMessageName() string { return "cli" }
+func (*Cli) GetCrcString() string { return "23bfbfff" }
+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
- // field[1] m.CmdInShmem
- size += 8
+ size += 8 // m.CmdInShmem
return size
}
func (m *Cli) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.CmdInShmem
- o.PutUint64(buf[pos:pos+8], uint64(m.CmdInShmem))
- pos += 8
- return buf, nil
-}
-func (m *Cli) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.CmdInShmem
- m.CmdInShmem = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint64(m.CmdInShmem)
+ return buf.Bytes(), nil
+}
+func (m *Cli) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.CmdInShmem = buf.DecodeUint64()
return nil
}
-// CliInband represents VPP binary API message 'cli_inband'.
+// CliInband defines message 'cli_inband'.
type CliInband struct {
- XXX_CmdLen uint32 `struc:"sizeof=Cmd"`
- Cmd string `json:"cmd,omitempty"`
+ Cmd string `binapi:"string[],name=cmd" json:"cmd,omitempty"`
}
-func (m *CliInband) Reset() { *m = CliInband{} }
-func (*CliInband) GetMessageName() string { return "cli_inband" }
-func (*CliInband) GetCrcString() string { return "f8377302" }
-func (*CliInband) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *CliInband) Reset() { *m = CliInband{} }
+func (*CliInband) GetMessageName() string { return "cli_inband" }
+func (*CliInband) GetCrcString() string { return "f8377302" }
+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
- // field[1] m.Cmd
- size += 4 + len(m.Cmd)
+ size += 4 + len(m.Cmd) // m.Cmd
return size
}
func (m *CliInband) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Cmd
- o.PutUint32(buf[pos:pos+4], uint32(len(m.Cmd)))
- pos += 4
- copy(buf[pos:pos+len(m.Cmd)], m.Cmd[:])
- pos += len(m.Cmd)
- return buf, nil
-}
-func (m *CliInband) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Cmd
- {
- siz := o.Uint32(tmp[pos : pos+4])
- pos += 4
- m.Cmd = codec.DecodeString(tmp[pos : pos+int(siz)])
- pos += len(m.Cmd)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Cmd, 0)
+ return buf.Bytes(), nil
+}
+func (m *CliInband) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Cmd = buf.DecodeString(0)
return nil
}
-// CliInbandReply represents VPP binary API message 'cli_inband_reply'.
+// CliInbandReply defines message 'cli_inband_reply'.
type CliInbandReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- XXX_ReplyLen uint32 `struc:"sizeof=Reply"`
- Reply string `json:"reply,omitempty"`
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ Reply string `binapi:"string[],name=reply" json:"reply,omitempty"`
}
-func (m *CliInbandReply) Reset() { *m = CliInbandReply{} }
-func (*CliInbandReply) GetMessageName() string { return "cli_inband_reply" }
-func (*CliInbandReply) GetCrcString() string { return "05879051" }
-func (*CliInbandReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *CliInbandReply) Reset() { *m = CliInbandReply{} }
+func (*CliInbandReply) GetMessageName() string { return "cli_inband_reply" }
+func (*CliInbandReply) GetCrcString() string { return "05879051" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.Reply
- size += 4 + len(m.Reply)
+ size += 4 // m.Retval
+ size += 4 + len(m.Reply) // m.Reply
return size
}
func (m *CliInbandReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.Reply
- o.PutUint32(buf[pos:pos+4], uint32(len(m.Reply)))
- pos += 4
- copy(buf[pos:pos+len(m.Reply)], m.Reply[:])
- pos += len(m.Reply)
- return buf, nil
-}
-func (m *CliInbandReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Reply
- {
- siz := o.Uint32(tmp[pos : pos+4])
- pos += 4
- m.Reply = codec.DecodeString(tmp[pos : pos+int(siz)])
- pos += len(m.Reply)
+ b = make([]byte, m.Size())
}
+ 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 = buf.DecodeInt32()
+ m.Reply = buf.DecodeString(0)
return nil
}
-// CliReply represents VPP binary API message 'cli_reply'.
+// CliReply defines message 'cli_reply'.
type CliReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
ReplyInShmem uint64 `binapi:"u64,name=reply_in_shmem" json:"reply_in_shmem,omitempty"`
}
-func (m *CliReply) Reset() { *m = CliReply{} }
-func (*CliReply) GetMessageName() string { return "cli_reply" }
-func (*CliReply) GetCrcString() string { return "06d68297" }
-func (*CliReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *CliReply) Reset() { *m = CliReply{} }
+func (*CliReply) GetMessageName() string { return "cli_reply" }
+func (*CliReply) GetCrcString() string { return "06d68297" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.ReplyInShmem
- size += 8
+ size += 4 // m.Retval
+ size += 8 // m.ReplyInShmem
return size
}
func (m *CliReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.ReplyInShmem
- o.PutUint64(buf[pos:pos+8], uint64(m.ReplyInShmem))
- pos += 8
- return buf, nil
-}
-func (m *CliReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ReplyInShmem
- m.ReplyInShmem = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
+ 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 = buf.DecodeInt32()
+ m.ReplyInShmem = buf.DecodeUint64()
return nil
}
-// ControlPing represents VPP binary API message 'control_ping'.
+// ControlPing defines message 'control_ping'.
type ControlPing struct{}
-func (m *ControlPing) Reset() { *m = ControlPing{} }
-func (*ControlPing) GetMessageName() string { return "control_ping" }
-func (*ControlPing) GetCrcString() string { return "51077d14" }
-func (*ControlPing) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ControlPing) Reset() { *m = ControlPing{} }
+func (*ControlPing) GetMessageName() string { return "control_ping" }
+func (*ControlPing) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *ControlPing) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *ControlPing) Unmarshal(b []byte) error {
return nil
}
-// ControlPingReply represents VPP binary API message 'control_ping_reply'.
+// ControlPingReply defines message 'control_ping_reply'.
type ControlPingReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
ClientIndex uint32 `binapi:"u32,name=client_index" json:"client_index,omitempty"`
VpePID uint32 `binapi:"u32,name=vpe_pid" json:"vpe_pid,omitempty"`
}
-func (m *ControlPingReply) Reset() { *m = ControlPingReply{} }
-func (*ControlPingReply) GetMessageName() string { return "control_ping_reply" }
-func (*ControlPingReply) GetCrcString() string { return "f6b0b8ca" }
-func (*ControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ControlPingReply) Reset() { *m = ControlPingReply{} }
+func (*ControlPingReply) GetMessageName() string { return "control_ping_reply" }
+func (*ControlPingReply) GetCrcString() string { return "f6b0b8ca" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.ClientIndex
- size += 4
- // field[1] m.VpePID
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.ClientIndex
+ size += 4 // m.VpePID
return size
}
func (m *ControlPingReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.ClientIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ClientIndex))
- pos += 4
- // field[1] m.VpePID
- o.PutUint32(buf[pos:pos+4], uint32(m.VpePID))
- pos += 4
- return buf, nil
-}
-func (m *ControlPingReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ClientIndex
- m.ClientIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VpePID
- m.VpePID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.ClientIndex = buf.DecodeUint32()
+ m.VpePID = buf.DecodeUint32()
return nil
}
-// GetF64EndianValue represents VPP binary API message 'get_f64_endian_value'.
+// GetF64EndianValue defines message 'get_f64_endian_value'.
type GetF64EndianValue struct {
F64One float64 `binapi:"f64,name=f64_one,default=1" json:"f64_one,omitempty"`
}
-func (m *GetF64EndianValue) Reset() { *m = GetF64EndianValue{} }
-func (*GetF64EndianValue) GetMessageName() string { return "get_f64_endian_value" }
-func (*GetF64EndianValue) GetCrcString() string { return "809fcd44" }
-func (*GetF64EndianValue) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *GetF64EndianValue) Reset() { *m = GetF64EndianValue{} }
+func (*GetF64EndianValue) GetMessageName() string { return "get_f64_endian_value" }
+func (*GetF64EndianValue) GetCrcString() string { return "809fcd44" }
+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
- // field[1] m.F64One
- size += 8
+ size += 8 // m.F64One
return size
}
func (m *GetF64EndianValue) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.F64One
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64One)))
- pos += 8
- return buf, nil
-}
-func (m *GetF64EndianValue) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.F64One
- m.F64One = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
+ 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 = buf.DecodeFloat64()
return nil
}
-// GetF64EndianValueReply represents VPP binary API message 'get_f64_endian_value_reply'.
+// GetF64EndianValueReply defines message 'get_f64_endian_value_reply'.
type GetF64EndianValueReply struct {
Retval uint32 `binapi:"u32,name=retval" json:"retval,omitempty"`
F64OneResult float64 `binapi:"f64,name=f64_one_result" json:"f64_one_result,omitempty"`
}
-func (m *GetF64EndianValueReply) Reset() { *m = GetF64EndianValueReply{} }
-func (*GetF64EndianValueReply) GetMessageName() string { return "get_f64_endian_value_reply" }
-func (*GetF64EndianValueReply) GetCrcString() string { return "7e02e404" }
-func (*GetF64EndianValueReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *GetF64EndianValueReply) Reset() { *m = GetF64EndianValueReply{} }
+func (*GetF64EndianValueReply) GetMessageName() string { return "get_f64_endian_value_reply" }
+func (*GetF64EndianValueReply) GetCrcString() string { return "7e02e404" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.F64OneResult
- size += 8
+ size += 4 // m.Retval
+ size += 8 // m.F64OneResult
return size
}
func (m *GetF64EndianValueReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.F64OneResult
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64OneResult)))
- pos += 8
- return buf, nil
-}
-func (m *GetF64EndianValueReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.F64OneResult
- m.F64OneResult = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
+ 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 = buf.DecodeFloat64()
return nil
}
-// GetF64IncrementByOne represents VPP binary API message 'get_f64_increment_by_one'.
+// GetF64IncrementByOne defines message 'get_f64_increment_by_one'.
type GetF64IncrementByOne struct {
F64Value float64 `binapi:"f64,name=f64_value,default=1" json:"f64_value,omitempty"`
}
-func (m *GetF64IncrementByOne) Reset() { *m = GetF64IncrementByOne{} }
-func (*GetF64IncrementByOne) GetMessageName() string { return "get_f64_increment_by_one" }
-func (*GetF64IncrementByOne) GetCrcString() string { return "b64f027e" }
-func (*GetF64IncrementByOne) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *GetF64IncrementByOne) Reset() { *m = GetF64IncrementByOne{} }
+func (*GetF64IncrementByOne) GetMessageName() string { return "get_f64_increment_by_one" }
+func (*GetF64IncrementByOne) GetCrcString() string { return "b64f027e" }
+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
- // field[1] m.F64Value
- size += 8
+ size += 8 // m.F64Value
return size
}
func (m *GetF64IncrementByOne) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.F64Value
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64Value)))
- pos += 8
- return buf, nil
-}
-func (m *GetF64IncrementByOne) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.F64Value
- m.F64Value = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
+ 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 = buf.DecodeFloat64()
return nil
}
-// GetF64IncrementByOneReply represents VPP binary API message 'get_f64_increment_by_one_reply'.
+// GetF64IncrementByOneReply defines message 'get_f64_increment_by_one_reply'.
type GetF64IncrementByOneReply struct {
Retval uint32 `binapi:"u32,name=retval" json:"retval,omitempty"`
F64Value float64 `binapi:"f64,name=f64_value" json:"f64_value,omitempty"`
}
-func (m *GetF64IncrementByOneReply) Reset() { *m = GetF64IncrementByOneReply{} }
-func (*GetF64IncrementByOneReply) GetMessageName() string { return "get_f64_increment_by_one_reply" }
-func (*GetF64IncrementByOneReply) GetCrcString() string { return "d25dbaa3" }
-func (*GetF64IncrementByOneReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *GetF64IncrementByOneReply) Reset() { *m = GetF64IncrementByOneReply{} }
+func (*GetF64IncrementByOneReply) GetMessageName() string { return "get_f64_increment_by_one_reply" }
+func (*GetF64IncrementByOneReply) GetCrcString() string { return "d25dbaa3" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.F64Value
- size += 8
+ size += 4 // m.Retval
+ size += 8 // m.F64Value
return size
}
func (m *GetF64IncrementByOneReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.F64Value
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64Value)))
- pos += 8
- return buf, nil
-}
-func (m *GetF64IncrementByOneReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.F64Value
- m.F64Value = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
+ 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 = buf.DecodeFloat64()
return nil
}
-// GetNextIndex represents VPP binary API message 'get_next_index'.
+// GetNextIndex defines message 'get_next_index'.
type GetNextIndex struct {
- NodeName []byte `binapi:"u8[64],name=node_name" json:"node_name,omitempty" struc:"[64]byte"`
- NextName []byte `binapi:"u8[64],name=next_name" json:"next_name,omitempty" struc:"[64]byte"`
+ NodeName []byte `binapi:"u8[64],name=node_name" json:"node_name,omitempty"`
+ NextName []byte `binapi:"u8[64],name=next_name" json:"next_name,omitempty"`
}
-func (m *GetNextIndex) Reset() { *m = GetNextIndex{} }
-func (*GetNextIndex) GetMessageName() string { return "get_next_index" }
-func (*GetNextIndex) GetCrcString() string { return "9ab92f7a" }
-func (*GetNextIndex) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *GetNextIndex) Reset() { *m = GetNextIndex{} }
+func (*GetNextIndex) GetMessageName() string { return "get_next_index" }
+func (*GetNextIndex) GetCrcString() string { return "9ab92f7a" }
+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
- // field[1] m.NodeName
- size += 64
- // field[1] m.NextName
- size += 64
+ size += 1 * 64 // m.NodeName
+ size += 1 * 64 // m.NextName
return size
}
func (m *GetNextIndex) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.NodeName
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.NodeName) {
- x = uint8(m.NodeName[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.NextName
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.NextName) {
- x = uint8(m.NextName[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *GetNextIndex) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.NodeName
- m.NodeName = make([]uint8, 64)
- for i := 0; i < len(m.NodeName); i++ {
- m.NodeName[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.NextName
- m.NextName = make([]uint8, 64)
- for i := 0; i < len(m.NextName); i++ {
- m.NextName[i] = uint8(tmp[pos])
- pos += 1
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.NodeName, 64)
+ buf.EncodeBytes(m.NextName, 64)
+ return buf.Bytes(), nil
+}
+func (m *GetNextIndex) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.NodeName = make([]byte, 64)
+ copy(m.NodeName, buf.DecodeBytes(len(m.NodeName)))
+ m.NextName = make([]byte, 64)
+ copy(m.NextName, buf.DecodeBytes(len(m.NextName)))
return nil
}
-// GetNextIndexReply represents VPP binary API message 'get_next_index_reply'.
+// GetNextIndexReply defines message 'get_next_index_reply'.
type GetNextIndexReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
NextIndex uint32 `binapi:"u32,name=next_index" json:"next_index,omitempty"`
}
-func (m *GetNextIndexReply) Reset() { *m = GetNextIndexReply{} }
-func (*GetNextIndexReply) GetMessageName() string { return "get_next_index_reply" }
-func (*GetNextIndexReply) GetCrcString() string { return "2ed75f32" }
-func (*GetNextIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *GetNextIndexReply) Reset() { *m = GetNextIndexReply{} }
+func (*GetNextIndexReply) GetMessageName() string { return "get_next_index_reply" }
+func (*GetNextIndexReply) GetCrcString() string { return "2ed75f32" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.NextIndex
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.NextIndex
return size
}
func (m *GetNextIndexReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.NextIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.NextIndex))
- pos += 4
- return buf, nil
-}
-func (m *GetNextIndexReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NextIndex
- m.NextIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
+ m.NextIndex = buf.DecodeUint32()
return nil
}
-// GetNodeGraph represents VPP binary API message 'get_node_graph'.
+// GetNodeGraph defines message 'get_node_graph'.
type GetNodeGraph struct{}
-func (m *GetNodeGraph) Reset() { *m = GetNodeGraph{} }
-func (*GetNodeGraph) GetMessageName() string { return "get_node_graph" }
-func (*GetNodeGraph) GetCrcString() string { return "51077d14" }
-func (*GetNodeGraph) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *GetNodeGraph) Reset() { *m = GetNodeGraph{} }
+func (*GetNodeGraph) GetMessageName() string { return "get_node_graph" }
+func (*GetNodeGraph) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *GetNodeGraph) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *GetNodeGraph) Unmarshal(b []byte) error {
return nil
}
-// GetNodeGraphReply represents VPP binary API message 'get_node_graph_reply'.
+// GetNodeGraphReply defines message 'get_node_graph_reply'.
type GetNodeGraphReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
ReplyInShmem uint64 `binapi:"u64,name=reply_in_shmem" json:"reply_in_shmem,omitempty"`
}
-func (m *GetNodeGraphReply) Reset() { *m = GetNodeGraphReply{} }
-func (*GetNodeGraphReply) GetMessageName() string { return "get_node_graph_reply" }
-func (*GetNodeGraphReply) GetCrcString() string { return "06d68297" }
-func (*GetNodeGraphReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *GetNodeGraphReply) Reset() { *m = GetNodeGraphReply{} }
+func (*GetNodeGraphReply) GetMessageName() string { return "get_node_graph_reply" }
+func (*GetNodeGraphReply) GetCrcString() string { return "06d68297" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.ReplyInShmem
- size += 8
+ size += 4 // m.Retval
+ size += 8 // m.ReplyInShmem
return size
}
func (m *GetNodeGraphReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.ReplyInShmem
- o.PutUint64(buf[pos:pos+8], uint64(m.ReplyInShmem))
- pos += 8
- return buf, nil
-}
-func (m *GetNodeGraphReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ReplyInShmem
- m.ReplyInShmem = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
+ 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 = buf.DecodeInt32()
+ m.ReplyInShmem = buf.DecodeUint64()
return nil
}
-// GetNodeIndex represents VPP binary API message 'get_node_index'.
+// GetNodeIndex defines message 'get_node_index'.
type GetNodeIndex struct {
- NodeName []byte `binapi:"u8[64],name=node_name" json:"node_name,omitempty" struc:"[64]byte"`
+ NodeName []byte `binapi:"u8[64],name=node_name" json:"node_name,omitempty"`
}
-func (m *GetNodeIndex) Reset() { *m = GetNodeIndex{} }
-func (*GetNodeIndex) GetMessageName() string { return "get_node_index" }
-func (*GetNodeIndex) GetCrcString() string { return "6c9a495d" }
-func (*GetNodeIndex) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *GetNodeIndex) Reset() { *m = GetNodeIndex{} }
+func (*GetNodeIndex) GetMessageName() string { return "get_node_index" }
+func (*GetNodeIndex) GetCrcString() string { return "6c9a495d" }
+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
- // field[1] m.NodeName
- size += 64
+ size += 1 * 64 // m.NodeName
return size
}
func (m *GetNodeIndex) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.NodeName
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.NodeName) {
- x = uint8(m.NodeName[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *GetNodeIndex) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.NodeName
- m.NodeName = make([]uint8, 64)
- for i := 0; i < len(m.NodeName); i++ {
- m.NodeName[i] = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeBytes(m.NodeName, 64)
+ return buf.Bytes(), nil
+}
+func (m *GetNodeIndex) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.NodeName = make([]byte, 64)
+ copy(m.NodeName, buf.DecodeBytes(len(m.NodeName)))
return nil
}
-// GetNodeIndexReply represents VPP binary API message 'get_node_index_reply'.
+// GetNodeIndexReply defines message 'get_node_index_reply'.
type GetNodeIndexReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
NodeIndex uint32 `binapi:"u32,name=node_index" json:"node_index,omitempty"`
}
-func (m *GetNodeIndexReply) Reset() { *m = GetNodeIndexReply{} }
-func (*GetNodeIndexReply) GetMessageName() string { return "get_node_index_reply" }
-func (*GetNodeIndexReply) GetCrcString() string { return "a8600b89" }
-func (*GetNodeIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *GetNodeIndexReply) Reset() { *m = GetNodeIndexReply{} }
+func (*GetNodeIndexReply) GetMessageName() string { return "get_node_index_reply" }
+func (*GetNodeIndexReply) GetCrcString() string { return "a8600b89" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.NodeIndex
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.NodeIndex
return size
}
func (m *GetNodeIndexReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.NodeIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.NodeIndex))
- pos += 4
- return buf, nil
-}
-func (m *GetNodeIndexReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NodeIndex
- m.NodeIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ 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 = buf.DecodeInt32()
+ m.NodeIndex = buf.DecodeUint32()
return nil
}
-// LogDetails represents VPP binary API message 'log_details'.
+// LogDetails defines message 'log_details'.
type LogDetails struct {
Timestamp Timestamp `binapi:"timestamp,name=timestamp" json:"timestamp,omitempty"`
Level LogLevel `binapi:"log_level,name=level" json:"level,omitempty"`
- MsgClass string `binapi:"string[32],name=msg_class" json:"msg_class,omitempty" struc:"[32]byte"`
- Message string `binapi:"string[256],name=message" json:"message,omitempty" struc:"[256]byte"`
+ MsgClass string `binapi:"string[32],name=msg_class" json:"msg_class,omitempty"`
+ Message string `binapi:"string[256],name=message" json:"message,omitempty"`
}
-func (m *LogDetails) Reset() { *m = LogDetails{} }
-func (*LogDetails) GetMessageName() string { return "log_details" }
-func (*LogDetails) GetCrcString() string { return "255827a1" }
-func (*LogDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *LogDetails) Reset() { *m = LogDetails{} }
+func (*LogDetails) GetMessageName() string { return "log_details" }
+func (*LogDetails) GetCrcString() string { return "255827a1" }
+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
- // field[1] m.Timestamp
- size += 8
- // field[1] m.Level
- size += 4
- // field[1] m.MsgClass
- size += 32
- // field[1] m.Message
- size += 256
+ size += 8 // m.Timestamp
+ size += 4 // m.Level
+ size += 32 // m.MsgClass
+ size += 256 // m.Message
return size
}
func (m *LogDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Timestamp
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.Timestamp)))
- pos += 8
- // field[1] m.Level
- o.PutUint32(buf[pos:pos+4], uint32(m.Level))
- pos += 4
- // field[1] m.MsgClass
- copy(buf[pos:pos+32], m.MsgClass)
- pos += 32
- // field[1] m.Message
- copy(buf[pos:pos+256], m.Message)
- pos += 256
- return buf, nil
-}
-func (m *LogDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Timestamp
- m.Timestamp = Timestamp(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- // field[1] m.Level
- m.Level = LogLevel(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MsgClass
- {
- nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
- m.MsgClass = codec.DecodeString(tmp[pos : pos+nul])
- pos += 32
- }
- // field[1] m.Message
- {
- nul := bytes.Index(tmp[pos:pos+256], []byte{0x00})
- m.Message = codec.DecodeString(tmp[pos : pos+nul])
- pos += 256
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeFloat64(float64(m.Timestamp))
+ buf.EncodeUint32(uint32(m.Level))
+ buf.EncodeString(m.MsgClass, 32)
+ buf.EncodeString(m.Message, 256)
+ return buf.Bytes(), nil
+}
+func (m *LogDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Timestamp = Timestamp(buf.DecodeFloat64())
+ m.Level = LogLevel(buf.DecodeUint32())
+ m.MsgClass = buf.DecodeString(32)
+ m.Message = buf.DecodeString(256)
return nil
}
-// LogDump represents VPP binary API message 'log_dump'.
+// LogDump defines message 'log_dump'.
type LogDump struct {
StartTimestamp Timestamp `binapi:"timestamp,name=start_timestamp" json:"start_timestamp,omitempty"`
}
-func (m *LogDump) Reset() { *m = LogDump{} }
-func (*LogDump) GetMessageName() string { return "log_dump" }
-func (*LogDump) GetCrcString() string { return "6ab31753" }
-func (*LogDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *LogDump) Reset() { *m = LogDump{} }
+func (*LogDump) GetMessageName() string { return "log_dump" }
+func (*LogDump) GetCrcString() string { return "6ab31753" }
+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
- // field[1] m.StartTimestamp
- size += 8
+ size += 8 // m.StartTimestamp
return size
}
func (m *LogDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.StartTimestamp
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.StartTimestamp)))
- pos += 8
- return buf, nil
-}
-func (m *LogDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.StartTimestamp
- m.StartTimestamp = Timestamp(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
+ buf := codec.NewBuffer(b)
+ buf.EncodeFloat64(float64(m.StartTimestamp))
+ return buf.Bytes(), nil
+}
+func (m *LogDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.StartTimestamp = Timestamp(buf.DecodeFloat64())
return nil
}
-// ShowThreads represents VPP binary API message 'show_threads'.
+// ShowThreads defines message 'show_threads'.
type ShowThreads struct{}
-func (m *ShowThreads) Reset() { *m = ShowThreads{} }
-func (*ShowThreads) GetMessageName() string { return "show_threads" }
-func (*ShowThreads) GetCrcString() string { return "51077d14" }
-func (*ShowThreads) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ShowThreads) Reset() { *m = ShowThreads{} }
+func (*ShowThreads) GetMessageName() string { return "show_threads" }
+func (*ShowThreads) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *ShowThreads) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *ShowThreads) Unmarshal(b []byte) error {
return nil
}
-// ShowThreadsReply represents VPP binary API message 'show_threads_reply'.
+// ShowThreadsReply defines message 'show_threads_reply'.
type ShowThreadsReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=ThreadData"`
+ Count uint32 `binapi:"u32,name=count" json:"-"`
ThreadData []ThreadData `binapi:"thread_data[count],name=thread_data" json:"thread_data,omitempty"`
}
-func (m *ShowThreadsReply) Reset() { *m = ShowThreadsReply{} }
-func (*ShowThreadsReply) GetMessageName() string { return "show_threads_reply" }
-func (*ShowThreadsReply) GetCrcString() string { return "f5e0b66f" }
-func (*ShowThreadsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ShowThreadsReply) Reset() { *m = ShowThreadsReply{} }
+func (*ShowThreadsReply) GetMessageName() string { return "show_threads_reply" }
+func (*ShowThreadsReply) GetCrcString() string { return "f5e0b66f" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.Count
- size += 4
- // field[1] m.ThreadData
+ size += 4 // m.Retval
+ size += 4 // m.Count
for j1 := 0; j1 < len(m.ThreadData); j1++ {
var s1 ThreadData
_ = s1
if j1 < len(m.ThreadData) {
s1 = m.ThreadData[j1]
}
- // field[2] s1.ID
- size += 4
- // field[2] s1.Name
- size += 64
- // field[2] s1.Type
- size += 64
- // field[2] s1.PID
- size += 4
- // field[2] s1.CPUID
- size += 4
- // field[2] s1.Core
- size += 4
- // field[2] s1.CPUSocket
- size += 4
+ size += 4 // s1.ID
+ size += 1 * 64 // s1.Name
+ size += 1 * 64 // s1.Type
+ size += 4 // s1.PID
+ size += 4 // s1.CPUID
+ size += 4 // s1.Core
+ size += 4 // s1.CPUSocket
}
return size
}
func (m *ShowThreadsReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.ThreadData)))
- pos += 4
- // field[1] m.ThreadData
- for j1 := 0; j1 < len(m.ThreadData); j1++ {
- var v1 ThreadData
- if j1 < len(m.ThreadData) {
- v1 = m.ThreadData[j1]
- }
- // field[2] v1.ID
- o.PutUint32(buf[pos:pos+4], uint32(v1.ID))
- pos += 4
- // field[2] v1.Name
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(v1.Name) {
- x = uint8(v1.Name[i])
- }
- buf[pos] = uint8(x)
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ 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 // ThreadData
+ if j0 < len(m.ThreadData) {
+ v0 = m.ThreadData[j0]
}
- // field[2] v1.Type
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(v1.Type) {
- x = uint8(v1.Type[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.PID
- o.PutUint32(buf[pos:pos+4], uint32(v1.PID))
- pos += 4
- // field[2] v1.CPUID
- o.PutUint32(buf[pos:pos+4], uint32(v1.CPUID))
- pos += 4
- // field[2] v1.Core
- o.PutUint32(buf[pos:pos+4], uint32(v1.Core))
- pos += 4
- // field[2] v1.CPUSocket
- o.PutUint32(buf[pos:pos+4], uint32(v1.CPUSocket))
- pos += 4
- }
- return buf, nil
-}
-func (m *ShowThreadsReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ThreadData
- m.ThreadData = make([]ThreadData, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.ThreadData[j1].ID
- m.ThreadData[j1].ID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.ThreadData[j1].Name
- m.ThreadData[j1].Name = make([]uint8, 64)
- for i := 0; i < len(m.ThreadData[j1].Name); i++ {
- m.ThreadData[j1].Name[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.ThreadData[j1].Type
- m.ThreadData[j1].Type = make([]uint8, 64)
- for i := 0; i < len(m.ThreadData[j1].Type); i++ {
- m.ThreadData[j1].Type[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.ThreadData[j1].PID
- m.ThreadData[j1].PID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.ThreadData[j1].CPUID
- m.ThreadData[j1].CPUID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.ThreadData[j1].Core
- m.ThreadData[j1].Core = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.ThreadData[j1].CPUSocket
- m.ThreadData[j1].CPUSocket = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ buf.EncodeUint32(v0.ID)
+ buf.EncodeBytes(v0.Name, 64)
+ buf.EncodeBytes(v0.Type, 64)
+ 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 = buf.DecodeInt32()
+ m.Count = buf.DecodeUint32()
+ m.ThreadData = make([]ThreadData, m.Count)
+ for j0 := 0; j0 < len(m.ThreadData); j0++ {
+ m.ThreadData[j0].ID = buf.DecodeUint32()
+ m.ThreadData[j0].Name = make([]byte, 64)
+ copy(m.ThreadData[j0].Name, buf.DecodeBytes(len(m.ThreadData[j0].Name)))
+ m.ThreadData[j0].Type = make([]byte, 64)
+ copy(m.ThreadData[j0].Type, buf.DecodeBytes(len(m.ThreadData[j0].Type)))
+ m.ThreadData[j0].PID = buf.DecodeUint32()
+ m.ThreadData[j0].CPUID = buf.DecodeUint32()
+ m.ThreadData[j0].Core = buf.DecodeUint32()
+ m.ThreadData[j0].CPUSocket = buf.DecodeUint32()
}
return nil
}
-// ShowVersion represents VPP binary API message 'show_version'.
+// ShowVersion defines message 'show_version'.
type ShowVersion struct{}
-func (m *ShowVersion) Reset() { *m = ShowVersion{} }
-func (*ShowVersion) GetMessageName() string { return "show_version" }
-func (*ShowVersion) GetCrcString() string { return "51077d14" }
-func (*ShowVersion) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ShowVersion) Reset() { *m = ShowVersion{} }
+func (*ShowVersion) GetMessageName() string { return "show_version" }
+func (*ShowVersion) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *ShowVersion) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *ShowVersion) Unmarshal(b []byte) error {
return nil
}
-// ShowVersionReply represents VPP binary API message 'show_version_reply'.
+// ShowVersionReply defines message 'show_version_reply'.
type ShowVersionReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- Program string `binapi:"string[32],name=program" json:"program,omitempty" struc:"[32]byte"`
- Version string `binapi:"string[32],name=version" json:"version,omitempty" struc:"[32]byte"`
- BuildDate string `binapi:"string[32],name=build_date" json:"build_date,omitempty" struc:"[32]byte"`
- BuildDirectory string `binapi:"string[256],name=build_directory" json:"build_directory,omitempty" struc:"[256]byte"`
+ Program string `binapi:"string[32],name=program" json:"program,omitempty"`
+ Version string `binapi:"string[32],name=version" json:"version,omitempty"`
+ BuildDate string `binapi:"string[32],name=build_date" json:"build_date,omitempty"`
+ BuildDirectory string `binapi:"string[256],name=build_directory" json:"build_directory,omitempty"`
}
-func (m *ShowVersionReply) Reset() { *m = ShowVersionReply{} }
-func (*ShowVersionReply) GetMessageName() string { return "show_version_reply" }
-func (*ShowVersionReply) GetCrcString() string { return "c919bde1" }
-func (*ShowVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ShowVersionReply) Reset() { *m = ShowVersionReply{} }
+func (*ShowVersionReply) GetMessageName() string { return "show_version_reply" }
+func (*ShowVersionReply) GetCrcString() string { return "c919bde1" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.Program
- size += 32
- // field[1] m.Version
- size += 32
- // field[1] m.BuildDate
- size += 32
- // field[1] m.BuildDirectory
- size += 256
+ size += 4 // m.Retval
+ size += 32 // m.Program
+ size += 32 // m.Version
+ size += 32 // m.BuildDate
+ size += 256 // m.BuildDirectory
return size
}
func (m *ShowVersionReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.Program
- copy(buf[pos:pos+32], m.Program)
- pos += 32
- // field[1] m.Version
- copy(buf[pos:pos+32], m.Version)
- pos += 32
- // field[1] m.BuildDate
- copy(buf[pos:pos+32], m.BuildDate)
- pos += 32
- // field[1] m.BuildDirectory
- copy(buf[pos:pos+256], m.BuildDirectory)
- pos += 256
- return buf, nil
-}
-func (m *ShowVersionReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Program
- {
- nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
- m.Program = codec.DecodeString(tmp[pos : pos+nul])
- pos += 32
- }
- // field[1] m.Version
- {
- nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
- m.Version = codec.DecodeString(tmp[pos : pos+nul])
- pos += 32
- }
- // field[1] m.BuildDate
- {
- nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
- m.BuildDate = codec.DecodeString(tmp[pos : pos+nul])
- pos += 32
- }
- // field[1] m.BuildDirectory
- {
- nul := bytes.Index(tmp[pos:pos+256], []byte{0x00})
- m.BuildDirectory = codec.DecodeString(tmp[pos : pos+nul])
- pos += 256
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeString(m.Program, 32)
+ buf.EncodeString(m.Version, 32)
+ buf.EncodeString(m.BuildDate, 32)
+ buf.EncodeString(m.BuildDirectory, 256)
+ return buf.Bytes(), nil
+}
+func (m *ShowVersionReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.Program = buf.DecodeString(32)
+ m.Version = buf.DecodeString(32)
+ m.BuildDate = buf.DecodeString(32)
+ m.BuildDirectory = buf.DecodeString(256)
return nil
}
-// ShowVpeSystemTime represents VPP binary API message 'show_vpe_system_time'.
+// ShowVpeSystemTime defines message 'show_vpe_system_time'.
type ShowVpeSystemTime struct{}
-func (m *ShowVpeSystemTime) Reset() { *m = ShowVpeSystemTime{} }
-func (*ShowVpeSystemTime) GetMessageName() string { return "show_vpe_system_time" }
-func (*ShowVpeSystemTime) GetCrcString() string { return "51077d14" }
-func (*ShowVpeSystemTime) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *ShowVpeSystemTime) Reset() { *m = ShowVpeSystemTime{} }
+func (*ShowVpeSystemTime) GetMessageName() string { return "show_vpe_system_time" }
+func (*ShowVpeSystemTime) GetCrcString() string { return "51077d14" }
+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) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *ShowVpeSystemTime) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *ShowVpeSystemTime) Unmarshal(b []byte) error {
return nil
}
-// ShowVpeSystemTimeReply represents VPP binary API message 'show_vpe_system_time_reply'.
+// ShowVpeSystemTimeReply defines message 'show_vpe_system_time_reply'.
type ShowVpeSystemTimeReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
VpeSystemTime Timestamp `binapi:"timestamp,name=vpe_system_time" json:"vpe_system_time,omitempty"`
}
-func (m *ShowVpeSystemTimeReply) Reset() { *m = ShowVpeSystemTimeReply{} }
-func (*ShowVpeSystemTimeReply) GetMessageName() string { return "show_vpe_system_time_reply" }
-func (*ShowVpeSystemTimeReply) GetCrcString() string { return "7ffd8193" }
-func (*ShowVpeSystemTimeReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *ShowVpeSystemTimeReply) Reset() { *m = ShowVpeSystemTimeReply{} }
+func (*ShowVpeSystemTimeReply) GetMessageName() string { return "show_vpe_system_time_reply" }
+func (*ShowVpeSystemTimeReply) GetCrcString() string { return "7ffd8193" }
+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
- // field[1] m.Retval
- size += 4
- // field[1] m.VpeSystemTime
- size += 8
+ size += 4 // m.Retval
+ size += 8 // m.VpeSystemTime
return size
}
func (m *ShowVpeSystemTimeReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.VpeSystemTime
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.VpeSystemTime)))
- pos += 8
- return buf, nil
-}
-func (m *ShowVpeSystemTimeReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VpeSystemTime
- m.VpeSystemTime = Timestamp(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
+ 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 = buf.DecodeInt32()
+ m.VpeSystemTime = Timestamp(buf.DecodeFloat64())
return nil
}
func init() { file_vpe_binapi_init() }
func file_vpe_binapi_init() {
- api.RegisterMessage((*AddNodeNext)(nil), "vpe.AddNodeNext")
- api.RegisterMessage((*AddNodeNextReply)(nil), "vpe.AddNodeNextReply")
- api.RegisterMessage((*Cli)(nil), "vpe.Cli")
- api.RegisterMessage((*CliInband)(nil), "vpe.CliInband")
- api.RegisterMessage((*CliInbandReply)(nil), "vpe.CliInbandReply")
- api.RegisterMessage((*CliReply)(nil), "vpe.CliReply")
- api.RegisterMessage((*ControlPing)(nil), "vpe.ControlPing")
- api.RegisterMessage((*ControlPingReply)(nil), "vpe.ControlPingReply")
- api.RegisterMessage((*GetF64EndianValue)(nil), "vpe.GetF64EndianValue")
- api.RegisterMessage((*GetF64EndianValueReply)(nil), "vpe.GetF64EndianValueReply")
- api.RegisterMessage((*GetF64IncrementByOne)(nil), "vpe.GetF64IncrementByOne")
- api.RegisterMessage((*GetF64IncrementByOneReply)(nil), "vpe.GetF64IncrementByOneReply")
- api.RegisterMessage((*GetNextIndex)(nil), "vpe.GetNextIndex")
- api.RegisterMessage((*GetNextIndexReply)(nil), "vpe.GetNextIndexReply")
- api.RegisterMessage((*GetNodeGraph)(nil), "vpe.GetNodeGraph")
- api.RegisterMessage((*GetNodeGraphReply)(nil), "vpe.GetNodeGraphReply")
- api.RegisterMessage((*GetNodeIndex)(nil), "vpe.GetNodeIndex")
- api.RegisterMessage((*GetNodeIndexReply)(nil), "vpe.GetNodeIndexReply")
- api.RegisterMessage((*LogDetails)(nil), "vpe.LogDetails")
- api.RegisterMessage((*LogDump)(nil), "vpe.LogDump")
- api.RegisterMessage((*ShowThreads)(nil), "vpe.ShowThreads")
- api.RegisterMessage((*ShowThreadsReply)(nil), "vpe.ShowThreadsReply")
- api.RegisterMessage((*ShowVersion)(nil), "vpe.ShowVersion")
- api.RegisterMessage((*ShowVersionReply)(nil), "vpe.ShowVersionReply")
- api.RegisterMessage((*ShowVpeSystemTime)(nil), "vpe.ShowVpeSystemTime")
- api.RegisterMessage((*ShowVpeSystemTimeReply)(nil), "vpe.ShowVpeSystemTimeReply")
+ api.RegisterMessage((*AddNodeNext)(nil), "add_node_next_9ab92f7a")
+ api.RegisterMessage((*AddNodeNextReply)(nil), "add_node_next_reply_2ed75f32")
+ api.RegisterMessage((*Cli)(nil), "cli_23bfbfff")
+ api.RegisterMessage((*CliInband)(nil), "cli_inband_f8377302")
+ api.RegisterMessage((*CliInbandReply)(nil), "cli_inband_reply_05879051")
+ api.RegisterMessage((*CliReply)(nil), "cli_reply_06d68297")
+ api.RegisterMessage((*ControlPing)(nil), "control_ping_51077d14")
+ api.RegisterMessage((*ControlPingReply)(nil), "control_ping_reply_f6b0b8ca")
+ api.RegisterMessage((*GetF64EndianValue)(nil), "get_f64_endian_value_809fcd44")
+ api.RegisterMessage((*GetF64EndianValueReply)(nil), "get_f64_endian_value_reply_7e02e404")
+ api.RegisterMessage((*GetF64IncrementByOne)(nil), "get_f64_increment_by_one_b64f027e")
+ api.RegisterMessage((*GetF64IncrementByOneReply)(nil), "get_f64_increment_by_one_reply_d25dbaa3")
+ api.RegisterMessage((*GetNextIndex)(nil), "get_next_index_9ab92f7a")
+ api.RegisterMessage((*GetNextIndexReply)(nil), "get_next_index_reply_2ed75f32")
+ api.RegisterMessage((*GetNodeGraph)(nil), "get_node_graph_51077d14")
+ api.RegisterMessage((*GetNodeGraphReply)(nil), "get_node_graph_reply_06d68297")
+ api.RegisterMessage((*GetNodeIndex)(nil), "get_node_index_6c9a495d")
+ api.RegisterMessage((*GetNodeIndexReply)(nil), "get_node_index_reply_a8600b89")
+ api.RegisterMessage((*LogDetails)(nil), "log_details_255827a1")
+ api.RegisterMessage((*LogDump)(nil), "log_dump_6ab31753")
+ api.RegisterMessage((*ShowThreads)(nil), "show_threads_51077d14")
+ api.RegisterMessage((*ShowThreadsReply)(nil), "show_threads_reply_f5e0b66f")
+ api.RegisterMessage((*ShowVersion)(nil), "show_version_51077d14")
+ api.RegisterMessage((*ShowVersionReply)(nil), "show_version_reply_c919bde1")
+ api.RegisterMessage((*ShowVpeSystemTime)(nil), "show_vpe_system_time_51077d14")
+ api.RegisterMessage((*ShowVpeSystemTimeReply)(nil), "show_vpe_system_time_reply_7ffd8193")
}
// Messages returns list of all messages in this module.
@@ -1688,14 +1124,3 @@ func AllMessages() []api.Message {
(*ShowVpeSystemTimeReply)(nil),
}
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
diff --git a/internal/testbinapi/binapi2001/vpe/vpe_rpc.ba.go b/internal/testbinapi/binapi2001/vpe/vpe_rpc.ba.go
index e81fb91..dfa669f 100644
--- a/internal/testbinapi/binapi2001/vpe/vpe_rpc.ba.go
+++ b/internal/testbinapi/binapi2001/vpe/vpe_rpc.ba.go
@@ -4,14 +4,13 @@ package vpe
import (
"context"
- "io"
-
+ "fmt"
api "git.fd.io/govpp.git/api"
+ "io"
)
-// RPCService represents RPC service API for vpe module.
+// RPCService defines RPC service vpe.
type RPCService interface {
- DumpLog(ctx context.Context, in *LogDump) (RPCService_DumpLogClient, error)
AddNodeNext(ctx context.Context, in *AddNodeNext) (*AddNodeNextReply, error)
Cli(ctx context.Context, in *Cli) (*CliReply, error)
CliInband(ctx context.Context, in *CliInband) (*CliInbandReply, error)
@@ -21,48 +20,23 @@ type RPCService interface {
GetNextIndex(ctx context.Context, in *GetNextIndex) (*GetNextIndexReply, error)
GetNodeGraph(ctx context.Context, in *GetNodeGraph) (*GetNodeGraphReply, error)
GetNodeIndex(ctx context.Context, in *GetNodeIndex) (*GetNodeIndexReply, error)
+ LogDump(ctx context.Context, in *LogDump) (RPCService_LogDumpClient, error)
ShowThreads(ctx context.Context, in *ShowThreads) (*ShowThreadsReply, error)
ShowVersion(ctx context.Context, in *ShowVersion) (*ShowVersionReply, error)
ShowVpeSystemTime(ctx context.Context, in *ShowVpeSystemTime) (*ShowVpeSystemTimeReply, error)
}
type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpLog(ctx context.Context, in *LogDump) (RPCService_DumpLogClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpLogClient{stream}
- return x, nil
-}
-
-type RPCService_DumpLogClient interface {
- Recv() (*LogDetails, error)
+ conn api.Connection
}
-type serviceClient_DumpLogClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpLogClient) Recv() (*LogDetails, error) {
- m := new(LogDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
}
func (c *serviceClient) AddNodeNext(ctx context.Context, in *AddNodeNext) (*AddNodeNextReply, error) {
out := new(AddNodeNextReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -71,7 +45,7 @@ func (c *serviceClient) AddNodeNext(ctx context.Context, in *AddNodeNext) (*AddN
func (c *serviceClient) Cli(ctx context.Context, in *Cli) (*CliReply, error) {
out := new(CliReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -80,7 +54,7 @@ func (c *serviceClient) Cli(ctx context.Context, in *Cli) (*CliReply, error) {
func (c *serviceClient) CliInband(ctx context.Context, in *CliInband) (*CliInbandReply, error) {
out := new(CliInbandReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -89,7 +63,7 @@ func (c *serviceClient) CliInband(ctx context.Context, in *CliInband) (*CliInban
func (c *serviceClient) ControlPing(ctx context.Context, in *ControlPing) (*ControlPingReply, error) {
out := new(ControlPingReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -98,7 +72,7 @@ func (c *serviceClient) ControlPing(ctx context.Context, in *ControlPing) (*Cont
func (c *serviceClient) GetF64EndianValue(ctx context.Context, in *GetF64EndianValue) (*GetF64EndianValueReply, error) {
out := new(GetF64EndianValueReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -107,7 +81,7 @@ func (c *serviceClient) GetF64EndianValue(ctx context.Context, in *GetF64EndianV
func (c *serviceClient) GetF64IncrementByOne(ctx context.Context, in *GetF64IncrementByOne) (*GetF64IncrementByOneReply, error) {
out := new(GetF64IncrementByOneReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -116,7 +90,7 @@ func (c *serviceClient) GetF64IncrementByOne(ctx context.Context, in *GetF64Incr
func (c *serviceClient) GetNextIndex(ctx context.Context, in *GetNextIndex) (*GetNextIndexReply, error) {
out := new(GetNextIndexReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -125,7 +99,7 @@ func (c *serviceClient) GetNextIndex(ctx context.Context, in *GetNextIndex) (*Ge
func (c *serviceClient) GetNodeGraph(ctx context.Context, in *GetNodeGraph) (*GetNodeGraphReply, error) {
out := new(GetNodeGraphReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -134,16 +108,55 @@ func (c *serviceClient) GetNodeGraph(ctx context.Context, in *GetNodeGraph) (*Ge
func (c *serviceClient) GetNodeIndex(ctx context.Context, in *GetNodeIndex) (*GetNodeIndexReply, error) {
out := new(GetNodeIndexReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
+func (c *serviceClient) LogDump(ctx context.Context, in *LogDump) (RPCService_LogDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_LogDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_LogDumpClient interface {
+ Recv() (*LogDetails, error)
+ api.Stream
+}
+
+type serviceClient_LogDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_LogDumpClient) Recv() (*LogDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *LogDetails:
+ return m, nil
+ case *ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
func (c *serviceClient) ShowThreads(ctx context.Context, in *ShowThreads) (*ShowThreadsReply, error) {
out := new(ShowThreadsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -152,7 +165,7 @@ func (c *serviceClient) ShowThreads(ctx context.Context, in *ShowThreads) (*Show
func (c *serviceClient) ShowVersion(ctx context.Context, in *ShowVersion) (*ShowVersionReply, error) {
out := new(ShowVersionReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
@@ -161,14 +174,9 @@ func (c *serviceClient) ShowVersion(ctx context.Context, in *ShowVersion) (*Show
func (c *serviceClient) ShowVpeSystemTime(ctx context.Context, in *ShowVpeSystemTime) (*ShowVpeSystemTimeReply, error) {
out := new(ShowVpeSystemTimeReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
+ err := c.conn.Invoke(ctx, in, out)
if err != nil {
return nil, err
}
return out, nil
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/internal/testbinapi/binapi2001/vpe_types/vpe_types.ba.go b/internal/testbinapi/binapi2001/vpe_types/vpe_types.ba.go
new file mode 100644
index 0000000..280005e
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vpe_types/vpe_types.ba.go
@@ -0,0 +1,88 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/vpe_types.api.json
+
+// Package vpe_types contains generated bindings for API file vpe_types.api.
+//
+// Contents:
+// 2 aliases
+// 1 enum
+// 1 struct
+//
+package vpe_types
+
+import (
+ api "git.fd.io/govpp.git/api"
+ "strconv"
+)
+
+// 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
+
+// LogLevel defines enum 'log_level'.
+type LogLevel uint32
+
+const (
+ VPE_API_LOG_LEVEL_EMERG LogLevel = 0
+ VPE_API_LOG_LEVEL_ALERT LogLevel = 1
+ VPE_API_LOG_LEVEL_CRIT LogLevel = 2
+ VPE_API_LOG_LEVEL_ERR LogLevel = 3
+ VPE_API_LOG_LEVEL_WARNING LogLevel = 4
+ VPE_API_LOG_LEVEL_NOTICE LogLevel = 5
+ VPE_API_LOG_LEVEL_INFO LogLevel = 6
+ VPE_API_LOG_LEVEL_DEBUG LogLevel = 7
+ VPE_API_LOG_LEVEL_DISABLED LogLevel = 8
+)
+
+var (
+ LogLevel_name = map[uint32]string{
+ 0: "VPE_API_LOG_LEVEL_EMERG",
+ 1: "VPE_API_LOG_LEVEL_ALERT",
+ 2: "VPE_API_LOG_LEVEL_CRIT",
+ 3: "VPE_API_LOG_LEVEL_ERR",
+ 4: "VPE_API_LOG_LEVEL_WARNING",
+ 5: "VPE_API_LOG_LEVEL_NOTICE",
+ 6: "VPE_API_LOG_LEVEL_INFO",
+ 7: "VPE_API_LOG_LEVEL_DEBUG",
+ 8: "VPE_API_LOG_LEVEL_DISABLED",
+ }
+ LogLevel_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x LogLevel) String() string {
+ s, ok := LogLevel_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LogLevel(" + strconv.Itoa(int(x)) + ")"
+}
+
+// Timedelta defines alias 'timedelta'.
+type Timedelta float64
+
+// Timestamp defines alias 'timestamp'.
+type Timestamp float64
+
+// Version defines type 'version'.
+type Version struct {
+ Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
+ Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
+ Patch uint32 `binapi:"u32,name=patch" json:"patch,omitempty"`
+ PreRelease []byte `binapi:"u8[17],name=pre_release" json:"pre_release,omitempty"`
+ BuildMetadata []byte `binapi:"u8[17],name=build_metadata" json:"build_metadata,omitempty"`
+}
diff --git a/internal/testbinapi/binapi2001/vxlan/vxlan.ba.go b/internal/testbinapi/binapi2001/vxlan/vxlan.ba.go
new file mode 100644
index 0000000..04a9541
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vxlan/vxlan.ba.go
@@ -0,0 +1,409 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/vxlan.api.json
+
+// Package vxlan contains generated bindings for API file vxlan.api.
+//
+// Contents:
+// 8 messages
+//
+package vxlan
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "vxlan"
+ APIVersion = "1.1.0"
+ VersionCrc = 0xa95aa271
+)
+
+// SwInterfaceSetVxlanBypass defines message 'sw_interface_set_vxlan_bypass'.
+type SwInterfaceSetVxlanBypass struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ Enable uint8 `binapi:"u8,name=enable" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetVxlanBypass) Reset() { *m = SwInterfaceSetVxlanBypass{} }
+func (*SwInterfaceSetVxlanBypass) GetMessageName() string { return "sw_interface_set_vxlan_bypass" }
+func (*SwInterfaceSetVxlanBypass) GetCrcString() string { return "e74ca095" }
+func (*SwInterfaceSetVxlanBypass) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetVxlanBypass) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetVxlanBypass) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeUint8(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetVxlanBypass) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.IsIPv6 = buf.DecodeUint8()
+ m.Enable = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceSetVxlanBypassReply defines message 'sw_interface_set_vxlan_bypass_reply'.
+type SwInterfaceSetVxlanBypassReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetVxlanBypassReply) Reset() { *m = SwInterfaceSetVxlanBypassReply{} }
+func (*SwInterfaceSetVxlanBypassReply) GetMessageName() string {
+ return "sw_interface_set_vxlan_bypass_reply"
+}
+func (*SwInterfaceSetVxlanBypassReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetVxlanBypassReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetVxlanBypassReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetVxlanBypassReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// VxlanAddDelTunnel defines message 'vxlan_add_del_tunnel'.
+type VxlanAddDelTunnel struct {
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
+ SrcAddress []byte `binapi:"u8[16],name=src_address" json:"src_address,omitempty"`
+ DstAddress []byte `binapi:"u8[16],name=dst_address" json:"dst_address,omitempty"`
+ McastSwIfIndex uint32 `binapi:"u32,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
+ EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
+ DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+}
+
+func (m *VxlanAddDelTunnel) Reset() { *m = VxlanAddDelTunnel{} }
+func (*VxlanAddDelTunnel) GetMessageName() string { return "vxlan_add_del_tunnel" }
+func (*VxlanAddDelTunnel) GetCrcString() string { return "00f4bdd0" }
+func (*VxlanAddDelTunnel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanAddDelTunnel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 1 // m.IsIPv6
+ size += 4 // m.Instance
+ size += 1 * 16 // m.SrcAddress
+ size += 1 * 16 // m.DstAddress
+ size += 4 // m.McastSwIfIndex
+ size += 4 // m.EncapVrfID
+ size += 4 // m.DecapNextIndex
+ size += 4 // m.Vni
+ return size
+}
+func (m *VxlanAddDelTunnel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsAdd)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeUint32(m.Instance)
+ buf.EncodeBytes(m.SrcAddress, 16)
+ buf.EncodeBytes(m.DstAddress, 16)
+ buf.EncodeUint32(m.McastSwIfIndex)
+ buf.EncodeUint32(m.EncapVrfID)
+ buf.EncodeUint32(m.DecapNextIndex)
+ buf.EncodeUint32(m.Vni)
+ return buf.Bytes(), nil
+}
+func (m *VxlanAddDelTunnel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeUint8()
+ m.IsIPv6 = buf.DecodeUint8()
+ m.Instance = buf.DecodeUint32()
+ m.SrcAddress = make([]byte, 16)
+ copy(m.SrcAddress, buf.DecodeBytes(len(m.SrcAddress)))
+ m.DstAddress = make([]byte, 16)
+ copy(m.DstAddress, buf.DecodeBytes(len(m.DstAddress)))
+ m.McastSwIfIndex = buf.DecodeUint32()
+ m.EncapVrfID = buf.DecodeUint32()
+ m.DecapNextIndex = buf.DecodeUint32()
+ m.Vni = buf.DecodeUint32()
+ return nil
+}
+
+// VxlanAddDelTunnelReply defines message 'vxlan_add_del_tunnel_reply'.
+type VxlanAddDelTunnelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *VxlanAddDelTunnelReply) Reset() { *m = VxlanAddDelTunnelReply{} }
+func (*VxlanAddDelTunnelReply) GetMessageName() string { return "vxlan_add_del_tunnel_reply" }
+func (*VxlanAddDelTunnelReply) GetCrcString() string { return "fda5941f" }
+func (*VxlanAddDelTunnelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanAddDelTunnelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *VxlanAddDelTunnelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *VxlanAddDelTunnelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// VxlanOffloadRx defines message 'vxlan_offload_rx'.
+type VxlanOffloadRx struct {
+ HwIfIndex uint32 `binapi:"u32,name=hw_if_index" json:"hw_if_index,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Enable uint8 `binapi:"u8,name=enable" json:"enable,omitempty"`
+}
+
+func (m *VxlanOffloadRx) Reset() { *m = VxlanOffloadRx{} }
+func (*VxlanOffloadRx) GetMessageName() string { return "vxlan_offload_rx" }
+func (*VxlanOffloadRx) GetCrcString() string { return "f0b08786" }
+func (*VxlanOffloadRx) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanOffloadRx) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.HwIfIndex
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
+ return size
+}
+func (m *VxlanOffloadRx) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.HwIfIndex)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *VxlanOffloadRx) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.HwIfIndex = buf.DecodeUint32()
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Enable = buf.DecodeUint8()
+ return nil
+}
+
+// VxlanOffloadRxReply defines message 'vxlan_offload_rx_reply'.
+type VxlanOffloadRxReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *VxlanOffloadRxReply) Reset() { *m = VxlanOffloadRxReply{} }
+func (*VxlanOffloadRxReply) GetMessageName() string { return "vxlan_offload_rx_reply" }
+func (*VxlanOffloadRxReply) GetCrcString() string { return "e8d4e804" }
+func (*VxlanOffloadRxReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanOffloadRxReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *VxlanOffloadRxReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// VxlanTunnelDetails defines message 'vxlan_tunnel_details'.
+type VxlanTunnelDetails struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
+ SrcAddress []byte `binapi:"u8[16],name=src_address" json:"src_address,omitempty"`
+ DstAddress []byte `binapi:"u8[16],name=dst_address" json:"dst_address,omitempty"`
+ McastSwIfIndex uint32 `binapi:"u32,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
+ EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
+ DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+}
+
+func (m *VxlanTunnelDetails) Reset() { *m = VxlanTunnelDetails{} }
+func (*VxlanTunnelDetails) GetMessageName() string { return "vxlan_tunnel_details" }
+func (*VxlanTunnelDetails) GetCrcString() string { return "ce38e127" }
+func (*VxlanTunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanTunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Instance
+ size += 1 * 16 // m.SrcAddress
+ size += 1 * 16 // m.DstAddress
+ size += 4 // m.McastSwIfIndex
+ size += 4 // m.EncapVrfID
+ size += 4 // m.DecapNextIndex
+ size += 4 // m.Vni
+ size += 1 // m.IsIPv6
+ return size
+}
+func (m *VxlanTunnelDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.Instance)
+ buf.EncodeBytes(m.SrcAddress, 16)
+ buf.EncodeBytes(m.DstAddress, 16)
+ buf.EncodeUint32(m.McastSwIfIndex)
+ buf.EncodeUint32(m.EncapVrfID)
+ buf.EncodeUint32(m.DecapNextIndex)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *VxlanTunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Instance = buf.DecodeUint32()
+ m.SrcAddress = make([]byte, 16)
+ copy(m.SrcAddress, buf.DecodeBytes(len(m.SrcAddress)))
+ m.DstAddress = make([]byte, 16)
+ copy(m.DstAddress, buf.DecodeBytes(len(m.DstAddress)))
+ m.McastSwIfIndex = buf.DecodeUint32()
+ m.EncapVrfID = buf.DecodeUint32()
+ m.DecapNextIndex = buf.DecodeUint32()
+ m.Vni = buf.DecodeUint32()
+ m.IsIPv6 = buf.DecodeUint8()
+ return nil
+}
+
+// VxlanTunnelDump defines message 'vxlan_tunnel_dump'.
+type VxlanTunnelDump struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *VxlanTunnelDump) Reset() { *m = VxlanTunnelDump{} }
+func (*VxlanTunnelDump) GetMessageName() string { return "vxlan_tunnel_dump" }
+func (*VxlanTunnelDump) GetCrcString() string { return "529cb13f" }
+func (*VxlanTunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanTunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *VxlanTunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *VxlanTunnelDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+func init() { file_vxlan_binapi_init() }
+func file_vxlan_binapi_init() {
+ api.RegisterMessage((*SwInterfaceSetVxlanBypass)(nil), "sw_interface_set_vxlan_bypass_e74ca095")
+ api.RegisterMessage((*SwInterfaceSetVxlanBypassReply)(nil), "sw_interface_set_vxlan_bypass_reply_e8d4e804")
+ api.RegisterMessage((*VxlanAddDelTunnel)(nil), "vxlan_add_del_tunnel_00f4bdd0")
+ api.RegisterMessage((*VxlanAddDelTunnelReply)(nil), "vxlan_add_del_tunnel_reply_fda5941f")
+ api.RegisterMessage((*VxlanOffloadRx)(nil), "vxlan_offload_rx_f0b08786")
+ api.RegisterMessage((*VxlanOffloadRxReply)(nil), "vxlan_offload_rx_reply_e8d4e804")
+ api.RegisterMessage((*VxlanTunnelDetails)(nil), "vxlan_tunnel_details_ce38e127")
+ api.RegisterMessage((*VxlanTunnelDump)(nil), "vxlan_tunnel_dump_529cb13f")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SwInterfaceSetVxlanBypass)(nil),
+ (*SwInterfaceSetVxlanBypassReply)(nil),
+ (*VxlanAddDelTunnel)(nil),
+ (*VxlanAddDelTunnelReply)(nil),
+ (*VxlanOffloadRx)(nil),
+ (*VxlanOffloadRxReply)(nil),
+ (*VxlanTunnelDetails)(nil),
+ (*VxlanTunnelDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vxlan/vxlan_rpc.ba.go b/internal/testbinapi/binapi2001/vxlan/vxlan_rpc.ba.go
new file mode 100644
index 0000000..0d56593
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vxlan/vxlan_rpc.ba.go
@@ -0,0 +1,93 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package vxlan
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service vxlan.
+type RPCService interface {
+ SwInterfaceSetVxlanBypass(ctx context.Context, in *SwInterfaceSetVxlanBypass) (*SwInterfaceSetVxlanBypassReply, error)
+ VxlanAddDelTunnel(ctx context.Context, in *VxlanAddDelTunnel) (*VxlanAddDelTunnelReply, error)
+ VxlanOffloadRx(ctx context.Context, in *VxlanOffloadRx) (*VxlanOffloadRxReply, error)
+ VxlanTunnelDump(ctx context.Context, in *VxlanTunnelDump) (RPCService_VxlanTunnelDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SwInterfaceSetVxlanBypass(ctx context.Context, in *SwInterfaceSetVxlanBypass) (*SwInterfaceSetVxlanBypassReply, error) {
+ out := new(SwInterfaceSetVxlanBypassReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanAddDelTunnel(ctx context.Context, in *VxlanAddDelTunnel) (*VxlanAddDelTunnelReply, error) {
+ out := new(VxlanAddDelTunnelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanOffloadRx(ctx context.Context, in *VxlanOffloadRx) (*VxlanOffloadRxReply, error) {
+ out := new(VxlanOffloadRxReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanTunnelDump(ctx context.Context, in *VxlanTunnelDump) (RPCService_VxlanTunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_VxlanTunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_VxlanTunnelDumpClient interface {
+ Recv() (*VxlanTunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_VxlanTunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_VxlanTunnelDumpClient) Recv() (*VxlanTunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *VxlanTunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp.ba.go b/internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp.ba.go
new file mode 100644
index 0000000..85fc2c8
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp.ba.go
@@ -0,0 +1,1183 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/vxlan_gbp.api.json
+
+// Package vxlan_gbp contains generated bindings for API file vxlan_gbp.api.
+//
+// Contents:
+// 6 aliases
+// 11 enums
+// 7 structs
+// 1 union
+// 6 messages
+//
+package vxlan_gbp
+
+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 = "vxlan_gbp"
+ APIVersion = "1.1.1"
+ VersionCrc = 0xdc218362
+)
+
+// 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)) + ")"
+}
+
+// IfStatusFlags defines enum 'if_status_flags'.
+type IfStatusFlags uint32
+
+const (
+ IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
+ IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
+)
+
+var (
+ IfStatusFlags_name = map[uint32]string{
+ 1: "IF_STATUS_API_FLAG_ADMIN_UP",
+ 2: "IF_STATUS_API_FLAG_LINK_UP",
+ }
+ IfStatusFlags_value = map[string]uint32{
+ "IF_STATUS_API_FLAG_ADMIN_UP": 1,
+ "IF_STATUS_API_FLAG_LINK_UP": 2,
+ }
+)
+
+func (x IfStatusFlags) String() string {
+ s, ok := IfStatusFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// IfType defines enum 'if_type'.
+type IfType uint32
+
+const (
+ IF_API_TYPE_HARDWARE IfType = 1
+ IF_API_TYPE_SUB IfType = 2
+ IF_API_TYPE_P2P IfType = 3
+ IF_API_TYPE_PIPE IfType = 4
+)
+
+var (
+ IfType_name = map[uint32]string{
+ 1: "IF_API_TYPE_HARDWARE",
+ 2: "IF_API_TYPE_SUB",
+ 3: "IF_API_TYPE_P2P",
+ 4: "IF_API_TYPE_PIPE",
+ }
+ IfType_value = map[string]uint32{
+ "IF_API_TYPE_HARDWARE": 1,
+ "IF_API_TYPE_SUB": 2,
+ "IF_API_TYPE_P2P": 3,
+ "IF_API_TYPE_PIPE": 4,
+ }
+)
+
+func (x IfType) String() string {
+ s, ok := IfType_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IfType(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// LinkDuplex defines enum 'link_duplex'.
+type LinkDuplex uint32
+
+const (
+ LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
+ LINK_DUPLEX_API_HALF LinkDuplex = 1
+ LINK_DUPLEX_API_FULL LinkDuplex = 2
+)
+
+var (
+ LinkDuplex_name = map[uint32]string{
+ 0: "LINK_DUPLEX_API_UNKNOWN",
+ 1: "LINK_DUPLEX_API_HALF",
+ 2: "LINK_DUPLEX_API_FULL",
+ }
+ LinkDuplex_value = map[string]uint32{
+ "LINK_DUPLEX_API_UNKNOWN": 0,
+ "LINK_DUPLEX_API_HALF": 1,
+ "LINK_DUPLEX_API_FULL": 2,
+ }
+)
+
+func (x LinkDuplex) String() string {
+ s, ok := LinkDuplex_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MtuProto defines enum 'mtu_proto'.
+type MtuProto uint32
+
+const (
+ MTU_PROTO_API_L3 MtuProto = 1
+ MTU_PROTO_API_IP4 MtuProto = 2
+ MTU_PROTO_API_IP6 MtuProto = 3
+ MTU_PROTO_API_MPLS MtuProto = 4
+ MTU_PROTO_API_N MtuProto = 5
+)
+
+var (
+ MtuProto_name = map[uint32]string{
+ 1: "MTU_PROTO_API_L3",
+ 2: "MTU_PROTO_API_IP4",
+ 3: "MTU_PROTO_API_IP6",
+ 4: "MTU_PROTO_API_MPLS",
+ 5: "MTU_PROTO_API_N",
+ }
+ MtuProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x MtuProto) String() string {
+ s, ok := MtuProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "MtuProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// RxMode defines enum 'rx_mode'.
+type RxMode uint32
+
+const (
+ RX_MODE_API_UNKNOWN RxMode = 0
+ RX_MODE_API_POLLING RxMode = 1
+ RX_MODE_API_INTERRUPT RxMode = 2
+ RX_MODE_API_ADAPTIVE RxMode = 3
+ RX_MODE_API_DEFAULT RxMode = 4
+)
+
+var (
+ RxMode_name = map[uint32]string{
+ 0: "RX_MODE_API_UNKNOWN",
+ 1: "RX_MODE_API_POLLING",
+ 2: "RX_MODE_API_INTERRUPT",
+ 3: "RX_MODE_API_ADAPTIVE",
+ 4: "RX_MODE_API_DEFAULT",
+ }
+ RxMode_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x RxMode) String() string {
+ s, ok := RxMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "RxMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// SubIfFlags defines enum 'sub_if_flags'.
+type SubIfFlags uint32
+
+const (
+ SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
+ SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
+ SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
+ SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
+ SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
+ SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
+ SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
+ SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
+ SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
+ SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
+)
+
+var (
+ SubIfFlags_name = map[uint32]string{
+ 1: "SUB_IF_API_FLAG_NO_TAGS",
+ 2: "SUB_IF_API_FLAG_ONE_TAG",
+ 4: "SUB_IF_API_FLAG_TWO_TAGS",
+ 8: "SUB_IF_API_FLAG_DOT1AD",
+ 16: "SUB_IF_API_FLAG_EXACT_MATCH",
+ 32: "SUB_IF_API_FLAG_DEFAULT",
+ 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
+ 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
+ 254: "SUB_IF_API_FLAG_MASK_VNET",
+ 256: "SUB_IF_API_FLAG_DOT1AH",
+ }
+ SubIfFlags_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x SubIfFlags) String() string {
+ s, ok := SubIfFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
+// VxlanGbpAPITunnelMode defines enum 'vxlan_gbp_api_tunnel_mode'.
+type VxlanGbpAPITunnelMode uint32
+
+const (
+ VXLAN_GBP_API_TUNNEL_MODE_L2 VxlanGbpAPITunnelMode = 1
+ VXLAN_GBP_API_TUNNEL_MODE_L3 VxlanGbpAPITunnelMode = 2
+)
+
+var (
+ VxlanGbpAPITunnelMode_name = map[uint32]string{
+ 1: "VXLAN_GBP_API_TUNNEL_MODE_L2",
+ 2: "VXLAN_GBP_API_TUNNEL_MODE_L3",
+ }
+ VxlanGbpAPITunnelMode_value = map[string]uint32{
+ "VXLAN_GBP_API_TUNNEL_MODE_L2": 1,
+ "VXLAN_GBP_API_TUNNEL_MODE_L3": 2,
+ }
+)
+
+func (x VxlanGbpAPITunnelMode) String() string {
+ s, ok := VxlanGbpAPITunnelMode_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "VxlanGbpAPITunnelMode(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
+type InterfaceIndex uint32
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// VxlanGbpTunnel defines type 'vxlan_gbp_tunnel'.
+type VxlanGbpTunnel struct {
+ Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
+ Src Address `binapi:"address,name=src" json:"src,omitempty"`
+ Dst Address `binapi:"address,name=dst" json:"dst,omitempty"`
+ McastSwIfIndex InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
+ EncapTableID uint32 `binapi:"u32,name=encap_table_id" json:"encap_table_id,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Mode VxlanGbpAPITunnelMode `binapi:"vxlan_gbp_api_tunnel_mode,name=mode" json:"mode,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// SwInterfaceSetVxlanGbpBypass defines message 'sw_interface_set_vxlan_gbp_bypass'.
+type SwInterfaceSetVxlanGbpBypass struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
+ Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetVxlanGbpBypass) Reset() { *m = SwInterfaceSetVxlanGbpBypass{} }
+func (*SwInterfaceSetVxlanGbpBypass) GetMessageName() string {
+ return "sw_interface_set_vxlan_gbp_bypass"
+}
+func (*SwInterfaceSetVxlanGbpBypass) GetCrcString() string { return "65247409" }
+func (*SwInterfaceSetVxlanGbpBypass) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetVxlanGbpBypass) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetVxlanGbpBypass) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetVxlanGbpBypass) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
+ m.Enable = buf.DecodeBool()
+ return nil
+}
+
+// SwInterfaceSetVxlanGbpBypassReply defines message 'sw_interface_set_vxlan_gbp_bypass_reply'.
+type SwInterfaceSetVxlanGbpBypassReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetVxlanGbpBypassReply) Reset() { *m = SwInterfaceSetVxlanGbpBypassReply{} }
+func (*SwInterfaceSetVxlanGbpBypassReply) GetMessageName() string {
+ return "sw_interface_set_vxlan_gbp_bypass_reply"
+}
+func (*SwInterfaceSetVxlanGbpBypassReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetVxlanGbpBypassReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetVxlanGbpBypassReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetVxlanGbpBypassReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// VxlanGbpTunnelAddDel defines message 'vxlan_gbp_tunnel_add_del'.
+type VxlanGbpTunnelAddDel struct {
+ IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
+ Tunnel VxlanGbpTunnel `binapi:"vxlan_gbp_tunnel,name=tunnel" json:"tunnel,omitempty"`
+}
+
+func (m *VxlanGbpTunnelAddDel) Reset() { *m = VxlanGbpTunnelAddDel{} }
+func (*VxlanGbpTunnelAddDel) GetMessageName() string { return "vxlan_gbp_tunnel_add_del" }
+func (*VxlanGbpTunnelAddDel) GetCrcString() string { return "8c819166" }
+func (*VxlanGbpTunnelAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGbpTunnelAddDel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Tunnel.Instance
+ size += 4 // m.Tunnel.Src.Af
+ size += 1 * 16 // m.Tunnel.Src.Un
+ size += 4 // m.Tunnel.Dst.Af
+ size += 1 * 16 // m.Tunnel.Dst.Un
+ size += 4 // m.Tunnel.McastSwIfIndex
+ size += 4 // m.Tunnel.EncapTableID
+ size += 4 // m.Tunnel.Vni
+ size += 4 // m.Tunnel.SwIfIndex
+ size += 4 // m.Tunnel.Mode
+ return size
+}
+func (m *VxlanGbpTunnelAddDel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(m.Tunnel.Instance)
+ buf.EncodeUint32(uint32(m.Tunnel.Src.Af))
+ buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.Dst.Af))
+ buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex))
+ 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
+}
+func (m *VxlanGbpTunnelAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Tunnel.Instance = buf.DecodeUint32()
+ m.Tunnel.Src.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.Dst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.McastSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tunnel.EncapTableID = buf.DecodeUint32()
+ m.Tunnel.Vni = buf.DecodeUint32()
+ m.Tunnel.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tunnel.Mode = VxlanGbpAPITunnelMode(buf.DecodeUint32())
+ return nil
+}
+
+// VxlanGbpTunnelAddDelReply defines message 'vxlan_gbp_tunnel_add_del_reply'.
+type VxlanGbpTunnelAddDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *VxlanGbpTunnelAddDelReply) Reset() { *m = VxlanGbpTunnelAddDelReply{} }
+func (*VxlanGbpTunnelAddDelReply) GetMessageName() string { return "vxlan_gbp_tunnel_add_del_reply" }
+func (*VxlanGbpTunnelAddDelReply) GetCrcString() string { return "5383d31f" }
+func (*VxlanGbpTunnelAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGbpTunnelAddDelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *VxlanGbpTunnelAddDelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// VxlanGbpTunnelDetails defines message 'vxlan_gbp_tunnel_details'.
+type VxlanGbpTunnelDetails struct {
+ Tunnel VxlanGbpTunnel `binapi:"vxlan_gbp_tunnel,name=tunnel" json:"tunnel,omitempty"`
+}
+
+func (m *VxlanGbpTunnelDetails) Reset() { *m = VxlanGbpTunnelDetails{} }
+func (*VxlanGbpTunnelDetails) GetMessageName() string { return "vxlan_gbp_tunnel_details" }
+func (*VxlanGbpTunnelDetails) GetCrcString() string { return "1da24016" }
+func (*VxlanGbpTunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGbpTunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Tunnel.Instance
+ size += 4 // m.Tunnel.Src.Af
+ size += 1 * 16 // m.Tunnel.Src.Un
+ size += 4 // m.Tunnel.Dst.Af
+ size += 1 * 16 // m.Tunnel.Dst.Un
+ size += 4 // m.Tunnel.McastSwIfIndex
+ size += 4 // m.Tunnel.EncapTableID
+ size += 4 // m.Tunnel.Vni
+ size += 4 // m.Tunnel.SwIfIndex
+ size += 4 // m.Tunnel.Mode
+ return size
+}
+func (m *VxlanGbpTunnelDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Tunnel.Instance)
+ buf.EncodeUint32(uint32(m.Tunnel.Src.Af))
+ buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.Dst.Af))
+ buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex))
+ 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
+}
+func (m *VxlanGbpTunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Tunnel.Instance = buf.DecodeUint32()
+ m.Tunnel.Src.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.Dst.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Tunnel.McastSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tunnel.EncapTableID = buf.DecodeUint32()
+ m.Tunnel.Vni = buf.DecodeUint32()
+ m.Tunnel.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Tunnel.Mode = VxlanGbpAPITunnelMode(buf.DecodeUint32())
+ return nil
+}
+
+// VxlanGbpTunnelDump defines message 'vxlan_gbp_tunnel_dump'.
+type VxlanGbpTunnelDump struct {
+ SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *VxlanGbpTunnelDump) Reset() { *m = VxlanGbpTunnelDump{} }
+func (*VxlanGbpTunnelDump) GetMessageName() string { return "vxlan_gbp_tunnel_dump" }
+func (*VxlanGbpTunnelDump) GetCrcString() string { return "f9e6675e" }
+func (*VxlanGbpTunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGbpTunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *VxlanGbpTunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *VxlanGbpTunnelDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+func init() { file_vxlan_gbp_binapi_init() }
+func file_vxlan_gbp_binapi_init() {
+ api.RegisterMessage((*SwInterfaceSetVxlanGbpBypass)(nil), "sw_interface_set_vxlan_gbp_bypass_65247409")
+ api.RegisterMessage((*SwInterfaceSetVxlanGbpBypassReply)(nil), "sw_interface_set_vxlan_gbp_bypass_reply_e8d4e804")
+ api.RegisterMessage((*VxlanGbpTunnelAddDel)(nil), "vxlan_gbp_tunnel_add_del_8c819166")
+ api.RegisterMessage((*VxlanGbpTunnelAddDelReply)(nil), "vxlan_gbp_tunnel_add_del_reply_5383d31f")
+ api.RegisterMessage((*VxlanGbpTunnelDetails)(nil), "vxlan_gbp_tunnel_details_1da24016")
+ api.RegisterMessage((*VxlanGbpTunnelDump)(nil), "vxlan_gbp_tunnel_dump_f9e6675e")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SwInterfaceSetVxlanGbpBypass)(nil),
+ (*SwInterfaceSetVxlanGbpBypassReply)(nil),
+ (*VxlanGbpTunnelAddDel)(nil),
+ (*VxlanGbpTunnelAddDelReply)(nil),
+ (*VxlanGbpTunnelDetails)(nil),
+ (*VxlanGbpTunnelDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp_rpc.ba.go b/internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp_rpc.ba.go
new file mode 100644
index 0000000..e2ec338
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vxlan_gbp/vxlan_gbp_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package vxlan_gbp
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service vxlan_gbp.
+type RPCService interface {
+ SwInterfaceSetVxlanGbpBypass(ctx context.Context, in *SwInterfaceSetVxlanGbpBypass) (*SwInterfaceSetVxlanGbpBypassReply, error)
+ VxlanGbpTunnelAddDel(ctx context.Context, in *VxlanGbpTunnelAddDel) (*VxlanGbpTunnelAddDelReply, error)
+ VxlanGbpTunnelDump(ctx context.Context, in *VxlanGbpTunnelDump) (RPCService_VxlanGbpTunnelDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SwInterfaceSetVxlanGbpBypass(ctx context.Context, in *SwInterfaceSetVxlanGbpBypass) (*SwInterfaceSetVxlanGbpBypassReply, error) {
+ out := new(SwInterfaceSetVxlanGbpBypassReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanGbpTunnelAddDel(ctx context.Context, in *VxlanGbpTunnelAddDel) (*VxlanGbpTunnelAddDelReply, error) {
+ out := new(VxlanGbpTunnelAddDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanGbpTunnelDump(ctx context.Context, in *VxlanGbpTunnelDump) (RPCService_VxlanGbpTunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_VxlanGbpTunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_VxlanGbpTunnelDumpClient interface {
+ Recv() (*VxlanGbpTunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_VxlanGbpTunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_VxlanGbpTunnelDumpClient) Recv() (*VxlanGbpTunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *VxlanGbpTunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe.ba.go b/internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe.ba.go
new file mode 100644
index 0000000..105fa77
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe.ba.go
@@ -0,0 +1,333 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/core/vxlan_gpe.api.json
+
+// Package vxlan_gpe contains generated bindings for API file vxlan_gpe.api.
+//
+// Contents:
+// 6 messages
+//
+package vxlan_gpe
+
+import (
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
+)
+
+// 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 = "vxlan_gpe"
+ APIVersion = "1.0.0"
+ VersionCrc = 0x25bfb55d
+)
+
+// SwInterfaceSetVxlanGpeBypass defines message 'sw_interface_set_vxlan_gpe_bypass'.
+type SwInterfaceSetVxlanGpeBypass struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ Enable uint8 `binapi:"u8,name=enable" json:"enable,omitempty"`
+}
+
+func (m *SwInterfaceSetVxlanGpeBypass) Reset() { *m = SwInterfaceSetVxlanGpeBypass{} }
+func (*SwInterfaceSetVxlanGpeBypass) GetMessageName() string {
+ return "sw_interface_set_vxlan_gpe_bypass"
+}
+func (*SwInterfaceSetVxlanGpeBypass) GetCrcString() string { return "e74ca095" }
+func (*SwInterfaceSetVxlanGpeBypass) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *SwInterfaceSetVxlanGpeBypass) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
+ size += 1 // m.Enable
+ return size
+}
+func (m *SwInterfaceSetVxlanGpeBypass) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeUint8(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceSetVxlanGpeBypass) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.IsIPv6 = buf.DecodeUint8()
+ m.Enable = buf.DecodeUint8()
+ return nil
+}
+
+// SwInterfaceSetVxlanGpeBypassReply defines message 'sw_interface_set_vxlan_gpe_bypass_reply'.
+type SwInterfaceSetVxlanGpeBypassReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *SwInterfaceSetVxlanGpeBypassReply) Reset() { *m = SwInterfaceSetVxlanGpeBypassReply{} }
+func (*SwInterfaceSetVxlanGpeBypassReply) GetMessageName() string {
+ return "sw_interface_set_vxlan_gpe_bypass_reply"
+}
+func (*SwInterfaceSetVxlanGpeBypassReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceSetVxlanGpeBypassReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *SwInterfaceSetVxlanGpeBypassReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *SwInterfaceSetVxlanGpeBypassReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+// VxlanGpeAddDelTunnel defines message 'vxlan_gpe_add_del_tunnel'.
+type VxlanGpeAddDelTunnel struct {
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+ Local []byte `binapi:"u8[16],name=local" json:"local,omitempty"`
+ Remote []byte `binapi:"u8[16],name=remote" json:"remote,omitempty"`
+ McastSwIfIndex uint32 `binapi:"u32,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
+ EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
+ DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
+}
+
+func (m *VxlanGpeAddDelTunnel) Reset() { *m = VxlanGpeAddDelTunnel{} }
+func (*VxlanGpeAddDelTunnel) GetMessageName() string { return "vxlan_gpe_add_del_tunnel" }
+func (*VxlanGpeAddDelTunnel) GetCrcString() string { return "d15850ba" }
+func (*VxlanGpeAddDelTunnel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGpeAddDelTunnel) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsIPv6
+ size += 1 * 16 // m.Local
+ size += 1 * 16 // m.Remote
+ size += 4 // m.McastSwIfIndex
+ size += 4 // m.EncapVrfID
+ size += 4 // m.DecapVrfID
+ size += 1 // m.Protocol
+ size += 4 // m.Vni
+ size += 1 // m.IsAdd
+ return size
+}
+func (m *VxlanGpeAddDelTunnel) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint8(m.IsIPv6)
+ buf.EncodeBytes(m.Local, 16)
+ buf.EncodeBytes(m.Remote, 16)
+ buf.EncodeUint32(m.McastSwIfIndex)
+ buf.EncodeUint32(m.EncapVrfID)
+ buf.EncodeUint32(m.DecapVrfID)
+ buf.EncodeUint8(m.Protocol)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeAddDelTunnel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeUint8()
+ m.Local = make([]byte, 16)
+ copy(m.Local, buf.DecodeBytes(len(m.Local)))
+ m.Remote = make([]byte, 16)
+ copy(m.Remote, buf.DecodeBytes(len(m.Remote)))
+ m.McastSwIfIndex = buf.DecodeUint32()
+ m.EncapVrfID = buf.DecodeUint32()
+ m.DecapVrfID = buf.DecodeUint32()
+ m.Protocol = buf.DecodeUint8()
+ m.Vni = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeUint8()
+ return nil
+}
+
+// VxlanGpeAddDelTunnelReply defines message 'vxlan_gpe_add_del_tunnel_reply'.
+type VxlanGpeAddDelTunnelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *VxlanGpeAddDelTunnelReply) Reset() { *m = VxlanGpeAddDelTunnelReply{} }
+func (*VxlanGpeAddDelTunnelReply) GetMessageName() string { return "vxlan_gpe_add_del_tunnel_reply" }
+func (*VxlanGpeAddDelTunnelReply) GetCrcString() string { return "fda5941f" }
+func (*VxlanGpeAddDelTunnelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGpeAddDelTunnelReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *VxlanGpeAddDelTunnelReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeAddDelTunnelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+// VxlanGpeTunnelDetails defines message 'vxlan_gpe_tunnel_details'.
+type VxlanGpeTunnelDetails struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Local []byte `binapi:"u8[16],name=local" json:"local,omitempty"`
+ Remote []byte `binapi:"u8[16],name=remote" json:"remote,omitempty"`
+ Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
+ Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
+ McastSwIfIndex uint32 `binapi:"u32,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
+ EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
+ DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
+ IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
+}
+
+func (m *VxlanGpeTunnelDetails) Reset() { *m = VxlanGpeTunnelDetails{} }
+func (*VxlanGpeTunnelDetails) GetMessageName() string { return "vxlan_gpe_tunnel_details" }
+func (*VxlanGpeTunnelDetails) GetCrcString() string { return "2673fbfa" }
+func (*VxlanGpeTunnelDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGpeTunnelDetails) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ size += 1 * 16 // m.Local
+ size += 1 * 16 // m.Remote
+ size += 4 // m.Vni
+ size += 1 // m.Protocol
+ size += 4 // m.McastSwIfIndex
+ size += 4 // m.EncapVrfID
+ size += 4 // m.DecapVrfID
+ size += 1 // m.IsIPv6
+ return size
+}
+func (m *VxlanGpeTunnelDetails) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeBytes(m.Local, 16)
+ buf.EncodeBytes(m.Remote, 16)
+ buf.EncodeUint32(m.Vni)
+ buf.EncodeUint8(m.Protocol)
+ buf.EncodeUint32(m.McastSwIfIndex)
+ buf.EncodeUint32(m.EncapVrfID)
+ buf.EncodeUint32(m.DecapVrfID)
+ buf.EncodeUint8(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeTunnelDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ m.Local = make([]byte, 16)
+ copy(m.Local, buf.DecodeBytes(len(m.Local)))
+ m.Remote = make([]byte, 16)
+ copy(m.Remote, buf.DecodeBytes(len(m.Remote)))
+ m.Vni = buf.DecodeUint32()
+ m.Protocol = buf.DecodeUint8()
+ m.McastSwIfIndex = buf.DecodeUint32()
+ m.EncapVrfID = buf.DecodeUint32()
+ m.DecapVrfID = buf.DecodeUint32()
+ m.IsIPv6 = buf.DecodeUint8()
+ return nil
+}
+
+// VxlanGpeTunnelDump defines message 'vxlan_gpe_tunnel_dump'.
+type VxlanGpeTunnelDump struct {
+ SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *VxlanGpeTunnelDump) Reset() { *m = VxlanGpeTunnelDump{} }
+func (*VxlanGpeTunnelDump) GetMessageName() string { return "vxlan_gpe_tunnel_dump" }
+func (*VxlanGpeTunnelDump) GetCrcString() string { return "529cb13f" }
+func (*VxlanGpeTunnelDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGpeTunnelDump) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *VxlanGpeTunnelDump) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeTunnelDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = buf.DecodeUint32()
+ return nil
+}
+
+func init() { file_vxlan_gpe_binapi_init() }
+func file_vxlan_gpe_binapi_init() {
+ api.RegisterMessage((*SwInterfaceSetVxlanGpeBypass)(nil), "sw_interface_set_vxlan_gpe_bypass_e74ca095")
+ api.RegisterMessage((*SwInterfaceSetVxlanGpeBypassReply)(nil), "sw_interface_set_vxlan_gpe_bypass_reply_e8d4e804")
+ api.RegisterMessage((*VxlanGpeAddDelTunnel)(nil), "vxlan_gpe_add_del_tunnel_d15850ba")
+ api.RegisterMessage((*VxlanGpeAddDelTunnelReply)(nil), "vxlan_gpe_add_del_tunnel_reply_fda5941f")
+ api.RegisterMessage((*VxlanGpeTunnelDetails)(nil), "vxlan_gpe_tunnel_details_2673fbfa")
+ api.RegisterMessage((*VxlanGpeTunnelDump)(nil), "vxlan_gpe_tunnel_dump_529cb13f")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*SwInterfaceSetVxlanGpeBypass)(nil),
+ (*SwInterfaceSetVxlanGpeBypassReply)(nil),
+ (*VxlanGpeAddDelTunnel)(nil),
+ (*VxlanGpeAddDelTunnelReply)(nil),
+ (*VxlanGpeTunnelDetails)(nil),
+ (*VxlanGpeTunnelDump)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe_rpc.ba.go b/internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe_rpc.ba.go
new file mode 100644
index 0000000..3cb05d5
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vxlan_gpe/vxlan_gpe_rpc.ba.go
@@ -0,0 +1,83 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package vxlan_gpe
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
+ "io"
+)
+
+// RPCService defines RPC service vxlan_gpe.
+type RPCService interface {
+ SwInterfaceSetVxlanGpeBypass(ctx context.Context, in *SwInterfaceSetVxlanGpeBypass) (*SwInterfaceSetVxlanGpeBypassReply, error)
+ VxlanGpeAddDelTunnel(ctx context.Context, in *VxlanGpeAddDelTunnel) (*VxlanGpeAddDelTunnelReply, error)
+ VxlanGpeTunnelDump(ctx context.Context, in *VxlanGpeTunnelDump) (RPCService_VxlanGpeTunnelDumpClient, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) SwInterfaceSetVxlanGpeBypass(ctx context.Context, in *SwInterfaceSetVxlanGpeBypass) (*SwInterfaceSetVxlanGpeBypassReply, error) {
+ out := new(SwInterfaceSetVxlanGpeBypassReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanGpeAddDelTunnel(ctx context.Context, in *VxlanGpeAddDelTunnel) (*VxlanGpeAddDelTunnelReply, error) {
+ out := new(VxlanGpeAddDelTunnelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) VxlanGpeTunnelDump(ctx context.Context, in *VxlanGpeTunnelDump) (RPCService_VxlanGpeTunnelDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_VxlanGpeTunnelDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_VxlanGpeTunnelDumpClient interface {
+ Recv() (*VxlanGpeTunnelDetails, error)
+ api.Stream
+}
+
+type serviceClient_VxlanGpeTunnelDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_VxlanGpeTunnelDumpClient) Recv() (*VxlanGpeTunnelDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *VxlanGpeTunnelDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go b/internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go
new file mode 100644
index 0000000..a70fdd1
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go
@@ -0,0 +1,688 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.01
+// source: .vppapi/plugins/vxlan_gpe_ioam_export.api.json
+
+// Package vxlan_gpe_ioam_export contains generated bindings for API file vxlan_gpe_ioam_export.api.
+//
+// Contents:
+// 5 aliases
+// 4 enums
+// 6 structs
+// 1 union
+// 2 messages
+//
+package vxlan_gpe_ioam_export
+
+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 = "vxlan_gpe_ioam_export"
+ APIVersion = "1.0.0"
+ VersionCrc = 0xc6fdb83f
+)
+
+// 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)) + ")"
+}
+
+// IPDscp defines enum 'ip_dscp'.
+type IPDscp uint8
+
+const (
+ IP_API_DSCP_CS0 IPDscp = 0
+ IP_API_DSCP_CS1 IPDscp = 8
+ IP_API_DSCP_AF11 IPDscp = 10
+ IP_API_DSCP_AF12 IPDscp = 12
+ IP_API_DSCP_AF13 IPDscp = 14
+ IP_API_DSCP_CS2 IPDscp = 16
+ IP_API_DSCP_AF21 IPDscp = 18
+ IP_API_DSCP_AF22 IPDscp = 20
+ IP_API_DSCP_AF23 IPDscp = 22
+ IP_API_DSCP_CS3 IPDscp = 24
+ IP_API_DSCP_AF31 IPDscp = 26
+ IP_API_DSCP_AF32 IPDscp = 28
+ IP_API_DSCP_AF33 IPDscp = 30
+ IP_API_DSCP_CS4 IPDscp = 32
+ IP_API_DSCP_AF41 IPDscp = 34
+ IP_API_DSCP_AF42 IPDscp = 36
+ IP_API_DSCP_AF43 IPDscp = 38
+ IP_API_DSCP_CS5 IPDscp = 40
+ IP_API_DSCP_EF IPDscp = 46
+ IP_API_DSCP_CS6 IPDscp = 48
+ IP_API_DSCP_CS7 IPDscp = 50
+)
+
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "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,
+ }
+)
+
+func (x IPDscp) String() string {
+ s, ok := IPDscp_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPEcn defines enum 'ip_ecn'.
+type IPEcn uint8
+
+const (
+ IP_API_ECN_NONE IPEcn = 0
+ IP_API_ECN_ECT0 IPEcn = 1
+ IP_API_ECN_ECT1 IPEcn = 2
+ IP_API_ECN_CE IPEcn = 3
+)
+
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
+
+func (x IPEcn) String() string {
+ s, ok := IPEcn_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
+}
+
+// IPProto defines enum 'ip_proto'.
+type IPProto uint32
+
+const (
+ IP_API_PROTO_HOPOPT IPProto = 0
+ IP_API_PROTO_ICMP IPProto = 1
+ IP_API_PROTO_IGMP IPProto = 2
+ IP_API_PROTO_TCP IPProto = 6
+ IP_API_PROTO_UDP IPProto = 17
+ IP_API_PROTO_GRE IPProto = 47
+ IP_API_PROTO_AH IPProto = 50
+ IP_API_PROTO_ESP IPProto = 51
+ IP_API_PROTO_EIGRP IPProto = 88
+ IP_API_PROTO_OSPF IPProto = 89
+ IP_API_PROTO_SCTP IPProto = 132
+ IP_API_PROTO_RESERVED IPProto = 255
+)
+
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "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,
+ }
+)
+
+func (x IPProto) String() string {
+ s, ok := IPProto_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
+}
+
+// AddressWithPrefix defines alias 'address_with_prefix'.
+type AddressWithPrefix Prefix
+
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ return AddressWithPrefix(prefix), nil
+}
+func (x AddressWithPrefix) String() string {
+ return Prefix(x).String()
+}
+func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseAddressWithPrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP4Address defines alias 'ip4_address'.
+type IP4Address [4]uint8
+
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+func (x IP4Address) ToIP() net.IP {
+ return net.IP(x[:]).To4()
+}
+func (x IP4Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP4Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP4Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
+type IP4AddressWithPrefix IP4Prefix
+
+// IP6Address defines alias 'ip6_address'.
+type IP6Address [16]uint8
+
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+func (x IP6Address) ToIP() net.IP {
+ return net.IP(x[:]).To16()
+}
+func (x IP6Address) String() string {
+ return x.ToIP().String()
+}
+func (x *IP6Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Address) UnmarshalText(text []byte) error {
+ ipaddr, err := ParseIP6Address(string(text))
+ if err != nil {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
+type IP6AddressWithPrefix IP6Prefix
+
+// Address defines type 'address'.
+type Address struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
+}
+
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ return net.IP(ip4[:]).To4()
+ }
+}
+func (x Address) String() string {
+ return x.ToIP().String()
+}
+func (x *Address) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Address) UnmarshalText(text []byte) error {
+ addr, err := ParseAddress(string(text))
+ if err != nil {
+ return err
+ }
+ *x = addr
+ return nil
+}
+
+// IP4Prefix defines type 'ip4_prefix'.
+type IP4Prefix struct {
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP4Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 32)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP4Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP4Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP4Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP4Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// IP6Prefix defines type 'ip6_prefix'.
+type IP6Prefix struct {
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ return prefix, nil
+}
+func (x IP6Prefix) ToIPNet() *net.IPNet {
+ mask := net.CIDRMask(int(x.Len), 128)
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x IP6Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *IP6Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *IP6Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParseIP6Prefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// Mprefix defines type 'mprefix'.
+type Mprefix struct {
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
+}
+
+// Prefix defines type 'prefix'.
+type Prefix struct {
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
+}
+
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
+ return ipnet
+}
+func (x Prefix) String() string {
+ ip := x.Address.String()
+ return ip + "/" + strconv.Itoa(int(x.Len))
+}
+func (x *Prefix) MarshalText() ([]byte, error) {
+ return []byte(x.String()), nil
+}
+func (x *Prefix) UnmarshalText(text []byte) error {
+ prefix, err := ParsePrefix(string(text))
+ if err != nil {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// PrefixMatcher defines type 'prefix_matcher'.
+type PrefixMatcher struct {
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
+}
+
+// AddressUnion defines union 'address_union'.
+type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
+ XXX_UnionData [16]byte
+}
+
+func AddressUnionIP4(a IP4Address) (u AddressUnion) {
+ u.SetIP4(a)
+ return
+}
+func (u *AddressUnion) SetIP4(a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
+}
+func (u *AddressUnion) GetIP4() (a IP4Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
+ return
+}
+
+func AddressUnionIP6(a IP6Address) (u AddressUnion) {
+ u.SetIP6(a)
+ return
+}
+func (u *AddressUnion) SetIP6(a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
+}
+func (u *AddressUnion) GetIP6() (a IP6Address) {
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
+ return
+}
+
+// VxlanGpeIoamExportEnableDisable defines message 'vxlan_gpe_ioam_export_enable_disable'.
+type VxlanGpeIoamExportEnableDisable struct {
+ IsDisable bool `binapi:"bool,name=is_disable" json:"is_disable,omitempty"`
+ CollectorAddress IP4Address `binapi:"ip4_address,name=collector_address" json:"collector_address,omitempty"`
+ SrcAddress IP4Address `binapi:"ip4_address,name=src_address" json:"src_address,omitempty"`
+}
+
+func (m *VxlanGpeIoamExportEnableDisable) Reset() { *m = VxlanGpeIoamExportEnableDisable{} }
+func (*VxlanGpeIoamExportEnableDisable) GetMessageName() string {
+ return "vxlan_gpe_ioam_export_enable_disable"
+}
+func (*VxlanGpeIoamExportEnableDisable) GetCrcString() string { return "e4d4ebfa" }
+func (*VxlanGpeIoamExportEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VxlanGpeIoamExportEnableDisable) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsDisable
+ size += 1 * 4 // m.CollectorAddress
+ size += 1 * 4 // m.SrcAddress
+ return size
+}
+func (m *VxlanGpeIoamExportEnableDisable) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsDisable)
+ buf.EncodeBytes(m.CollectorAddress[:], 4)
+ buf.EncodeBytes(m.SrcAddress[:], 4)
+ return buf.Bytes(), nil
+}
+func (m *VxlanGpeIoamExportEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsDisable = buf.DecodeBool()
+ copy(m.CollectorAddress[:], buf.DecodeBytes(4))
+ copy(m.SrcAddress[:], buf.DecodeBytes(4))
+ return nil
+}
+
+// VxlanGpeIoamExportEnableDisableReply defines message 'vxlan_gpe_ioam_export_enable_disable_reply'.
+type VxlanGpeIoamExportEnableDisableReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *VxlanGpeIoamExportEnableDisableReply) Reset() { *m = VxlanGpeIoamExportEnableDisableReply{} }
+func (*VxlanGpeIoamExportEnableDisableReply) GetMessageName() string {
+ return "vxlan_gpe_ioam_export_enable_disable_reply"
+}
+func (*VxlanGpeIoamExportEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*VxlanGpeIoamExportEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VxlanGpeIoamExportEnableDisableReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *VxlanGpeIoamExportEnableDisableReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ 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 = buf.DecodeInt32()
+ return nil
+}
+
+func init() { file_vxlan_gpe_ioam_export_binapi_init() }
+func file_vxlan_gpe_ioam_export_binapi_init() {
+ api.RegisterMessage((*VxlanGpeIoamExportEnableDisable)(nil), "vxlan_gpe_ioam_export_enable_disable_e4d4ebfa")
+ api.RegisterMessage((*VxlanGpeIoamExportEnableDisableReply)(nil), "vxlan_gpe_ioam_export_enable_disable_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*VxlanGpeIoamExportEnableDisable)(nil),
+ (*VxlanGpeIoamExportEnableDisableReply)(nil),
+ }
+}
diff --git a/internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export_rpc.ba.go b/internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export_rpc.ba.go
new file mode 100644
index 0000000..ce35b62
--- /dev/null
+++ b/internal/testbinapi/binapi2001/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export_rpc.ba.go
@@ -0,0 +1,30 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package vxlan_gpe_ioam_export
+
+import (
+ "context"
+ api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service vxlan_gpe_ioam_export.
+type RPCService interface {
+ VxlanGpeIoamExportEnableDisable(ctx context.Context, in *VxlanGpeIoamExportEnableDisable) (*VxlanGpeIoamExportEnableDisableReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) VxlanGpeIoamExportEnableDisable(ctx context.Context, in *VxlanGpeIoamExportEnableDisable) (*VxlanGpeIoamExportEnableDisableReply, error) {
+ out := new(VxlanGpeIoamExportEnableDisableReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}