1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
5 // source: /usr/share/vpp/api/plugins/urpf.api.json
7 // Package urpf contains generated bindings for API file urpf.api.
18 api "git.fd.io/govpp.git/api"
19 _ "git.fd.io/govpp.git/binapi/fib_types"
20 interface_types "git.fd.io/govpp.git/binapi/interface_types"
21 ip_types "git.fd.io/govpp.git/binapi/ip_types"
22 codec "git.fd.io/govpp.git/codec"
25 // This is a compile-time assertion to ensure that this generated file
26 // is compatible with the GoVPP api package it is being compiled against.
27 // A compilation error at this line likely means your copy of the
28 // GoVPP api package needs to be updated.
29 const _ = api.GoVppAPIPackageIsVersion2
34 VersionCrc = 0xb2bfd2c4
37 // UrpfMode defines enum 'urpf_mode'.
41 URPF_API_MODE_OFF UrpfMode = 1
42 URPF_API_MODE_LOOSE UrpfMode = 2
43 URPF_API_MODE_STRICT UrpfMode = 3
47 UrpfMode_name = map[uint8]string{
48 1: "URPF_API_MODE_OFF",
49 2: "URPF_API_MODE_LOOSE",
50 3: "URPF_API_MODE_STRICT",
52 UrpfMode_value = map[string]uint8{
53 "URPF_API_MODE_OFF": 1,
54 "URPF_API_MODE_LOOSE": 2,
55 "URPF_API_MODE_STRICT": 3,
59 func (x UrpfMode) String() string {
60 s, ok := UrpfMode_name[uint8(x)]
64 return "UrpfMode(" + strconv.Itoa(int(x)) + ")"
67 // UrpfUpdate defines message 'urpf_update'.
68 type UrpfUpdate struct {
69 IsInput bool `binapi:"bool,name=is_input,default=true" json:"is_input,omitempty"`
70 Mode UrpfMode `binapi:"urpf_mode,name=mode" json:"mode,omitempty"`
71 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
72 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
75 func (m *UrpfUpdate) Reset() { *m = UrpfUpdate{} }
76 func (*UrpfUpdate) GetMessageName() string { return "urpf_update" }
77 func (*UrpfUpdate) GetCrcString() string { return "2bf8a77c" }
78 func (*UrpfUpdate) GetMessageType() api.MessageType {
79 return api.RequestMessage
82 func (m *UrpfUpdate) Size() (size int) {
86 size += 1 // m.IsInput
89 size += 4 // m.SwIfIndex
92 func (m *UrpfUpdate) Marshal(b []byte) ([]byte, error) {
94 b = make([]byte, m.Size())
96 buf := codec.NewBuffer(b)
97 buf.EncodeBool(m.IsInput)
98 buf.EncodeUint8(uint8(m.Mode))
99 buf.EncodeUint8(uint8(m.Af))
100 buf.EncodeUint32(uint32(m.SwIfIndex))
101 return buf.Bytes(), nil
103 func (m *UrpfUpdate) Unmarshal(b []byte) error {
104 buf := codec.NewBuffer(b)
105 m.IsInput = buf.DecodeBool()
106 m.Mode = UrpfMode(buf.DecodeUint8())
107 m.Af = ip_types.AddressFamily(buf.DecodeUint8())
108 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
112 // UrpfUpdateReply defines message 'urpf_update_reply'.
113 type UrpfUpdateReply struct {
114 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
117 func (m *UrpfUpdateReply) Reset() { *m = UrpfUpdateReply{} }
118 func (*UrpfUpdateReply) GetMessageName() string { return "urpf_update_reply" }
119 func (*UrpfUpdateReply) GetCrcString() string { return "e8d4e804" }
120 func (*UrpfUpdateReply) GetMessageType() api.MessageType {
121 return api.ReplyMessage
124 func (m *UrpfUpdateReply) Size() (size int) {
128 size += 4 // m.Retval
131 func (m *UrpfUpdateReply) Marshal(b []byte) ([]byte, error) {
133 b = make([]byte, m.Size())
135 buf := codec.NewBuffer(b)
136 buf.EncodeInt32(m.Retval)
137 return buf.Bytes(), nil
139 func (m *UrpfUpdateReply) Unmarshal(b []byte) error {
140 buf := codec.NewBuffer(b)
141 m.Retval = buf.DecodeInt32()
145 func init() { file_urpf_binapi_init() }
146 func file_urpf_binapi_init() {
147 api.RegisterMessage((*UrpfUpdate)(nil), "urpf_update_2bf8a77c")
148 api.RegisterMessage((*UrpfUpdateReply)(nil), "urpf_update_reply_e8d4e804")
151 // Messages returns list of all messages in this module.
152 func AllMessages() []api.Message {
153 return []api.Message{
155 (*UrpfUpdateReply)(nil),