github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/sr_pt/sr_pt.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.4.0-dev 4 // VPP: 23.02-rc0~189-g57127b32a 5 // source: /usr/share/vpp/api/core/sr_pt.api.json 6 7 // Package sr_pt contains generated bindings for API file sr_pt.api. 8 // 9 // Contents: 10 // 6 messages 11 // 12 package sr_pt 13 14 import ( 15 api "git.fd.io/govpp.git/api" 16 codec "git.fd.io/govpp.git/codec" 17 interface_types "github.com/edwarnicke/govpp/binapi/interface_types" 18 ) 19 20 // This is a compile-time assertion to ensure that this generated file 21 // is compatible with the GoVPP api package it is being compiled against. 22 // A compilation error at this line likely means your copy of the 23 // GoVPP api package needs to be updated. 24 const _ = api.GoVppAPIPackageIsVersion2 25 26 const ( 27 APIFile = "sr_pt" 28 APIVersion = "1.0.0" 29 VersionCrc = 0x1fddedad 30 ) 31 32 // SrPtIfaceAdd defines message 'sr_pt_iface_add'. 33 type SrPtIfaceAdd struct { 34 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 35 ID uint16 `binapi:"u16,name=id" json:"id,omitempty"` 36 IngressLoad uint8 `binapi:"u8,name=ingress_load" json:"ingress_load,omitempty"` 37 EgressLoad uint8 `binapi:"u8,name=egress_load" json:"egress_load,omitempty"` 38 TtsTemplate uint8 `binapi:"u8,name=tts_template" json:"tts_template,omitempty"` 39 } 40 41 func (m *SrPtIfaceAdd) Reset() { *m = SrPtIfaceAdd{} } 42 func (*SrPtIfaceAdd) GetMessageName() string { return "sr_pt_iface_add" } 43 func (*SrPtIfaceAdd) GetCrcString() string { return "852c0cda" } 44 func (*SrPtIfaceAdd) GetMessageType() api.MessageType { 45 return api.RequestMessage 46 } 47 48 func (m *SrPtIfaceAdd) Size() (size int) { 49 if m == nil { 50 return 0 51 } 52 size += 4 // m.SwIfIndex 53 size += 2 // m.ID 54 size += 1 // m.IngressLoad 55 size += 1 // m.EgressLoad 56 size += 1 // m.TtsTemplate 57 return size 58 } 59 func (m *SrPtIfaceAdd) Marshal(b []byte) ([]byte, error) { 60 if b == nil { 61 b = make([]byte, m.Size()) 62 } 63 buf := codec.NewBuffer(b) 64 buf.EncodeUint32(uint32(m.SwIfIndex)) 65 buf.EncodeUint16(m.ID) 66 buf.EncodeUint8(m.IngressLoad) 67 buf.EncodeUint8(m.EgressLoad) 68 buf.EncodeUint8(m.TtsTemplate) 69 return buf.Bytes(), nil 70 } 71 func (m *SrPtIfaceAdd) Unmarshal(b []byte) error { 72 buf := codec.NewBuffer(b) 73 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 74 m.ID = buf.DecodeUint16() 75 m.IngressLoad = buf.DecodeUint8() 76 m.EgressLoad = buf.DecodeUint8() 77 m.TtsTemplate = buf.DecodeUint8() 78 return nil 79 } 80 81 // SrPtIfaceAddReply defines message 'sr_pt_iface_add_reply'. 82 type SrPtIfaceAddReply struct { 83 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 84 } 85 86 func (m *SrPtIfaceAddReply) Reset() { *m = SrPtIfaceAddReply{} } 87 func (*SrPtIfaceAddReply) GetMessageName() string { return "sr_pt_iface_add_reply" } 88 func (*SrPtIfaceAddReply) GetCrcString() string { return "e8d4e804" } 89 func (*SrPtIfaceAddReply) GetMessageType() api.MessageType { 90 return api.ReplyMessage 91 } 92 93 func (m *SrPtIfaceAddReply) Size() (size int) { 94 if m == nil { 95 return 0 96 } 97 size += 4 // m.Retval 98 return size 99 } 100 func (m *SrPtIfaceAddReply) Marshal(b []byte) ([]byte, error) { 101 if b == nil { 102 b = make([]byte, m.Size()) 103 } 104 buf := codec.NewBuffer(b) 105 buf.EncodeInt32(m.Retval) 106 return buf.Bytes(), nil 107 } 108 func (m *SrPtIfaceAddReply) Unmarshal(b []byte) error { 109 buf := codec.NewBuffer(b) 110 m.Retval = buf.DecodeInt32() 111 return nil 112 } 113 114 // SrPtIfaceDel defines message 'sr_pt_iface_del'. 115 type SrPtIfaceDel struct { 116 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 117 } 118 119 func (m *SrPtIfaceDel) Reset() { *m = SrPtIfaceDel{} } 120 func (*SrPtIfaceDel) GetMessageName() string { return "sr_pt_iface_del" } 121 func (*SrPtIfaceDel) GetCrcString() string { return "f9e6675e" } 122 func (*SrPtIfaceDel) GetMessageType() api.MessageType { 123 return api.RequestMessage 124 } 125 126 func (m *SrPtIfaceDel) Size() (size int) { 127 if m == nil { 128 return 0 129 } 130 size += 4 // m.SwIfIndex 131 return size 132 } 133 func (m *SrPtIfaceDel) Marshal(b []byte) ([]byte, error) { 134 if b == nil { 135 b = make([]byte, m.Size()) 136 } 137 buf := codec.NewBuffer(b) 138 buf.EncodeUint32(uint32(m.SwIfIndex)) 139 return buf.Bytes(), nil 140 } 141 func (m *SrPtIfaceDel) Unmarshal(b []byte) error { 142 buf := codec.NewBuffer(b) 143 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 144 return nil 145 } 146 147 // SrPtIfaceDelReply defines message 'sr_pt_iface_del_reply'. 148 type SrPtIfaceDelReply struct { 149 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 150 } 151 152 func (m *SrPtIfaceDelReply) Reset() { *m = SrPtIfaceDelReply{} } 153 func (*SrPtIfaceDelReply) GetMessageName() string { return "sr_pt_iface_del_reply" } 154 func (*SrPtIfaceDelReply) GetCrcString() string { return "e8d4e804" } 155 func (*SrPtIfaceDelReply) GetMessageType() api.MessageType { 156 return api.ReplyMessage 157 } 158 159 func (m *SrPtIfaceDelReply) Size() (size int) { 160 if m == nil { 161 return 0 162 } 163 size += 4 // m.Retval 164 return size 165 } 166 func (m *SrPtIfaceDelReply) Marshal(b []byte) ([]byte, error) { 167 if b == nil { 168 b = make([]byte, m.Size()) 169 } 170 buf := codec.NewBuffer(b) 171 buf.EncodeInt32(m.Retval) 172 return buf.Bytes(), nil 173 } 174 func (m *SrPtIfaceDelReply) Unmarshal(b []byte) error { 175 buf := codec.NewBuffer(b) 176 m.Retval = buf.DecodeInt32() 177 return nil 178 } 179 180 // SrPtIfaceDetails defines message 'sr_pt_iface_details'. 181 type SrPtIfaceDetails struct { 182 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 183 ID uint16 `binapi:"u16,name=id" json:"id,omitempty"` 184 IngressLoad uint8 `binapi:"u8,name=ingress_load" json:"ingress_load,omitempty"` 185 EgressLoad uint8 `binapi:"u8,name=egress_load" json:"egress_load,omitempty"` 186 TtsTemplate uint8 `binapi:"u8,name=tts_template" json:"tts_template,omitempty"` 187 } 188 189 func (m *SrPtIfaceDetails) Reset() { *m = SrPtIfaceDetails{} } 190 func (*SrPtIfaceDetails) GetMessageName() string { return "sr_pt_iface_details" } 191 func (*SrPtIfaceDetails) GetCrcString() string { return "1f472f85" } 192 func (*SrPtIfaceDetails) GetMessageType() api.MessageType { 193 return api.ReplyMessage 194 } 195 196 func (m *SrPtIfaceDetails) Size() (size int) { 197 if m == nil { 198 return 0 199 } 200 size += 4 // m.SwIfIndex 201 size += 2 // m.ID 202 size += 1 // m.IngressLoad 203 size += 1 // m.EgressLoad 204 size += 1 // m.TtsTemplate 205 return size 206 } 207 func (m *SrPtIfaceDetails) Marshal(b []byte) ([]byte, error) { 208 if b == nil { 209 b = make([]byte, m.Size()) 210 } 211 buf := codec.NewBuffer(b) 212 buf.EncodeUint32(uint32(m.SwIfIndex)) 213 buf.EncodeUint16(m.ID) 214 buf.EncodeUint8(m.IngressLoad) 215 buf.EncodeUint8(m.EgressLoad) 216 buf.EncodeUint8(m.TtsTemplate) 217 return buf.Bytes(), nil 218 } 219 func (m *SrPtIfaceDetails) Unmarshal(b []byte) error { 220 buf := codec.NewBuffer(b) 221 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 222 m.ID = buf.DecodeUint16() 223 m.IngressLoad = buf.DecodeUint8() 224 m.EgressLoad = buf.DecodeUint8() 225 m.TtsTemplate = buf.DecodeUint8() 226 return nil 227 } 228 229 // SrPtIfaceDump defines message 'sr_pt_iface_dump'. 230 type SrPtIfaceDump struct{} 231 232 func (m *SrPtIfaceDump) Reset() { *m = SrPtIfaceDump{} } 233 func (*SrPtIfaceDump) GetMessageName() string { return "sr_pt_iface_dump" } 234 func (*SrPtIfaceDump) GetCrcString() string { return "51077d14" } 235 func (*SrPtIfaceDump) GetMessageType() api.MessageType { 236 return api.RequestMessage 237 } 238 239 func (m *SrPtIfaceDump) Size() (size int) { 240 if m == nil { 241 return 0 242 } 243 return size 244 } 245 func (m *SrPtIfaceDump) Marshal(b []byte) ([]byte, error) { 246 if b == nil { 247 b = make([]byte, m.Size()) 248 } 249 buf := codec.NewBuffer(b) 250 return buf.Bytes(), nil 251 } 252 func (m *SrPtIfaceDump) Unmarshal(b []byte) error { 253 return nil 254 } 255 256 func init() { file_sr_pt_binapi_init() } 257 func file_sr_pt_binapi_init() { 258 api.RegisterMessage((*SrPtIfaceAdd)(nil), "sr_pt_iface_add_852c0cda") 259 api.RegisterMessage((*SrPtIfaceAddReply)(nil), "sr_pt_iface_add_reply_e8d4e804") 260 api.RegisterMessage((*SrPtIfaceDel)(nil), "sr_pt_iface_del_f9e6675e") 261 api.RegisterMessage((*SrPtIfaceDelReply)(nil), "sr_pt_iface_del_reply_e8d4e804") 262 api.RegisterMessage((*SrPtIfaceDetails)(nil), "sr_pt_iface_details_1f472f85") 263 api.RegisterMessage((*SrPtIfaceDump)(nil), "sr_pt_iface_dump_51077d14") 264 } 265 266 // Messages returns list of all messages in this module. 267 func AllMessages() []api.Message { 268 return []api.Message{ 269 (*SrPtIfaceAdd)(nil), 270 (*SrPtIfaceAddReply)(nil), 271 (*SrPtIfaceDel)(nil), 272 (*SrPtIfaceDelReply)(nil), 273 (*SrPtIfaceDetails)(nil), 274 (*SrPtIfaceDump)(nil), 275 } 276 }