1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/plugins/lb_types.api.json
7 // Package lb_types contains generated bindings for API file lb_types.api.
23 api "git.fd.io/govpp.git/api"
24 codec "git.fd.io/govpp.git/codec"
27 // This is a compile-time assertion to ensure that this generated file
28 // is compatible with the GoVPP api package it is being compiled against.
29 // A compilation error at this line likely means your copy of the
30 // GoVPP api package needs to be updated.
31 const _ = api.GoVppAPIPackageIsVersion2
36 VersionCrc = 0xd04207f3
39 // AddressFamily defines enum 'address_family'.
40 type AddressFamily uint32
43 ADDRESS_IP4 AddressFamily = 0
44 ADDRESS_IP6 AddressFamily = 1
48 AddressFamily_name = map[uint32]string{
52 AddressFamily_value = map[string]uint32{
58 func (x AddressFamily) String() string {
59 s, ok := AddressFamily_name[uint32(x)]
63 return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
66 // IPDscp defines enum 'ip_dscp'.
70 IP_API_DSCP_CS0 IPDscp = 0
71 IP_API_DSCP_CS1 IPDscp = 8
72 IP_API_DSCP_AF11 IPDscp = 10
73 IP_API_DSCP_AF12 IPDscp = 12
74 IP_API_DSCP_AF13 IPDscp = 14
75 IP_API_DSCP_CS2 IPDscp = 16
76 IP_API_DSCP_AF21 IPDscp = 18
77 IP_API_DSCP_AF22 IPDscp = 20
78 IP_API_DSCP_AF23 IPDscp = 22
79 IP_API_DSCP_CS3 IPDscp = 24
80 IP_API_DSCP_AF31 IPDscp = 26
81 IP_API_DSCP_AF32 IPDscp = 28
82 IP_API_DSCP_AF33 IPDscp = 30
83 IP_API_DSCP_CS4 IPDscp = 32
84 IP_API_DSCP_AF41 IPDscp = 34
85 IP_API_DSCP_AF42 IPDscp = 36
86 IP_API_DSCP_AF43 IPDscp = 38
87 IP_API_DSCP_CS5 IPDscp = 40
88 IP_API_DSCP_EF IPDscp = 46
89 IP_API_DSCP_CS6 IPDscp = 48
90 IP_API_DSCP_CS7 IPDscp = 50
94 IPDscp_name = map[uint8]string{
97 10: "IP_API_DSCP_AF11",
98 12: "IP_API_DSCP_AF12",
99 14: "IP_API_DSCP_AF13",
100 16: "IP_API_DSCP_CS2",
101 18: "IP_API_DSCP_AF21",
102 20: "IP_API_DSCP_AF22",
103 22: "IP_API_DSCP_AF23",
104 24: "IP_API_DSCP_CS3",
105 26: "IP_API_DSCP_AF31",
106 28: "IP_API_DSCP_AF32",
107 30: "IP_API_DSCP_AF33",
108 32: "IP_API_DSCP_CS4",
109 34: "IP_API_DSCP_AF41",
110 36: "IP_API_DSCP_AF42",
111 38: "IP_API_DSCP_AF43",
112 40: "IP_API_DSCP_CS5",
113 46: "IP_API_DSCP_EF",
114 48: "IP_API_DSCP_CS6",
115 50: "IP_API_DSCP_CS7",
117 IPDscp_value = map[string]uint8{
118 "IP_API_DSCP_CS0": 0,
119 "IP_API_DSCP_CS1": 8,
120 "IP_API_DSCP_AF11": 10,
121 "IP_API_DSCP_AF12": 12,
122 "IP_API_DSCP_AF13": 14,
123 "IP_API_DSCP_CS2": 16,
124 "IP_API_DSCP_AF21": 18,
125 "IP_API_DSCP_AF22": 20,
126 "IP_API_DSCP_AF23": 22,
127 "IP_API_DSCP_CS3": 24,
128 "IP_API_DSCP_AF31": 26,
129 "IP_API_DSCP_AF32": 28,
130 "IP_API_DSCP_AF33": 30,
131 "IP_API_DSCP_CS4": 32,
132 "IP_API_DSCP_AF41": 34,
133 "IP_API_DSCP_AF42": 36,
134 "IP_API_DSCP_AF43": 38,
135 "IP_API_DSCP_CS5": 40,
136 "IP_API_DSCP_EF": 46,
137 "IP_API_DSCP_CS6": 48,
138 "IP_API_DSCP_CS7": 50,
142 func (x IPDscp) String() string {
143 s, ok := IPDscp_name[uint8(x)]
147 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
150 // IPEcn defines enum 'ip_ecn'.
154 IP_API_ECN_NONE IPEcn = 0
155 IP_API_ECN_ECT0 IPEcn = 1
156 IP_API_ECN_ECT1 IPEcn = 2
157 IP_API_ECN_CE IPEcn = 3
161 IPEcn_name = map[uint8]string{
162 0: "IP_API_ECN_NONE",
163 1: "IP_API_ECN_ECT0",
164 2: "IP_API_ECN_ECT1",
167 IPEcn_value = map[string]uint8{
168 "IP_API_ECN_NONE": 0,
169 "IP_API_ECN_ECT0": 1,
170 "IP_API_ECN_ECT1": 2,
175 func (x IPEcn) String() string {
176 s, ok := IPEcn_name[uint8(x)]
180 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
183 // IPProto defines enum 'ip_proto'.
187 IP_API_PROTO_HOPOPT IPProto = 0
188 IP_API_PROTO_ICMP IPProto = 1
189 IP_API_PROTO_IGMP IPProto = 2
190 IP_API_PROTO_TCP IPProto = 6
191 IP_API_PROTO_UDP IPProto = 17
192 IP_API_PROTO_GRE IPProto = 47
193 IP_API_PROTO_AH IPProto = 50
194 IP_API_PROTO_ESP IPProto = 51
195 IP_API_PROTO_EIGRP IPProto = 88
196 IP_API_PROTO_OSPF IPProto = 89
197 IP_API_PROTO_SCTP IPProto = 132
198 IP_API_PROTO_RESERVED IPProto = 255
202 IPProto_name = map[uint32]string{
203 0: "IP_API_PROTO_HOPOPT",
204 1: "IP_API_PROTO_ICMP",
205 2: "IP_API_PROTO_IGMP",
206 6: "IP_API_PROTO_TCP",
207 17: "IP_API_PROTO_UDP",
208 47: "IP_API_PROTO_GRE",
209 50: "IP_API_PROTO_AH",
210 51: "IP_API_PROTO_ESP",
211 88: "IP_API_PROTO_EIGRP",
212 89: "IP_API_PROTO_OSPF",
213 132: "IP_API_PROTO_SCTP",
214 255: "IP_API_PROTO_RESERVED",
216 IPProto_value = map[string]uint32{
217 "IP_API_PROTO_HOPOPT": 0,
218 "IP_API_PROTO_ICMP": 1,
219 "IP_API_PROTO_IGMP": 2,
220 "IP_API_PROTO_TCP": 6,
221 "IP_API_PROTO_UDP": 17,
222 "IP_API_PROTO_GRE": 47,
223 "IP_API_PROTO_AH": 50,
224 "IP_API_PROTO_ESP": 51,
225 "IP_API_PROTO_EIGRP": 88,
226 "IP_API_PROTO_OSPF": 89,
227 "IP_API_PROTO_SCTP": 132,
228 "IP_API_PROTO_RESERVED": 255,
232 func (x IPProto) String() string {
233 s, ok := IPProto_name[uint32(x)]
237 return "IPProto(" + strconv.Itoa(int(x)) + ")"
240 // LbEncapType defines enum 'lb_encap_type'.
241 type LbEncapType uint32
244 LB_API_ENCAP_TYPE_GRE4 LbEncapType = 0
245 LB_API_ENCAP_TYPE_GRE6 LbEncapType = 1
246 LB_API_ENCAP_TYPE_L3DSR LbEncapType = 2
247 LB_API_ENCAP_TYPE_NAT4 LbEncapType = 3
248 LB_API_ENCAP_TYPE_NAT6 LbEncapType = 4
249 LB_API_ENCAP_N_TYPES LbEncapType = 5
253 LbEncapType_name = map[uint32]string{
254 0: "LB_API_ENCAP_TYPE_GRE4",
255 1: "LB_API_ENCAP_TYPE_GRE6",
256 2: "LB_API_ENCAP_TYPE_L3DSR",
257 3: "LB_API_ENCAP_TYPE_NAT4",
258 4: "LB_API_ENCAP_TYPE_NAT6",
259 5: "LB_API_ENCAP_N_TYPES",
261 LbEncapType_value = map[string]uint32{
262 "LB_API_ENCAP_TYPE_GRE4": 0,
263 "LB_API_ENCAP_TYPE_GRE6": 1,
264 "LB_API_ENCAP_TYPE_L3DSR": 2,
265 "LB_API_ENCAP_TYPE_NAT4": 3,
266 "LB_API_ENCAP_TYPE_NAT6": 4,
267 "LB_API_ENCAP_N_TYPES": 5,
271 func (x LbEncapType) String() string {
272 s, ok := LbEncapType_name[uint32(x)]
276 return "LbEncapType(" + strconv.Itoa(int(x)) + ")"
279 // LbLkpTypeT defines enum 'lb_lkp_type_t'.
280 type LbLkpTypeT uint32
283 LB_API_LKP_SAME_IP_PORT LbLkpTypeT = 0
284 LB_API_LKP_DIFF_IP_PORT LbLkpTypeT = 1
285 LB_API_LKP_ALL_PORT_IP LbLkpTypeT = 2
286 LB_API_LKP_N_TYPES LbLkpTypeT = 3
290 LbLkpTypeT_name = map[uint32]string{
291 0: "LB_API_LKP_SAME_IP_PORT",
292 1: "LB_API_LKP_DIFF_IP_PORT",
293 2: "LB_API_LKP_ALL_PORT_IP",
294 3: "LB_API_LKP_N_TYPES",
296 LbLkpTypeT_value = map[string]uint32{
297 "LB_API_LKP_SAME_IP_PORT": 0,
298 "LB_API_LKP_DIFF_IP_PORT": 1,
299 "LB_API_LKP_ALL_PORT_IP": 2,
300 "LB_API_LKP_N_TYPES": 3,
304 func (x LbLkpTypeT) String() string {
305 s, ok := LbLkpTypeT_name[uint32(x)]
309 return "LbLkpTypeT(" + strconv.Itoa(int(x)) + ")"
312 // LbNatProtocol defines enum 'lb_nat_protocol'.
313 type LbNatProtocol uint32
316 LB_API_NAT_PROTOCOL_UDP LbNatProtocol = 6
317 LB_API_NAT_PROTOCOL_TCP LbNatProtocol = 23
318 LB_API_NAT_PROTOCOL_ANY LbNatProtocol = 4294967295
322 LbNatProtocol_name = map[uint32]string{
323 6: "LB_API_NAT_PROTOCOL_UDP",
324 23: "LB_API_NAT_PROTOCOL_TCP",
325 4294967295: "LB_API_NAT_PROTOCOL_ANY",
327 LbNatProtocol_value = map[string]uint32{
328 "LB_API_NAT_PROTOCOL_UDP": 6,
329 "LB_API_NAT_PROTOCOL_TCP": 23,
330 "LB_API_NAT_PROTOCOL_ANY": 4294967295,
334 func (x LbNatProtocol) String() string {
335 s, ok := LbNatProtocol_name[uint32(x)]
339 return "LbNatProtocol(" + strconv.Itoa(int(x)) + ")"
342 // LbSrvType defines enum 'lb_srv_type'.
343 type LbSrvType uint32
346 LB_API_SRV_TYPE_CLUSTERIP LbSrvType = 0
347 LB_API_SRV_TYPE_NODEPORT LbSrvType = 1
348 LB_API_SRV_N_TYPES LbSrvType = 2
352 LbSrvType_name = map[uint32]string{
353 0: "LB_API_SRV_TYPE_CLUSTERIP",
354 1: "LB_API_SRV_TYPE_NODEPORT",
355 2: "LB_API_SRV_N_TYPES",
357 LbSrvType_value = map[string]uint32{
358 "LB_API_SRV_TYPE_CLUSTERIP": 0,
359 "LB_API_SRV_TYPE_NODEPORT": 1,
360 "LB_API_SRV_N_TYPES": 2,
364 func (x LbSrvType) String() string {
365 s, ok := LbSrvType_name[uint32(x)]
369 return "LbSrvType(" + strconv.Itoa(int(x)) + ")"
372 // LbVipType defines enum 'lb_vip_type'.
373 type LbVipType uint32
376 LB_API_VIP_TYPE_IP6_GRE6 LbVipType = 0
377 LB_API_VIP_TYPE_IP6_GRE4 LbVipType = 1
378 LB_API_VIP_TYPE_IP4_GRE6 LbVipType = 2
379 LB_API_VIP_TYPE_IP4_GRE4 LbVipType = 3
380 LB_API_VIP_TYPE_IP4_L3DSR LbVipType = 4
381 LB_API_VIP_TYPE_IP4_NAT4 LbVipType = 5
382 LB_API_VIP_TYPE_IP6_NAT6 LbVipType = 6
383 LB_API_VIP_N_TYPES LbVipType = 7
387 LbVipType_name = map[uint32]string{
388 0: "LB_API_VIP_TYPE_IP6_GRE6",
389 1: "LB_API_VIP_TYPE_IP6_GRE4",
390 2: "LB_API_VIP_TYPE_IP4_GRE6",
391 3: "LB_API_VIP_TYPE_IP4_GRE4",
392 4: "LB_API_VIP_TYPE_IP4_L3DSR",
393 5: "LB_API_VIP_TYPE_IP4_NAT4",
394 6: "LB_API_VIP_TYPE_IP6_NAT6",
395 7: "LB_API_VIP_N_TYPES",
397 LbVipType_value = map[string]uint32{
398 "LB_API_VIP_TYPE_IP6_GRE6": 0,
399 "LB_API_VIP_TYPE_IP6_GRE4": 1,
400 "LB_API_VIP_TYPE_IP4_GRE6": 2,
401 "LB_API_VIP_TYPE_IP4_GRE4": 3,
402 "LB_API_VIP_TYPE_IP4_L3DSR": 4,
403 "LB_API_VIP_TYPE_IP4_NAT4": 5,
404 "LB_API_VIP_TYPE_IP6_NAT6": 6,
405 "LB_API_VIP_N_TYPES": 7,
409 func (x LbVipType) String() string {
410 s, ok := LbVipType_name[uint32(x)]
414 return "LbVipType(" + strconv.Itoa(int(x)) + ")"
417 // AddressWithPrefix defines alias 'address_with_prefix'.
418 type AddressWithPrefix Prefix
420 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
421 prefix, err := ParsePrefix(s)
423 return AddressWithPrefix{}, err
425 return AddressWithPrefix(prefix), nil
428 func (x AddressWithPrefix) String() string {
429 return Prefix(x).String()
432 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
433 return []byte(x.String()), nil
436 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
437 prefix, err := ParseAddressWithPrefix(string(text))
445 // IP4Address defines alias 'ip4_address'.
446 type IP4Address [4]uint8
448 func ParseIP4Address(s string) (IP4Address, error) {
449 ip := net.ParseIP(s).To4()
451 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
453 var ipaddr IP4Address
454 copy(ipaddr[:], ip.To4())
458 func (x IP4Address) ToIP() net.IP {
459 return net.IP(x[:]).To4()
462 func (x IP4Address) String() string {
463 return x.ToIP().String()
466 func (x *IP4Address) MarshalText() ([]byte, error) {
467 return []byte(x.String()), nil
470 func (x *IP4Address) UnmarshalText(text []byte) error {
471 ipaddr, err := ParseIP4Address(string(text))
479 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
480 type IP4AddressWithPrefix IP4Prefix
482 // IP6Address defines alias 'ip6_address'.
483 type IP6Address [16]uint8
485 func ParseIP6Address(s string) (IP6Address, error) {
486 ip := net.ParseIP(s).To16()
488 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
490 var ipaddr IP6Address
491 copy(ipaddr[:], ip.To16())
495 func (x IP6Address) ToIP() net.IP {
496 return net.IP(x[:]).To16()
499 func (x IP6Address) String() string {
500 return x.ToIP().String()
503 func (x *IP6Address) MarshalText() ([]byte, error) {
504 return []byte(x.String()), nil
507 func (x *IP6Address) UnmarshalText(text []byte) error {
508 ipaddr, err := ParseIP6Address(string(text))
516 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
517 type IP6AddressWithPrefix IP6Prefix
519 // Address defines type 'address'.
520 type Address struct {
521 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
522 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
525 func ParseAddress(s string) (Address, error) {
528 return Address{}, fmt.Errorf("invalid address: %s", s)
530 return AddressFromIP(ip), nil
533 func AddressFromIP(ip net.IP) Address {
536 addr.Af = ADDRESS_IP6
538 copy(ip6[:], ip.To16())
541 addr.Af = ADDRESS_IP4
543 copy(ip4[:], ip.To4())
549 func (x Address) ToIP() net.IP {
550 if x.Af == ADDRESS_IP6 {
552 return net.IP(ip6[:]).To16()
555 return net.IP(ip4[:]).To4()
559 func (x Address) String() string {
560 return x.ToIP().String()
563 func (x *Address) MarshalText() ([]byte, error) {
564 return []byte(x.String()), nil
567 func (x *Address) UnmarshalText(text []byte) error {
568 addr, err := ParseAddress(string(text))
576 // IP4Prefix defines type 'ip4_prefix'.
577 type IP4Prefix struct {
578 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
579 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
582 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
583 hasPrefix := strings.Contains(s, "/")
585 ip, network, err := net.ParseCIDR(s)
587 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
589 maskSize, _ := network.Mask.Size()
590 prefix.Len = byte(maskSize)
591 prefix.Address, err = ParseIP4Address(ip.String())
593 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
597 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
599 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
601 prefix.Len = byte(defaultMaskSize)
602 prefix.Address, err = ParseIP4Address(ip.String())
604 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
610 func (x IP4Prefix) ToIPNet() *net.IPNet {
611 mask := net.CIDRMask(int(x.Len), 32)
612 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
616 func (x IP4Prefix) String() string {
617 ip := x.Address.String()
618 return ip + "/" + strconv.Itoa(int(x.Len))
621 func (x *IP4Prefix) MarshalText() ([]byte, error) {
622 return []byte(x.String()), nil
625 func (x *IP4Prefix) UnmarshalText(text []byte) error {
626 prefix, err := ParseIP4Prefix(string(text))
634 // IP6Prefix defines type 'ip6_prefix'.
635 type IP6Prefix struct {
636 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
637 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
640 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
641 hasPrefix := strings.Contains(s, "/")
643 ip, network, err := net.ParseCIDR(s)
645 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
647 maskSize, _ := network.Mask.Size()
648 prefix.Len = byte(maskSize)
649 prefix.Address, err = ParseIP6Address(ip.String())
651 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
655 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
657 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
659 prefix.Len = byte(defaultMaskSize)
660 prefix.Address, err = ParseIP6Address(ip.String())
662 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
668 func (x IP6Prefix) ToIPNet() *net.IPNet {
669 mask := net.CIDRMask(int(x.Len), 128)
670 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
674 func (x IP6Prefix) String() string {
675 ip := x.Address.String()
676 return ip + "/" + strconv.Itoa(int(x.Len))
679 func (x *IP6Prefix) MarshalText() ([]byte, error) {
680 return []byte(x.String()), nil
683 func (x *IP6Prefix) UnmarshalText(text []byte) error {
684 prefix, err := ParseIP6Prefix(string(text))
692 // LbVip defines type 'lb_vip'.
694 Pfx AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
695 Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
696 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
699 // Mprefix defines type 'mprefix'.
700 type Mprefix struct {
701 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
702 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
703 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
704 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
707 // Prefix defines type 'prefix'.
709 Address Address `binapi:"address,name=address" json:"address,omitempty"`
710 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
713 func ParsePrefix(ip string) (prefix Prefix, err error) {
714 hasPrefix := strings.Contains(ip, "/")
716 netIP, network, err := net.ParseCIDR(ip)
718 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
720 maskSize, _ := network.Mask.Size()
721 prefix.Len = byte(maskSize)
722 prefix.Address, err = ParseAddress(netIP.String())
724 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
727 netIP := net.ParseIP(ip)
728 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
729 if netIP.To4() == nil {
730 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
732 prefix.Len = byte(defaultMaskSize)
733 prefix.Address, err = ParseAddress(netIP.String())
735 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
741 func (x Prefix) ToIPNet() *net.IPNet {
743 if x.Address.Af == ADDRESS_IP4 {
744 mask = net.CIDRMask(int(x.Len), 32)
746 mask = net.CIDRMask(int(x.Len), 128)
748 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
752 func (x Prefix) String() string {
753 ip := x.Address.String()
754 return ip + "/" + strconv.Itoa(int(x.Len))
757 func (x *Prefix) MarshalText() ([]byte, error) {
758 return []byte(x.String()), nil
761 func (x *Prefix) UnmarshalText(text []byte) error {
762 prefix, err := ParsePrefix(string(text))
770 // PrefixMatcher defines type 'prefix_matcher'.
771 type PrefixMatcher struct {
772 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
773 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
776 // AddressUnion defines union 'address_union'.
777 type AddressUnion struct {
778 // AddressUnion can be one of:
781 XXX_UnionData [16]byte
784 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
788 func (u *AddressUnion) SetIP4(a IP4Address) {
789 buf := codec.NewBuffer(u.XXX_UnionData[:])
790 buf.EncodeBytes(a[:], 4)
792 func (u *AddressUnion) GetIP4() (a IP4Address) {
793 buf := codec.NewBuffer(u.XXX_UnionData[:])
794 copy(a[:], buf.DecodeBytes(4))
798 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
802 func (u *AddressUnion) SetIP6(a IP6Address) {
803 buf := codec.NewBuffer(u.XXX_UnionData[:])
804 buf.EncodeBytes(a[:], 16)
806 func (u *AddressUnion) GetIP6() (a IP6Address) {
807 buf := codec.NewBuffer(u.XXX_UnionData[:])
808 copy(a[:], buf.DecodeBytes(16))