1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/plugins/lb_types.api.json
7 // Package lb_types contains generated bindings for API file lb_types.api.
19 api "git.fd.io/govpp.git/api"
20 codec "git.fd.io/govpp.git/codec"
26 // This is a compile-time assertion to ensure that this generated file
27 // is compatible with the GoVPP api package it is being compiled against.
28 // A compilation error at this line likely means your copy of the
29 // GoVPP api package needs to be updated.
30 const _ = api.GoVppAPIPackageIsVersion2
32 // AddressFamily defines enum 'address_family'.
33 type AddressFamily uint32
36 ADDRESS_IP4 AddressFamily = 0
37 ADDRESS_IP6 AddressFamily = 1
41 AddressFamily_name = map[uint32]string{
45 AddressFamily_value = map[string]uint32{
51 func (x AddressFamily) String() string {
52 s, ok := AddressFamily_name[uint32(x)]
56 return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
59 // IPDscp defines enum 'ip_dscp'.
63 IP_API_DSCP_CS0 IPDscp = 0
64 IP_API_DSCP_CS1 IPDscp = 8
65 IP_API_DSCP_AF11 IPDscp = 10
66 IP_API_DSCP_AF12 IPDscp = 12
67 IP_API_DSCP_AF13 IPDscp = 14
68 IP_API_DSCP_CS2 IPDscp = 16
69 IP_API_DSCP_AF21 IPDscp = 18
70 IP_API_DSCP_AF22 IPDscp = 20
71 IP_API_DSCP_AF23 IPDscp = 22
72 IP_API_DSCP_CS3 IPDscp = 24
73 IP_API_DSCP_AF31 IPDscp = 26
74 IP_API_DSCP_AF32 IPDscp = 28
75 IP_API_DSCP_AF33 IPDscp = 30
76 IP_API_DSCP_CS4 IPDscp = 32
77 IP_API_DSCP_AF41 IPDscp = 34
78 IP_API_DSCP_AF42 IPDscp = 36
79 IP_API_DSCP_AF43 IPDscp = 38
80 IP_API_DSCP_CS5 IPDscp = 40
81 IP_API_DSCP_EF IPDscp = 46
82 IP_API_DSCP_CS6 IPDscp = 48
83 IP_API_DSCP_CS7 IPDscp = 50
87 IPDscp_name = map[uint8]string{
90 10: "IP_API_DSCP_AF11",
91 12: "IP_API_DSCP_AF12",
92 14: "IP_API_DSCP_AF13",
93 16: "IP_API_DSCP_CS2",
94 18: "IP_API_DSCP_AF21",
95 20: "IP_API_DSCP_AF22",
96 22: "IP_API_DSCP_AF23",
97 24: "IP_API_DSCP_CS3",
98 26: "IP_API_DSCP_AF31",
99 28: "IP_API_DSCP_AF32",
100 30: "IP_API_DSCP_AF33",
101 32: "IP_API_DSCP_CS4",
102 34: "IP_API_DSCP_AF41",
103 36: "IP_API_DSCP_AF42",
104 38: "IP_API_DSCP_AF43",
105 40: "IP_API_DSCP_CS5",
106 46: "IP_API_DSCP_EF",
107 48: "IP_API_DSCP_CS6",
108 50: "IP_API_DSCP_CS7",
110 IPDscp_value = map[string]uint8{
111 "IP_API_DSCP_CS0": 0,
112 "IP_API_DSCP_CS1": 8,
113 "IP_API_DSCP_AF11": 10,
114 "IP_API_DSCP_AF12": 12,
115 "IP_API_DSCP_AF13": 14,
116 "IP_API_DSCP_CS2": 16,
117 "IP_API_DSCP_AF21": 18,
118 "IP_API_DSCP_AF22": 20,
119 "IP_API_DSCP_AF23": 22,
120 "IP_API_DSCP_CS3": 24,
121 "IP_API_DSCP_AF31": 26,
122 "IP_API_DSCP_AF32": 28,
123 "IP_API_DSCP_AF33": 30,
124 "IP_API_DSCP_CS4": 32,
125 "IP_API_DSCP_AF41": 34,
126 "IP_API_DSCP_AF42": 36,
127 "IP_API_DSCP_AF43": 38,
128 "IP_API_DSCP_CS5": 40,
129 "IP_API_DSCP_EF": 46,
130 "IP_API_DSCP_CS6": 48,
131 "IP_API_DSCP_CS7": 50,
135 func (x IPDscp) String() string {
136 s, ok := IPDscp_name[uint8(x)]
140 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
143 // IPEcn defines enum 'ip_ecn'.
147 IP_API_ECN_NONE IPEcn = 0
148 IP_API_ECN_ECT0 IPEcn = 1
149 IP_API_ECN_ECT1 IPEcn = 2
150 IP_API_ECN_CE IPEcn = 3
154 IPEcn_name = map[uint8]string{
155 0: "IP_API_ECN_NONE",
156 1: "IP_API_ECN_ECT0",
157 2: "IP_API_ECN_ECT1",
160 IPEcn_value = map[string]uint8{
161 "IP_API_ECN_NONE": 0,
162 "IP_API_ECN_ECT0": 1,
163 "IP_API_ECN_ECT1": 2,
168 func (x IPEcn) String() string {
169 s, ok := IPEcn_name[uint8(x)]
173 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
176 // IPProto defines enum 'ip_proto'.
180 IP_API_PROTO_HOPOPT IPProto = 0
181 IP_API_PROTO_ICMP IPProto = 1
182 IP_API_PROTO_IGMP IPProto = 2
183 IP_API_PROTO_TCP IPProto = 6
184 IP_API_PROTO_UDP IPProto = 17
185 IP_API_PROTO_GRE IPProto = 47
186 IP_API_PROTO_AH IPProto = 50
187 IP_API_PROTO_ESP IPProto = 51
188 IP_API_PROTO_EIGRP IPProto = 88
189 IP_API_PROTO_OSPF IPProto = 89
190 IP_API_PROTO_SCTP IPProto = 132
191 IP_API_PROTO_RESERVED IPProto = 255
195 IPProto_name = map[uint32]string{
196 0: "IP_API_PROTO_HOPOPT",
197 1: "IP_API_PROTO_ICMP",
198 2: "IP_API_PROTO_IGMP",
199 6: "IP_API_PROTO_TCP",
200 17: "IP_API_PROTO_UDP",
201 47: "IP_API_PROTO_GRE",
202 50: "IP_API_PROTO_AH",
203 51: "IP_API_PROTO_ESP",
204 88: "IP_API_PROTO_EIGRP",
205 89: "IP_API_PROTO_OSPF",
206 132: "IP_API_PROTO_SCTP",
207 255: "IP_API_PROTO_RESERVED",
209 IPProto_value = map[string]uint32{
210 "IP_API_PROTO_HOPOPT": 0,
211 "IP_API_PROTO_ICMP": 1,
212 "IP_API_PROTO_IGMP": 2,
213 "IP_API_PROTO_TCP": 6,
214 "IP_API_PROTO_UDP": 17,
215 "IP_API_PROTO_GRE": 47,
216 "IP_API_PROTO_AH": 50,
217 "IP_API_PROTO_ESP": 51,
218 "IP_API_PROTO_EIGRP": 88,
219 "IP_API_PROTO_OSPF": 89,
220 "IP_API_PROTO_SCTP": 132,
221 "IP_API_PROTO_RESERVED": 255,
225 func (x IPProto) String() string {
226 s, ok := IPProto_name[uint32(x)]
230 return "IPProto(" + strconv.Itoa(int(x)) + ")"
233 // LbEncapType defines enum 'lb_encap_type'.
234 type LbEncapType uint32
237 LB_API_ENCAP_TYPE_GRE4 LbEncapType = 0
238 LB_API_ENCAP_TYPE_GRE6 LbEncapType = 1
239 LB_API_ENCAP_TYPE_L3DSR LbEncapType = 2
240 LB_API_ENCAP_TYPE_NAT4 LbEncapType = 3
241 LB_API_ENCAP_TYPE_NAT6 LbEncapType = 4
242 LB_API_ENCAP_N_TYPES LbEncapType = 5
246 LbEncapType_name = map[uint32]string{
247 0: "LB_API_ENCAP_TYPE_GRE4",
248 1: "LB_API_ENCAP_TYPE_GRE6",
249 2: "LB_API_ENCAP_TYPE_L3DSR",
250 3: "LB_API_ENCAP_TYPE_NAT4",
251 4: "LB_API_ENCAP_TYPE_NAT6",
252 5: "LB_API_ENCAP_N_TYPES",
254 LbEncapType_value = map[string]uint32{
255 "LB_API_ENCAP_TYPE_GRE4": 0,
256 "LB_API_ENCAP_TYPE_GRE6": 1,
257 "LB_API_ENCAP_TYPE_L3DSR": 2,
258 "LB_API_ENCAP_TYPE_NAT4": 3,
259 "LB_API_ENCAP_TYPE_NAT6": 4,
260 "LB_API_ENCAP_N_TYPES": 5,
264 func (x LbEncapType) String() string {
265 s, ok := LbEncapType_name[uint32(x)]
269 return "LbEncapType(" + strconv.Itoa(int(x)) + ")"
272 // LbLkpTypeT defines enum 'lb_lkp_type_t'.
273 type LbLkpTypeT uint32
276 LB_API_LKP_SAME_IP_PORT LbLkpTypeT = 0
277 LB_API_LKP_DIFF_IP_PORT LbLkpTypeT = 1
278 LB_API_LKP_ALL_PORT_IP LbLkpTypeT = 2
279 LB_API_LKP_N_TYPES LbLkpTypeT = 3
283 LbLkpTypeT_name = map[uint32]string{
284 0: "LB_API_LKP_SAME_IP_PORT",
285 1: "LB_API_LKP_DIFF_IP_PORT",
286 2: "LB_API_LKP_ALL_PORT_IP",
287 3: "LB_API_LKP_N_TYPES",
289 LbLkpTypeT_value = map[string]uint32{
290 "LB_API_LKP_SAME_IP_PORT": 0,
291 "LB_API_LKP_DIFF_IP_PORT": 1,
292 "LB_API_LKP_ALL_PORT_IP": 2,
293 "LB_API_LKP_N_TYPES": 3,
297 func (x LbLkpTypeT) String() string {
298 s, ok := LbLkpTypeT_name[uint32(x)]
302 return "LbLkpTypeT(" + strconv.Itoa(int(x)) + ")"
305 // LbNatProtocol defines enum 'lb_nat_protocol'.
306 type LbNatProtocol uint32
309 LB_API_NAT_PROTOCOL_UDP LbNatProtocol = 6
310 LB_API_NAT_PROTOCOL_TCP LbNatProtocol = 23
311 LB_API_NAT_PROTOCOL_ANY LbNatProtocol = 4294967295
315 LbNatProtocol_name = map[uint32]string{
316 6: "LB_API_NAT_PROTOCOL_UDP",
317 23: "LB_API_NAT_PROTOCOL_TCP",
318 4294967295: "LB_API_NAT_PROTOCOL_ANY",
320 LbNatProtocol_value = map[string]uint32{
321 "LB_API_NAT_PROTOCOL_UDP": 6,
322 "LB_API_NAT_PROTOCOL_TCP": 23,
323 "LB_API_NAT_PROTOCOL_ANY": 4294967295,
327 func (x LbNatProtocol) String() string {
328 s, ok := LbNatProtocol_name[uint32(x)]
332 return "LbNatProtocol(" + strconv.Itoa(int(x)) + ")"
335 // LbSrvType defines enum 'lb_srv_type'.
336 type LbSrvType uint32
339 LB_API_SRV_TYPE_CLUSTERIP LbSrvType = 0
340 LB_API_SRV_TYPE_NODEPORT LbSrvType = 1
341 LB_API_SRV_N_TYPES LbSrvType = 2
345 LbSrvType_name = map[uint32]string{
346 0: "LB_API_SRV_TYPE_CLUSTERIP",
347 1: "LB_API_SRV_TYPE_NODEPORT",
348 2: "LB_API_SRV_N_TYPES",
350 LbSrvType_value = map[string]uint32{
351 "LB_API_SRV_TYPE_CLUSTERIP": 0,
352 "LB_API_SRV_TYPE_NODEPORT": 1,
353 "LB_API_SRV_N_TYPES": 2,
357 func (x LbSrvType) String() string {
358 s, ok := LbSrvType_name[uint32(x)]
362 return "LbSrvType(" + strconv.Itoa(int(x)) + ")"
365 // LbVipType defines enum 'lb_vip_type'.
366 type LbVipType uint32
369 LB_API_VIP_TYPE_IP6_GRE6 LbVipType = 0
370 LB_API_VIP_TYPE_IP6_GRE4 LbVipType = 1
371 LB_API_VIP_TYPE_IP4_GRE6 LbVipType = 2
372 LB_API_VIP_TYPE_IP4_GRE4 LbVipType = 3
373 LB_API_VIP_TYPE_IP4_L3DSR LbVipType = 4
374 LB_API_VIP_TYPE_IP4_NAT4 LbVipType = 5
375 LB_API_VIP_TYPE_IP6_NAT6 LbVipType = 6
376 LB_API_VIP_N_TYPES LbVipType = 7
380 LbVipType_name = map[uint32]string{
381 0: "LB_API_VIP_TYPE_IP6_GRE6",
382 1: "LB_API_VIP_TYPE_IP6_GRE4",
383 2: "LB_API_VIP_TYPE_IP4_GRE6",
384 3: "LB_API_VIP_TYPE_IP4_GRE4",
385 4: "LB_API_VIP_TYPE_IP4_L3DSR",
386 5: "LB_API_VIP_TYPE_IP4_NAT4",
387 6: "LB_API_VIP_TYPE_IP6_NAT6",
388 7: "LB_API_VIP_N_TYPES",
390 LbVipType_value = map[string]uint32{
391 "LB_API_VIP_TYPE_IP6_GRE6": 0,
392 "LB_API_VIP_TYPE_IP6_GRE4": 1,
393 "LB_API_VIP_TYPE_IP4_GRE6": 2,
394 "LB_API_VIP_TYPE_IP4_GRE4": 3,
395 "LB_API_VIP_TYPE_IP4_L3DSR": 4,
396 "LB_API_VIP_TYPE_IP4_NAT4": 5,
397 "LB_API_VIP_TYPE_IP6_NAT6": 6,
398 "LB_API_VIP_N_TYPES": 7,
402 func (x LbVipType) String() string {
403 s, ok := LbVipType_name[uint32(x)]
407 return "LbVipType(" + strconv.Itoa(int(x)) + ")"
410 // AddressWithPrefix defines alias 'address_with_prefix'.
411 type AddressWithPrefix Prefix
413 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
414 prefix, err := ParsePrefix(s)
416 return AddressWithPrefix{}, err
418 return AddressWithPrefix(prefix), nil
420 func (x AddressWithPrefix) String() string {
421 return Prefix(x).String()
423 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
424 return []byte(x.String()), nil
426 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
427 prefix, err := ParseAddressWithPrefix(string(text))
435 // IP4Address defines alias 'ip4_address'.
436 type IP4Address [4]uint8
438 func ParseIP4Address(s string) (IP4Address, error) {
439 ip := net.ParseIP(s).To4()
441 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
443 var ipaddr IP4Address
444 copy(ipaddr[:], ip.To4())
448 func (x IP4Address) ToIP() net.IP {
449 return net.IP(x[:]).To4()
451 func (x IP4Address) String() string {
452 return x.ToIP().String()
454 func (x *IP4Address) MarshalText() ([]byte, error) {
455 return []byte(x.String()), nil
457 func (x *IP4Address) UnmarshalText(text []byte) error {
458 ipaddr, err := ParseIP4Address(string(text))
466 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
467 type IP4AddressWithPrefix IP4Prefix
469 // IP6Address defines alias 'ip6_address'.
470 type IP6Address [16]uint8
472 func ParseIP6Address(s string) (IP6Address, error) {
473 ip := net.ParseIP(s).To16()
475 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
477 var ipaddr IP6Address
478 copy(ipaddr[:], ip.To16())
482 func (x IP6Address) ToIP() net.IP {
483 return net.IP(x[:]).To16()
485 func (x IP6Address) String() string {
486 return x.ToIP().String()
488 func (x *IP6Address) MarshalText() ([]byte, error) {
489 return []byte(x.String()), nil
491 func (x *IP6Address) UnmarshalText(text []byte) error {
492 ipaddr, err := ParseIP6Address(string(text))
500 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
501 type IP6AddressWithPrefix IP6Prefix
503 // Address defines type 'address'.
504 type Address struct {
505 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
506 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
509 func ParseAddress(s string) (Address, error) {
512 return Address{}, fmt.Errorf("invalid address: %s", s)
516 addr.Af = ADDRESS_IP6
518 copy(ip6[:], ip.To16())
521 addr.Af = ADDRESS_IP4
523 copy(ip4[:], ip.To4())
528 func (x Address) ToIP() net.IP {
529 if x.Af == ADDRESS_IP6 {
531 return net.IP(ip6[:]).To16()
534 return net.IP(ip4[:]).To4()
537 func (x Address) String() string {
538 return x.ToIP().String()
540 func (x *Address) MarshalText() ([]byte, error) {
541 return []byte(x.String()), nil
543 func (x *Address) UnmarshalText(text []byte) error {
544 addr, err := ParseAddress(string(text))
552 // IP4Prefix defines type 'ip4_prefix'.
553 type IP4Prefix struct {
554 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
555 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
558 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
559 hasPrefix := strings.Contains(s, "/")
561 ip, network, err := net.ParseCIDR(s)
563 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
565 maskSize, _ := network.Mask.Size()
566 prefix.Len = byte(maskSize)
567 prefix.Address, err = ParseIP4Address(ip.String())
569 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
573 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
575 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
577 prefix.Len = byte(defaultMaskSize)
578 prefix.Address, err = ParseIP4Address(ip.String())
580 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
585 func (x IP4Prefix) ToIPNet() *net.IPNet {
586 mask := net.CIDRMask(int(x.Len), 32)
587 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
590 func (x IP4Prefix) String() string {
591 ip := x.Address.String()
592 return ip + "/" + strconv.Itoa(int(x.Len))
594 func (x *IP4Prefix) MarshalText() ([]byte, error) {
595 return []byte(x.String()), nil
597 func (x *IP4Prefix) UnmarshalText(text []byte) error {
598 prefix, err := ParseIP4Prefix(string(text))
606 // IP6Prefix defines type 'ip6_prefix'.
607 type IP6Prefix struct {
608 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
609 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
612 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
613 hasPrefix := strings.Contains(s, "/")
615 ip, network, err := net.ParseCIDR(s)
617 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
619 maskSize, _ := network.Mask.Size()
620 prefix.Len = byte(maskSize)
621 prefix.Address, err = ParseIP6Address(ip.String())
623 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
627 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
629 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
631 prefix.Len = byte(defaultMaskSize)
632 prefix.Address, err = ParseIP6Address(ip.String())
634 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
639 func (x IP6Prefix) ToIPNet() *net.IPNet {
640 mask := net.CIDRMask(int(x.Len), 128)
641 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
644 func (x IP6Prefix) String() string {
645 ip := x.Address.String()
646 return ip + "/" + strconv.Itoa(int(x.Len))
648 func (x *IP6Prefix) MarshalText() ([]byte, error) {
649 return []byte(x.String()), nil
651 func (x *IP6Prefix) UnmarshalText(text []byte) error {
652 prefix, err := ParseIP6Prefix(string(text))
660 // LbVip defines type 'lb_vip'.
662 Pfx AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
663 Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
664 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
667 // Mprefix defines type 'mprefix'.
668 type Mprefix struct {
669 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
670 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
671 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
672 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
675 // Prefix defines type 'prefix'.
677 Address Address `binapi:"address,name=address" json:"address,omitempty"`
678 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
681 func ParsePrefix(ip string) (prefix Prefix, err error) {
682 hasPrefix := strings.Contains(ip, "/")
684 netIP, network, err := net.ParseCIDR(ip)
686 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
688 maskSize, _ := network.Mask.Size()
689 prefix.Len = byte(maskSize)
690 prefix.Address, err = ParseAddress(netIP.String())
692 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
695 netIP := net.ParseIP(ip)
696 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
697 if netIP.To4() == nil {
698 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
700 prefix.Len = byte(defaultMaskSize)
701 prefix.Address, err = ParseAddress(netIP.String())
703 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
708 func (x Prefix) ToIPNet() *net.IPNet {
710 if x.Address.Af == ADDRESS_IP4 {
711 mask = net.CIDRMask(int(x.Len), 32)
713 mask = net.CIDRMask(int(x.Len), 128)
715 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
718 func (x Prefix) String() string {
719 ip := x.Address.String()
720 return ip + "/" + strconv.Itoa(int(x.Len))
722 func (x *Prefix) MarshalText() ([]byte, error) {
723 return []byte(x.String()), nil
725 func (x *Prefix) UnmarshalText(text []byte) error {
726 prefix, err := ParsePrefix(string(text))
734 // PrefixMatcher defines type 'prefix_matcher'.
735 type PrefixMatcher struct {
736 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
737 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
740 // AddressUnion defines union 'address_union'.
741 type AddressUnion struct {
744 XXX_UnionData [16]byte
747 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
751 func (u *AddressUnion) SetIP4(a IP4Address) {
752 buf := codec.NewBuffer(u.XXX_UnionData[:])
753 buf.EncodeBytes(a[:], 4)
755 func (u *AddressUnion) GetIP4() (a IP4Address) {
756 buf := codec.NewBuffer(u.XXX_UnionData[:])
757 copy(a[:], buf.DecodeBytes(4))
761 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
765 func (u *AddressUnion) SetIP6(a IP6Address) {
766 buf := codec.NewBuffer(u.XXX_UnionData[:])
767 buf.EncodeBytes(a[:], 16)
769 func (u *AddressUnion) GetIP6() (a IP6Address) {
770 buf := codec.NewBuffer(u.XXX_UnionData[:])
771 copy(a[:], buf.DecodeBytes(16))