github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/adl/adl.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: plugins/adl.api.json 6 7 // Package adl contains generated bindings for API file adl.api. 8 // 9 // Contents: 10 // - 4 messages 11 package adl 12 13 import ( 14 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 15 api "go.fd.io/govpp/api" 16 codec "go.fd.io/govpp/codec" 17 ) 18 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the GoVPP api package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // GoVPP api package needs to be updated. 23 const _ = api.GoVppAPIPackageIsVersion2 24 25 const ( 26 APIFile = "adl" 27 APIVersion = "0.0.1" 28 VersionCrc = 0xb752b7a2 29 ) 30 31 // adl: enable/disable allow list filtration features on an interface 32 // 33 // Note: the supplied fib_id must match in order to remove the feature! 34 // - sw_if_index - interface handle, physical interfaces only 35 // - fib_id - fib identifier for the allow/deny fib 36 // - ip4 - 1 => enable ip4 filtration, 0=> disable ip4 filtration 37 // - ip6 - 1 => enable ip6 filtration, 0=> disable ip6 filtration 38 // - default_adl - 1 => enable non-ip4, non-ip6 filtration 39 // 0 => disable it 40 // 41 // AdlAllowlistEnableDisable defines message 'adl_allowlist_enable_disable'. 42 type AdlAllowlistEnableDisable struct { 43 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 44 FibID uint32 `binapi:"u32,name=fib_id" json:"fib_id,omitempty"` 45 IP4 bool `binapi:"bool,name=ip4" json:"ip4,omitempty"` 46 IP6 bool `binapi:"bool,name=ip6" json:"ip6,omitempty"` 47 DefaultAdl bool `binapi:"bool,name=default_adl" json:"default_adl,omitempty"` 48 } 49 50 func (m *AdlAllowlistEnableDisable) Reset() { *m = AdlAllowlistEnableDisable{} } 51 func (*AdlAllowlistEnableDisable) GetMessageName() string { return "adl_allowlist_enable_disable" } 52 func (*AdlAllowlistEnableDisable) GetCrcString() string { return "ea88828d" } 53 func (*AdlAllowlistEnableDisable) GetMessageType() api.MessageType { 54 return api.RequestMessage 55 } 56 57 func (m *AdlAllowlistEnableDisable) Size() (size int) { 58 if m == nil { 59 return 0 60 } 61 size += 4 // m.SwIfIndex 62 size += 4 // m.FibID 63 size += 1 // m.IP4 64 size += 1 // m.IP6 65 size += 1 // m.DefaultAdl 66 return size 67 } 68 func (m *AdlAllowlistEnableDisable) Marshal(b []byte) ([]byte, error) { 69 if b == nil { 70 b = make([]byte, m.Size()) 71 } 72 buf := codec.NewBuffer(b) 73 buf.EncodeUint32(uint32(m.SwIfIndex)) 74 buf.EncodeUint32(m.FibID) 75 buf.EncodeBool(m.IP4) 76 buf.EncodeBool(m.IP6) 77 buf.EncodeBool(m.DefaultAdl) 78 return buf.Bytes(), nil 79 } 80 func (m *AdlAllowlistEnableDisable) Unmarshal(b []byte) error { 81 buf := codec.NewBuffer(b) 82 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 83 m.FibID = buf.DecodeUint32() 84 m.IP4 = buf.DecodeBool() 85 m.IP6 = buf.DecodeBool() 86 m.DefaultAdl = buf.DecodeBool() 87 return nil 88 } 89 90 // AdlAllowlistEnableDisableReply defines message 'adl_allowlist_enable_disable_reply'. 91 type AdlAllowlistEnableDisableReply struct { 92 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 93 } 94 95 func (m *AdlAllowlistEnableDisableReply) Reset() { *m = AdlAllowlistEnableDisableReply{} } 96 func (*AdlAllowlistEnableDisableReply) GetMessageName() string { 97 return "adl_allowlist_enable_disable_reply" 98 } 99 func (*AdlAllowlistEnableDisableReply) GetCrcString() string { return "e8d4e804" } 100 func (*AdlAllowlistEnableDisableReply) GetMessageType() api.MessageType { 101 return api.ReplyMessage 102 } 103 104 func (m *AdlAllowlistEnableDisableReply) Size() (size int) { 105 if m == nil { 106 return 0 107 } 108 size += 4 // m.Retval 109 return size 110 } 111 func (m *AdlAllowlistEnableDisableReply) Marshal(b []byte) ([]byte, error) { 112 if b == nil { 113 b = make([]byte, m.Size()) 114 } 115 buf := codec.NewBuffer(b) 116 buf.EncodeInt32(m.Retval) 117 return buf.Bytes(), nil 118 } 119 func (m *AdlAllowlistEnableDisableReply) Unmarshal(b []byte) error { 120 buf := codec.NewBuffer(b) 121 m.Retval = buf.DecodeInt32() 122 return nil 123 } 124 125 // adl: enable/disable filtration features on an interface 126 // - sw_if_inded - desired interface 127 // - enable_disable - 1 => enable, 0 => disable 128 // 129 // AdlInterfaceEnableDisable defines message 'adl_interface_enable_disable'. 130 type AdlInterfaceEnableDisable struct { 131 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 132 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"` 133 } 134 135 func (m *AdlInterfaceEnableDisable) Reset() { *m = AdlInterfaceEnableDisable{} } 136 func (*AdlInterfaceEnableDisable) GetMessageName() string { return "adl_interface_enable_disable" } 137 func (*AdlInterfaceEnableDisable) GetCrcString() string { return "5501adee" } 138 func (*AdlInterfaceEnableDisable) GetMessageType() api.MessageType { 139 return api.RequestMessage 140 } 141 142 func (m *AdlInterfaceEnableDisable) Size() (size int) { 143 if m == nil { 144 return 0 145 } 146 size += 4 // m.SwIfIndex 147 size += 1 // m.EnableDisable 148 return size 149 } 150 func (m *AdlInterfaceEnableDisable) Marshal(b []byte) ([]byte, error) { 151 if b == nil { 152 b = make([]byte, m.Size()) 153 } 154 buf := codec.NewBuffer(b) 155 buf.EncodeUint32(uint32(m.SwIfIndex)) 156 buf.EncodeBool(m.EnableDisable) 157 return buf.Bytes(), nil 158 } 159 func (m *AdlInterfaceEnableDisable) Unmarshal(b []byte) error { 160 buf := codec.NewBuffer(b) 161 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 162 m.EnableDisable = buf.DecodeBool() 163 return nil 164 } 165 166 // AdlInterfaceEnableDisableReply defines message 'adl_interface_enable_disable_reply'. 167 type AdlInterfaceEnableDisableReply struct { 168 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 169 } 170 171 func (m *AdlInterfaceEnableDisableReply) Reset() { *m = AdlInterfaceEnableDisableReply{} } 172 func (*AdlInterfaceEnableDisableReply) GetMessageName() string { 173 return "adl_interface_enable_disable_reply" 174 } 175 func (*AdlInterfaceEnableDisableReply) GetCrcString() string { return "e8d4e804" } 176 func (*AdlInterfaceEnableDisableReply) GetMessageType() api.MessageType { 177 return api.ReplyMessage 178 } 179 180 func (m *AdlInterfaceEnableDisableReply) Size() (size int) { 181 if m == nil { 182 return 0 183 } 184 size += 4 // m.Retval 185 return size 186 } 187 func (m *AdlInterfaceEnableDisableReply) Marshal(b []byte) ([]byte, error) { 188 if b == nil { 189 b = make([]byte, m.Size()) 190 } 191 buf := codec.NewBuffer(b) 192 buf.EncodeInt32(m.Retval) 193 return buf.Bytes(), nil 194 } 195 func (m *AdlInterfaceEnableDisableReply) Unmarshal(b []byte) error { 196 buf := codec.NewBuffer(b) 197 m.Retval = buf.DecodeInt32() 198 return nil 199 } 200 201 func init() { file_adl_binapi_init() } 202 func file_adl_binapi_init() { 203 api.RegisterMessage((*AdlAllowlistEnableDisable)(nil), "adl_allowlist_enable_disable_ea88828d") 204 api.RegisterMessage((*AdlAllowlistEnableDisableReply)(nil), "adl_allowlist_enable_disable_reply_e8d4e804") 205 api.RegisterMessage((*AdlInterfaceEnableDisable)(nil), "adl_interface_enable_disable_5501adee") 206 api.RegisterMessage((*AdlInterfaceEnableDisableReply)(nil), "adl_interface_enable_disable_reply_e8d4e804") 207 } 208 209 // Messages returns list of all messages in this module. 210 func AllMessages() []api.Message { 211 return []api.Message{ 212 (*AdlAllowlistEnableDisable)(nil), 213 (*AdlAllowlistEnableDisableReply)(nil), 214 (*AdlInterfaceEnableDisable)(nil), 215 (*AdlInterfaceEnableDisableReply)(nil), 216 } 217 }