diff options
Diffstat (limited to 'binapigen/vppapi')
-rw-r--r-- | binapigen/vppapi/api.go | 94 | ||||
-rw-r--r-- | binapigen/vppapi/integration_test.go | 43 | ||||
-rw-r--r-- | binapigen/vppapi/parse_json.go | 552 | ||||
-rw-r--r-- | binapigen/vppapi/parser.go | 111 | ||||
-rw-r--r-- | binapigen/vppapi/parser_test.go | 114 | ||||
-rw-r--r-- | binapigen/vppapi/testdata/acl.api.json | 929 | ||||
-rw-r--r-- | binapigen/vppapi/testdata/af_packet.api.json | 157 | ||||
-rw-r--r-- | binapigen/vppapi/testdata/input-generate-error.json | 3 | ||||
-rw-r--r-- | binapigen/vppapi/testdata/input-read-json-error.json | 1 | ||||
-rw-r--r-- | binapigen/vppapi/testdata/input.txt | 0 | ||||
-rw-r--r-- | binapigen/vppapi/testdata/ip.api.json | 2246 | ||||
-rw-r--r-- | binapigen/vppapi/testdata/test-all.api.json | 3240 | ||||
-rw-r--r-- | binapigen/vppapi/testdata/vpe.api.json | 775 |
13 files changed, 8265 insertions, 0 deletions
diff --git a/binapigen/vppapi/api.go b/binapigen/vppapi/api.go new file mode 100644 index 0000000..06d9046 --- /dev/null +++ b/binapigen/vppapi/api.go @@ -0,0 +1,94 @@ +// Copyright (c) 2020 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package vppapi + +type File struct { + Name string + Path string + + CRC string + Options map[string]string `json:",omitempty"` + + Imports []string `json:",omitempty"` + + AliasTypes []AliasType `json:",omitempty"` + EnumTypes []EnumType `json:",omitempty"` + StructTypes []StructType `json:",omitempty"` + UnionTypes []UnionType `json:",omitempty"` + Messages []Message `json:",omitempty"` + Service *Service `json:",omitempty"` +} + +func (x File) Version() string { + if x.Options != nil { + return x.Options[fileOptionVersion] + } + return "" +} + +type AliasType struct { + Name string + Type string + Length int `json:",omitempty"` +} + +type EnumType struct { + Name string + Type string + Entries []EnumEntry +} + +type EnumEntry struct { + Name string + Value uint32 +} + +type StructType struct { + Name string + Fields []Field +} + +type UnionType struct { + Name string + Fields []Field +} + +type Message struct { + Name string + Fields []Field + CRC string +} + +type Field struct { + Name string + Type string + Length int `json:",omitempty"` + Array bool `json:",omitempty"` + SizeFrom string `json:",omitempty"` + Meta map[string]interface{} `json:",omitempty"` +} + +type Service struct { + RPCs []RPC `json:",omitempty"` +} + +type RPC struct { + Name string + RequestMsg string + ReplyMsg string + Stream bool `json:",omitempty"` + StreamMsg string `json:",omitempty"` + Events []string `json:",omitempty"` +} diff --git a/binapigen/vppapi/integration_test.go b/binapigen/vppapi/integration_test.go new file mode 100644 index 0000000..142017a --- /dev/null +++ b/binapigen/vppapi/integration_test.go @@ -0,0 +1,43 @@ +// Copyright (c) 2020 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +build integration + +package vppapi_test + +import ( + "encoding/json" + "testing" + + "git.fd.io/govpp.git/binapigen/vppapi" +) + +func TestParse(t *testing.T) { + files, err := vppapi.Parse() + if err != nil { + t.Fatal(err) + } + + for _, file := range files { + //t.Logf(" - %s: %+v", path, module) + b, err := json.MarshalIndent(file, "\t", " ") + if err != nil { + t.Fatal(err) + } + t.Logf(" - %s:\n%s", file.Name, b) + } + + t.Logf("parsed %d files", len(files)) + +} diff --git a/binapigen/vppapi/parse_json.go b/binapigen/vppapi/parse_json.go new file mode 100644 index 0000000..45b5796 --- /dev/null +++ b/binapigen/vppapi/parse_json.go @@ -0,0 +1,552 @@ +// Copyright (c) 2020 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package vppapi + +import ( + "encoding/json" + "errors" + "fmt" + "os" + "strings" + + "github.com/bennyscetbun/jsongo" + "github.com/sirupsen/logrus" +) + +var Logger *logrus.Logger + +func init() { + if strings.Contains(os.Getenv("DEBUG_GOVPP"), "parser") { + Logger = logrus.StandardLogger() + } +} + +func logf(f string, v ...interface{}) { + if Logger != nil { + Logger.Debugf(f, v...) + } +} + +const ( + // file + objAPIVersion = "vl_api_version" + objTypes = "types" + objMessages = "messages" + objUnions = "unions" + objEnums = "enums" + objServices = "services" + objAliases = "aliases" + objOptions = "options" + objImports = "imports" + + // message + messageFieldCrc = "crc" + + // alias + aliasFieldLength = "length" + aliasFieldType = "type" + + // service + serviceFieldReply = "reply" + serviceFieldStream = "stream" + serviceFieldStreamMsg = "stream_msg" + serviceFieldEvents = "events" +) + +const ( + // file + fileOptionVersion = "version" + + // field + fieldOptionLimit = "limit" + fieldOptionDefault = "default" + + // service + serviceReplyNull = "null" +) + +func parseJSON(data []byte) (module *File, err error) { + defer func() { + if e := recover(); e != nil { + err = fmt.Errorf("recovered panic: %v", e) + } + }() + + // parse JSON data into objects + jsonRoot := new(jsongo.Node) + if err := json.Unmarshal(data, jsonRoot); err != nil { + return nil, fmt.Errorf("unmarshalling JSON failed: %v", err) + } + + logf("file contents:") + for _, key := range jsonRoot.GetKeys() { + if jsonRoot.At(key).Len() > 0 { + logf(" - %2d %s", jsonRoot.At(key).Len(), key) + } + } + + module = new(File) + + // parse CRC + if crc := jsonRoot.At(objAPIVersion); crc.GetType() == jsongo.TypeValue { + module.CRC = crc.Get().(string) + } + + // parse options + opt := jsonRoot.Map(objOptions) + if opt.GetType() == jsongo.TypeMap { + module.Options = make(map[string]string, 0) + for _, key := range opt.GetKeys() { + optionsNode := opt.At(key) + optionKey := key.(string) + optionValue := optionsNode.Get().(string) + module.Options[optionKey] = optionValue + } + } + + // parse imports + imports := jsonRoot.Map(objImports) + module.Imports = make([]string, 0) + imported := make(map[string]struct{}) + for i := 0; i < imports.Len(); i++ { + importNode := imports.At(i) + imp, err := parseImport(importNode) + if err != nil { + return nil, err + } + if _, ok := imported[*imp]; ok { + logf("duplicate import found: %v", *imp) + continue + } + imported[*imp] = struct{}{} + module.Imports = append(module.Imports, *imp) + } + + // avoid duplicate objects + known := make(map[string]struct{}) + exists := func(name string) bool { + if _, ok := known[name]; ok { + logf("duplicate object found: %v", name) + return true + } + known[name] = struct{}{} + return false + } + + // parse enum types + enumsNode := jsonRoot.Map(objEnums) + module.EnumTypes = make([]EnumType, 0) + for i := 0; i < enumsNode.Len(); i++ { + enumNode := enumsNode.At(i) + enum, err := parseEnum(enumNode) + if err != nil { + return nil, err + } + if exists(enum.Name) { + continue + } + module.EnumTypes = append(module.EnumTypes, *enum) + } + + // parse alias types + aliasesNode := jsonRoot.Map(objAliases) + if aliasesNode.GetType() == jsongo.TypeMap { + module.AliasTypes = make([]AliasType, 0) + for _, key := range aliasesNode.GetKeys() { + aliasNode := aliasesNode.At(key) + aliasName := key.(string) + alias, err := parseAlias(aliasName, aliasNode) + if err != nil { + return nil, err + } + if exists(alias.Name) { + continue + } + module.AliasTypes = append(module.AliasTypes, *alias) + } + } + + // parse struct types + typesNode := jsonRoot.Map(objTypes) + module.StructTypes = make([]StructType, 0) + for i := 0; i < typesNode.Len(); i++ { + typNode := typesNode.At(i) + structyp, err := parseStruct(typNode) + if err != nil { + return nil, err + } + if exists(structyp.Name) { + continue + } + module.StructTypes = append(module.StructTypes, *structyp) + } + + // parse union types + unionsNode := jsonRoot.Map(objUnions) + module.UnionTypes = make([]UnionType, 0) + for i := 0; i < unionsNode.Len(); i++ { + unionNode := unionsNode.At(i) + union, err := parseUnion(unionNode) + if err != nil { + return nil, err + } + if exists(union.Name) { + continue + } + module.UnionTypes = append(module.UnionTypes, *union) + } + + // parse messages + messagesNode := jsonRoot.Map(objMessages) + if messagesNode.GetType() == jsongo.TypeArray { + module.Messages = make([]Message, messagesNode.Len()) + for i := 0; i < messagesNode.Len(); i++ { + msgNode := messagesNode.At(i) + msg, err := parseMessage(msgNode) + if err != nil { + return nil, err + } + module.Messages[i] = *msg + } + } + + // parse services + servicesNode := jsonRoot.Map(objServices) + if servicesNode.GetType() == jsongo.TypeMap { + module.Service = &Service{ + RPCs: make([]RPC, servicesNode.Len()), + } + for i, key := range servicesNode.GetKeys() { + rpcNode := servicesNode.At(key) + rpcName := key.(string) + svc, err := parseServiceRPC(rpcName, rpcNode) + if err != nil { + return nil, err + } + module.Service.RPCs[i] = *svc + } + } + + return module, nil +} + +// parseImport parses VPP binary API import from JSON node +func parseImport(importNode *jsongo.Node) (*string, error) { + if importNode.GetType() != jsongo.TypeValue { + return nil, errors.New("invalid JSON for import specified") + } + + importName, ok := importNode.Get().(string) + if !ok { + return nil, fmt.Errorf("import name is %T, not a string", importNode.Get()) + } + + return &importName, nil +} + +// parseEnum parses VPP binary API enum object from JSON node +func parseEnum(enumNode *jsongo.Node) (*EnumType, error) { + if enumNode.Len() == 0 || enumNode.At(0).GetType() != jsongo.TypeValue { + return nil, errors.New("invalid JSON for enum specified") + } + + enumName, ok := enumNode.At(0).Get().(string) + if !ok { + return nil, fmt.Errorf("enum name is %T, not a string", enumNode.At(0).Get()) + } + enumType, ok := enumNode.At(enumNode.Len() - 1).At("enumtype").Get().(string) + if !ok { + return nil, fmt.Errorf("enum type invalid or missing") + } + + enum := EnumType{ + Name: enumName, + Type: enumType, + } + + // loop through enum entries, skip first (name) and last (enumtype) + for j := 1; j < enumNode.Len()-1; j++ { + if enumNode.At(j).GetType() == jsongo.TypeArray { + entry := enumNode.At(j) + + if entry.Len() < 2 || entry.At(0).GetType() != jsongo.TypeValue || entry.At(1).GetType() != jsongo.TypeValue { + return nil, errors.New("invalid JSON for enum entry specified") + } + + entryName, ok := entry.At(0).Get().(string) + if !ok { + return nil, fmt.Errorf("enum entry name is %T, not a string", entry.At(0).Get()) + } + entryVal := entry.At(1).Get().(float64) + + enum.Entries = append(enum.Entries, EnumEntry{ + Name: entryName, + Value: uint32(entryVal), + }) + } + } + + return &enum, nil +} + +// parseUnion parses VPP binary API union object from JSON node +func parseUnion(unionNode *jsongo.Node) (*UnionType, error) { + if unionNode.Len() == 0 || unionNode.At(0).GetType() != jsongo.TypeValue { + return nil, errors.New("invalid JSON for union specified") + } + + unionName, ok := unionNode.At(0).Get().(string) + if !ok { + return nil, fmt.Errorf("union name is %T, not a string", unionNode.At(0).Get()) + } + + union := UnionType{ + Name: unionName, + } + + // loop through union fields, skip first (name) + for j := 1; j < unionNode.Len(); j++ { + if unionNode.At(j).GetType() == jsongo.TypeArray { + fieldNode := unionNode.At(j) + + field, err := parseField(fieldNode) + if err != nil { + return nil, err + } + + union.Fields = append(union.Fields, *field) + } + } + + return &union, nil +} + +// parseStruct parses VPP binary API type object from JSON node +func parseStruct(typeNode *jsongo.Node) (*StructType, error) { + if typeNode.Len() == 0 || typeNode.At(0).GetType() != jsongo.TypeValue { + return nil, errors.New("invalid JSON for type specified") + } + + typeName, ok := typeNode.At(0).Get().(string) + if !ok { + return nil, fmt.Errorf("type name is %T, not a string", typeNode.At(0).Get()) + } + + typ := StructType{ + Name: typeName, + } + + // loop through type fields, skip first (name) + for j := 1; j < typeNode.Len(); j++ { + if typeNode.At(j).GetType() == jsongo.TypeArray { + fieldNode := typeNode.At(j) + + field, err := parseField(fieldNode) + if err != nil { + return nil, err + } + + typ.Fields = append(typ.Fields, *field) + } + } + + return &typ, nil +} + +// parseAlias parses VPP binary API alias object from JSON node +func parseAlias(aliasName string, aliasNode *jsongo.Node) (*AliasType, error) { + if aliasNode.Len() == 0 || aliasNode.At(aliasFieldType).GetType() != jsongo.TypeValue { + return nil, errors.New("invalid JSON for alias specified") + } + + alias := AliasType{ + Name: aliasName, + } + + if typeNode := aliasNode.At(aliasFieldType); typeNode.GetType() == jsongo.TypeValue { + typ, ok := typeNode.Get().(string) + if !ok { + return nil, fmt.Errorf("alias type is %T, not a string", typeNode.Get()) + } + if typ != "null" { + alias.Type = typ + } + } + + if lengthNode := aliasNode.At(aliasFieldLength); lengthNode.GetType() == jsongo.TypeValue { + length, ok := lengthNode.Get().(float64) + if !ok { + return nil, fmt.Errorf("alias length is %T, not a float64", lengthNode.Get()) + } + alias.Length = int(length) + } + + return &alias, nil +} + +// parseMessage parses VPP binary API message object from JSON node +func parseMessage(msgNode *jsongo.Node) (*Message, error) { + if msgNode.Len() == 0 || msgNode.At(0).GetType() != jsongo.TypeValue { + return nil, errors.New("invalid JSON for message specified") + } + + msgName, ok := msgNode.At(0).Get().(string) + if !ok { + return nil, fmt.Errorf("message name is %T, not a string", msgNode.At(0).Get()) + } + msgCRC, ok := msgNode.At(msgNode.Len() - 1).At(messageFieldCrc).Get().(string) + if !ok { + + return nil, fmt.Errorf("message crc invalid or missing") + } + + msg := Message{ + Name: msgName, + CRC: msgCRC, + } + + // loop through message fields, skip first (name) and last (crc) + for j := 1; j < msgNode.Len()-1; j++ { + if msgNode.At(j).GetType() == jsongo.TypeArray { + fieldNode := msgNode.At(j) + + field, err := parseField(fieldNode) + if err != nil { + return nil, err + } + + msg.Fields = append(msg.Fields, *field) + } + } + + return &msg, nil +} + +// parseField parses VPP binary API object field from JSON node +func parseField(field *jsongo.Node) (*Field, error) { + if field.Len() < 2 || field.At(0).GetType() != jsongo.TypeValue || field.At(1).GetType() != jsongo.TypeValue { + return nil, errors.New("invalid JSON for field specified") + } + + fieldType, ok := field.At(0).Get().(string) + if !ok { + return nil, fmt.Errorf("field type is %T, not a string", field.At(0).Get()) + } + fieldName, ok := field.At(1).Get().(string) + if !ok { + return nil, fmt.Errorf("field name is %T, not a string", field.At(1).Get()) + } + + f := &Field{ + Name: fieldName, + Type: fieldType, + } + + if field.Len() >= 3 { + switch field.At(2).GetType() { + case jsongo.TypeValue: + fieldLength, ok := field.At(2).Get().(float64) + if !ok { + return nil, fmt.Errorf("field length is %T, not float64", field.At(2).Get()) + } + f.Length = int(fieldLength) + f.Array = true + + case jsongo.TypeMap: + fieldMeta := field.At(2) + + for _, key := range fieldMeta.GetKeys() { + metaNode := fieldMeta.At(key) + metaName := key.(string) + metaValue := metaNode.Get() + + switch metaName { + case fieldOptionLimit: + metaValue = int(metaNode.Get().(float64)) + case fieldOptionDefault: + metaValue = metaNode.Get() + default: + logrus.Warnf("unknown meta info (%s=%v) for field (%s)", metaName, metaValue, fieldName) + } + + if f.Meta == nil { + f.Meta = map[string]interface{}{} + } + f.Meta[metaName] = metaValue + } + default: + return nil, errors.New("invalid JSON for field specified") + } + } + if field.Len() >= 4 { + fieldLengthFrom, ok := field.At(3).Get().(string) + if !ok { + return nil, fmt.Errorf("field length from is %T, not a string", field.At(3).Get()) + } + f.SizeFrom = fieldLengthFrom + } + + return f, nil +} + +// parseServiceRPC parses VPP binary API service object from JSON node +func parseServiceRPC(rpcName string, rpcNode *jsongo.Node) (*RPC, error) { + if rpcNode.Len() == 0 || rpcNode.At(serviceFieldReply).GetType() != jsongo.TypeValue { + return nil, errors.New("invalid JSON for service RPC specified") + } + + rpc := RPC{ + Name: rpcName, + RequestMsg: rpcName, + } + + if replyNode := rpcNode.At(serviceFieldReply); replyNode.GetType() == jsongo.TypeValue { + reply, ok := replyNode.Get().(string) + if !ok { + return nil, fmt.Errorf("service RPC reply is %T, not a string", replyNode.Get()) + } + if reply != serviceReplyNull { + rpc.ReplyMsg = reply + } + } + + // is stream (dump) + if streamNode := rpcNode.At(serviceFieldStream); streamNode.GetType() == jsongo.TypeValue { + var ok bool + rpc.Stream, ok = streamNode.Get().(bool) + if !ok { + return nil, fmt.Errorf("service RPC stream is %T, not a boolean", streamNode.Get()) + } + } + + // stream message + if streamMsgNode := rpcNode.At(serviceFieldStreamMsg); streamMsgNode.GetType() == jsongo.TypeValue { + var ok bool + rpc.StreamMsg, ok = streamMsgNode.Get().(string) + if !ok { + return nil, fmt.Errorf("service RPC stream msg is %T, not a string", streamMsgNode.Get()) + } + } + + // events service (event subscription) + if eventsNode := rpcNode.At(serviceFieldEvents); eventsNode.GetType() == jsongo.TypeArray { + for j := 0; j < eventsNode.Len(); j++ { + event := eventsNode.At(j).Get().(string) + rpc.Events = append(rpc.Events, event) + } + } + + return &rpc, nil +} diff --git a/binapigen/vppapi/parser.go b/binapigen/vppapi/parser.go new file mode 100644 index 0000000..312dd0e --- /dev/null +++ b/binapigen/vppapi/parser.go @@ -0,0 +1,111 @@ +// Copyright (c) 2020 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package vppapi + +import ( + "fmt" + "io/ioutil" + "path/filepath" + "strings" + + "github.com/sirupsen/logrus" +) + +const ( + DefaultAPIDir = "/usr/share/vpp/api" +) + +const apifileSuffixJson = ".api.json" + +// FindFiles returns all input files located in specified directory +func FindFiles(dir string, deep int) (paths []string, err error) { + entries, err := ioutil.ReadDir(dir) + if err != nil { + return nil, fmt.Errorf("reading directory %s failed: %v", dir, err) + } + for _, e := range entries { + if e.IsDir() && deep > 0 { + nestedDir := filepath.Join(dir, e.Name()) + if nested, err := FindFiles(nestedDir, deep-1); err != nil { + return nil, err + } else { + paths = append(paths, nested...) + } + } else if strings.HasSuffix(e.Name(), apifileSuffixJson) { + paths = append(paths, filepath.Join(dir, e.Name())) + } + } + return paths, nil +} + +func Parse() ([]*File, error) { + return ParseDir(DefaultAPIDir) +} + +func ParseDir(apidir string) ([]*File, error) { + files, err := FindFiles(apidir, 1) + if err != nil { + return nil, err + } + + logrus.Infof("found %d files in API dir %q", len(files), apidir) + + var modules []*File + + for _, file := range files { + module, err := ParseFile(file) + if err != nil { + return nil, err + } + modules = append(modules, module) + } + + return modules, nil +} + +// ParseFile parses API file contents and returns File. +func ParseFile(apifile string) (*File, error) { + if !strings.HasSuffix(apifile, apifileSuffixJson) { + return nil, fmt.Errorf("unsupported file format: %q", apifile) + } + + data, err := ioutil.ReadFile(apifile) + if err != nil { + return nil, fmt.Errorf("reading file %s failed: %v", apifile, err) + } + + base := filepath.Base(apifile) + name := base[:strings.Index(base, ".")] + + logf("parsing file %q", base) + + module, err := ParseRaw(data) + if err != nil { + return nil, fmt.Errorf("parsing file %s failed: %v", base, err) + } + module.Name = name + module.Path = apifile + + return module, nil +} + +func ParseRaw(data []byte) (file *File, err error) { + file, err = parseJSON(data) + if err != nil { + return nil, err + } + + return file, nil +} diff --git a/binapigen/vppapi/parser_test.go b/binapigen/vppapi/parser_test.go new file mode 100644 index 0000000..2dc82e4 --- /dev/null +++ b/binapigen/vppapi/parser_test.go @@ -0,0 +1,114 @@ +// Copyright (c) 2020 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package vppapi + +import ( + "encoding/json" + "io/ioutil" + "testing" + + . "github.com/onsi/gomega" +) + +func TestGetInputFiles(t *testing.T) { + RegisterTestingT(t) + + result, err := FindFiles("testdata", 1) + Expect(err).ShouldNot(HaveOccurred()) + Expect(result).To(HaveLen(5)) + for _, file := range result { + Expect(file).To(BeAnExistingFile()) + } +} + +func TestGetInputFilesError(t *testing.T) { + RegisterTestingT(t) + + result, err := FindFiles("nonexisting_directory", 1) + Expect(err).Should(HaveOccurred()) + Expect(result).To(BeNil()) +} + +func TestReadJson(t *testing.T) { + RegisterTestingT(t) + + inputData, err := ioutil.ReadFile("testdata/af_packet.api.json") + Expect(err).ShouldNot(HaveOccurred()) + result, err := parseJSON(inputData) + Expect(err).ShouldNot(HaveOccurred()) + Expect(result).ToNot(BeNil()) + Expect(result.EnumTypes).To(HaveLen(0)) + Expect(result.StructTypes).To(HaveLen(0)) + Expect(result.Messages).To(HaveLen(6)) + Expect(result.Service.RPCs).To(HaveLen(3)) +} + +func TestReadJsonError(t *testing.T) { + RegisterTestingT(t) + + inputData, err := ioutil.ReadFile("testdata/input-read-json-error.json") + Expect(err).ShouldNot(HaveOccurred()) + result, err := parseJSON(inputData) + Expect(err).Should(HaveOccurred()) + Expect(result).To(BeNil()) +} + +func TestParseFile(t *testing.T) { + module, err := ParseFile("testdata/vpe.api.json") + if err != nil { + t.Fatal("unexpected error:", err) + } + + b, err := json.MarshalIndent(module, "", " ") + if err != nil { + t.Fatal(err) + } + t.Logf("parsed module: %s", b) + + if module.Name != "vpe" { + t.Errorf("expected Name=%s, got %v", "vpe", module.Name) + } + if module.CRC != "0xbd2c94f4" { + t.Errorf("expected CRC=%s, got %v", "0xbd2c94f4", module.CRC) + } + if module.Version() != "1.6.1" { + t.Errorf("expected Version=%s, got %v", "1.6.1", module.Version()) + } + if len(module.Imports) == 0 { + t.Errorf("expected imports, got none") + } + if len(module.Options) == 0 { + t.Errorf("expected options, got none") + } + if len(module.AliasTypes) == 0 { + t.Errorf("expected aliases, got none") + } + if len(module.StructTypes) == 0 { + t.Errorf("expected types, got none") + } + if len(module.Service.RPCs) == 0 { + t.Errorf("expected service method, got none") + } + if len(module.Messages) == 0 { + t.Errorf("expected messages, got none") + } +} + +func TestParseFileUnsupported(t *testing.T) { + _, err := ParseFile("testdata/input.txt") + if err == nil { + t.Fatal("expected error") + } +} diff --git a/binapigen/vppapi/testdata/acl.api.json b/binapigen/vppapi/testdata/acl.api.json new file mode 100644 index 0000000..4c6653c --- /dev/null +++ b/binapigen/vppapi/testdata/acl.api.json @@ -0,0 +1,929 @@ +{ + "services": [ + { + "acl_interface_add_del": { + "reply": "acl_interface_add_del_reply" + } + }, + { + "acl_del": { + "reply": "acl_del_reply" + } + }, + { + "macip_acl_del": { + "reply": "macip_acl_del_reply" + } + }, + { + "acl_plugin_get_version": { + "reply": "acl_plugin_get_version_reply" + } + }, + { + "macip_acl_interface_add_del": { + "reply": "macip_acl_interface_add_del_reply" + } + }, + { + "acl_interface_set_acl_list": { + "reply": "acl_interface_set_acl_list_reply" + } + }, + { + "acl_dump": { + "reply": "acl_details", + "stream": true + } + }, + { + "acl_interface_list_dump": { + "reply": "acl_interface_list_details", + "stream": true + } + }, + { + "macip_acl_interface_list_dump": { + "reply": "macip_acl_interface_list_details", + "stream": true + } + }, + { + "acl_add_replace": { + "reply": "acl_add_replace_reply" + } + }, + { + "acl_plugin_control_ping": { + "reply": "acl_plugin_control_ping_reply" + } + }, + { + "macip_acl_interface_get": { + "reply": "macip_acl_interface_get_reply" + } + }, + { + "macip_acl_add": { + "reply": "macip_acl_add_reply" + } + }, + { + "macip_acl_add_replace": { + "reply": "macip_acl_add_replace_reply" + } + }, + { + "macip_acl_dump": { + "reply": "macip_acl_details", + "stream": true + } + } + ], + "vl_api_version": "0x1db2ece9", + "enums": [], + "messages": [ + [ + "acl_plugin_get_version", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "acl_plugin_get_version_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + { + "crc": "0x9b32cf86" + } + ], + [ + "acl_plugin_control_ping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "acl_plugin_control_ping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "vpe_pid" + ], + { + "crc": "0xf6b0b8ca" + } + ], + [ + "acl_add_replace", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0xe839997e" + } + ], + [ + "acl_add_replace_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xac407b0c" + } + ], + [ + "acl_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0xef34fea4" + } + ], + [ + "acl_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "acl_interface_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_input" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0x0b2aedd1" + } + ], + [ + "acl_interface_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "acl_interface_set_acl_list", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "count" + ], + [ + "u8", + "n_input" + ], + [ + "u32", + "acls", + 0, + "count" + ], + { + "crc": "0x8baece38" + } + ], + [ + "acl_interface_set_acl_list_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "acl_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0xef34fea4" + } + ], + [ + "acl_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0x5bd895be" + } + ], + [ + "acl_interface_list_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x529cb13f" + } + ], + [ + "acl_interface_list_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "count" + ], + [ + "u8", + "n_input" + ], + [ + "u32", + "acls", + 0, + "count" + ], + { + "crc": "0xd5e80809" + } + ], + [ + "macip_acl_add", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_macip_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0xb3d3d65a" + } + ], + [ + "macip_acl_add_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xac407b0c" + } + ], + [ + "macip_acl_add_replace", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_macip_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0xa0e8c01b" + } + ], + [ + "macip_acl_add_replace_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xac407b0c" + } + ], + [ + "macip_acl_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0xef34fea4" + } + ], + [ + "macip_acl_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "macip_acl_interface_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0x6a6be97c" + } + ], + [ + "macip_acl_interface_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "macip_acl_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + { + "crc": "0xef34fea4" + } + ], + [ + "macip_acl_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "acl_index" + ], + [ + "u8", + "tag", + 64 + ], + [ + "u32", + "count" + ], + [ + "vl_api_macip_acl_rule_t", + "r", + 0, + "count" + ], + { + "crc": "0xdd2b55ba" + } + ], + [ + "macip_acl_interface_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "macip_acl_interface_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "count" + ], + [ + "u32", + "acls", + 0, + "count" + ], + { + "crc": "0xaccf9b05" + } + ], + [ + "macip_acl_interface_list_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0x529cb13f" + } + ], + [ + "macip_acl_interface_list_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "count" + ], + [ + "u32", + "acls", + 0, + "count" + ], + { + "crc": "0x29783fa0" + } + ] + ], + "types": [ + [ + "acl_rule", + [ + "u8", + "is_permit" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "src_ip_addr", + 16 + ], + [ + "u8", + "src_ip_prefix_len" + ], + [ + "u8", + "dst_ip_addr", + 16 + ], + [ + "u8", + "dst_ip_prefix_len" + ], + [ + "u8", + "proto" + ], + [ + "u16", + "srcport_or_icmptype_first" + ], + [ + "u16", + "srcport_or_icmptype_last" + ], + [ + "u16", + "dstport_or_icmpcode_first" + ], + [ + "u16", + "dstport_or_icmpcode_last" + ], + [ + "u8", + "tcp_flags_mask" + ], + [ + "u8", + "tcp_flags_value" + ], + { + "crc": "0x6f99bf4d" + } + ], + [ + "macip_acl_rule", + [ + "u8", + "is_permit" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "src_mac", + 6 + ], + [ + "u8", + "src_mac_mask", + 6 + ], + [ + "u8", + "src_ip_addr", + 16 + ], + [ + "u8", + "src_ip_prefix_len" + ], + { + "crc": "0x70589f1e" + } + ] + ] +} diff --git a/binapigen/vppapi/testdata/af_packet.api.json b/binapigen/vppapi/testdata/af_packet.api.json new file mode 100644 index 0000000..dc0de16 --- /dev/null +++ b/binapigen/vppapi/testdata/af_packet.api.json @@ -0,0 +1,157 @@ +{ + "services": { + "af_packet_delete": { + "reply": "af_packet_delete_reply" + }, + "af_packet_create": { + "reply": "af_packet_create_reply" + }, + "af_packet_set_l4_cksum_offload": { + "reply": "af_packet_set_l4_cksum_offload_reply" + } + }, + "vl_api_version": "0x8957ca8b", + "enums": [], + "messages": [ + [ + "af_packet_create", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "host_if_name", + 64 + ], + [ + "u8", + "hw_addr", + 6 + ], + [ + "u8", + "use_random_hw_addr" + ], + { + "crc": "0x6d5d30d6" + } + ], + [ + "af_packet_create_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "sw_if_index" + ], + { + "crc": "0xfda5941f" + } + ], + [ + "af_packet_delete", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "host_if_name", + 64 + ], + { + "crc": "0x3efceda3" + } + ], + [ + "af_packet_delete_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "af_packet_set_l4_cksum_offload", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "sw_if_index" + ], + [ + "u8", + "set" + ], + { + "crc": "0x86538585" + } + ], + [ + "af_packet_set_l4_cksum_offload_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "types": [] +} diff --git a/binapigen/vppapi/testdata/input-generate-error.json b/binapigen/vppapi/testdata/input-generate-error.json new file mode 100644 index 0000000..d5df76e --- /dev/null +++ b/binapigen/vppapi/testdata/input-generate-error.json @@ -0,0 +1,3 @@ +{ + "key": "value" +}
\ No newline at end of file diff --git a/binapigen/vppapi/testdata/input-read-json-error.json b/binapigen/vppapi/testdata/input-read-json-error.json new file mode 100644 index 0000000..02691e3 --- /dev/null +++ b/binapigen/vppapi/testdata/input-read-json-error.json @@ -0,0 +1 @@ +%
\ No newline at end of file diff --git a/binapigen/vppapi/testdata/input.txt b/binapigen/vppapi/testdata/input.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/binapigen/vppapi/testdata/input.txt diff --git a/binapigen/vppapi/testdata/ip.api.json b/binapigen/vppapi/testdata/ip.api.json new file mode 100644 index 0000000..530b6d6 --- /dev/null +++ b/binapigen/vppapi/testdata/ip.api.json @@ -0,0 +1,2246 @@ +{ + "services": [ + { + "ip_source_and_port_range_check_add_del": { + "reply": "ip_source_and_port_range_check_add_del_reply" + } + }, + { + "ip6_fib_dump": { + "reply": "ip6_fib_details", + "stream": true + } + }, + { + "want_ip6_nd_events": { + "reply": "want_ip6_nd_events_reply" + } + }, + { + "ip_punt_police": { + "reply": "ip_punt_police_reply" + } + }, + { + "set_arp_neighbor_limit": { + "reply": "set_arp_neighbor_limit_reply" + } + }, + { + "ip6nd_proxy_add_del": { + "reply": "ip6nd_proxy_add_del_reply" + } + }, + { + "ioam_disable": { + "reply": "ioam_disable_reply" + } + }, + { + "ip_table_add_del": { + "reply": "ip_table_add_del_reply" + } + }, + { + "ip_neighbor_dump": { + "reply": "ip_neighbor_details", + "stream": true + } + }, + { + "ip4_arp_event": { + "reply": null + } + }, + { + "ip_punt_redirect": { + "reply": "ip_punt_redirect_reply" + } + }, + { + "sw_interface_ip6nd_ra_prefix": { + "reply": "sw_interface_ip6nd_ra_prefix_reply" + } + }, + { + "reset_fib": { + "reply": "reset_fib_reply" + } + }, + { + "ip6_mfib_dump": { + "reply": "ip6_mfib_details", + "stream": true + } + }, + { + "sw_interface_ip6nd_ra_config": { + "reply": "sw_interface_ip6nd_ra_config_reply" + } + }, + { + "sw_interface_ip6_enable_disable": { + "reply": "sw_interface_ip6_enable_disable_reply" + } + }, + { + "sw_interface_ip6_set_link_local_address": { + "reply": "sw_interface_ip6_set_link_local_address_reply" + } + }, + { + "mfib_signal_dump": { + "reply": "mfib_signal_details", + "stream": true + } + }, + { + "ip_container_proxy_add_del": { + "reply": "ip_container_proxy_add_del_reply" + } + }, + { + "ip_mfib_dump": { + "reply": "ip_mfib_details", + "stream": true + } + }, + { + "ip_address_dump": { + "reply": "ip_address_details", + "stream": true + } + }, + { + "ip_dump": { + "reply": "ip_details", + "stream": true + } + }, + { + "ip_neighbor_add_del": { + "reply": "ip_neighbor_add_del_reply" + } + }, + { + "proxy_arp_intfc_enable_disable": { + "reply": "proxy_arp_intfc_enable_disable_reply" + } + }, + { + "proxy_arp_add_del": { + "reply": "proxy_arp_add_del_reply" + } + }, + { + "ip_add_del_route": { + "reply": "ip_add_del_route_reply" + } + }, + { + "ip6nd_proxy_dump": { + "reply": "ip6nd_proxy_details", + "stream": true + } + }, + { + "ip_fib_dump": { + "reply": "ip_fib_details", + "stream": true + } + }, + { + "want_ip4_arp_events": { + "reply": "want_ip4_arp_events_reply" + } + }, + { + "ioam_enable": { + "reply": "ioam_enable_reply" + } + }, + { + "ip6_nd_event": { + "reply": null + } + }, + { + "ip_mroute_add_del": { + "reply": "ip_mroute_add_del_reply" + } + }, + { + "ip_source_and_port_range_check_interface_add_del": { + "reply": "ip_source_and_port_range_check_interface_add_del_reply" + } + }, + { + "set_ip_flow_hash": { + "reply": "set_ip_flow_hash_reply" + } + } + ], + "vl_api_version": "0xb395c625", + "enums": [], + "messages": [ + [ + "ip_table_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "name", + 64 + ], + { + "crc": "0x0240c89d" + } + ], + [ + "ip_table_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_fib_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip_fib_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + [ + "u8", + "table_name", + 64 + ], + [ + "u8", + "address_length" + ], + [ + "u8", + "address", + 4 + ], + [ + "u32", + "count" + ], + [ + "vl_api_fib_path_t", + "path", + 0, + "count" + ], + { + "crc": "0x99dfd73b" + } + ], + [ + "ip6_fib_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip6_fib_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + [ + "u8", + "table_name", + 64 + ], + [ + "u8", + "address_length" + ], + [ + "u8", + "address", + 16 + ], + [ + "u32", + "count" + ], + [ + "vl_api_fib_path_t", + "path", + 0, + "count" + ], + { + "crc": "0xabd0060e" + } + ], + [ + "ip_neighbor_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_ipv6" + ], + { + "crc": "0x6b7bcd0a" + } + ], + [ + "ip_neighbor_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_static" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "mac_address", + 6 + ], + [ + "u8", + "ip_address", + 16 + ], + { + "crc": "0x85e32a72" + } + ], + [ + "ip_neighbor_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "is_static" + ], + [ + "u8", + "is_no_adj_fib" + ], + [ + "u8", + "mac_address", + 6 + ], + [ + "u8", + "dst_address", + 16 + ], + { + "crc": "0x4711eb25" + } + ], + [ + "ip_neighbor_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "set_ip_flow_hash", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vrf_id" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "src" + ], + [ + "u8", + "dst" + ], + [ + "u8", + "sport" + ], + [ + "u8", + "dport" + ], + [ + "u8", + "proto" + ], + [ + "u8", + "reverse" + ], + { + "crc": "0x32ebf737" + } + ], + [ + "set_ip_flow_hash_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_ip6nd_ra_config", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "suppress" + ], + [ + "u8", + "managed" + ], + [ + "u8", + "other" + ], + [ + "u8", + "ll_option" + ], + [ + "u8", + "send_unicast" + ], + [ + "u8", + "cease" + ], + [ + "u8", + "is_no" + ], + [ + "u8", + "default_router" + ], + [ + "u32", + "max_interval" + ], + [ + "u32", + "min_interval" + ], + [ + "u32", + "lifetime" + ], + [ + "u32", + "initial_count" + ], + [ + "u32", + "initial_interval" + ], + { + "crc": "0xc3f02daa" + } + ], + [ + "sw_interface_ip6nd_ra_config_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_ip6nd_ra_prefix", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "address", + 16 + ], + [ + "u8", + "address_length" + ], + [ + "u8", + "use_default" + ], + [ + "u8", + "no_advertise" + ], + [ + "u8", + "off_link" + ], + [ + "u8", + "no_autoconfig" + ], + [ + "u8", + "no_onlink" + ], + [ + "u8", + "is_no" + ], + [ + "u32", + "val_lifetime" + ], + [ + "u32", + "pref_lifetime" + ], + { + "crc": "0xca763c9a" + } + ], + [ + "sw_interface_ip6nd_ra_prefix_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip6nd_proxy_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_del" + ], + [ + "u8", + "address", + 16 + ], + { + "crc": "0xd95f0fa0" + } + ], + [ + "ip6nd_proxy_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip6nd_proxy_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "address", + 16 + ], + { + "crc": "0xd73bf1ab" + } + ], + [ + "ip6nd_proxy_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "sw_interface_ip6_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "enable" + ], + { + "crc": "0xa36fadc0" + } + ], + [ + "sw_interface_ip6_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_ip6_set_link_local_address", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "address", + 16 + ], + { + "crc": "0xd73bf1ab" + } + ], + [ + "sw_interface_ip6_set_link_local_address_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_add_del_route", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "next_hop_sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "classify_table_index" + ], + [ + "u32", + "next_hop_table_id" + ], + [ + "u32", + "next_hop_id" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_drop" + ], + [ + "u8", + "is_unreach" + ], + [ + "u8", + "is_prohibit" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "is_local" + ], + [ + "u8", + "is_classify" + ], + [ + "u8", + "is_multipath" + ], + [ + "u8", + "is_resolve_host" + ], + [ + "u8", + "is_resolve_attached" + ], + [ + "u8", + "is_dvr" + ], + [ + "u8", + "is_source_lookup" + ], + [ + "u8", + "is_udp_encap" + ], + [ + "u8", + "next_hop_weight" + ], + [ + "u8", + "next_hop_preference" + ], + [ + "u8", + "next_hop_proto" + ], + [ + "u8", + "dst_address_length" + ], + [ + "u8", + "dst_address", + 16 + ], + [ + "u8", + "next_hop_address", + 16 + ], + [ + "u8", + "next_hop_n_out_labels" + ], + [ + "u32", + "next_hop_via_label" + ], + [ + "u32", + "next_hop_out_label_stack", + 0, + "next_hop_n_out_labels" + ], + { + "crc": "0xc85f8290" + } + ], + [ + "ip_add_del_route_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_mroute_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "next_hop_sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "entry_flags" + ], + [ + "u32", + "itf_flags" + ], + [ + "u32", + "rpf_id" + ], + [ + "u32", + "bier_imp" + ], + [ + "u16", + "grp_address_length" + ], + [ + "u8", + "next_hop_afi" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "is_local" + ], + [ + "u8", + "grp_address", + 16 + ], + [ + "u8", + "src_address", + 16 + ], + { + "crc": "0xc37112f7" + } + ], + [ + "ip_mroute_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_mfib_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip_mfib_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "entry_flags" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "address_length" + ], + [ + "u8", + "grp_address", + 4 + ], + [ + "u8", + "src_address", + 4 + ], + [ + "u32", + "count" + ], + [ + "vl_api_fib_path_t", + "path", + 0, + "count" + ], + { + "crc": "0x5e530d5e" + } + ], + [ + "ip6_mfib_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip6_mfib_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + [ + "u8", + "address_length" + ], + [ + "u8", + "grp_address", + 16 + ], + [ + "u8", + "src_address", + 16 + ], + [ + "u32", + "count" + ], + [ + "vl_api_fib_path_t", + "path", + 0, + "count" + ], + { + "crc": "0xe02dcb4b" + } + ], + [ + "ip_address_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "ip", + 16 + ], + [ + "u8", + "prefix_length" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_ipv6" + ], + { + "crc": "0xbc7442f2" + } + ], + [ + "ip_address_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_ipv6" + ], + { + "crc": "0x6b7bcd0a" + } + ], + [ + "ip_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + { + "crc": "0x452ffc5a" + } + ], + [ + "ip_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + { + "crc": "0xde883da4" + } + ], + [ + "mfib_signal_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "mfib_signal_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u16", + "grp_address_len" + ], + [ + "u8", + "grp_address", + 16 + ], + [ + "u8", + "src_address", + 16 + ], + [ + "u16", + "ip_packet_len" + ], + [ + "u8", + "ip_packet_data", + 256 + ], + { + "crc": "0x791bbeab" + } + ], + [ + "ip_punt_police", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "policer_index" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_ip6" + ], + { + "crc": "0x38691592" + } + ], + [ + "ip_punt_police_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_punt_redirect", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "rx_sw_if_index" + ], + [ + "u32", + "tx_sw_if_index" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "is_ip6" + ], + [ + "u8", + "nh", + 16 + ], + { + "crc": "0x996b6603" + } + ], + [ + "ip_punt_redirect_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_container_proxy_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "ip", + 16 + ], + [ + "u8", + "is_ip4" + ], + [ + "u8", + "plen" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "is_add" + ], + { + "crc": "0x0a355d39" + } + ], + [ + "ip_container_proxy_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_source_and_port_range_check_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "mask_length" + ], + [ + "u8", + "address", + 16 + ], + [ + "u8", + "number_of_ranges" + ], + [ + "u16", + "low_ports", + 32 + ], + [ + "u16", + "high_ports", + 32 + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0x03d6b03a" + } + ], + [ + "ip_source_and_port_range_check_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_source_and_port_range_check_interface_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_add" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "tcp_in_vrf_id" + ], + [ + "u32", + "tcp_out_vrf_id" + ], + [ + "u32", + "udp_in_vrf_id" + ], + [ + "u32", + "udp_out_vrf_id" + ], + { + "crc": "0x6966bc44" + } + ], + [ + "ip_source_and_port_range_check_interface_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "want_ip4_arp_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "enable_disable" + ], + [ + "u32", + "pid" + ], + [ + "u32", + "address" + ], + { + "crc": "0x77e06379" + } + ], + [ + "want_ip4_arp_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip4_arp_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "address" + ], + [ + "u32", + "pid" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "new_mac", + 6 + ], + [ + "u8", + "mac_ip" + ], + { + "crc": "0xef7235f7" + } + ], + [ + "want_ip6_nd_events", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "enable_disable" + ], + [ + "u32", + "pid" + ], + [ + "u8", + "address", + 16 + ], + { + "crc": "0x1cf65fbb" + } + ], + [ + "want_ip6_nd_events_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip6_nd_event", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "pid" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "address", + 16 + ], + [ + "u8", + "new_mac", + 6 + ], + [ + "u8", + "mac_ip" + ], + { + "crc": "0x96ab2fdd" + } + ], + [ + "proxy_arp_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vrf_id" + ], + [ + "u8", + "is_add" + ], + [ + "u8", + "low_address", + 4 + ], + [ + "u8", + "hi_address", + 4 + ], + { + "crc": "0xc2442918" + } + ], + [ + "proxy_arp_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "proxy_arp_intfc_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "sw_if_index" + ], + [ + "u8", + "enable_disable" + ], + { + "crc": "0x69d24598" + } + ], + [ + "proxy_arp_intfc_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "reset_fib", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vrf_id" + ], + [ + "u8", + "is_ipv6" + ], + { + "crc": "0x8553ebd9" + } + ], + [ + "reset_fib_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "set_arp_neighbor_limit", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u8", + "is_ipv6" + ], + [ + "u32", + "arp_neighbor_limit" + ], + { + "crc": "0x97d01fd6" + } + ], + [ + "set_arp_neighbor_limit_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ioam_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "id" + ], + [ + "u8", + "seqno" + ], + [ + "u8", + "analyse" + ], + [ + "u8", + "pot_enable" + ], + [ + "u8", + "trace_enable" + ], + [ + "u32", + "node_id" + ], + { + "crc": "0x9392e032" + } + ], + [ + "ioam_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ioam_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "id" + ], + { + "crc": "0x6b16a45e" + } + ], + [ + "ioam_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "types": [ + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "u8", + "is_local" + ], + [ + "u8", + "is_drop" + ], + [ + "u8", + "is_unreach" + ], + [ + "u8", + "is_prohibit" + ], + [ + "u8", + "afi" + ], + [ + "u8", + "next_hop", + 16 + ], + { + "crc": "0xcd899e0a" + } + ] + ] +} diff --git a/binapigen/vppapi/testdata/test-all.api.json b/binapigen/vppapi/testdata/test-all.api.json new file mode 100644 index 0000000..4e858b8 --- /dev/null +++ b/binapigen/vppapi/testdata/test-all.api.json @@ -0,0 +1,3240 @@ +[ + { + "types": [ + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ], + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "fib_mpls_label", + [ + "u8", + "is_uniform" + ], + [ + "u32", + "label" + ], + [ + "u8", + "ttl" + ], + [ + "u8", + "exp" + ] + ], + [ + "fib_path_nh", + [ + "vl_api_address_union_t", + "address" + ], + [ + "u32", + "via_label" + ], + [ + "u32", + "obj_id" + ], + [ + "u32", + "classify_table_index" + ] + ], + [ + "fib_path", + [ + "u32", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "u32", + "rpf_id" + ], + [ + "u8", + "weight" + ], + [ + "u8", + "preference" + ], + [ + "vl_api_fib_path_type_t", + "type" + ], + [ + "vl_api_fib_path_flags_t", + "flags" + ], + [ + "vl_api_fib_path_nh_proto_t", + "proto" + ], + [ + "vl_api_fib_path_nh_t", + "nh" + ], + [ + "u8", + "n_labels" + ], + [ + "vl_api_fib_mpls_label_t", + "label_stack", + 16 + ] + ], + [ + "address", + [ + "vl_api_address_family_t", + "af" + ], + [ + "vl_api_address_union_t", + "un" + ] + ], + [ + "prefix", + [ + "vl_api_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "mprefix", + [ + "vl_api_address_family_t", + "af" + ], + [ + "u16", + "grp_address_length" + ], + [ + "vl_api_address_union_t", + "grp_address" + ], + [ + "vl_api_address_union_t", + "src_address" + ] + ], + [ + "ip6_prefix", + [ + "vl_api_ip6_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "ip4_prefix", + [ + "vl_api_ip4_address_t", + "address" + ], + [ + "u8", + "len" + ] + ], + [ + "prefix_matcher", + [ + "u8", + "le" + ], + [ + "u8", + "ge" + ] + ], + [ + "mfib_path", + [ + "vl_api_mfib_itf_flags_t", + "itf_flags" + ], + [ + "vl_api_fib_path_t", + "path" + ] + ], + [ + "ip_table", + [ + "u32", + "table_id" + ], + [ + "bool", + "is_ip6" + ], + [ + "string", + "name", + 64 + ] + ], + [ + "ip_route", + [ + "u32", + "table_id" + ], + [ + "u32", + "stats_index" + ], + [ + "vl_api_prefix_t", + "prefix" + ], + [ + "u8", + "n_paths" + ], + [ + "vl_api_fib_path_t", + "paths", + 0, + "n_paths" + ] + ], + [ + "ip_mroute", + [ + "u32", + "table_id" + ], + [ + "u32", + "entry_flags" + ], + [ + "u32", + "rpf_id" + ], + [ + "vl_api_mprefix_t", + "prefix" + ], + [ + "u8", + "n_paths" + ], + [ + "vl_api_mfib_path_t", + "paths", + 0, + "n_paths" + ] + ], + [ + "punt_redirect", + [ + "vl_api_interface_index_t", + "rx_sw_if_index" + ], + [ + "vl_api_interface_index_t", + "tx_sw_if_index" + ], + [ + "vl_api_address_t", + "nh" + ] + ] + ], + "messages": [ + [ + "ip_table_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0x0ffdaec0" + } + ], + [ + "ip_table_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_table_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip_table_replace_begin", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_table_replace_begin_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_table_replace_end", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_table_replace_end_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_table_flush", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_table_flush_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_table_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xc79fca0f" + } + ], + [ + "ip_route_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "bool", + "is_multipath" + ], + [ + "vl_api_ip_route_t", + "route" + ], + { + "crc": "0xc1ff832d" + } + ], + [ + "ip_route_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stats_index" + ], + { + "crc": "0x1992deab" + } + ], + [ + "ip_route_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_route_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_route_t", + "route" + ], + { + "crc": "0xd1ffaae1" + } + ], + [ + "ip_route_lookup", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "table_id" + ], + [ + "u8", + "exact" + ], + [ + "vl_api_prefix_t", + "prefix" + ], + { + "crc": "0xe2986185" + } + ], + [ + "ip_route_lookup_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_ip_route_t", + "route" + ], + { + "crc": "0xae99de8e" + } + ], + [ + "set_ip_flow_hash", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "vrf_id" + ], + [ + "bool", + "is_ipv6" + ], + [ + "bool", + "src" + ], + [ + "bool", + "dst" + ], + [ + "bool", + "sport" + ], + [ + "bool", + "dport" + ], + [ + "bool", + "proto" + ], + [ + "bool", + "reverse" + ], + [ + "bool", + "symmetric" + ], + { + "crc": "0x084ee09e" + } + ], + [ + "set_ip_flow_hash_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_ip6_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable" + ], + { + "crc": "0xae6cfcfb" + } + ], + [ + "sw_interface_ip6_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_mtable_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip_mtable_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_mroute_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "bool", + "is_multipath" + ], + [ + "vl_api_ip_mroute_t", + "route" + ], + { + "crc": "0xf6627d17" + } + ], + [ + "ip_mroute_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "stats_index" + ], + { + "crc": "0x1992deab" + } + ], + [ + "ip_mroute_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_table_t", + "table" + ], + { + "crc": "0xb9d2e09e" + } + ], + [ + "ip_mroute_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_ip_mroute_t", + "route" + ], + { + "crc": "0xc1cb4b44" + } + ], + [ + "ip_address_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_address_with_prefix_t", + "prefix" + ], + { + "crc": "0xb1199745" + } + ], + [ + "ip_address_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + { + "crc": "0x2d033de4" + } + ], + [ + "ip_unnumbered_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_interface_index_t", + "ip_sw_if_index" + ], + { + "crc": "0xaa12a483" + } + ], + [ + "ip_unnumbered_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index", + { + "default": 4294967295 + } + ], + { + "crc": "0xf9e6675e" + } + ], + [ + "ip_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + { + "crc": "0xeb152d07" + } + ], + [ + "ip_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_ipv6" + ], + { + "crc": "0x98d231ca" + } + ], + [ + "mfib_signal_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "mfib_signal_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "table_id" + ], + [ + "vl_api_mprefix_t", + "prefix" + ], + [ + "u16", + "ip_packet_len" + ], + [ + "u8", + "ip_packet_data", + 256 + ], + { + "crc": "0x64398a9a" + } + ], + [ + "ip_punt_police", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "policer_index" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "bool", + "is_ip6" + ], + { + "crc": "0xdb867cea" + } + ], + [ + "ip_punt_police_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_punt_redirect", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_punt_redirect_t", + "punt" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + { + "crc": "0xa9a5592c" + } + ], + [ + "ip_punt_redirect_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_punt_redirect_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_ipv6" + ], + { + "crc": "0x2d033de4" + } + ], + [ + "ip_punt_redirect_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_punt_redirect_t", + "punt" + ], + { + "crc": "0x3924f5d3" + } + ], + [ + "ip_container_proxy_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_prefix_t", + "pfx" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + { + "crc": "0x91189f40" + } + ], + [ + "ip_container_proxy_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_container_proxy_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "ip_container_proxy_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_prefix_t", + "prefix" + ], + { + "crc": "0x0ee460e8" + } + ], + [ + "ip_source_and_port_range_check_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "vl_api_prefix_t", + "prefix" + ], + [ + "u8", + "number_of_ranges" + ], + [ + "u16", + "low_ports", + 32 + ], + [ + "u16", + "high_ports", + 32 + ], + [ + "u32", + "vrf_id" + ], + { + "crc": "0x8bfc76f2" + } + ], + [ + "ip_source_and_port_range_check_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_source_and_port_range_check_interface_add_del", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_add", + { + "default": "true" + } + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "u32", + "tcp_in_vrf_id" + ], + [ + "u32", + "tcp_out_vrf_id" + ], + [ + "u32", + "udp_in_vrf_id" + ], + [ + "u32", + "udp_out_vrf_id" + ], + { + "crc": "0xe1ba8987" + } + ], + [ + "ip_source_and_port_range_check_interface_add_del_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "sw_interface_ip6_set_link_local_address", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "vl_api_ip6_address_t", + "ip" + ], + { + "crc": "0x2931d9fa" + } + ], + [ + "sw_interface_ip6_set_link_local_address_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ioam_enable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "id" + ], + [ + "bool", + "seqno" + ], + [ + "bool", + "analyse" + ], + [ + "bool", + "pot_enable" + ], + [ + "bool", + "trace_enable" + ], + [ + "u32", + "node_id" + ], + { + "crc": "0x51ccd868" + } + ], + [ + "ioam_enable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ioam_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u16", + "id" + ], + { + "crc": "0x6b16a45e" + } + ], + [ + "ioam_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_reassembly_set", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u32", + "timeout_ms" + ], + [ + "u32", + "max_reassemblies" + ], + [ + "u32", + "max_reassembly_length" + ], + [ + "u32", + "expire_walk_interval_ms" + ], + [ + "bool", + "is_ip6" + ], + [ + "vl_api_ip_reass_type_t", + "type" + ], + { + "crc": "0x16467d25" + } + ], + [ + "ip_reassembly_set_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ], + [ + "ip_reassembly_get", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "bool", + "is_ip6" + ], + [ + "vl_api_ip_reass_type_t", + "type" + ], + { + "crc": "0xea13ff63" + } + ], + [ + "ip_reassembly_get_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "timeout_ms" + ], + [ + "u32", + "max_reassemblies" + ], + [ + "u32", + "max_reassembly_length" + ], + [ + "u32", + "expire_walk_interval_ms" + ], + [ + "bool", + "is_ip6" + ], + { + "crc": "0xd5eb8d34" + } + ], + [ + "ip_reassembly_enable_disable", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_interface_index_t", + "sw_if_index" + ], + [ + "bool", + "enable_ip4" + ], + [ + "bool", + "enable_ip6" + ], + [ + "vl_api_ip_reass_type_t", + "type" + ], + { + "crc": "0x885c85a6" + } + ], + [ + "ip_reassembly_enable_disable_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + { + "crc": "0xe8d4e804" + } + ] + ], + "unions": [ + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ], + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ], + [ + "address_union", + [ + "vl_api_ip4_address_t", + "ip4" + ], + [ + "vl_api_ip6_address_t", + "ip6" + ] + ] + ], + "enums": [ + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 0 + ], + [ + "MTU_PROTO_API_IP4", + 1 + ], + [ + "MTU_PROTO_API_IP6", + 2 + ], + [ + "MTU_PROTO_API_MPLS", + 3 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 0 + ], + [ + "IF_API_TYPE_SUB", + 1 + ], + [ + "IF_API_TYPE_P2P", + 2 + ], + [ + "IF_API_TYPE_PIPE", + 3 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_ESP", + 50 + ], + [ + "IP_API_PROTO_AH", + 51 + ], + [ + "IP_API_PROTO_ICMP6", + 58 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u8" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_ESP", + 50 + ], + [ + "IP_API_PROTO_AH", + 51 + ], + [ + "IP_API_PROTO_ICMP6", + 58 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u8" + } + ], + [ + "fib_path_nh_proto", + [ + "FIB_API_PATH_NH_PROTO_IP4", + 0 + ], + [ + "FIB_API_PATH_NH_PROTO_IP6", + 1 + ], + [ + "FIB_API_PATH_NH_PROTO_MPLS", + 2 + ], + [ + "FIB_API_PATH_NH_PROTO_ETHERNET", + 3 + ], + [ + "FIB_API_PATH_NH_PROTO_BIER", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_flags", + [ + "FIB_API_PATH_FLAG_NONE", + 0 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED", + 1 + ], + [ + "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST", + 2 + ], + [ + "FIB_API_PATH_FLAG_POP_PW_CW", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "fib_path_type", + [ + "FIB_API_PATH_TYPE_NORMAL", + 0 + ], + [ + "FIB_API_PATH_TYPE_LOCAL", + 1 + ], + [ + "FIB_API_PATH_TYPE_DROP", + 2 + ], + [ + "FIB_API_PATH_TYPE_UDP_ENCAP", + 3 + ], + [ + "FIB_API_PATH_TYPE_BIER_IMP", + 4 + ], + [ + "FIB_API_PATH_TYPE_ICMP_UNREACH", + 5 + ], + [ + "FIB_API_PATH_TYPE_ICMP_PROHIBIT", + 6 + ], + [ + "FIB_API_PATH_TYPE_SOURCE_LOOKUP", + 7 + ], + [ + "FIB_API_PATH_TYPE_DVR", + 8 + ], + [ + "FIB_API_PATH_TYPE_INTERFACE_RX", + 9 + ], + [ + "FIB_API_PATH_TYPE_CLASSIFY", + 10 + ], + { + "enumtype": "u32" + } + ], + [ + "address_family", + [ + "ADDRESS_IP4", + 0 + ], + [ + "ADDRESS_IP6", + 1 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_ecn", + [ + "IP_API_ECN_NONE", + 0 + ], + [ + "IP_API_ECN_ECT0", + 1 + ], + [ + "IP_API_ECN_ECT1", + 2 + ], + [ + "IP_API_ECN_CE", + 3 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_dscp", + [ + "IP_API_DSCP_CS0", + 0 + ], + [ + "IP_API_DSCP_CS1", + 8 + ], + [ + "IP_API_DSCP_AF11", + 10 + ], + [ + "IP_API_DSCP_AF12", + 12 + ], + [ + "IP_API_DSCP_AF13", + 14 + ], + [ + "IP_API_DSCP_CS2", + 16 + ], + [ + "IP_API_DSCP_AF21", + 18 + ], + [ + "IP_API_DSCP_AF22", + 20 + ], + [ + "IP_API_DSCP_AF23", + 22 + ], + [ + "IP_API_DSCP_CS3", + 24 + ], + [ + "IP_API_DSCP_AF31", + 26 + ], + [ + "IP_API_DSCP_AF32", + 28 + ], + [ + "IP_API_DSCP_AF33", + 30 + ], + [ + "IP_API_DSCP_CS4", + 32 + ], + [ + "IP_API_DSCP_AF41", + 34 + ], + [ + "IP_API_DSCP_AF42", + 36 + ], + [ + "IP_API_DSCP_AF43", + 38 + ], + [ + "IP_API_DSCP_CS5", + 40 + ], + [ + "IP_API_DSCP_EF", + 46 + ], + [ + "IP_API_DSCP_CS6", + 48 + ], + [ + "IP_API_DSCP_CS7", + 50 + ], + { + "enumtype": "u8" + } + ], + [ + "ip_proto", + [ + "IP_API_PROTO_HOPOPT", + 0 + ], + [ + "IP_API_PROTO_ICMP", + 1 + ], + [ + "IP_API_PROTO_IGMP", + 2 + ], + [ + "IP_API_PROTO_TCP", + 6 + ], + [ + "IP_API_PROTO_UDP", + 17 + ], + [ + "IP_API_PROTO_GRE", + 47 + ], + [ + "IP_API_PROTO_ESP", + 50 + ], + [ + "IP_API_PROTO_AH", + 51 + ], + [ + "IP_API_PROTO_ICMP6", + 58 + ], + [ + "IP_API_PROTO_EIGRP", + 88 + ], + [ + "IP_API_PROTO_OSPF", + 89 + ], + [ + "IP_API_PROTO_SCTP", + 132 + ], + [ + "IP_API_PROTO_RESERVED", + 255 + ], + { + "enumtype": "u8" + } + ], + [ + "mfib_itf_flags", + [ + "MFIB_API_ITF_FLAG_NONE", + 0 + ], + [ + "MFIB_API_ITF_FLAG_NEGATE_SIGNAL", + 1 + ], + [ + "MFIB_API_ITF_FLAG_ACCEPT", + 2 + ], + [ + "MFIB_API_ITF_FLAG_FORWARD", + 4 + ], + [ + "MFIB_API_ITF_FLAG_SIGNAL_PRESENT", + 8 + ], + [ + "MFIB_API_ITF_FLAG_DONT_PRESERVE", + 16 + ], + { + "enumtype": "u32" + } + ], + [ + "if_status_flags", + [ + "IF_STATUS_API_FLAG_ADMIN_UP", + 1 + ], + [ + "IF_STATUS_API_FLAG_LINK_UP", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "mtu_proto", + [ + "MTU_PROTO_API_L3", + 0 + ], + [ + "MTU_PROTO_API_IP4", + 1 + ], + [ + "MTU_PROTO_API_IP6", + 2 + ], + [ + "MTU_PROTO_API_MPLS", + 3 + ], + { + "enumtype": "u32" + } + ], + [ + "link_duplex", + [ + "LINK_DUPLEX_API_UNKNOWN", + 0 + ], + [ + "LINK_DUPLEX_API_HALF", + 1 + ], + [ + "LINK_DUPLEX_API_FULL", + 2 + ], + { + "enumtype": "u32" + } + ], + [ + "sub_if_flags", + [ + "SUB_IF_API_FLAG_NO_TAGS", + 1 + ], + [ + "SUB_IF_API_FLAG_ONE_TAG", + 2 + ], + [ + "SUB_IF_API_FLAG_TWO_TAGS", + 4 + ], + [ + "SUB_IF_API_FLAG_DOT1AD", + 8 + ], + [ + "SUB_IF_API_FLAG_EXACT_MATCH", + 16 + ], + [ + "SUB_IF_API_FLAG_DEFAULT", + 32 + ], + [ + "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", + 64 + ], + [ + "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", + 128 + ], + [ + "SUB_IF_API_FLAG_MASK_VNET", + 254 + ], + [ + "SUB_IF_API_FLAG_DOT1AH", + 256 + ], + { + "enumtype": "u32" + } + ], + [ + "rx_mode", + [ + "RX_MODE_API_UNKNOWN", + 0 + ], + [ + "RX_MODE_API_POLLING", + 1 + ], + [ + "RX_MODE_API_INTERRUPT", + 2 + ], + [ + "RX_MODE_API_ADAPTIVE", + 3 + ], + [ + "RX_MODE_API_DEFAULT", + 4 + ], + { + "enumtype": "u32" + } + ], + [ + "if_type", + [ + "IF_API_TYPE_HARDWARE", + 0 + ], + [ + "IF_API_TYPE_SUB", + 1 + ], + [ + "IF_API_TYPE_P2P", + 2 + ], + [ + "IF_API_TYPE_PIPE", + 3 + ], + { + "enumtype": "u32" + } + ], + [ + "ip_reass_type", + [ + "IP_REASS_TYPE_FULL", + 0 + ], + [ + "IP_REASS_TYPE_SHALLOW_VIRTUAL", + 1 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "ip_table_add_del": { + "reply": "ip_table_add_del_reply" + }, + "ip_table_dump": { + "reply": "ip_table_details", + "stream": true + }, + "ip_table_replace_begin": { + "reply": "ip_table_replace_begin_reply" + }, + "ip_table_replace_end": { + "reply": "ip_table_replace_end_reply" + }, + "ip_table_flush": { + "reply": "ip_table_flush_reply" + }, + "ip_route_add_del": { + "reply": "ip_route_add_del_reply" + }, + "ip_route_dump": { + "reply": "ip_route_details", + "stream": true + }, + "ip_route_lookup": { + "reply": "ip_route_lookup_reply" + }, + "set_ip_flow_hash": { + "reply": "set_ip_flow_hash_reply" + }, + "sw_interface_ip6_enable_disable": { + "reply": "sw_interface_ip6_enable_disable_reply" + }, + "ip_mtable_dump": { + "reply": "ip_mtable_details", + "stream": true + }, + "ip_mroute_add_del": { + "reply": "ip_mroute_add_del_reply" + }, + "ip_mroute_dump": { + "reply": "ip_mroute_details", + "stream": true + }, + "ip_address_dump": { + "reply": "ip_address_details", + "stream": true + }, + "ip_unnumbered_dump": { + "reply": "ip_unnumbered_details", + "stream": true + }, + "ip_dump": { + "reply": "ip_details", + "stream": true + }, + "mfib_signal_dump": { + "reply": "mfib_signal_details", + "stream": true + }, + "ip_punt_police": { + "reply": "ip_punt_police_reply" + }, + "ip_punt_redirect": { + "reply": "ip_punt_redirect_reply" + }, + "ip_punt_redirect_dump": { + "reply": "ip_punt_redirect_details", + "stream": true + }, + "ip_container_proxy_add_del": { + "reply": "ip_container_proxy_add_del_reply" + }, + "ip_container_proxy_dump": { + "reply": "ip_container_proxy_details", + "stream": true + }, + "ip_source_and_port_range_check_add_del": { + "reply": "ip_source_and_port_range_check_add_del_reply" + }, + "ip_source_and_port_range_check_interface_add_del": { + "reply": "ip_source_and_port_range_check_interface_add_del_reply" + }, + "sw_interface_ip6_set_link_local_address": { + "reply": "sw_interface_ip6_set_link_local_address_reply" + }, + "ioam_enable": { + "reply": "ioam_enable_reply" + }, + "ioam_disable": { + "reply": "ioam_disable_reply" + }, + "ip_reassembly_set": { + "reply": "ip_reassembly_set_reply" + }, + "ip_reassembly_get": { + "reply": "ip_reassembly_get_reply" + }, + "ip_reassembly_enable_disable": { + "reply": "ip_reassembly_enable_disable_reply" + } + }, + "options": { + "version": "3.0.1" + }, + "aliases": { + "interface_index": { + "type": "u32" + }, + "ip4_address": { + "type": "u8", + "length": 4 + }, + "ip6_address": { + "type": "u8", + "length": 16 + }, + "address_with_prefix": { + "type": "vl_api_prefix_t" + }, + "ip4_address_with_prefix": { + "type": "vl_api_ip4_prefix_t" + }, + "ip6_address_with_prefix": { + "type": "vl_api_ip6_prefix_t" + }, + "mac_address": { + "type": "u8", + "length": 6 + } + }, + "vl_api_version": "0x765d74b1", + "imports": [ + "vnet/interface_types.api", + "vnet/fib/fib_types.api", + "vnet/ip/ip_types.api", + "vnet/ethernet/ethernet_types.api", + "vnet/mfib/mfib_types.api", + "vnet/fib/fib_types.api", + "vnet/ip/ip_types.api", + "vnet/ip/ip_types.api", + "vnet/interface_types.api" + ] + } +] diff --git a/binapigen/vppapi/testdata/vpe.api.json b/binapigen/vppapi/testdata/vpe.api.json new file mode 100644 index 0000000..960ba12 --- /dev/null +++ b/binapigen/vppapi/testdata/vpe.api.json @@ -0,0 +1,775 @@ +{ + "types": [ + [ + "version", + [ + "u32", + "major" + ], + [ + "u32", + "minor" + ], + [ + "u32", + "patch" + ], + [ + "u8", + "pre_release", + 17 + ], + [ + "u8", + "build_metadata", + 17 + ] + ], + [ + "thread_data", + [ + "u32", + "id" + ], + [ + "string", + "name", + 64 + ], + [ + "string", + "type", + 64 + ], + [ + "u32", + "pid" + ], + [ + "u32", + "cpu_id" + ], + [ + "u32", + "core" + ], + [ + "u32", + "cpu_socket" + ] + ] + ], + "messages": [ + [ + "control_ping", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "control_ping_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "vpe_pid" + ], + { + "crc": "0xf6b0b8ca" + } + ], + [ + "cli", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "u64", + "cmd_in_shmem" + ], + { + "crc": "0x23bfbfff" + } + ], + [ + "cli_inband", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "cmd", + 0 + ], + { + "crc": "0xf8377302" + } + ], + [ + "cli_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u64", + "reply_in_shmem" + ], + { + "crc": "0x06d68297" + } + ], + [ + "cli_inband_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "string", + "reply", + 0 + ], + { + "crc": "0x05879051" + } + ], + [ + "get_node_index", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "node_name", + 64 + ], + { + "crc": "0xf1984c64" + } + ], + [ + "get_node_index_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "node_index" + ], + { + "crc": "0xa8600b89" + } + ], + [ + "add_node_next", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "node_name", + 64 + ], + [ + "string", + "next_name", + 64 + ], + { + "crc": "0x2457116d" + } + ], + [ + "add_node_next_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "next_index" + ], + { + "crc": "0x2ed75f32" + } + ], + [ + "show_version", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_version_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "string", + "program", + 32 + ], + [ + "string", + "version", + 32 + ], + [ + "string", + "build_date", + 32 + ], + [ + "string", + "build_directory", + 256 + ], + { + "crc": "0xc919bde1" + } + ], + [ + "show_threads", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_threads_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "count" + ], + [ + "vl_api_thread_data_t", + "thread_data", + 0, + "count" + ], + { + "crc": "0xefd78e83" + } + ], + [ + "get_node_graph", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "get_node_graph_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u64", + "reply_in_shmem" + ], + { + "crc": "0x06d68297" + } + ], + [ + "get_next_index", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "string", + "node_name", + 64 + ], + [ + "string", + "next_name", + 64 + ], + { + "crc": "0x2457116d" + } + ], + [ + "get_next_index_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "u32", + "next_index" + ], + { + "crc": "0x2ed75f32" + } + ], + [ + "log_dump", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "vl_api_timestamp_t", + "start_timestamp" + ], + { + "crc": "0x6ab31753" + } + ], + [ + "log_details", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "vl_api_timestamp_t", + "timestamp" + ], + [ + "vl_api_log_level_t", + "level" + ], + [ + "string", + "msg_class", + 32 + ], + [ + "string", + "message", + 256 + ], + { + "crc": "0x255827a1" + } + ], + [ + "show_vpe_system_time", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + { + "crc": "0x51077d14" + } + ], + [ + "show_vpe_system_time_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "i32", + "retval" + ], + [ + "vl_api_timestamp_t", + "vpe_system_time" + ], + { + "crc": "0x7ffd8193" + } + ], + [ + "get_f64_endian_value", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "f64", + "f64_one", + { + "default": 1.0 + } + ], + { + "crc": "0x809fcd44" + } + ], + [ + "get_f64_endian_value_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "retval" + ], + [ + "f64", + "f64_one_result" + ], + { + "crc": "0x7e02e404" + } + ], + [ + "get_f64_increment_by_one", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "client_index" + ], + [ + "u32", + "context" + ], + [ + "f64", + "f64_value", + { + "default": 1.0 + } + ], + { + "crc": "0xb64f027e" + } + ], + [ + "get_f64_increment_by_one_reply", + [ + "u16", + "_vl_msg_id" + ], + [ + "u32", + "context" + ], + [ + "u32", + "retval" + ], + [ + "f64", + "f64_value" + ], + { + "crc": "0xd25dbaa3" + } + ] + ], + "unions": [], + "enums": [ + [ + "log_level", + [ + "VPE_API_LOG_LEVEL_EMERG", + 0 + ], + [ + "VPE_API_LOG_LEVEL_ALERT", + 1 + ], + [ + "VPE_API_LOG_LEVEL_CRIT", + 2 + ], + [ + "VPE_API_LOG_LEVEL_ERR", + 3 + ], + [ + "VPE_API_LOG_LEVEL_WARNING", + 4 + ], + [ + "VPE_API_LOG_LEVEL_NOTICE", + 5 + ], + [ + "VPE_API_LOG_LEVEL_INFO", + 6 + ], + [ + "VPE_API_LOG_LEVEL_DEBUG", + 7 + ], + [ + "VPE_API_LOG_LEVEL_DISABLED", + 8 + ], + { + "enumtype": "u32" + } + ] + ], + "services": { + "control_ping": { + "reply": "control_ping_reply" + }, + "cli": { + "reply": "cli_reply" + }, + "cli_inband": { + "reply": "cli_inband_reply" + }, + "get_node_index": { + "reply": "get_node_index_reply" + }, + "add_node_next": { + "reply": "add_node_next_reply" + }, + "show_version": { + "reply": "show_version_reply" + }, + "show_threads": { + "reply": "show_threads_reply" + }, + "get_node_graph": { + "reply": "get_node_graph_reply" + }, + "get_next_index": { + "reply": "get_next_index_reply" + }, + "log_dump": { + "reply": "log_details", + "stream": true + }, + "show_vpe_system_time": { + "reply": "show_vpe_system_time_reply" + }, + "get_f64_endian_value": { + "reply": "get_f64_endian_value_reply" + }, + "get_f64_increment_by_one": { + "reply": "get_f64_increment_by_one_reply" + } + }, + "options": { + "version": "1.6.1" + }, + "aliases": { + "timestamp": { + "type": "f64" + }, + "timedelta": { + "type": "f64" + } + }, + "vl_api_version": "0xbd2c94f4", + "imports": [ + "vpp/api/vpe_types.api" + ] +} |