diff --git a/.gitignore b/.gitignore index 75045b9..35de756 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ **/.DS_Store -sla.go packetcaptures/ \ No newline at end of file diff --git a/README.md b/README.md index 169b60d..dfe485b 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,39 @@ The end goal is to enable use-cases where multiple interactions with devices are ![oc-config-validate](https://github.com/nleiva/xrgrpc/blob/gh-pages/oc-config-validateH.gif) +## Table of Contents + +- [gRPC library for Cisco IOS XR](#grpc-library-for-cisco-ios-xr) + * [Usage](#usage) + + [Get Config](#get-config) + + [Show Commands](#show-commands) + - [**Clear text**](#--clear-text--) + - [**JSON**](#--json--) + + [Configuring the router](#configuring-the-router) + - [**CLI config** (Merge)](#--cli-config----merge-) + - [**JSON** (Merge)](#--json----merge-) + - [**JSON** (Replace)](#--json----replace-) + - [**Using a YANG config Template** (Merge)](#--using-a-yang-config-template----merge-) + + [Removing router config](#removing-router-config) + - [**JSON**](#--json---1) + + [**CLI config multiple routers simultaneously** (Merge)](#--cli-config-multiple-routers-simultaneously----merge-) + + [Telemetry](#telemetry) + - [**JSON (GPBKV)**](#--json--gpbkv---) + - [**JSON (GPBKV): Exploring the fields**](#--json--gpbkv---exploring-the-fields--) + - [**JSON (GPBKV): OpenConfig**](#--json--gpbkv---openconfig--) + - [**GPB (Protobuf)**](#--gpb--protobuf---) + + [Config and Validate](#config-and-validate) + + [Service Layer API](#service-layer-api) + - [Add an IPv6 route](#add-an-ipv6-route) + - [SLA IOS XR config](#sla-ios-xr-config) + + [Bypass the config file](#bypass-the-config-file) + * [XR gRPC Config](#xr-grpc-config) + + [Port range](#port-range) + * [Certificate file](#certificate-file) + * [Compiling the proto files](#compiling-the-proto-files) + * [Compiling the Examples](#compiling-the-examples) + + ## Usage CLI examples to use the library are provided in the [example](example/) folder. The CLI specified in the examples is not definitive and might change as we go. @@ -54,9 +87,9 @@ Config from [2001:420:2cff:1204::5502:1]:57344 Provides the output of IOS XR cli commands for one router defined in [config.json](example/input/config.json). Two output format options are available; Unstructured text and JSON encoded: -- **Clear text** +#### **Clear text** -```bash +```console example/showcmd$ ./showcmd -cli "show isis database" -enc text Output from [2001:420:2cff:1204::5502:1]:57344 @@ -75,7 +108,7 @@ mrstn-5501-1.cisco.com.00-00 0x0000000c 0x65d5 1150 0/0/0 2017/07/21 15:37:00 This process took 2.480039252s ``` -- **JSON** +#### **JSON** ```shell example/showcmd$ ./showcmd -cli "show isis database" -enc json @@ -107,11 +140,11 @@ Config from [2001:420:2cff:1204::5502:1]:57344 ### Configuring the router -- **CLI config** (Merge) +#### **CLI config** (Merge) Applies CLI config commands on the device/router from the list in [config.json](example/input/config.json). -```bash +```console example/setconfig$ ./setconfig -cli "interface Lo11 ipv6 address 2001:db8::/128" Config applied to [2001:420:2cff:1204::5502:1]:57344 @@ -129,11 +162,11 @@ interface Loopback11 ! ``` -- **JSON** (Merge) +#### **JSON** (Merge) Applies a YANG/JSON formatted config to one device/router (merges with existing config) from the list in [config.json](example/input/config.json). It reads the target from [yangconfig.json](example/input/yangconfig.json). -```bash +```console example/mergeconfig$ ./mergeconfig Config merged on [2001:420:2cff:1204::5502:1]:57344 -> Request ID: 8162, Response ID: 8162 @@ -152,11 +185,11 @@ interface Loopback201 ! ``` -- **JSON** (Replace) +#### **JSON** (Replace) Applies a YANG/JSON formatted config to one device/router (replaces the config for this section) from the list in [config.json](example/input/config.json). It learns the config to replace from [yangconfigrep.json](example/input/yangconfigrep.json). If we had merged instead, we would have ended up with two IPv6 addresses in this example. -```bash +```console example/replaceconfig$ ./replaceconfig Config replaced on [2001:420:2cff:1204::5502:1]:57344 -> Request ID: 4616, Response ID: 4616 @@ -175,7 +208,7 @@ interface Loopback201 ! ``` -- **Using a YANG config Template** (Merge) +#### **Using a YANG config Template** (Merge) Applies a YANG/JSON formatted config to one device/router (merges with existing config) from the list in [config.json](example/input/config.json). It takes a template ([bgp.json](example/input/template/bgp.json)), based on the BGP YANG model [Cisco-IOS-XR-ipv4-bgp-cfg](https://github.com/YangModels/yang/blob/master/vendor/cisco/xr/622/Cisco-IOS-XR-ipv4-bgp-cfg.yang), in this case and the specific parameters from [bgp-parameters.json](example/input/template/bgp-parameters.json). @@ -245,11 +278,11 @@ While templates are cool, I'd recommend exploring one of these alternatives to h ### Removing router config -- **JSON** +#### **JSON** Removes YANG/JSON formatted config on one device/router from [config.json](example/input/config.json). It reads the config to delete from [yangdelconfig.json](example/input/yangdelconfig.json). The following example deletes both interfaces configured in the Merge example. See [yangdelintadd.json](example/input/yangdelintadd.json) to delete just the IP address and [yangdelintdesc.json](example/input/yangdelintdesc.json) for only the description of the interface. -```bash +```console example/deleteconfig$ ./deleteconfig Config Deleted on [2001:420:2cff:1204::5502:1]:57344 -> Request ID: 2856, Response ID: 2856 @@ -273,7 +306,7 @@ end Applies CLI config commands to the list of routers specified on [config.json](example/input/config.json). Notice that even though we added two devices, the execution time did NOT increase. This is possible because of the use of [Golang Concurrency](https://blog.golang.org/pipelines) primitives. -```bash +```console example/setconfiglist$ ./setconfiglist -cli "interface Lo33 ipv6 address 2001:db8:33::1/128" Config applied to [2001:420:2cff:1204::5502:2]:57344 @@ -319,11 +352,11 @@ interface Loopback33 ### Telemetry -- **JSON (GPBKV)** +#### **JSON (GPBKV)** Subscribe to a Telemetry stream. The Telemetry message is defined in [telemetry.proto](proto/telemetry/telemetry.proto). The payload is JSON encoded (self-describing GPB). -```bash +```console example/telemetry$ ./telemetry -subs "LLDP" Time 1500666991103, Path: Cisco-IOS-XR-ethernet-lldp-oper:lldp/nodes/node/neighbors/details/detail { @@ -358,7 +391,7 @@ telemetry model-driven ! ``` -- **JSON (GPBKV): Exploring the fields** +#### **JSON (GPBKV): Exploring the fields** Same as the previous example using a Cisco native YANG model. However this time we explore the fields in order to produce a custom output. @@ -377,7 +410,7 @@ func exploreFields(f []*telemetry.TelemetryField, indent string) { The result looks like this: -```bash +```console example/telemetrykv$ ./telemetrykv ****************************************************************************************** Time 01:24:48PM, Path: Cisco-IOS-XR-ethernet-lldp-oper:lldp/nodes/node/neighbors/details/detail @@ -400,11 +433,11 @@ Time 01:24:48PM, Path: Cisco-IOS-XR-ethernet-lldp-oper:lldp/nodes/node/neighbors ``` -- **JSON (GPBKV): OpenConfig** +#### **JSON (GPBKV): OpenConfig** Same example as before, just calling a subscription that uses an OpenConfig model instead. The result looks like this: -```bash +```console example/telemetrykv$ ./telemetrykv -subs "BGP-OC" ****************************************************************************************** Time 01:08:03PM, Path: openconfig-bgp:bgp/neighbors/neighbor/state @@ -448,11 +481,11 @@ telemetry model-driven ``` -- **GPB (Protobuf)** +#### **GPB (Protobuf)** Again, we subscribe to a Telemetry stream but we request the content is encoded with [protobuf](https://developers.google.com/protocol-buffers/). To decode the message we need to look at the "LLDP neighbor details" definition in [lldp_neighbor.proto](proto/telemetry/lldp/lldp_neighbor.proto). We parse the message and modify the output to illustrate how to access to each field on it. -```bash +```console example/telemetrygpb$ ./telemetrygpb -subs "LLDP" Time 1500667512299, Path: Cisco-IOS-XR-ethernet-lldp-oper:lldp/nodes/node/neighbors/details/detail { @@ -523,7 +556,7 @@ The example will run a config checklist, composed of three items as a result of The output of the example is very basic, but ilustrates all these points. Notice we receive BGP status every 5 seconds and the neighbor goes from bgp-st-idle to bgp-st-estab. -```bash +```console example/configvalidate$ ./configvalidate ****************************************************************************************** @@ -596,6 +629,41 @@ BGP Neighbor; IP: 2001:db8:cafe::2, ASN: 64512, State bgp-st-idle BGP Neighbor; IP: 2001:db8:cafe::2, ASN: 64512, State bgp-st-estab ``` +### Service Layer API + +#### Add an IPv6 route + +Add a new route to the IPv6 routing table. + +```console +example/setroute$ ./setroute -pfx "2001:db8:1413::/48" -nh "2001:db8:cafe::2" +2017/07/25 15:02:01 This process took 329.560647ms +``` + +Which results in: + +```console +RP/0/RP0/CPU0:mrstn-5502-1.cisco.com#show route ipv6 unicast 2001:db8:1413::/48 +Tue Jul 25 15:02:20.369 EDT + +Routing entry for 2001:db8:1413::/48 + Known via "application Service-layer", distance 2, metric 0 + Installed Jul 25 15:01:54.011 for 00:00:27 + Routing Descriptor Blocks + 2001:db8:cafe::2, from :: + Route metric is 0 + No advertising protos. +``` + +#### SLA IOS XR config + +``` +!! IOS XR Configuration version = 6.2.2 +grpc + service-layer +! +``` + ### Bypass the config file You can manually define the target without the config file [config.json](example/input/config.json), by calling the functional options "WithValue". See the snippet below from [definetarget](example/definetarget/main.go). @@ -637,7 +705,7 @@ mrstn-5502-1 emsd: [1058]: %MGBL-EMS-4-EMSD_PORT_RANGE : The configured port 565 You need to retrive the `ems.pem` file from the IOS XR device (after enabling gRPC/TLS) and put it in the [input](example/input) folder (or any other location specified in [config.json](example/input/config.json)). You can find the file in the router on either `/misc/config/grpc/` or `/var/xr/config/grpc`. -```bash +```console [xrrouter.cisco.com:/var/xr/config/grpc]$ ls -la total 20 drwxr-xr-x 3 root root 4096 Jul 5 17:47 . @@ -652,13 +720,13 @@ drwx------ 2 root root 4096 Jul 3 12:50 dialout The Go generated code in [ems_grpc.pb.go](proto/ems/ems_grpc.pb.go) is the result of the following: -```bash +```console proto/ems/$ protoc --go_out=plugins=grpc:. ems_grpc.proto ``` The Go generated code in [lldp_neighbor.pb.go](proto/telemetry/lldp/lldp_neighbor.pb.go) is the result of the following: -```bash +```console proto/telemetry/lldp$ protoc --go_out=. lldp_neighbor.proto ``` @@ -666,6 +734,6 @@ proto/telemetry/lldp$ protoc --go_out=. lldp_neighbor.proto Simply execute `go build` on the corresponding example folder. E.g. -```bash +```console example/telemetry$ go build ``` diff --git a/doc.go b/doc.go index 0710187..4837551 100644 --- a/doc.go +++ b/doc.go @@ -23,10 +23,10 @@ // log.Fatalf("Do NOT recognize encoding: %v\n", *enc) // } // -// Tutorials to setup a testbed have been posted in -// https://xrdocs.github.io/programmability/tutorials/2017-08-04-programming-ios-xr-with-grpc-and-go/ +// Tutorials to setup a testbed have been posted at: // // - Programming IOS-XR with gRPC and Go: https://xrdocs.github.io/programmability/tutorials/2017-08-04-programming-ios-xr-with-grpc-and-go/ +// // - Validate the intent of network config changes: https://xrdocs.github.io/programmability/tutorials/2017-08-14-validate-the-intent-of-network-config-changes/ // package xrgrpc diff --git a/example/.gitignore b/example/.gitignore index f27aa91..62af6f2 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -1 +1,2 @@ -setroute/ \ No newline at end of file +configvalidateoc4/ +configvalidateoc6/ \ No newline at end of file diff --git a/example/getconfig/main.go b/example/getconfig/main.go index 8c2ef8b..454f4da 100644 --- a/example/getconfig/main.go +++ b/example/getconfig/main.go @@ -44,7 +44,7 @@ func main() { // Setup a connection to the target. 'd' is the index of the router // in the config file - d := 0 + d := 1 conn, ctx, err := xr.Connect(targets.Routers[d]) if err != nil { log.Fatalf("could not setup a client connection to %s, %v", targets.Routers[d].Host, err) diff --git a/example/input/certificate/ems5502-2.pem b/example/input/certificate/ems5502-2.pem index 37a2542..255ebbc 100644 --- a/example/input/certificate/ems5502-2.pem +++ b/example/input/certificate/ems5502-2.pem @@ -1,25 +1,25 @@ -----BEGIN CERTIFICATE----- -MIIEMTCCAxmgAwIBAgICDD4wDQYJKoZIhvcNAQENBQAwgbAxCzAJBgNVBAYTAlVT +MIIEMTCCAxmgAwIBAgICD+0wDQYJKoZIhvcNAQENBQAwgbAxCzAJBgNVBAYTAlVT MQswCQYDVQQIEwJDQTERMA8GA1UEBxMIU2FuIEpvc2UxFzAVBgNVBAkTDjM3MDAg Q2lzY28gV2F5MQ4wDAYDVQQREwU5NTEzNDEcMBoGA1UEChMTQ2lzY28gU3lzdGVt cywgSW5jLjEMMAoGA1UECxMDQ1NHMRYwFAYDVQQDEw1lbXMuY2lzY28uY29tMRQw -EgYDVQQFEwtGT0MyMTAzUjA5RTAeFw0xNzA4MTMwNDAwNTlaFw0zNzA4MTMwNDAw -NTlaMIGwMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExETAPBgNVBAcTCFNhbiBK +EgYDVQQFEwtGT0MyMTAzUjA5RTAeFw0xNzA4MzEyMTQ1MzlaFw0z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FhTQPBC6GObB68XR/nXKelPIpM2A15VUll7/ndVCqTyAT8vydjJ8I -wdj/BS/ygzz0qCzkLl2dudrmTZVm ------END CERTIFICATE----- +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9ggHNlw/7DMF/lfFgstF+Pl2awoYmVt+f +br7c9Lt7gMhLAJ4ij+9buO/CKlmlwlXP2gajyHFUBczAGdnVXlmBFcjhp427Arn3 +ZvQjn29VQkGbCaFIuJYUXbYAW6cGDLstGCIE4ghHOenopxhqAvqZ7N5j7xvUjULs +U6v6q/3rtgPi1s72W8pDZWg7mfBg9cwNHW8kt/85yv2fQKt3P0ciHgFGEFEBKCds +kCIOp0TUHNIpgRk93I5Fr5IlRc3FlAwA124R25jUeJofxgxNoJ7xexNXPj+YxB9o +DBa5cKw19c1aa5fJgiKsLeyFaDm3yhTgLJfjsGIKuJpay4Ur6l6pAgMBAAGjUzBR +MA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFGHhuQfsT2NeTub0wF9H3Pqyzm4k +MB8GA1UdIwQYMBaAFGHhuQfsT2NeTub0wF9H3Pqyzm4kMA0GCSqGSIb3DQEBDQUA +A4IBAQA+Pvec6tgmwwJJ4taueRAaD900jfDf4zBrcTWDu6wq3U9JNmsutNGHAV7D +Tz5jUxwYYmxpWYKKaQ2t9Ev0Hm2uyXRZspg7Qwc6M8hjJbveogq5dFDnq/F28Ha4 +ot4d1GnD1xcHGVSqofUQkcuevDftrLN+5TkGE/Qj1YRzrUa72zSdptpTFQ++BDeU +xEdufS7bJkr4Ounf10zfqO1anqyRQ/mP+2Efqs/TvrOtqml9irKAGnsWCgO1IZZP +7SH37ThzcU2aC9yJrF4Qr4nzTsHums1/bvLOPieWMhEzQUVtsrdvg6H8WSeDNzv5 +ll4niC8H4JGdrXR+Rz/4MO4iVZhZ +-----END CERTIFICATE----- \ No newline at end of file diff --git a/example/setroute/.gitignore b/example/setroute/.gitignore new file mode 100644 index 0000000..619cc89 --- /dev/null +++ b/example/setroute/.gitignore @@ -0,0 +1 @@ +setroute \ No newline at end of file diff --git a/example/setroute/main.go b/example/setroute/main.go new file mode 100644 index 0000000..73f6a20 --- /dev/null +++ b/example/setroute/main.go @@ -0,0 +1,73 @@ +/* +gRPC Client +*/ + +package main + +import ( + "flag" + "log" + "time" + + xr "github.com/nleiva/xrgrpc" +) + +func timeTrack(start time.Time) { + elapsed := time.Since(start) + log.Printf("This process took %s\n", elapsed) +} + +func main() { + // To time this process + defer timeTrack(time.Now()) + + // IPv6 prefix to setup; defaults to "2001:db8::/32" + pfx := flag.String("pfx", "2001:db8::/32", "IPv6 prefix to setup") + // IPv6 next-hop to setup; defaults to "2001:db8:cafe::1" + nh := flag.String("nh", "2001:db8:cafe::1", "IPv6 next-hop to setup") + // Config file; defaults to "config.json" + cfg := flag.String("cfg", "../input/config.json", "Configuration file") + flag.Parse() + + // Admin Distance + var admdis uint32 = 2 + + // Define target parameters from the configuration file + targets := xr.NewDevices() + err := xr.DecodeJSONConfig(targets, *cfg) + if err != nil { + log.Fatalf("Could not read the config: %v\n", err) + } + + // Setup a connection to the target. 'd' is the index of the router + // in the config file + d := 1 + conn, _, err := xr.Connect(targets.Routers[d]) + if err != nil { + log.Fatalf("Could not setup a client connection to %s, %v", targets.Routers[d].Host, err) + } + defer conn.Close() + + // CSCva95005: Return SL_NOT_CONNECTED when the init session is killed from the Client. + err = xr.ClientInit(conn) + if err != nil { + log.Fatalf("Failed to initialize connection to %s, %v", targets.Routers[d].Host, err) + } + + // VRF Register Operation (= 1), + err = xr.VRFOperation(conn, 1, admdis) + if err != nil { + log.Fatalf("Failed to register the VRF Operation on %s, %v", targets.Routers[d].Host, err) + } + // VRF EOF Operation (= 3), + err = xr.VRFOperation(conn, 3, admdis) + if err != nil { + log.Fatalf("Failed to send VRF Operation EOF to %s, %v", targets.Routers[d].Host, err) + } + // Route Add Operation (= 1), + err = xr.SetRoute(conn, 1, *pfx, admdis, *nh) + if err != nil { + log.Fatalf("Failed to set Route on %s, %v", targets.Routers[d].Host, err) + } + +} diff --git a/proto/.gitignore b/proto/.gitignore index 08d2fbf..e69de29 100644 --- a/proto/.gitignore +++ b/proto/.gitignore @@ -1 +0,0 @@ -sla/ \ No newline at end of file diff --git a/proto/ems/ems_grpc.proto b/proto/ems/ems_grpc.proto index dc5bdaa..6664107 100644 --- a/proto/ems/ems_grpc.proto +++ b/proto/ems/ems_grpc.proto @@ -42,7 +42,8 @@ service gRPCExec { // Exec commands rpc ShowCmdTextOutput(ShowCmdArgs) returns(stream ShowCmdTextReply) {}; rpc ShowCmdJSONOutput(ShowCmdArgs) returns(stream ShowCmdJSONReply) {}; - +// rpc ActionCLI(ActionCliArgs) returns(stream ActionCliReply) {}; +// rpc ActionJSON(ActionJSONArgs) returns(stream ActionJSONReply) {}; } @@ -160,4 +161,25 @@ message CreateSubsReply { int64 ResReqId = 1; bytes data = 2; string errors = 3; -} \ No newline at end of file +} +//message ActionCliArgs { +// int64 ReqId = 1; +// string cli = 2; +//} + +//message ActionCliReply { +// int64 ResReqId = 1; +// string output = 2; +// string errors = 3; +//} + +//message ActionJSONArgs { +// int64 ReqId = 1; +// string yangpathjson = 2; +//} + +//message ActionJSONReply { +// int64 ResReqId = 1; +// string yangjson = 2; +// string errors = 3; +//} \ No newline at end of file diff --git a/proto/sla/sl_common_types.pb.go b/proto/sla/sl_common_types.pb.go new file mode 100644 index 0000000..c11dd3b --- /dev/null +++ b/proto/sla/sl_common_types.pb.go @@ -0,0 +1,1334 @@ +// Code generated by protoc-gen-go. +// source: sl_common_types.proto +// DO NOT EDIT! + +/* +Package service_layer is a generated protocol buffer package. + +It is generated from these files: + sl_common_types.proto + sl_global.proto + sl_route_common.proto + sl_route_ipv6.proto + sl_version.proto + +It has these top-level messages: + SLErrorStatus + SLInterface + SLIpAddress + SLInitMsg + SLInitMsgRsp + SLGlobalNotif + SLGlobalsGetMsg + SLGlobalsGetMsgRsp + SLRouteGlobalsGetMsg + SLRouteGlobalsGetMsgRsp + SLRouteGlobalStatsGetMsg + SLRouteGlobalStatsGetMsgRsp + SLVrfReg + SLVrfRegMsg + SLVrfRegMsgRes + SLVrfRegMsgRsp + SLVrfRegGetMsg + SLVrfRegGetMsgRsp + SLVRFGetStatsMsgRes + SLVRFGetStatsMsgRsp + SLRouteCommon + SLRoutePath + SLRoutev6 + SLRoutev6Msg + SLRoutev6Res + SLRoutev6MsgRsp + SLRoutev6GetMsg + SLRoutev6GetMsgRsp +*/ +package service_layer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// Registration Operations. +type SLRegOp int32 + +const ( + // Reserved. 0x0 + SLRegOp_SL_REGOP_RESERVED SLRegOp = 0 + // Register. 0x1 + SLRegOp_SL_REGOP_REGISTER SLRegOp = 1 + // Un-Register. 0x2 + SLRegOp_SL_REGOP_UNREGISTER SLRegOp = 2 + // End Of File. 0x3 + SLRegOp_SL_REGOP_EOF SLRegOp = 3 +) + +var SLRegOp_name = map[int32]string{ + 0: "SL_REGOP_RESERVED", + 1: "SL_REGOP_REGISTER", + 2: "SL_REGOP_UNREGISTER", + 3: "SL_REGOP_EOF", +} +var SLRegOp_value = map[string]int32{ + "SL_REGOP_RESERVED": 0, + "SL_REGOP_REGISTER": 1, + "SL_REGOP_UNREGISTER": 2, + "SL_REGOP_EOF": 3, +} + +func (x SLRegOp) String() string { + return proto.EnumName(SLRegOp_name, int32(x)) +} +func (SLRegOp) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Object Operations. +type SLObjectOp int32 + +const ( + // Reserved. 0x0 + SLObjectOp_SL_OBJOP_RESERVED SLObjectOp = 0 + // Add. 0x1 + SLObjectOp_SL_OBJOP_ADD SLObjectOp = 1 + // Update. 0x2 + SLObjectOp_SL_OBJOP_UPDATE SLObjectOp = 2 + // Delete. 0x3 + SLObjectOp_SL_OBJOP_DELETE SLObjectOp = 3 +) + +var SLObjectOp_name = map[int32]string{ + 0: "SL_OBJOP_RESERVED", + 1: "SL_OBJOP_ADD", + 2: "SL_OBJOP_UPDATE", + 3: "SL_OBJOP_DELETE", +} +var SLObjectOp_value = map[string]int32{ + "SL_OBJOP_RESERVED": 0, + "SL_OBJOP_ADD": 1, + "SL_OBJOP_UPDATE": 2, + "SL_OBJOP_DELETE": 3, +} + +func (x SLObjectOp) String() string { + return proto.EnumName(SLObjectOp_name, int32(x)) +} +func (SLObjectOp) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +// Notification Operations. +type SLNotifOp int32 + +const ( + // Reserved. 0x0 + SLNotifOp_SL_NOTIFOP_RESERVED SLNotifOp = 0 + // Enable. 0x1 + SLNotifOp_SL_NOTIFOP_ENABLE SLNotifOp = 1 + // Disable. 0x2 + SLNotifOp_SL_NOTIFOP_DISABLE SLNotifOp = 2 +) + +var SLNotifOp_name = map[int32]string{ + 0: "SL_NOTIFOP_RESERVED", + 1: "SL_NOTIFOP_ENABLE", + 2: "SL_NOTIFOP_DISABLE", +} +var SLNotifOp_value = map[string]int32{ + "SL_NOTIFOP_RESERVED": 0, + "SL_NOTIFOP_ENABLE": 1, + "SL_NOTIFOP_DISABLE": 2, +} + +func (x SLNotifOp) String() string { + return proto.EnumName(SLNotifOp_name, int32(x)) +} +func (SLNotifOp) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type SLErrorStatus_SLErrno int32 + +const ( + // Success, no errors detected. 0x0. + SLErrorStatus_SL_SUCCESS SLErrorStatus_SLErrno = 0 + // Client is not connected. + // The client is expected to remain connected after init and version + // validation, RPC calls can fail with this error code otherwise. + // Refer to RPC SLGlobalInitNotif. 0x1 + SLErrorStatus_SL_NOT_CONNECTED SLErrorStatus_SLErrno = 1 + // Operation must be retried. 0x2 + SLErrorStatus_SL_EAGAIN SLErrorStatus_SLErrno = 2 + // One or more components does not have sufficient memory. 0x3 + SLErrorStatus_SL_ENOMEM SLErrorStatus_SLErrno = 3 + // Too many outstanding requests. 0x4 + SLErrorStatus_SL_EBUSY SLErrorStatus_SLErrno = 4 + // One or more arguments are invalid. 0x5 + SLErrorStatus_SL_EINVAL SLErrorStatus_SLErrno = 5 + // Unsupported version. 0x6 + SLErrorStatus_SL_UNSUPPORTED_VER SLErrorStatus_SLErrno = 6 + // Not Available. 0x7 + SLErrorStatus_SL_NOT_AVAILABLE SLErrorStatus_SLErrno = 7 + // Stream mode not supported. 0x8 + SLErrorStatus_SL_STREAM_NOT_SUPPORTED SLErrorStatus_SLErrno = 8 + // Operation not supported. 0x9 + SLErrorStatus_SL_ENOTSUP SLErrorStatus_SLErrno = 9 + // One or more objects is errored: + // Each object must be individually examined. 0xa + SLErrorStatus_SL_SOME_ERR SLErrorStatus_SLErrno = 10 + // Operation Timed out. + // The result of the operation is undeterministic (success or fail). 0xb + SLErrorStatus_SL_TIMEOUT SLErrorStatus_SLErrno = 11 + // Due to some event, the client will no longer receive notification + // events on this channel. 0xc + // Such events include: + // - Notification Session was hijacked by another client. + SLErrorStatus_SL_NOTIF_TERM SLErrorStatus_SLErrno = 12 + // Offset for INIT errors. 0x500 + SLErrorStatus_SL_INIT_START_OFFSET SLErrorStatus_SLErrno = 1280 + // Success, no errors detected - clear state. + // This error is returned on the first-ever initialization, or, + // when a fatal event has occured and all previous state was lost. 0x501 + SLErrorStatus_SL_INIT_STATE_CLEAR SLErrorStatus_SLErrno = 1281 + // Success, no errors detected - previous state fully recovered. + // This error is returned on a client re-initialization with + // successful recovery of state. 0x502 + SLErrorStatus_SL_INIT_STATE_READY SLErrorStatus_SLErrno = 1282 + // Server software incompatible with client software version. 0x503 + SLErrorStatus_SL_INIT_UNSUPPORTED_VER SLErrorStatus_SLErrno = 1283 + // Initialization request received while server is not ready. 0x504 + SLErrorStatus_SL_INIT_SERVER_NOT_INITIALIZED SLErrorStatus_SLErrno = 1284 + // Server operational mode change from stream to non-stream + // or vice-versa failed. 0x505 + SLErrorStatus_SL_INIT_SERVER_MODE_CHANGE_FAILED SLErrorStatus_SLErrno = 1285 + // Offset for VRF errors. 0x1000 + SLErrorStatus_SL_RPC_VRF_START_OFFSET SLErrorStatus_SLErrno = 4096 + // Operation rejected for ALL VRFs due to too many VRF registration + // messages in the request. 0x1001 + SLErrorStatus_SL_RPC_VRF_TOO_MANY_VRF_REG_MSGS SLErrorStatus_SLErrno = 4097 + // Operation rejected for all VRFs as server is not initialized. 0x1002 + SLErrorStatus_SL_RPC_VRF_SERVER_NOT_INITIALIZED SLErrorStatus_SLErrno = 4098 + // Offset for VRF errors. 0x2000 + SLErrorStatus_SL_VRF_START_OFFSET SLErrorStatus_SLErrno = 8192 + // VRF name in the VRF registration message is too long. 0x2001 + SLErrorStatus_SL_VRF_NAME_TOOLONG SLErrorStatus_SLErrno = 8193 + // VRF not found during a unregister or EOF. 0x2002 + SLErrorStatus_SL_VRF_NOT_FOUND SLErrorStatus_SLErrno = 8194 + // On a VRF registration, Table ID for the VRF is not found. 0x2003 + SLErrorStatus_SL_VRF_NO_TABLE_ID SLErrorStatus_SLErrno = 8195 + // VRF add registration message with invalid administrative distance. 0x2004 + SLErrorStatus_SL_VRF_REG_INVALID_ADMIN_DISTANCE SLErrorStatus_SLErrno = 8196 + // On a VRF registration, Table cannot be added to persistent memory. 0x2005 + SLErrorStatus_SL_VRF_TABLE_ADD_ERR SLErrorStatus_SLErrno = 8197 + // VRF table cannot be registered with RIB. 0x2006 + SLErrorStatus_SL_VRF_TABLE_REGISTRATION_ERR SLErrorStatus_SLErrno = 8198 + // VRF table cannot be unregistered with RIB. 0x2007 + SLErrorStatus_SL_VRF_TABLE_UNREGISTRATION_ERR SLErrorStatus_SLErrno = 8199 + // VRF table RIB EOF operation error. 0x2008 + SLErrorStatus_SL_VRF_TABLE_EOF_ERR SLErrorStatus_SLErrno = 8200 + // VRF registration message does not have a VRF name. 0x2009 + SLErrorStatus_SL_VRF_REG_VRF_NAME_MISSING SLErrorStatus_SLErrno = 8201 + // Offset for Route operation errors. 0x3000 + SLErrorStatus_SL_RPC_ROUTE_START_OFFSET SLErrorStatus_SLErrno = 12288 + // Operation rejected for ALL routes due to too many routes in the + // request. 0x3001 + SLErrorStatus_SL_RPC_ROUTE_TOO_MANY_ROUTES SLErrorStatus_SLErrno = 12289 + // Operation rejected for ALL routes as the request's VRF name + // is too long. 0x3002 + SLErrorStatus_SL_RPC_ROUTE_VRF_NAME_TOOLONG SLErrorStatus_SLErrno = 12290 + // Operation rejected for ALL routes as VRF for the given name + // is not found. 0x3003 + SLErrorStatus_SL_RPC_ROUTE_VRF_NOT_FOUND SLErrorStatus_SLErrno = 12291 + // Operation rejected for ALL routes as VRF's Table ID is not found. + // 0x3004 + SLErrorStatus_SL_RPC_ROUTE_VRF_NO_TABLE SLErrorStatus_SLErrno = 12292 + // Operation rejected for ALL routes as VRF is not registered with RIB. + // 0x3005 + SLErrorStatus_SL_RPC_ROUTE_VRF_TABLE_NOT_REGISTERED SLErrorStatus_SLErrno = 12293 + // Route Operation rejected for ALL objects as VRF name is missing. + // 0x3006 + SLErrorStatus_SL_RPC_ROUTE_VRF_NAME_MISSING SLErrorStatus_SLErrno = 12294 + // Operation rejected for all routes as the RPC request is + // not supported for the library's initialization mode. 0x3007 + SLErrorStatus_SL_RPC_ROUTE_INIT_MODE_INCOMPATIBLE SLErrorStatus_SLErrno = 12295 + // Operation rejected for all routes as server is not initialized. + // 0x3008 + SLErrorStatus_SL_RPC_ROUTE_SERVER_NOT_INITIALIZED SLErrorStatus_SLErrno = 12296 + // Offset for route errors. 0x4000 + SLErrorStatus_SL_ROUTE_START_OFFSET SLErrorStatus_SLErrno = 16384 + // Route add operation requested but no paths were provided. 0x4001 + SLErrorStatus_SL_ROUTE_ADD_NO_PATHS SLErrorStatus_SLErrno = 16385 + // Route update operation requested but no paths were provided. 0x4002 + SLErrorStatus_SL_ROUTE_UPDATE_NO_PATHS SLErrorStatus_SLErrno = 16386 + // Route's prefix length is invalid. 0x4003 + SLErrorStatus_SL_ROUTE_INVALID_PREFIX_LEN SLErrorStatus_SLErrno = 16387 + // Route's admininstrative distance is invalid. 0x4004 + SLErrorStatus_SL_ROUTE_INVALID_ADMIN_DISTANCE SLErrorStatus_SLErrno = 16388 + // Route's number of paths exceeds system capabilities. 0x4005 + SLErrorStatus_SL_ROUTE_INVALID_NUM_PATHS SLErrorStatus_SLErrno = 16389 + // Size of IPv6 prefix is invalid. 0x4006 + SLErrorStatus_SL_ROUTE_INVALID_PREFIX_SZ SLErrorStatus_SLErrno = 16390 + // Route's prefix is invalid. 0x4007 + SLErrorStatus_SL_ROUTE_INVALID_PREFIX SLErrorStatus_SLErrno = 16391 + // Route programming failed in RIB as VRF table limit reached. 0x4008 + SLErrorStatus_SL_ROUTE_ERR_RIB_TABLE_LIMIT_REACHED SLErrorStatus_SLErrno = 16392 + // RIB route programming failed in RIB due to invalid arguments. 0x4009 + SLErrorStatus_SL_ROUTE_ERR_RIB_INVALID_ARGS SLErrorStatus_SLErrno = 16393 + // One or more paths could not be programmed in RIB as VRF + // table limit reached. 0x400a + SLErrorStatus_SL_ROUTE_ERR_RIB_PATH_TABLE_LIMIT SLErrorStatus_SLErrno = 16394 + // One or more paths could not be programmed in RIB as number of paths + // reached system limit. 0x400b + SLErrorStatus_SL_ROUTE_ERR_RIB_TOOMANYPATHS SLErrorStatus_SLErrno = 16395 + // This route already exists in the database. 0x400c + SLErrorStatus_SL_ROUTE_EEXIST SLErrorStatus_SLErrno = 16396 + // Route prefix has host bits set. 0x400d + SLErrorStatus_SL_ROUTE_HOST_BITS_SET SLErrorStatus_SLErrno = 16397 + // IPv4 Route prefix is a multicast address. 0x400e + SLErrorStatus_SL_ROUTE_INVALID_PREFIX_MCAST SLErrorStatus_SLErrno = 16398 + // Route and Path AFI does not match. 0x400f + SLErrorStatus_SL_ROUTE_PATH_AFI_MISMATCH SLErrorStatus_SLErrno = 16399 + // Number of primary paths exceeds system capabilities. 0x4010 + SLErrorStatus_SL_ROUTE_TOOMANY_PRIMARY_PATHS SLErrorStatus_SLErrno = 16400 + // Number of backup paths exceeds system capabilities. 0x4011 + SLErrorStatus_SL_ROUTE_TOOMANY_BACKUP_PATHS SLErrorStatus_SLErrno = 16401 + // The route database is out of memory. 0x4012 + SLErrorStatus_SL_ROUTE_DB_NOMEM SLErrorStatus_SLErrno = 16402 + // The route has an invalid local label. 0x4013 + SLErrorStatus_SL_ROUTE_INVALID_LOCAL_LABEL SLErrorStatus_SLErrno = 16403 + // Offset for route path errors. 0x5000 + SLErrorStatus_SL_PATH_START_OFFSET SLErrorStatus_SLErrno = 20480 + // VRF table for the path could not be determined. 0x5001 + SLErrorStatus_SL_PATH_NH_NO_TABLE SLErrorStatus_SLErrno = 20481 + // Path next hop interface not found. 0x5002 + SLErrorStatus_SL_PATH_NH_INTF_NOT_FOUND SLErrorStatus_SLErrno = 20482 + // Number of labels in the path exceeds system capabilities. 0x5003 + SLErrorStatus_SL_PATH_INVALID_LABEL_COUNT SLErrorStatus_SLErrno = 20483 + // Path ID assigned to the path falls outside the supported range. 0x5004 + SLErrorStatus_SL_PATH_INVALID_ID SLErrorStatus_SLErrno = 20484 + // Path VRF name exceeds supported length. 0x5005 + SLErrorStatus_SL_PATH_VRF_NAME_TOOLONG SLErrorStatus_SLErrno = 20485 + // Path next hop interface name exceeds supported length. 0x5006 + SLErrorStatus_SL_PATH_NH_INTF_NAME_TOOLONG SLErrorStatus_SLErrno = 20486 + // Size of next hop IPv6 address is invalid. 0x5007 + SLErrorStatus_SL_PATH_NH_INVALID_ADDR_SZ SLErrorStatus_SLErrno = 20487 + // Next hop interface name is missing from path. 0x5008 + SLErrorStatus_SL_PATH_NH_INF_NAME_MISSING SLErrorStatus_SLErrno = 20488 + // Path has an invalid next hop address. 0x5009 + SLErrorStatus_SL_PATH_INVALID_NEXT_HOP_ADDR SLErrorStatus_SLErrno = 20489 + // Number of remote backup addresses in the path exceeds + // system capabilities. 0x500a + SLErrorStatus_SL_PATH_INVALID_REMOTE_ADDR_COUNT SLErrorStatus_SLErrno = 20490 + // Size of IPv6 remote backup address is invalid. 0x500b + SLErrorStatus_SL_PATH_REMOTE_ADDR_INVALID_SZ SLErrorStatus_SLErrno = 20491 + // Route and Path remote backup address AFI does not match. 0x500c + SLErrorStatus_SL_PATH_REMOTE_ADDR_AFI_MISMATCH SLErrorStatus_SLErrno = 20492 + // Path has an invalid protection bitmap. 0x500d + SLErrorStatus_SL_PATH_INVALID_PROTECTED_BITMAP SLErrorStatus_SLErrno = 20493 + // Protection bitmap of a backup path refers to a missing path. 0x500e + SLErrorStatus_SL_PATH_BACKUP_MISSING_PRIMARY_PATH SLErrorStatus_SLErrno = 20494 + // Too many primary paths with same Path ID. 0x500f + SLErrorStatus_SL_PATH_PRIMARY_ID_REPEATED SLErrorStatus_SLErrno = 20495 + // Too many pure backup paths with same Path ID. 0x5010 + SLErrorStatus_SL_PATH_BACKUP_ID_REPEATED SLErrorStatus_SLErrno = 20496 + // A primary path has too many backup paths. 0x5011 + SLErrorStatus_SL_PATH_PRIMARY_TOOMANY_BACKUP_PATHS SLErrorStatus_SLErrno = 20497 + // A primary path has too many labels. 0x5012 + SLErrorStatus_SL_PATH_PRIMARY_TOOMANY_LABELS SLErrorStatus_SLErrno = 20498 + // A primary path has too many remote addresses. 0x5013 + SLErrorStatus_SL_PATH_PRIMARY_TOOMANY_REMOTE_ADDR SLErrorStatus_SLErrno = 20499 + // A pure backup remote address is invalid. 0x5014 + SLErrorStatus_SL_PATH_REMOTE_ADDR_INVALID SLErrorStatus_SLErrno = 20500 + // Path has an invalid label. 0x5015 + SLErrorStatus_SL_PATH_INVALID_LABEL SLErrorStatus_SLErrno = 20501 + // Offset for BFD operation errors. 0x6000 + SLErrorStatus_SL_RPC_BFD_START_OFFSET SLErrorStatus_SLErrno = 24576 + // BFD Operation rejected for ALL Sessions as the BFD Session count + // is beyond supported limit. 0x6001 + SLErrorStatus_SL_RPC_BFD_TOO_MANY_BFD_SESSIONS SLErrorStatus_SLErrno = 24577 + // BFD Operation rejected due to one or many invalid parameters. 0x6002 + SLErrorStatus_SL_RPC_BFD_API_BAD_PARAMETER SLErrorStatus_SLErrno = 24578 + // BFD Operation failed as server is not registered with BFD. 0x6003 + SLErrorStatus_SL_RPC_BFD_API_CLIENT_NOT_REGISTERED SLErrorStatus_SLErrno = 24579 + // BFD Operation failed with internal error. 0x6004 + SLErrorStatus_SL_RPC_BFD_API_INTERNAL_ERROR SLErrorStatus_SLErrno = 24580 + // BFD Operation rejected as server is not initialized. 0x6005 + SLErrorStatus_SL_RPC_BFD_SERVER_NOT_INITIALIZED SLErrorStatus_SLErrno = 24581 + // BFD IPv4 not registered. 0x6006 + SLErrorStatus_SL_RPC_BFD_V4_NOT_REGISTERED SLErrorStatus_SLErrno = 24582 + // BFD IPv6 not registered. 0x6007 + SLErrorStatus_SL_RPC_BFD_V6_NOT_REGISTERED SLErrorStatus_SLErrno = 24583 + // Offset for BFD errors. 0x7000 + SLErrorStatus_SL_BFD_START_OFFSET SLErrorStatus_SLErrno = 28672 + // BFD Session's interface name exceeds supported length. 0x7001 + SLErrorStatus_SL_BFD_INTF_NAME_TOOLONG SLErrorStatus_SLErrno = 28673 + // BFD Session's interface not found. 0x7002 + SLErrorStatus_SL_BFD_INTF_NOT_FOUND SLErrorStatus_SLErrno = 28674 + // BFD Session's tx interval or multiplier are beyond the + // supported range. 0x7003 + SLErrorStatus_SL_BFD_INVALID_ATTRIBUTE SLErrorStatus_SLErrno = 28675 + // BFD Session's interface name is missing. 0x7004 + SLErrorStatus_SL_BFD_INTF_NAME_MISSING SLErrorStatus_SLErrno = 28676 + // BFD Session's neighbor is mcast address. 0x7005 + SLErrorStatus_SL_BFD_INVALID_NBR_MCAST SLErrorStatus_SLErrno = 28677 + // BFD Session's neighbor address is invalid. 0x7006 + SLErrorStatus_SL_BFD_INVALID_NBR SLErrorStatus_SLErrno = 28678 + // BFD Session's VRF Name is too long. 0x7007 + SLErrorStatus_SL_BFD_VRF_NAME_TOOLONG SLErrorStatus_SLErrno = 28679 + // BFD Session's one or more parameters are invalid. + // For example, Multihop BFD can not have the interface name set. 0x7008 + SLErrorStatus_SL_BFD_BAD_PARAMETER SLErrorStatus_SLErrno = 28680 + // BFD Session failed with internal error. 0x7009 + SLErrorStatus_SL_BFD_API_INTERNAL_ERROR SLErrorStatus_SLErrno = 28681 + // BFD Session's VRF not found. 0x700a + SLErrorStatus_SL_BFD_VRF_NOT_FOUND SLErrorStatus_SLErrno = 28682 + // BFD Session's neighbor IPv6 prefix size is invalid. 0x700b + SLErrorStatus_SL_BFD_INVALID_PREFIX_SIZE SLErrorStatus_SLErrno = 28683 + // BFD Session type invalid. 0x700c + SLErrorStatus_SL_BFD_INVALID_SESSION_TYPE SLErrorStatus_SLErrno = 28684 + // BFD Session's VRF is Invalid. 0x700d + SLErrorStatus_SL_BFD_INVALID_VRF SLErrorStatus_SLErrno = 28685 + // BFD Session not found. 0x700e + SLErrorStatus_SL_BFD_SESSION_NOT_FOUND SLErrorStatus_SLErrno = 28686 + // BFD Session exists. 0x700f + SLErrorStatus_SL_BFD_SESSION_EXISTS SLErrorStatus_SLErrno = 28687 + // BFD Internal database error. 0x7010 + SLErrorStatus_SL_BFD_INTERNAL_DB_ERROR SLErrorStatus_SLErrno = 28688 + // BFD Recovery error. 0x7011 + SLErrorStatus_SL_BFD_RECOVERY_ERROR SLErrorStatus_SLErrno = 28689 + // Offset for MPLS operation errors. 0x8000 + SLErrorStatus_SL_RPC_MPLS_START_OFFSET SLErrorStatus_SLErrno = 32768 + // Operation rejected for ALL ILMS due to too many ILMS in the + // request. 0x8001 + SLErrorStatus_SL_RPC_MPLS_ILM_TOO_MANY_ILMS SLErrorStatus_SLErrno = 32769 + // Operation rejected for all ILMs as server is not initialized. + // 0x0x8002 + SLErrorStatus_SL_RPC_MPLS_SERVER_NOT_INITIALIZED SLErrorStatus_SLErrno = 32770 + // Operation rejected for all ILMs as the RPC request is + // not supported for the library's initialization mode. 0x8003 + SLErrorStatus_SL_RPC_MPLS_INIT_MODE_INCOMPATIBLE SLErrorStatus_SLErrno = 32771 + // Operation rejected for ALL label blocks due to too many + // label blocks in the request. 0x8004 + SLErrorStatus_SL_RPC_MPLS_LABEL_BLK_TOO_MANY_LABEL_BLKS SLErrorStatus_SLErrno = 32772 + // Operation rejected for ALL ILMs as MPLS layer is not registered. + // 0x8005 + SLErrorStatus_SL_RPC_MPLS_NOT_REGISTERED SLErrorStatus_SLErrno = 32773 + // Offset for MPLS ILM errors. 0x9000 + SLErrorStatus_SL_ILM_ERR_OFFSET SLErrorStatus_SLErrno = 36864 + // MPLS ILM add to service layer failed. 0x9001 + SLErrorStatus_SL_ILM_ADD_FAILED SLErrorStatus_SLErrno = 36865 + // MPLS ILM add to Label Switching Database failed. 0x9002 + SLErrorStatus_SL_ILM_LSD_ADD_FAILED SLErrorStatus_SLErrno = 36866 + // MPLS ILM NHLFE count exceeded max supported number. 0x9003 + SLErrorStatus_SL_ILM_INVALID_NUM_NHLFE SLErrorStatus_SLErrno = 36867 + // MPLS ILM label value out of range. 0x9004 + SLErrorStatus_SL_ILM_INVALID_LABEL SLErrorStatus_SLErrno = 36868 + // MPLS ILM delete from service layer failed. 0x9005 + SLErrorStatus_SL_ILM_DELETE_FAILED SLErrorStatus_SLErrno = 36869 + // MPLS ILM delete from Label Switching Database failed. 0x9006 + SLErrorStatus_SL_ILM_LSD_DELETE_FAILED SLErrorStatus_SLErrno = 36870 + // Number of primary NHLFEs exceeds system capabilities. 0x9007 + SLErrorStatus_SL_ILM_TOOMANY_PRIMARY_NHLFES SLErrorStatus_SLErrno = 36871 + // Number of backup NHLFEs exceeds system capabilities. 0x9008 + SLErrorStatus_SL_ILM_TOOMANY_BACKUP_NHLFES SLErrorStatus_SLErrno = 36872 + // MPLS ILM label alloc failed in Label switching database. 0x9009 + SLErrorStatus_SL_ILM_LSD_ADD_LABEL_ALLOC_FAILED SLErrorStatus_SLErrno = 36873 + // MPLS ILM NHLFE attribute invalid. 0x900a + SLErrorStatus_SL_ILM_LSD_NHLFE_INVALID_ATTRIB SLErrorStatus_SLErrno = 36874 + // MPLS ILM already exists in the database. 0x900b + SLErrorStatus_SL_ILM_EEXIST SLErrorStatus_SLErrno = 36875 + // The ILM database is out of memory. 0x900c + SLErrorStatus_SL_ILM_DB_NOMEM SLErrorStatus_SLErrno = 36876 + // Offset for MPLS NHLFE errors. 0xa000 + SLErrorStatus_SL_NHLFE_ERR_OFFSET SLErrorStatus_SLErrno = 40960 + // MPLS NHLFE vrf table could not be determined. 0xa001 + SLErrorStatus_SL_NHLFE_NH_NO_TABLE SLErrorStatus_SLErrno = 40961 + // Size of next hop IPv6 address is invalid. 0xa002 + SLErrorStatus_SL_NHLFE_NH_INVALID_ADDR_SZ SLErrorStatus_SLErrno = 40962 + // NHLFE has an invalid next hop address. 0xa003 + SLErrorStatus_SL_NHLFE_INVALID_NEXT_HOP_ADDR SLErrorStatus_SLErrno = 40963 + // Path VRF name exceeds supported length. 0xa004 + SLErrorStatus_SL_NHLFE_VRF_NAME_TOOLONG SLErrorStatus_SLErrno = 40964 + // Next hop interface name is missing from path. 0xa005 + SLErrorStatus_SL_NHLFE_NH_INF_NAME_MISSING SLErrorStatus_SLErrno = 40965 + // Interface name exceeds supported length. 0xa006 + SLErrorStatus_SL_NHLFE_NH_INTF_NAME_TOOLONG SLErrorStatus_SLErrno = 40966 + // Number of labels in the path exceeds system capabilities. 0xa007 + SLErrorStatus_SL_NHLFE_INVALID_LABEL_COUNT SLErrorStatus_SLErrno = 40967 + // Path id is invalid in NHLFE. 0xa008 + SLErrorStatus_SL_NHLFE_INVALID_PATH_ID SLErrorStatus_SLErrno = 40968 + // MPLS NHLFE label value out of range. 0xa009 + SLErrorStatus_SL_NHLFE_INVALID_LABEL SLErrorStatus_SLErrno = 40969 + // NHLFE has an invalid protection bitmap. 0xa00a + SLErrorStatus_SL_NHLFE_INVALID_PROTECTED_BITMAP SLErrorStatus_SLErrno = 40970 + // Number of remote backup addresses in the NHLFE exceeds + // system capabilities. 0xa00b + SLErrorStatus_SL_NHLFE_INVALID_REMOTE_ADDR_COUNT SLErrorStatus_SLErrno = 40971 + // Size of IPv6 remote backup address is invalid. 0xa00c + SLErrorStatus_SL_NHLFE_REMOTE_ADDR_INVALID_SZ SLErrorStatus_SLErrno = 40972 + // A primary NHLFE has too many labels. 0xa00d + SLErrorStatus_SL_NHLFE_PRIMARY_TOOMANY_LABELS SLErrorStatus_SLErrno = 40973 + // A primary NHLFE has too many remote addresses. 0xa00e + SLErrorStatus_SL_NHLFE_PRIMARY_TOOMANY_REMOTE_ADDR SLErrorStatus_SLErrno = 40974 + // Too many pure backup NHLFE with same Path ID. 0xa00f + SLErrorStatus_SL_NHLFE_BACKUP_ID_REPEATED SLErrorStatus_SLErrno = 40975 + // Too many primary NHLFE with same Path ID. 0xa010 + SLErrorStatus_SL_NHLFE_PRIMARY_ID_REPEATED SLErrorStatus_SLErrno = 40976 + // Pure backup NHLFE has a empty protected bitmap. 0xa011 + SLErrorStatus_SL_NHLFE_BACKUP_PROTECTED_BITMAP_EMPTY SLErrorStatus_SLErrno = 40977 + // A primary NHLFE has too many backup paths. 0xa012 + SLErrorStatus_SL_NHLFE_PRIMARY_TOOMANY_BACKUP_PATHS SLErrorStatus_SLErrno = 40978 + // A pure backup remote address is invalid. 0xa013 + SLErrorStatus_SL_NHLFE_REMOTE_ADDR_INVALID SLErrorStatus_SLErrno = 40979 + // Protection bitmap of a backup NHLFE refers to a missing path. 0xa014 + SLErrorStatus_SL_NHLFE_BACKUP_MISSING_PRIMARY_PATH SLErrorStatus_SLErrno = 40980 + // NHLFE next-hop missing. 0xa015 + SLErrorStatus_SL_NHLFE_NEXT_HOP_MISSING SLErrorStatus_SLErrno = 40981 + // Label action specified is invalid. 0xa016 + SLErrorStatus_SL_NHLFE_LABEL_ACTION_INVALID SLErrorStatus_SLErrno = 40982 + // NHLFE next hop interface not found. 0xa017 + SLErrorStatus_SL_NHLFE_NH_INTF_NOT_FOUND SLErrorStatus_SLErrno = 40983 + // MPLS NHLFE operation failed. 0xa018 + SLErrorStatus_SL_NHLFE_OPER_FAILED SLErrorStatus_SLErrno = 40984 + // MPLS NHLFE label action missing. 0xa019 + SLErrorStatus_SL_NHLFE_LABEL_ACTION_MISSING SLErrorStatus_SLErrno = 40985 + // Offset for label block errors. 0xb000 + SLErrorStatus_SL_LABEL_BLK_ERR_OFFSET SLErrorStatus_SLErrno = 45056 + // MPLS label block add from Label Switching Database failed. 0xb001 + SLErrorStatus_SL_LABEL_BLK_LSD_ADD_FAILED SLErrorStatus_SLErrno = 45057 + // MPLS label block delete from Label Switching Database failed. 0xb002 + SLErrorStatus_SL_LABEL_BLK_LSD_DELETE_FAILED SLErrorStatus_SLErrno = 45058 + // MPLS label block not found. 0xb003 + SLErrorStatus_SL_LABEL_BLK_LSD_LABEL_BLK_NOT_FOUND SLErrorStatus_SLErrno = 45059 + // MPLS label block in use. 0xb004 + SLErrorStatus_SL_LABEL_BLK_LSD_LABEL_BLK_IN_USE SLErrorStatus_SLErrno = 45060 + // MPLS label block attribute invalid. 0xb005 + SLErrorStatus_SL_LABEL_BLK_LSD_INVALID_ATTRIB SLErrorStatus_SLErrno = 45061 + // MPLS label block size > max size per block. 0xb006 + SLErrorStatus_SL_LABEL_BLK_INVALID_BLOCK_SIZE SLErrorStatus_SLErrno = 45062 + // MPLS label start_label < min label for platform . 0xb007 + SLErrorStatus_SL_LABEL_BLK_INVALID_START_LABEL SLErrorStatus_SLErrno = 45063 + // MPLS label block already exists in the database. 0xb008 + SLErrorStatus_SL_LABEL_BLK_EEXIST SLErrorStatus_SLErrno = 45064 + // MPLS label database is out of memory. 0xb009 + SLErrorStatus_SL_LABEL_BLK_DB_NOMEM SLErrorStatus_SLErrno = 45065 + // Offset for MPLS registration errors. 0xc000 + SLErrorStatus_SL_MPLS_REG_ERR_OFFSET SLErrorStatus_SLErrno = 49152 + // MPLS registration error. 0xc001 + SLErrorStatus_SL_MPLS_REG_ERR SLErrorStatus_SLErrno = 49153 + // MPLS unregistration error. 0xc002 + SLErrorStatus_SL_MPLS_UNREG_ERR SLErrorStatus_SLErrno = 49154 + // MPLS EOF error. 0xc003 + SLErrorStatus_SL_MPLS_EOF_ERR SLErrorStatus_SLErrno = 49155 + // Offset for Interface operation errors. 0xd000 + SLErrorStatus_SL_RPC_INTF_START_OFFSET SLErrorStatus_SLErrno = 53248 + // Interface Operation rejected for ALL Sessions as the Interface + // Session count is beyond supported limit. 0xd001 + SLErrorStatus_SL_RPC_INTF_TOO_MANY_INTERFACES SLErrorStatus_SLErrno = 53249 + // Interface Operation rejected as server is not initialized. 0xd002 + SLErrorStatus_SL_RPC_INTF_SERVER_NOT_INITIALIZED SLErrorStatus_SLErrno = 53250 + // Interface Operation failed as server is not registered with + // interface manager. 0xd003 + SLErrorStatus_SL_RPC_INTF_API_CLIENT_NOT_REGISTERED SLErrorStatus_SLErrno = 53251 + // Offset for Interface object errors. 0xe000 + SLErrorStatus_SL_INTF_START_OFFSET SLErrorStatus_SLErrno = 57344 + // Interface object's interface name missing. 0xe001 + SLErrorStatus_SL_INTF_INTERFACE_NAME_MISSING SLErrorStatus_SLErrno = 57345 + // Interface object's interface name exceeds supported length. 0xe002 + SLErrorStatus_SL_INTF_INTERFACE_NAME_TOOLONG SLErrorStatus_SLErrno = 57346 + // Interface internal registration error. 0xe003 + SLErrorStatus_SL_INTF_INTERFACE_REG_ERR SLErrorStatus_SLErrno = 57347 + // Internal database error. 0xe004 + SLErrorStatus_SL_INTF_INTERNAL_DB_ERROR SLErrorStatus_SLErrno = 57348 + // Interface Recovery error. 0xe005 + SLErrorStatus_SL_INTF_RECOVERY_ERROR SLErrorStatus_SLErrno = 57349 + // Interface exists. 0xe006 + SLErrorStatus_SL_INTF_INTERFACE_EXISTS SLErrorStatus_SLErrno = 57350 + // Interface not found. 0xe007 + SLErrorStatus_SL_INTF_INTERFACE_NOT_FOUND SLErrorStatus_SLErrno = 57351 + // Offset for Internal errors. 0x100000 + SLErrorStatus_SL_INTERNAL_START_OFFSET SLErrorStatus_SLErrno = 1048576 +) + +var SLErrorStatus_SLErrno_name = map[int32]string{ + 0: "SL_SUCCESS", + 1: "SL_NOT_CONNECTED", + 2: "SL_EAGAIN", + 3: "SL_ENOMEM", + 4: "SL_EBUSY", + 5: "SL_EINVAL", + 6: "SL_UNSUPPORTED_VER", + 7: "SL_NOT_AVAILABLE", + 8: "SL_STREAM_NOT_SUPPORTED", + 9: "SL_ENOTSUP", + 10: "SL_SOME_ERR", + 11: "SL_TIMEOUT", + 12: "SL_NOTIF_TERM", + 1280: "SL_INIT_START_OFFSET", + 1281: "SL_INIT_STATE_CLEAR", + 1282: "SL_INIT_STATE_READY", + 1283: "SL_INIT_UNSUPPORTED_VER", + 1284: "SL_INIT_SERVER_NOT_INITIALIZED", + 1285: "SL_INIT_SERVER_MODE_CHANGE_FAILED", + 4096: "SL_RPC_VRF_START_OFFSET", + 4097: "SL_RPC_VRF_TOO_MANY_VRF_REG_MSGS", + 4098: "SL_RPC_VRF_SERVER_NOT_INITIALIZED", + 8192: "SL_VRF_START_OFFSET", + 8193: "SL_VRF_NAME_TOOLONG", + 8194: "SL_VRF_NOT_FOUND", + 8195: "SL_VRF_NO_TABLE_ID", + 8196: "SL_VRF_REG_INVALID_ADMIN_DISTANCE", + 8197: "SL_VRF_TABLE_ADD_ERR", + 8198: "SL_VRF_TABLE_REGISTRATION_ERR", + 8199: "SL_VRF_TABLE_UNREGISTRATION_ERR", + 8200: "SL_VRF_TABLE_EOF_ERR", + 8201: "SL_VRF_REG_VRF_NAME_MISSING", + 12288: "SL_RPC_ROUTE_START_OFFSET", + 12289: "SL_RPC_ROUTE_TOO_MANY_ROUTES", + 12290: "SL_RPC_ROUTE_VRF_NAME_TOOLONG", + 12291: "SL_RPC_ROUTE_VRF_NOT_FOUND", + 12292: "SL_RPC_ROUTE_VRF_NO_TABLE", + 12293: "SL_RPC_ROUTE_VRF_TABLE_NOT_REGISTERED", + 12294: "SL_RPC_ROUTE_VRF_NAME_MISSING", + 12295: "SL_RPC_ROUTE_INIT_MODE_INCOMPATIBLE", + 12296: "SL_RPC_ROUTE_SERVER_NOT_INITIALIZED", + 16384: "SL_ROUTE_START_OFFSET", + 16385: "SL_ROUTE_ADD_NO_PATHS", + 16386: "SL_ROUTE_UPDATE_NO_PATHS", + 16387: "SL_ROUTE_INVALID_PREFIX_LEN", + 16388: "SL_ROUTE_INVALID_ADMIN_DISTANCE", + 16389: "SL_ROUTE_INVALID_NUM_PATHS", + 16390: "SL_ROUTE_INVALID_PREFIX_SZ", + 16391: "SL_ROUTE_INVALID_PREFIX", + 16392: "SL_ROUTE_ERR_RIB_TABLE_LIMIT_REACHED", + 16393: "SL_ROUTE_ERR_RIB_INVALID_ARGS", + 16394: "SL_ROUTE_ERR_RIB_PATH_TABLE_LIMIT", + 16395: "SL_ROUTE_ERR_RIB_TOOMANYPATHS", + 16396: "SL_ROUTE_EEXIST", + 16397: "SL_ROUTE_HOST_BITS_SET", + 16398: "SL_ROUTE_INVALID_PREFIX_MCAST", + 16399: "SL_ROUTE_PATH_AFI_MISMATCH", + 16400: "SL_ROUTE_TOOMANY_PRIMARY_PATHS", + 16401: "SL_ROUTE_TOOMANY_BACKUP_PATHS", + 16402: "SL_ROUTE_DB_NOMEM", + 16403: "SL_ROUTE_INVALID_LOCAL_LABEL", + 20480: "SL_PATH_START_OFFSET", + 20481: "SL_PATH_NH_NO_TABLE", + 20482: "SL_PATH_NH_INTF_NOT_FOUND", + 20483: "SL_PATH_INVALID_LABEL_COUNT", + 20484: "SL_PATH_INVALID_ID", + 20485: "SL_PATH_VRF_NAME_TOOLONG", + 20486: "SL_PATH_NH_INTF_NAME_TOOLONG", + 20487: "SL_PATH_NH_INVALID_ADDR_SZ", + 20488: "SL_PATH_NH_INF_NAME_MISSING", + 20489: "SL_PATH_INVALID_NEXT_HOP_ADDR", + 20490: "SL_PATH_INVALID_REMOTE_ADDR_COUNT", + 20491: "SL_PATH_REMOTE_ADDR_INVALID_SZ", + 20492: "SL_PATH_REMOTE_ADDR_AFI_MISMATCH", + 20493: "SL_PATH_INVALID_PROTECTED_BITMAP", + 20494: "SL_PATH_BACKUP_MISSING_PRIMARY_PATH", + 20495: "SL_PATH_PRIMARY_ID_REPEATED", + 20496: "SL_PATH_BACKUP_ID_REPEATED", + 20497: "SL_PATH_PRIMARY_TOOMANY_BACKUP_PATHS", + 20498: "SL_PATH_PRIMARY_TOOMANY_LABELS", + 20499: "SL_PATH_PRIMARY_TOOMANY_REMOTE_ADDR", + 20500: "SL_PATH_REMOTE_ADDR_INVALID", + 20501: "SL_PATH_INVALID_LABEL", + 24576: "SL_RPC_BFD_START_OFFSET", + 24577: "SL_RPC_BFD_TOO_MANY_BFD_SESSIONS", + 24578: "SL_RPC_BFD_API_BAD_PARAMETER", + 24579: "SL_RPC_BFD_API_CLIENT_NOT_REGISTERED", + 24580: "SL_RPC_BFD_API_INTERNAL_ERROR", + 24581: "SL_RPC_BFD_SERVER_NOT_INITIALIZED", + 24582: "SL_RPC_BFD_V4_NOT_REGISTERED", + 24583: "SL_RPC_BFD_V6_NOT_REGISTERED", + 28672: "SL_BFD_START_OFFSET", + 28673: "SL_BFD_INTF_NAME_TOOLONG", + 28674: "SL_BFD_INTF_NOT_FOUND", + 28675: "SL_BFD_INVALID_ATTRIBUTE", + 28676: "SL_BFD_INTF_NAME_MISSING", + 28677: "SL_BFD_INVALID_NBR_MCAST", + 28678: "SL_BFD_INVALID_NBR", + 28679: "SL_BFD_VRF_NAME_TOOLONG", + 28680: "SL_BFD_BAD_PARAMETER", + 28681: "SL_BFD_API_INTERNAL_ERROR", + 28682: "SL_BFD_VRF_NOT_FOUND", + 28683: "SL_BFD_INVALID_PREFIX_SIZE", + 28684: "SL_BFD_INVALID_SESSION_TYPE", + 28685: "SL_BFD_INVALID_VRF", + 28686: "SL_BFD_SESSION_NOT_FOUND", + 28687: "SL_BFD_SESSION_EXISTS", + 28688: "SL_BFD_INTERNAL_DB_ERROR", + 28689: "SL_BFD_RECOVERY_ERROR", + 32768: "SL_RPC_MPLS_START_OFFSET", + 32769: "SL_RPC_MPLS_ILM_TOO_MANY_ILMS", + 32770: "SL_RPC_MPLS_SERVER_NOT_INITIALIZED", + 32771: "SL_RPC_MPLS_INIT_MODE_INCOMPATIBLE", + 32772: "SL_RPC_MPLS_LABEL_BLK_TOO_MANY_LABEL_BLKS", + 32773: "SL_RPC_MPLS_NOT_REGISTERED", + 36864: "SL_ILM_ERR_OFFSET", + 36865: "SL_ILM_ADD_FAILED", + 36866: "SL_ILM_LSD_ADD_FAILED", + 36867: "SL_ILM_INVALID_NUM_NHLFE", + 36868: "SL_ILM_INVALID_LABEL", + 36869: "SL_ILM_DELETE_FAILED", + 36870: "SL_ILM_LSD_DELETE_FAILED", + 36871: "SL_ILM_TOOMANY_PRIMARY_NHLFES", + 36872: "SL_ILM_TOOMANY_BACKUP_NHLFES", + 36873: "SL_ILM_LSD_ADD_LABEL_ALLOC_FAILED", + 36874: "SL_ILM_LSD_NHLFE_INVALID_ATTRIB", + 36875: "SL_ILM_EEXIST", + 36876: "SL_ILM_DB_NOMEM", + 40960: "SL_NHLFE_ERR_OFFSET", + 40961: "SL_NHLFE_NH_NO_TABLE", + 40962: "SL_NHLFE_NH_INVALID_ADDR_SZ", + 40963: "SL_NHLFE_INVALID_NEXT_HOP_ADDR", + 40964: "SL_NHLFE_VRF_NAME_TOOLONG", + 40965: "SL_NHLFE_NH_INF_NAME_MISSING", + 40966: "SL_NHLFE_NH_INTF_NAME_TOOLONG", + 40967: "SL_NHLFE_INVALID_LABEL_COUNT", + 40968: "SL_NHLFE_INVALID_PATH_ID", + 40969: "SL_NHLFE_INVALID_LABEL", + 40970: "SL_NHLFE_INVALID_PROTECTED_BITMAP", + 40971: "SL_NHLFE_INVALID_REMOTE_ADDR_COUNT", + 40972: "SL_NHLFE_REMOTE_ADDR_INVALID_SZ", + 40973: "SL_NHLFE_PRIMARY_TOOMANY_LABELS", + 40974: "SL_NHLFE_PRIMARY_TOOMANY_REMOTE_ADDR", + 40975: "SL_NHLFE_BACKUP_ID_REPEATED", + 40976: "SL_NHLFE_PRIMARY_ID_REPEATED", + 40977: "SL_NHLFE_BACKUP_PROTECTED_BITMAP_EMPTY", + 40978: "SL_NHLFE_PRIMARY_TOOMANY_BACKUP_PATHS", + 40979: "SL_NHLFE_REMOTE_ADDR_INVALID", + 40980: "SL_NHLFE_BACKUP_MISSING_PRIMARY_PATH", + 40981: "SL_NHLFE_NEXT_HOP_MISSING", + 40982: "SL_NHLFE_LABEL_ACTION_INVALID", + 40983: "SL_NHLFE_NH_INTF_NOT_FOUND", + 40984: "SL_NHLFE_OPER_FAILED", + 40985: "SL_NHLFE_LABEL_ACTION_MISSING", + 45056: "SL_LABEL_BLK_ERR_OFFSET", + 45057: "SL_LABEL_BLK_LSD_ADD_FAILED", + 45058: "SL_LABEL_BLK_LSD_DELETE_FAILED", + 45059: "SL_LABEL_BLK_LSD_LABEL_BLK_NOT_FOUND", + 45060: "SL_LABEL_BLK_LSD_LABEL_BLK_IN_USE", + 45061: "SL_LABEL_BLK_LSD_INVALID_ATTRIB", + 45062: "SL_LABEL_BLK_INVALID_BLOCK_SIZE", + 45063: "SL_LABEL_BLK_INVALID_START_LABEL", + 45064: "SL_LABEL_BLK_EEXIST", + 45065: "SL_LABEL_BLK_DB_NOMEM", + 49152: "SL_MPLS_REG_ERR_OFFSET", + 49153: "SL_MPLS_REG_ERR", + 49154: "SL_MPLS_UNREG_ERR", + 49155: "SL_MPLS_EOF_ERR", + 53248: "SL_RPC_INTF_START_OFFSET", + 53249: "SL_RPC_INTF_TOO_MANY_INTERFACES", + 53250: "SL_RPC_INTF_SERVER_NOT_INITIALIZED", + 53251: "SL_RPC_INTF_API_CLIENT_NOT_REGISTERED", + 57344: "SL_INTF_START_OFFSET", + 57345: "SL_INTF_INTERFACE_NAME_MISSING", + 57346: "SL_INTF_INTERFACE_NAME_TOOLONG", + 57347: "SL_INTF_INTERFACE_REG_ERR", + 57348: "SL_INTF_INTERNAL_DB_ERROR", + 57349: "SL_INTF_RECOVERY_ERROR", + 57350: "SL_INTF_INTERFACE_EXISTS", + 57351: "SL_INTF_INTERFACE_NOT_FOUND", + 1048576: "SL_INTERNAL_START_OFFSET", +} +var SLErrorStatus_SLErrno_value = map[string]int32{ + "SL_SUCCESS": 0, + "SL_NOT_CONNECTED": 1, + "SL_EAGAIN": 2, + "SL_ENOMEM": 3, + "SL_EBUSY": 4, + "SL_EINVAL": 5, + "SL_UNSUPPORTED_VER": 6, + "SL_NOT_AVAILABLE": 7, + "SL_STREAM_NOT_SUPPORTED": 8, + "SL_ENOTSUP": 9, + "SL_SOME_ERR": 10, + "SL_TIMEOUT": 11, + "SL_NOTIF_TERM": 12, + "SL_INIT_START_OFFSET": 1280, + "SL_INIT_STATE_CLEAR": 1281, + "SL_INIT_STATE_READY": 1282, + "SL_INIT_UNSUPPORTED_VER": 1283, + "SL_INIT_SERVER_NOT_INITIALIZED": 1284, + "SL_INIT_SERVER_MODE_CHANGE_FAILED": 1285, + "SL_RPC_VRF_START_OFFSET": 4096, + "SL_RPC_VRF_TOO_MANY_VRF_REG_MSGS": 4097, + "SL_RPC_VRF_SERVER_NOT_INITIALIZED": 4098, + "SL_VRF_START_OFFSET": 8192, + "SL_VRF_NAME_TOOLONG": 8193, + "SL_VRF_NOT_FOUND": 8194, + "SL_VRF_NO_TABLE_ID": 8195, + "SL_VRF_REG_INVALID_ADMIN_DISTANCE": 8196, + "SL_VRF_TABLE_ADD_ERR": 8197, + "SL_VRF_TABLE_REGISTRATION_ERR": 8198, + "SL_VRF_TABLE_UNREGISTRATION_ERR": 8199, + "SL_VRF_TABLE_EOF_ERR": 8200, + "SL_VRF_REG_VRF_NAME_MISSING": 8201, + "SL_RPC_ROUTE_START_OFFSET": 12288, + "SL_RPC_ROUTE_TOO_MANY_ROUTES": 12289, + "SL_RPC_ROUTE_VRF_NAME_TOOLONG": 12290, + "SL_RPC_ROUTE_VRF_NOT_FOUND": 12291, + "SL_RPC_ROUTE_VRF_NO_TABLE": 12292, + "SL_RPC_ROUTE_VRF_TABLE_NOT_REGISTERED": 12293, + "SL_RPC_ROUTE_VRF_NAME_MISSING": 12294, + "SL_RPC_ROUTE_INIT_MODE_INCOMPATIBLE": 12295, + "SL_RPC_ROUTE_SERVER_NOT_INITIALIZED": 12296, + "SL_ROUTE_START_OFFSET": 16384, + "SL_ROUTE_ADD_NO_PATHS": 16385, + "SL_ROUTE_UPDATE_NO_PATHS": 16386, + "SL_ROUTE_INVALID_PREFIX_LEN": 16387, + "SL_ROUTE_INVALID_ADMIN_DISTANCE": 16388, + "SL_ROUTE_INVALID_NUM_PATHS": 16389, + "SL_ROUTE_INVALID_PREFIX_SZ": 16390, + "SL_ROUTE_INVALID_PREFIX": 16391, + "SL_ROUTE_ERR_RIB_TABLE_LIMIT_REACHED": 16392, + "SL_ROUTE_ERR_RIB_INVALID_ARGS": 16393, + "SL_ROUTE_ERR_RIB_PATH_TABLE_LIMIT": 16394, + "SL_ROUTE_ERR_RIB_TOOMANYPATHS": 16395, + "SL_ROUTE_EEXIST": 16396, + "SL_ROUTE_HOST_BITS_SET": 16397, + "SL_ROUTE_INVALID_PREFIX_MCAST": 16398, + "SL_ROUTE_PATH_AFI_MISMATCH": 16399, + "SL_ROUTE_TOOMANY_PRIMARY_PATHS": 16400, + "SL_ROUTE_TOOMANY_BACKUP_PATHS": 16401, + "SL_ROUTE_DB_NOMEM": 16402, + "SL_ROUTE_INVALID_LOCAL_LABEL": 16403, + "SL_PATH_START_OFFSET": 20480, + "SL_PATH_NH_NO_TABLE": 20481, + "SL_PATH_NH_INTF_NOT_FOUND": 20482, + "SL_PATH_INVALID_LABEL_COUNT": 20483, + "SL_PATH_INVALID_ID": 20484, + "SL_PATH_VRF_NAME_TOOLONG": 20485, + "SL_PATH_NH_INTF_NAME_TOOLONG": 20486, + "SL_PATH_NH_INVALID_ADDR_SZ": 20487, + "SL_PATH_NH_INF_NAME_MISSING": 20488, + "SL_PATH_INVALID_NEXT_HOP_ADDR": 20489, + "SL_PATH_INVALID_REMOTE_ADDR_COUNT": 20490, + "SL_PATH_REMOTE_ADDR_INVALID_SZ": 20491, + "SL_PATH_REMOTE_ADDR_AFI_MISMATCH": 20492, + "SL_PATH_INVALID_PROTECTED_BITMAP": 20493, + "SL_PATH_BACKUP_MISSING_PRIMARY_PATH": 20494, + "SL_PATH_PRIMARY_ID_REPEATED": 20495, + "SL_PATH_BACKUP_ID_REPEATED": 20496, + "SL_PATH_PRIMARY_TOOMANY_BACKUP_PATHS": 20497, + "SL_PATH_PRIMARY_TOOMANY_LABELS": 20498, + "SL_PATH_PRIMARY_TOOMANY_REMOTE_ADDR": 20499, + "SL_PATH_REMOTE_ADDR_INVALID": 20500, + "SL_PATH_INVALID_LABEL": 20501, + "SL_RPC_BFD_START_OFFSET": 24576, + "SL_RPC_BFD_TOO_MANY_BFD_SESSIONS": 24577, + "SL_RPC_BFD_API_BAD_PARAMETER": 24578, + "SL_RPC_BFD_API_CLIENT_NOT_REGISTERED": 24579, + "SL_RPC_BFD_API_INTERNAL_ERROR": 24580, + "SL_RPC_BFD_SERVER_NOT_INITIALIZED": 24581, + "SL_RPC_BFD_V4_NOT_REGISTERED": 24582, + "SL_RPC_BFD_V6_NOT_REGISTERED": 24583, + "SL_BFD_START_OFFSET": 28672, + "SL_BFD_INTF_NAME_TOOLONG": 28673, + "SL_BFD_INTF_NOT_FOUND": 28674, + "SL_BFD_INVALID_ATTRIBUTE": 28675, + "SL_BFD_INTF_NAME_MISSING": 28676, + "SL_BFD_INVALID_NBR_MCAST": 28677, + "SL_BFD_INVALID_NBR": 28678, + "SL_BFD_VRF_NAME_TOOLONG": 28679, + "SL_BFD_BAD_PARAMETER": 28680, + "SL_BFD_API_INTERNAL_ERROR": 28681, + "SL_BFD_VRF_NOT_FOUND": 28682, + "SL_BFD_INVALID_PREFIX_SIZE": 28683, + "SL_BFD_INVALID_SESSION_TYPE": 28684, + "SL_BFD_INVALID_VRF": 28685, + "SL_BFD_SESSION_NOT_FOUND": 28686, + "SL_BFD_SESSION_EXISTS": 28687, + "SL_BFD_INTERNAL_DB_ERROR": 28688, + "SL_BFD_RECOVERY_ERROR": 28689, + "SL_RPC_MPLS_START_OFFSET": 32768, + "SL_RPC_MPLS_ILM_TOO_MANY_ILMS": 32769, + "SL_RPC_MPLS_SERVER_NOT_INITIALIZED": 32770, + "SL_RPC_MPLS_INIT_MODE_INCOMPATIBLE": 32771, + "SL_RPC_MPLS_LABEL_BLK_TOO_MANY_LABEL_BLKS": 32772, + "SL_RPC_MPLS_NOT_REGISTERED": 32773, + "SL_ILM_ERR_OFFSET": 36864, + "SL_ILM_ADD_FAILED": 36865, + "SL_ILM_LSD_ADD_FAILED": 36866, + "SL_ILM_INVALID_NUM_NHLFE": 36867, + "SL_ILM_INVALID_LABEL": 36868, + "SL_ILM_DELETE_FAILED": 36869, + "SL_ILM_LSD_DELETE_FAILED": 36870, + "SL_ILM_TOOMANY_PRIMARY_NHLFES": 36871, + "SL_ILM_TOOMANY_BACKUP_NHLFES": 36872, + "SL_ILM_LSD_ADD_LABEL_ALLOC_FAILED": 36873, + "SL_ILM_LSD_NHLFE_INVALID_ATTRIB": 36874, + "SL_ILM_EEXIST": 36875, + "SL_ILM_DB_NOMEM": 36876, + "SL_NHLFE_ERR_OFFSET": 40960, + "SL_NHLFE_NH_NO_TABLE": 40961, + "SL_NHLFE_NH_INVALID_ADDR_SZ": 40962, + "SL_NHLFE_INVALID_NEXT_HOP_ADDR": 40963, + "SL_NHLFE_VRF_NAME_TOOLONG": 40964, + "SL_NHLFE_NH_INF_NAME_MISSING": 40965, + "SL_NHLFE_NH_INTF_NAME_TOOLONG": 40966, + "SL_NHLFE_INVALID_LABEL_COUNT": 40967, + "SL_NHLFE_INVALID_PATH_ID": 40968, + "SL_NHLFE_INVALID_LABEL": 40969, + "SL_NHLFE_INVALID_PROTECTED_BITMAP": 40970, + "SL_NHLFE_INVALID_REMOTE_ADDR_COUNT": 40971, + "SL_NHLFE_REMOTE_ADDR_INVALID_SZ": 40972, + "SL_NHLFE_PRIMARY_TOOMANY_LABELS": 40973, + "SL_NHLFE_PRIMARY_TOOMANY_REMOTE_ADDR": 40974, + "SL_NHLFE_BACKUP_ID_REPEATED": 40975, + "SL_NHLFE_PRIMARY_ID_REPEATED": 40976, + "SL_NHLFE_BACKUP_PROTECTED_BITMAP_EMPTY": 40977, + "SL_NHLFE_PRIMARY_TOOMANY_BACKUP_PATHS": 40978, + "SL_NHLFE_REMOTE_ADDR_INVALID": 40979, + "SL_NHLFE_BACKUP_MISSING_PRIMARY_PATH": 40980, + "SL_NHLFE_NEXT_HOP_MISSING": 40981, + "SL_NHLFE_LABEL_ACTION_INVALID": 40982, + "SL_NHLFE_NH_INTF_NOT_FOUND": 40983, + "SL_NHLFE_OPER_FAILED": 40984, + "SL_NHLFE_LABEL_ACTION_MISSING": 40985, + "SL_LABEL_BLK_ERR_OFFSET": 45056, + "SL_LABEL_BLK_LSD_ADD_FAILED": 45057, + "SL_LABEL_BLK_LSD_DELETE_FAILED": 45058, + "SL_LABEL_BLK_LSD_LABEL_BLK_NOT_FOUND": 45059, + "SL_LABEL_BLK_LSD_LABEL_BLK_IN_USE": 45060, + "SL_LABEL_BLK_LSD_INVALID_ATTRIB": 45061, + "SL_LABEL_BLK_INVALID_BLOCK_SIZE": 45062, + "SL_LABEL_BLK_INVALID_START_LABEL": 45063, + "SL_LABEL_BLK_EEXIST": 45064, + "SL_LABEL_BLK_DB_NOMEM": 45065, + "SL_MPLS_REG_ERR_OFFSET": 49152, + "SL_MPLS_REG_ERR": 49153, + "SL_MPLS_UNREG_ERR": 49154, + "SL_MPLS_EOF_ERR": 49155, + "SL_RPC_INTF_START_OFFSET": 53248, + "SL_RPC_INTF_TOO_MANY_INTERFACES": 53249, + "SL_RPC_INTF_SERVER_NOT_INITIALIZED": 53250, + "SL_RPC_INTF_API_CLIENT_NOT_REGISTERED": 53251, + "SL_INTF_START_OFFSET": 57344, + "SL_INTF_INTERFACE_NAME_MISSING": 57345, + "SL_INTF_INTERFACE_NAME_TOOLONG": 57346, + "SL_INTF_INTERFACE_REG_ERR": 57347, + "SL_INTF_INTERNAL_DB_ERROR": 57348, + "SL_INTF_RECOVERY_ERROR": 57349, + "SL_INTF_INTERFACE_EXISTS": 57350, + "SL_INTF_INTERFACE_NOT_FOUND": 57351, + "SL_INTERNAL_START_OFFSET": 1048576, +} + +func (x SLErrorStatus_SLErrno) String() string { + return proto.EnumName(SLErrorStatus_SLErrno_name, int32(x)) +} +func (SLErrorStatus_SLErrno) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// Status codes, including errors and success codes. +// All service layer errors are defined below. +type SLErrorStatus struct { + Status SLErrorStatus_SLErrno `protobuf:"varint,1,opt,name=Status,enum=service_layer.SLErrorStatus_SLErrno" json:"Status,omitempty"` +} + +func (m *SLErrorStatus) Reset() { *m = SLErrorStatus{} } +func (m *SLErrorStatus) String() string { return proto.CompactTextString(m) } +func (*SLErrorStatus) ProtoMessage() {} +func (*SLErrorStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *SLErrorStatus) GetStatus() SLErrorStatus_SLErrno { + if m != nil { + return m.Status + } + return SLErrorStatus_SL_SUCCESS +} + +// Interface info. +type SLInterface struct { + // One of Interface name or handle + // + // Types that are valid to be assigned to Interface: + // *SLInterface_Name + // *SLInterface_Handle + Interface isSLInterface_Interface `protobuf_oneof:"Interface"` +} + +func (m *SLInterface) Reset() { *m = SLInterface{} } +func (m *SLInterface) String() string { return proto.CompactTextString(m) } +func (*SLInterface) ProtoMessage() {} +func (*SLInterface) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +type isSLInterface_Interface interface { + isSLInterface_Interface() +} + +type SLInterface_Name struct { + Name string `protobuf:"bytes,1,opt,name=Name,oneof"` +} +type SLInterface_Handle struct { + Handle uint32 `protobuf:"varint,2,opt,name=Handle,oneof"` +} + +func (*SLInterface_Name) isSLInterface_Interface() {} +func (*SLInterface_Handle) isSLInterface_Interface() {} + +func (m *SLInterface) GetInterface() isSLInterface_Interface { + if m != nil { + return m.Interface + } + return nil +} + +func (m *SLInterface) GetName() string { + if x, ok := m.GetInterface().(*SLInterface_Name); ok { + return x.Name + } + return "" +} + +func (m *SLInterface) GetHandle() uint32 { + if x, ok := m.GetInterface().(*SLInterface_Handle); ok { + return x.Handle + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SLInterface) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SLInterface_OneofMarshaler, _SLInterface_OneofUnmarshaler, _SLInterface_OneofSizer, []interface{}{ + (*SLInterface_Name)(nil), + (*SLInterface_Handle)(nil), + } +} + +func _SLInterface_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SLInterface) + // Interface + switch x := m.Interface.(type) { + case *SLInterface_Name: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Name) + case *SLInterface_Handle: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.Handle)) + case nil: + default: + return fmt.Errorf("SLInterface.Interface has unexpected type %T", x) + } + return nil +} + +func _SLInterface_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SLInterface) + switch tag { + case 1: // Interface.Name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Interface = &SLInterface_Name{x} + return true, err + case 2: // Interface.Handle + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Interface = &SLInterface_Handle{uint32(x)} + return true, err + default: + return false, nil + } +} + +func _SLInterface_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SLInterface) + // Interface + switch x := m.Interface.(type) { + case *SLInterface_Name: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Name))) + n += len(x.Name) + case *SLInterface_Handle: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.Handle)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// One of IPv4 or IPv6 addresses. +type SLIpAddress struct { + // One of IPv4 or IPv6 address + // + // Types that are valid to be assigned to Address: + // *SLIpAddress_V4Address + // *SLIpAddress_V6Address + Address isSLIpAddress_Address `protobuf_oneof:"Address"` +} + +func (m *SLIpAddress) Reset() { *m = SLIpAddress{} } +func (m *SLIpAddress) String() string { return proto.CompactTextString(m) } +func (*SLIpAddress) ProtoMessage() {} +func (*SLIpAddress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isSLIpAddress_Address interface { + isSLIpAddress_Address() +} + +type SLIpAddress_V4Address struct { + V4Address uint32 `protobuf:"varint,1,opt,name=V4Address,oneof"` +} +type SLIpAddress_V6Address struct { + V6Address []byte `protobuf:"bytes,2,opt,name=V6Address,proto3,oneof"` +} + +func (*SLIpAddress_V4Address) isSLIpAddress_Address() {} +func (*SLIpAddress_V6Address) isSLIpAddress_Address() {} + +func (m *SLIpAddress) GetAddress() isSLIpAddress_Address { + if m != nil { + return m.Address + } + return nil +} + +func (m *SLIpAddress) GetV4Address() uint32 { + if x, ok := m.GetAddress().(*SLIpAddress_V4Address); ok { + return x.V4Address + } + return 0 +} + +func (m *SLIpAddress) GetV6Address() []byte { + if x, ok := m.GetAddress().(*SLIpAddress_V6Address); ok { + return x.V6Address + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SLIpAddress) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SLIpAddress_OneofMarshaler, _SLIpAddress_OneofUnmarshaler, _SLIpAddress_OneofSizer, []interface{}{ + (*SLIpAddress_V4Address)(nil), + (*SLIpAddress_V6Address)(nil), + } +} + +func _SLIpAddress_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SLIpAddress) + // Address + switch x := m.Address.(type) { + case *SLIpAddress_V4Address: + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.V4Address)) + case *SLIpAddress_V6Address: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.V6Address) + case nil: + default: + return fmt.Errorf("SLIpAddress.Address has unexpected type %T", x) + } + return nil +} + +func _SLIpAddress_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SLIpAddress) + switch tag { + case 1: // Address.V4Address + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Address = &SLIpAddress_V4Address{uint32(x)} + return true, err + case 2: // Address.V6Address + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Address = &SLIpAddress_V6Address{x} + return true, err + default: + return false, nil + } +} + +func _SLIpAddress_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SLIpAddress) + // Address + switch x := m.Address.(type) { + case *SLIpAddress_V4Address: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.V4Address)) + case *SLIpAddress_V6Address: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.V6Address))) + n += len(x.V6Address) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*SLErrorStatus)(nil), "service_layer.SLErrorStatus") + proto.RegisterType((*SLInterface)(nil), "service_layer.SLInterface") + proto.RegisterType((*SLIpAddress)(nil), "service_layer.SLIpAddress") + proto.RegisterEnum("service_layer.SLRegOp", SLRegOp_name, SLRegOp_value) + proto.RegisterEnum("service_layer.SLObjectOp", SLObjectOp_name, SLObjectOp_value) + proto.RegisterEnum("service_layer.SLNotifOp", SLNotifOp_name, SLNotifOp_value) + proto.RegisterEnum("service_layer.SLErrorStatus_SLErrno", SLErrorStatus_SLErrno_name, SLErrorStatus_SLErrno_value) +} + +func init() { proto.RegisterFile("sl_common_types.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2282 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x59, 0xc9, 0x72, 0x1c, 0xb7, + 0x19, 0x56, 0xf7, 0x38, 0x92, 0x09, 0x49, 0x36, 0x0c, 0x4b, 0x16, 0x65, 0xc9, 0x12, 0x45, 0x2d, + 0x91, 0x95, 0x94, 0x5c, 0x95, 0xb8, 0x7c, 0xca, 0x81, 0x3d, 0xdd, 0x18, 0x0e, 0xac, 0x5e, 0xa6, + 0x00, 0x0c, 0x4b, 0xd4, 0x05, 0xd4, 0x32, 0x4e, 0x39, 0x25, 0x89, 0x2a, 0x92, 0x49, 0x95, 0x6f, + 0x3d, 0x9c, 0xe1, 0xa6, 0x7d, 0xb1, 0xb3, 0xdc, 0xfa, 0x31, 0x72, 0xec, 0x47, 0x99, 0x63, 0x1e, + 0x23, 0xd5, 0x68, 0xa0, 0xa7, 0x81, 0x9e, 0xd1, 0x8d, 0x8d, 0xef, 0x03, 0xfe, 0x1f, 0xff, 0x3e, + 0x20, 0x38, 0xbb, 0xfd, 0x58, 0x3c, 0xdc, 0x7c, 0xf2, 0x64, 0xf3, 0xa9, 0xd8, 0xf9, 0xe5, 0xd9, + 0x60, 0xfb, 0xf6, 0xb3, 0xad, 0xcd, 0x9d, 0x4d, 0x74, 0x7a, 0x7b, 0xb0, 0xf5, 0x8f, 0x9f, 0x1f, + 0x0e, 0xc4, 0xe3, 0xfb, 0xbf, 0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 0x18, + 0x87, 0xaf, 0x2d, 0xcb, 0x49, 0xfd, 0xbc, 0x0e, 0x29, 0x62, 0x2e, 0xf2, 0xb8, 0xdf, 0x85, 0x6f, + 0x52, 0x07, 0x5d, 0x93, 0x55, 0xb5, 0xca, 0x24, 0x99, 0x48, 0x3d, 0x4a, 0x22, 0x8f, 0xae, 0x2b, + 0x0f, 0xbc, 0xb5, 0x84, 0x69, 0x56, 0xdb, 0xf3, 0xef, 0xf4, 0x7b, 0x8a, 0xf4, 0x2e, 0x75, 0xd0, + 0x39, 0xf0, 0x45, 0x45, 0x0a, 0xda, 0xa2, 0x6c, 0x68, 0xef, 0x53, 0x07, 0x2d, 0x97, 0x19, 0x6b, + 0xa8, 0x1a, 0x26, 0xbe, 0x17, 0x8a, 0xd0, 0x6b, 0xe3, 0x10, 0x7e, 0x48, 0x1d, 0xf4, 0xb5, 0x2c, + 0x19, 0x52, 0x47, 0x33, 0x50, 0x33, 0x07, 0x9d, 0x97, 0x55, 0x52, 0x62, 0x71, 0x77, 0x9a, 0x83, + 0xc3, 0xcc, 0x41, 0x97, 0x65, 0x92, 0x6a, 0x88, 0xc4, 0xdc, 0xa8, 0x97, 0x99, 0x8e, 0x53, 0x49, + 0xa8, 0x44, 0x17, 0x42, 0x85, 0x9f, 0xf4, 0x63, 0x0e, 0x47, 0x99, 0x83, 0x16, 0x65, 0x4d, 0x35, + 0x28, 0x24, 0x80, 0xe3, 0x4c, 0x27, 0x81, 0x44, 0x1a, 0x25, 0x64, 0x2f, 0xd3, 0x17, 0x33, 0xa5, + 0xd7, 0x39, 0xfb, 0x99, 0x76, 0xc1, 0x94, 0xa3, 0xf3, 0x20, 0xa0, 0x45, 0xf0, 0x1e, 0x98, 0x2a, + 0x4a, 0x86, 0x55, 0x1a, 0x0e, 0x33, 0x6d, 0x7f, 0x43, 0xc5, 0x18, 0xdf, 0xe5, 0xa2, 0x9b, 0xf4, + 0xe4, 0x51, 0xf0, 0x28, 0xd3, 0x41, 0x69, 0x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0x79, 0xeb, 0x01, 0x38, 0xc1, 0x42, + 0x3a, 0xf8, 0x6b, 0xf2, 0x0c, 0x9d, 0x2d, 0x5f, 0x44, 0xf0, 0x6a, 0xd2, 0x13, 0x14, 0xcb, 0x88, + 0x09, 0xe0, 0x31, 0x6b, 0xb9, 0x8c, 0x06, 0xe8, 0xa0, 0x73, 0x32, 0x89, 0xca, 0x65, 0xfd, 0xae, + 0x8a, 0x29, 0x74, 0x11, 0x04, 0xa7, 0x2a, 0x00, 0x27, 0x1d, 0xd8, 0xba, 0x25, 0x00, 0x60, 0x61, + 0xf2, 0xe0, 0x6f, 0x83, 0x87, 0x3b, 0x95, 0x98, 0xa4, 0xfd, 0xa3, 0x29, 0xa6, 0xdc, 0x56, 0x2e, + 0x7b, 0x41, 0x00, 0x1d, 0xf4, 0xa5, 0x4c, 0x90, 0x72, 0xa5, 0x7c, 0xd4, 0x83, 0xae, 0xb1, 0x58, + 0x16, 0x29, 0xd8, 0xba, 0xc5, 0xc0, 0x02, 0x0b, 0xe3, 0xcd, 0x9d, 0x9f, 0x7f, 0x4a, 0x9e, 0x29, + 0xc5, 0xe4, 0xcb, 0xff, 0xac, 0x8b, 0x68, 0x00, 0xc7, 0x72, 0x7e, 0x71, 0xd4, 0x7f, 0x29, 0xf4, + 0x72, 0x40, 0x98, 0x5c, 0x77, 0x1f, 0x1c, 0x97, 0xff, 0x90, 0xf9, 0xf3, 0xff, 0x03, 0x00, 0x00, + 0xff, 0xff, 0x81, 0xb5, 0x27, 0xf1, 0xa9, 0x19, 0x00, 0x00, +} diff --git a/proto/sla/sl_common_types.proto b/proto/sla/sl_common_types.proto new file mode 100755 index 0000000..ffaf449 --- /dev/null +++ b/proto/sla/sl_common_types.proto @@ -0,0 +1,535 @@ +// @file +// @brief Common definitions for all of the service layer proto files. +// +//--------------------------------------------------------------------- +// Copyright (c) 2016 by Cisco Systems, Inc. +// All rights reserved. +//--------------------------------------------------------------------- +// +// + +//@defgroup Common +//@brief Common service definitions and Global initializations. + +syntax = "proto3"; +package service_layer; + +// @defgroup SLCommonTypes +// @ingroup Common +// Service Layer common types. +// The following messages are used as common Service Layer types. +// @{ + +// Status codes, including errors and success codes. +// All service layer errors are defined below. +message SLErrorStatus { + enum SLErrno { + + // !!! Common error codes for all RPCs and objects + + // Success, no errors detected. 0x0. + SL_SUCCESS = 0x0; + // Client is not connected. + // The client is expected to remain connected after init and version + // validation, RPC calls can fail with this error code otherwise. + // Refer to RPC SLGlobalInitNotif. 0x1 + SL_NOT_CONNECTED = 0x1; + // Operation must be retried. 0x2 + SL_EAGAIN = 0x2; + // One or more components does not have sufficient memory. 0x3 + SL_ENOMEM = 0x3; + // Too many outstanding requests. 0x4 + SL_EBUSY = 0x4; + // One or more arguments are invalid. 0x5 + SL_EINVAL = 0x5; + // Unsupported version. 0x6 + SL_UNSUPPORTED_VER = 0x6; + // Not Available. 0x7 + SL_NOT_AVAILABLE = 0x7; + // Stream mode not supported. 0x8 + SL_STREAM_NOT_SUPPORTED = 0x8; + // Operation not supported. 0x9 + SL_ENOTSUP = 0x9; + // One or more objects is errored: + // Each object must be individually examined. 0xa + SL_SOME_ERR = 0xa; + // Operation Timed out. + // The result of the operation is undeterministic (success or fail). 0xb + SL_TIMEOUT = 0xb; + // Due to some event, the client will no longer receive notification + // events on this channel. 0xc + // Such events include: + // - Notification Session was hijacked by another client. + SL_NOTIF_TERM = 0xc; + + // !!! Error codes for Client INIT operations. + + // Offset for INIT errors. 0x500 + SL_INIT_START_OFFSET = 0x500; + // Success, no errors detected - clear state. + // This error is returned on the first-ever initialization, or, + // when a fatal event has occured and all previous state was lost. 0x501 + SL_INIT_STATE_CLEAR = 0x501; + // Success, no errors detected - previous state fully recovered. + // This error is returned on a client re-initialization with + // successful recovery of state. 0x502 + SL_INIT_STATE_READY = 0x502; + // Server software incompatible with client software version. 0x503 + SL_INIT_UNSUPPORTED_VER = 0x503; + // Initialization request received while server is not ready. 0x504 + SL_INIT_SERVER_NOT_INITIALIZED = 0x504; + // Server operational mode change from stream to non-stream + // or vice-versa failed. 0x505 + SL_INIT_SERVER_MODE_CHANGE_FAILED = 0x505; + + // !!! Error codes for VRF operations. + + // Offset for VRF errors. 0x1000 + SL_RPC_VRF_START_OFFSET = 0x1000; + // Operation rejected for ALL VRFs due to too many VRF registration + // messages in the request. 0x1001 + SL_RPC_VRF_TOO_MANY_VRF_REG_MSGS = 0x1001; + // Operation rejected for all VRFs as server is not initialized. 0x1002 + SL_RPC_VRF_SERVER_NOT_INITIALIZED = 0x1002; + + // !!! Error codes for VRF objects. + + // Offset for VRF errors. 0x2000 + SL_VRF_START_OFFSET = 0x2000; + // VRF name in the VRF registration message is too long. 0x2001 + SL_VRF_NAME_TOOLONG = 0x2001; + // VRF not found during a unregister or EOF. 0x2002 + SL_VRF_NOT_FOUND = 0x2002; + // On a VRF registration, Table ID for the VRF is not found. 0x2003 + SL_VRF_NO_TABLE_ID = 0x2003; + // VRF add registration message with invalid administrative distance. 0x2004 + SL_VRF_REG_INVALID_ADMIN_DISTANCE = 0x2004; + // On a VRF registration, Table cannot be added to persistent memory. 0x2005 + SL_VRF_TABLE_ADD_ERR = 0x2005; + // VRF table cannot be registered with RIB. 0x2006 + SL_VRF_TABLE_REGISTRATION_ERR = 0x2006; + // VRF table cannot be unregistered with RIB. 0x2007 + SL_VRF_TABLE_UNREGISTRATION_ERR = 0x2007; + // VRF table RIB EOF operation error. 0x2008 + SL_VRF_TABLE_EOF_ERR = 0x2008; + // VRF registration message does not have a VRF name. 0x2009 + SL_VRF_REG_VRF_NAME_MISSING = 0x2009; + + // !!! Error codes for Route operations. + + // Offset for Route operation errors. 0x3000 + SL_RPC_ROUTE_START_OFFSET = 0x3000; + // Operation rejected for ALL routes due to too many routes in the + // request. 0x3001 + SL_RPC_ROUTE_TOO_MANY_ROUTES = 0x3001; + // Operation rejected for ALL routes as the request's VRF name + // is too long. 0x3002 + SL_RPC_ROUTE_VRF_NAME_TOOLONG = 0x3002; + // Operation rejected for ALL routes as VRF for the given name + // is not found. 0x3003 + SL_RPC_ROUTE_VRF_NOT_FOUND = 0x3003; + // Operation rejected for ALL routes as VRF's Table ID is not found. + // 0x3004 + SL_RPC_ROUTE_VRF_NO_TABLE = 0x3004; + // Operation rejected for ALL routes as VRF is not registered with RIB. + // 0x3005 + SL_RPC_ROUTE_VRF_TABLE_NOT_REGISTERED = 0x3005; + // Route Operation rejected for ALL objects as VRF name is missing. + // 0x3006 + SL_RPC_ROUTE_VRF_NAME_MISSING = 0x3006; + // Operation rejected for all routes as the RPC request is + // not supported for the library's initialization mode. 0x3007 + SL_RPC_ROUTE_INIT_MODE_INCOMPATIBLE = 0x3007; + // Operation rejected for all routes as server is not initialized. + // 0x3008 + SL_RPC_ROUTE_SERVER_NOT_INITIALIZED = 0x3008; + + // !!! Error codes for Route objects. + + // Offset for route errors. 0x4000 + SL_ROUTE_START_OFFSET = 0x4000; + // Route add operation requested but no paths were provided. 0x4001 + SL_ROUTE_ADD_NO_PATHS = 0x4001; + // Route update operation requested but no paths were provided. 0x4002 + SL_ROUTE_UPDATE_NO_PATHS = 0x4002; + // Route's prefix length is invalid. 0x4003 + SL_ROUTE_INVALID_PREFIX_LEN = 0x4003; + // Route's admininstrative distance is invalid. 0x4004 + SL_ROUTE_INVALID_ADMIN_DISTANCE = 0x4004; + // Route's number of paths exceeds system capabilities. 0x4005 + SL_ROUTE_INVALID_NUM_PATHS = 0x4005; + // Size of IPv6 prefix is invalid. 0x4006 + SL_ROUTE_INVALID_PREFIX_SZ = 0x4006; + // Route's prefix is invalid. 0x4007 + SL_ROUTE_INVALID_PREFIX = 0x4007; + // Route programming failed in RIB as VRF table limit reached. 0x4008 + SL_ROUTE_ERR_RIB_TABLE_LIMIT_REACHED = 0x4008; + // RIB route programming failed in RIB due to invalid arguments. 0x4009 + SL_ROUTE_ERR_RIB_INVALID_ARGS = 0x4009; + // One or more paths could not be programmed in RIB as VRF + // table limit reached. 0x400a + SL_ROUTE_ERR_RIB_PATH_TABLE_LIMIT = 0x400a; + // One or more paths could not be programmed in RIB as number of paths + // reached system limit. 0x400b + SL_ROUTE_ERR_RIB_TOOMANYPATHS = 0x400b; + // This route already exists in the database. 0x400c + SL_ROUTE_EEXIST = 0x400c; + // Route prefix has host bits set. 0x400d + SL_ROUTE_HOST_BITS_SET = 0x400d; + // IPv4 Route prefix is a multicast address. 0x400e + SL_ROUTE_INVALID_PREFIX_MCAST = 0x400e; + // Route and Path AFI does not match. 0x400f + SL_ROUTE_PATH_AFI_MISMATCH = 0x400f; + // Number of primary paths exceeds system capabilities. 0x4010 + SL_ROUTE_TOOMANY_PRIMARY_PATHS = 0x4010; + // Number of backup paths exceeds system capabilities. 0x4011 + SL_ROUTE_TOOMANY_BACKUP_PATHS = 0x4011; + // The route database is out of memory. 0x4012 + SL_ROUTE_DB_NOMEM = 0x4012; + // The route has an invalid local label. 0x4013 + SL_ROUTE_INVALID_LOCAL_LABEL = 0x4013; + + // !!! Error codes for route path objects. + + // Offset for route path errors. 0x5000 + SL_PATH_START_OFFSET = 0x5000; + // VRF table for the path could not be determined. 0x5001 + SL_PATH_NH_NO_TABLE = 0x5001; + // Path next hop interface not found. 0x5002 + SL_PATH_NH_INTF_NOT_FOUND = 0x5002; + // Number of labels in the path exceeds system capabilities. 0x5003 + SL_PATH_INVALID_LABEL_COUNT = 0x5003; + // Path ID assigned to the path falls outside the supported range. 0x5004 + SL_PATH_INVALID_ID = 0x5004; + // Path VRF name exceeds supported length. 0x5005 + SL_PATH_VRF_NAME_TOOLONG = 0x5005; + // Path next hop interface name exceeds supported length. 0x5006 + SL_PATH_NH_INTF_NAME_TOOLONG = 0x5006; + // Size of next hop IPv6 address is invalid. 0x5007 + SL_PATH_NH_INVALID_ADDR_SZ = 0x5007; + // Next hop interface name is missing from path. 0x5008 + SL_PATH_NH_INF_NAME_MISSING = 0x5008; + // Path has an invalid next hop address. 0x5009 + SL_PATH_INVALID_NEXT_HOP_ADDR = 0x5009; + // Number of remote backup addresses in the path exceeds + // system capabilities. 0x500a + SL_PATH_INVALID_REMOTE_ADDR_COUNT = 0x500a; + // Size of IPv6 remote backup address is invalid. 0x500b + SL_PATH_REMOTE_ADDR_INVALID_SZ = 0x500b; + // Route and Path remote backup address AFI does not match. 0x500c + SL_PATH_REMOTE_ADDR_AFI_MISMATCH = 0x500c; + // Path has an invalid protection bitmap. 0x500d + SL_PATH_INVALID_PROTECTED_BITMAP = 0x500d; + // Protection bitmap of a backup path refers to a missing path. 0x500e + SL_PATH_BACKUP_MISSING_PRIMARY_PATH = 0x500e; + // Too many primary paths with same Path ID. 0x500f + SL_PATH_PRIMARY_ID_REPEATED = 0x500f; + // Too many pure backup paths with same Path ID. 0x5010 + SL_PATH_BACKUP_ID_REPEATED = 0x5010; + // A primary path has too many backup paths. 0x5011 + SL_PATH_PRIMARY_TOOMANY_BACKUP_PATHS = 0x5011; + // A primary path has too many labels. 0x5012 + SL_PATH_PRIMARY_TOOMANY_LABELS = 0x5012; + // A primary path has too many remote addresses. 0x5013 + SL_PATH_PRIMARY_TOOMANY_REMOTE_ADDR = 0x5013; + // A pure backup remote address is invalid. 0x5014 + SL_PATH_REMOTE_ADDR_INVALID = 0x5014; + // Path has an invalid label. 0x5015 + SL_PATH_INVALID_LABEL = 0x5015; + + // !!! Error codes for BFD opertations. + + // Offset for BFD operation errors. 0x6000 + SL_RPC_BFD_START_OFFSET = 0x6000; + // BFD Operation rejected for ALL Sessions as the BFD Session count + // is beyond supported limit. 0x6001 + SL_RPC_BFD_TOO_MANY_BFD_SESSIONS = 0x6001; + // BFD Operation rejected due to one or many invalid parameters. 0x6002 + SL_RPC_BFD_API_BAD_PARAMETER = 0x6002; + // BFD Operation failed as server is not registered with BFD. 0x6003 + SL_RPC_BFD_API_CLIENT_NOT_REGISTERED = 0x6003; + // BFD Operation failed with internal error. 0x6004 + SL_RPC_BFD_API_INTERNAL_ERROR = 0x6004; + // BFD Operation rejected as server is not initialized. 0x6005 + SL_RPC_BFD_SERVER_NOT_INITIALIZED = 0x6005; + // BFD IPv4 not registered. 0x6006 + SL_RPC_BFD_V4_NOT_REGISTERED = 0x6006; + // BFD IPv6 not registered. 0x6007 + SL_RPC_BFD_V6_NOT_REGISTERED = 0x6007; + + // !!! Error codes for BFD Session objects. + + // Offset for BFD errors. 0x7000 + SL_BFD_START_OFFSET = 0x7000; + // BFD Session's interface name exceeds supported length. 0x7001 + SL_BFD_INTF_NAME_TOOLONG = 0x7001; + // BFD Session's interface not found. 0x7002 + SL_BFD_INTF_NOT_FOUND = 0x7002; + // BFD Session's tx interval or multiplier are beyond the + // supported range. 0x7003 + SL_BFD_INVALID_ATTRIBUTE = 0x7003; + // BFD Session's interface name is missing. 0x7004 + SL_BFD_INTF_NAME_MISSING = 0x7004; + // BFD Session's neighbor is mcast address. 0x7005 + SL_BFD_INVALID_NBR_MCAST = 0x7005; + // BFD Session's neighbor address is invalid. 0x7006 + SL_BFD_INVALID_NBR = 0x7006; + // BFD Session's VRF Name is too long. 0x7007 + SL_BFD_VRF_NAME_TOOLONG = 0x7007; + // BFD Session's one or more parameters are invalid. + // For example, Multihop BFD can not have the interface name set. 0x7008 + SL_BFD_BAD_PARAMETER = 0x7008; + // BFD Session failed with internal error. 0x7009 + SL_BFD_API_INTERNAL_ERROR = 0x7009; + // BFD Session's VRF not found. 0x700a + SL_BFD_VRF_NOT_FOUND = 0x700a; + // BFD Session's neighbor IPv6 prefix size is invalid. 0x700b + SL_BFD_INVALID_PREFIX_SIZE = 0x700b; + // BFD Session type invalid. 0x700c + SL_BFD_INVALID_SESSION_TYPE = 0x700c; + // BFD Session's VRF is Invalid. 0x700d + SL_BFD_INVALID_VRF = 0x700d; + // BFD Session not found. 0x700e + SL_BFD_SESSION_NOT_FOUND = 0x700e; + // BFD Session exists. 0x700f + SL_BFD_SESSION_EXISTS = 0x700f; + // BFD Internal database error. 0x7010 + SL_BFD_INTERNAL_DB_ERROR = 0x7010; + // BFD Recovery error. 0x7011 + SL_BFD_RECOVERY_ERROR = 0x7011; + + // !!! Error codes for MPLS opertations. + + // Offset for MPLS operation errors. 0x8000 + SL_RPC_MPLS_START_OFFSET = 0x8000; + // Operation rejected for ALL ILMS due to too many ILMS in the + // request. 0x8001 + SL_RPC_MPLS_ILM_TOO_MANY_ILMS = 0x8001; + // Operation rejected for all ILMs as server is not initialized. + // 0x0x8002 + SL_RPC_MPLS_SERVER_NOT_INITIALIZED = 0x8002; + // Operation rejected for all ILMs as the RPC request is + // not supported for the library's initialization mode. 0x8003 + SL_RPC_MPLS_INIT_MODE_INCOMPATIBLE = 0x8003; + // Operation rejected for ALL label blocks due to too many + // label blocks in the request. 0x8004 + SL_RPC_MPLS_LABEL_BLK_TOO_MANY_LABEL_BLKS = 0x8004; + // Operation rejected for ALL ILMs as MPLS layer is not registered. + // 0x8005 + SL_RPC_MPLS_NOT_REGISTERED = 0x8005; + + // !!! MPLS ILM Error codes + + // Offset for MPLS ILM errors. 0x9000 + SL_ILM_ERR_OFFSET = 0x9000; + // MPLS ILM add to service layer failed. 0x9001 + SL_ILM_ADD_FAILED = 0x9001; + // MPLS ILM add to Label Switching Database failed. 0x9002 + SL_ILM_LSD_ADD_FAILED = 0x9002; + // MPLS ILM NHLFE count exceeded max supported number. 0x9003 + SL_ILM_INVALID_NUM_NHLFE = 0x9003; + // MPLS ILM label value out of range. 0x9004 + SL_ILM_INVALID_LABEL = 0x9004; + // MPLS ILM delete from service layer failed. 0x9005 + SL_ILM_DELETE_FAILED = 0x9005; + // MPLS ILM delete from Label Switching Database failed. 0x9006 + SL_ILM_LSD_DELETE_FAILED = 0x9006; + // Number of primary NHLFEs exceeds system capabilities. 0x9007 + SL_ILM_TOOMANY_PRIMARY_NHLFES = 0x9007; + // Number of backup NHLFEs exceeds system capabilities. 0x9008 + SL_ILM_TOOMANY_BACKUP_NHLFES = 0x9008; + // MPLS ILM label alloc failed in Label switching database. 0x9009 + SL_ILM_LSD_ADD_LABEL_ALLOC_FAILED = 0x9009; + // MPLS ILM NHLFE attribute invalid. 0x900a + SL_ILM_LSD_NHLFE_INVALID_ATTRIB = 0x900a; + // MPLS ILM already exists in the database. 0x900b + SL_ILM_EEXIST = 0x900b; + // The ILM database is out of memory. 0x900c + SL_ILM_DB_NOMEM = 0x900c; + + // !!! MPLS NHLFE Error codes + + // Offset for MPLS NHLFE errors. 0xa000 + SL_NHLFE_ERR_OFFSET = 0xa000; + // MPLS NHLFE vrf table could not be determined. 0xa001 + SL_NHLFE_NH_NO_TABLE = 0xa001; + // Size of next hop IPv6 address is invalid. 0xa002 + SL_NHLFE_NH_INVALID_ADDR_SZ = 0xa002; + // NHLFE has an invalid next hop address. 0xa003 + SL_NHLFE_INVALID_NEXT_HOP_ADDR = 0xa003; + // Path VRF name exceeds supported length. 0xa004 + SL_NHLFE_VRF_NAME_TOOLONG = 0xa004; + // Next hop interface name is missing from path. 0xa005 + SL_NHLFE_NH_INF_NAME_MISSING = 0xa005; + // Interface name exceeds supported length. 0xa006 + SL_NHLFE_NH_INTF_NAME_TOOLONG = 0xa006; + // Number of labels in the path exceeds system capabilities. 0xa007 + SL_NHLFE_INVALID_LABEL_COUNT = 0xa007; + // Path id is invalid in NHLFE. 0xa008 + SL_NHLFE_INVALID_PATH_ID = 0xa008; + // MPLS NHLFE label value out of range. 0xa009 + SL_NHLFE_INVALID_LABEL = 0xa009; + // NHLFE has an invalid protection bitmap. 0xa00a + SL_NHLFE_INVALID_PROTECTED_BITMAP = 0xa00a; + // Number of remote backup addresses in the NHLFE exceeds + // system capabilities. 0xa00b + SL_NHLFE_INVALID_REMOTE_ADDR_COUNT = 0xa00b; + // Size of IPv6 remote backup address is invalid. 0xa00c + SL_NHLFE_REMOTE_ADDR_INVALID_SZ = 0xa00c; + // A primary NHLFE has too many labels. 0xa00d + SL_NHLFE_PRIMARY_TOOMANY_LABELS = 0xa00d; + // A primary NHLFE has too many remote addresses. 0xa00e + SL_NHLFE_PRIMARY_TOOMANY_REMOTE_ADDR = 0xa00e; + // Too many pure backup NHLFE with same Path ID. 0xa00f + SL_NHLFE_BACKUP_ID_REPEATED = 0xa00f; + // Too many primary NHLFE with same Path ID. 0xa010 + SL_NHLFE_PRIMARY_ID_REPEATED = 0xa010; + // Pure backup NHLFE has a empty protected bitmap. 0xa011 + SL_NHLFE_BACKUP_PROTECTED_BITMAP_EMPTY = 0xa011; + // A primary NHLFE has too many backup paths. 0xa012 + SL_NHLFE_PRIMARY_TOOMANY_BACKUP_PATHS = 0xa012; + // A pure backup remote address is invalid. 0xa013 + SL_NHLFE_REMOTE_ADDR_INVALID = 0xa013; + // Protection bitmap of a backup NHLFE refers to a missing path. 0xa014 + SL_NHLFE_BACKUP_MISSING_PRIMARY_PATH = 0xa014; + // NHLFE next-hop missing. 0xa015 + SL_NHLFE_NEXT_HOP_MISSING = 0xa015; + // Label action specified is invalid. 0xa016 + SL_NHLFE_LABEL_ACTION_INVALID = 0xa016; + // NHLFE next hop interface not found. 0xa017 + SL_NHLFE_NH_INTF_NOT_FOUND = 0xa017; + // MPLS NHLFE operation failed. 0xa018 + SL_NHLFE_OPER_FAILED = 0xa018; + // MPLS NHLFE label action missing. 0xa019 + SL_NHLFE_LABEL_ACTION_MISSING = 0xa019; + + // !!! MPLS Label block Error codes + + // Offset for label block errors. 0xb000 + SL_LABEL_BLK_ERR_OFFSET = 0xb000; + // MPLS label block add from Label Switching Database failed. 0xb001 + SL_LABEL_BLK_LSD_ADD_FAILED = 0xb001; + // MPLS label block delete from Label Switching Database failed. 0xb002 + SL_LABEL_BLK_LSD_DELETE_FAILED = 0xb002; + // MPLS label block not found. 0xb003 + SL_LABEL_BLK_LSD_LABEL_BLK_NOT_FOUND = 0xb003; + // MPLS label block in use. 0xb004 + SL_LABEL_BLK_LSD_LABEL_BLK_IN_USE = 0xb004; + // MPLS label block attribute invalid. 0xb005 + SL_LABEL_BLK_LSD_INVALID_ATTRIB = 0xb005; + // MPLS label block size > max size per block. 0xb006 + SL_LABEL_BLK_INVALID_BLOCK_SIZE = 0xb006; + // MPLS label start_label < min label for platform . 0xb007 + SL_LABEL_BLK_INVALID_START_LABEL = 0xb007; + // MPLS label block already exists in the database. 0xb008 + SL_LABEL_BLK_EEXIST = 0xb008; + // MPLS label database is out of memory. 0xb009 + SL_LABEL_BLK_DB_NOMEM = 0xb009; + + // !!! MPLS Reg error codes + + // Offset for MPLS registration errors. 0xc000 + SL_MPLS_REG_ERR_OFFSET = 0xc000; + // MPLS registration error. 0xc001 + SL_MPLS_REG_ERR = 0xc001; + // MPLS unregistration error. 0xc002 + SL_MPLS_UNREG_ERR = 0xc002; + // MPLS EOF error. 0xc003 + SL_MPLS_EOF_ERR = 0xc003; + + // !!! Error codes for Interface operations. + + // Offset for Interface operation errors. 0xd000 + SL_RPC_INTF_START_OFFSET = 0xd000; + // Interface Operation rejected for ALL Sessions as the Interface + // Session count is beyond supported limit. 0xd001 + SL_RPC_INTF_TOO_MANY_INTERFACES = 0xd001; + // Interface Operation rejected as server is not initialized. 0xd002 + SL_RPC_INTF_SERVER_NOT_INITIALIZED = 0xd002; + // Interface Operation failed as server is not registered with + // interface manager. 0xd003 + SL_RPC_INTF_API_CLIENT_NOT_REGISTERED = 0xd003; + + // !!! Error codes for Interface objects. + + // Offset for Interface object errors. 0xe000 + SL_INTF_START_OFFSET = 0xe000; + // Interface object's interface name missing. 0xe001 + SL_INTF_INTERFACE_NAME_MISSING = 0xe001; + // Interface object's interface name exceeds supported length. 0xe002 + SL_INTF_INTERFACE_NAME_TOOLONG = 0xe002; + // Interface internal registration error. 0xe003 + SL_INTF_INTERFACE_REG_ERR = 0xe003; + // Internal database error. 0xe004 + SL_INTF_INTERNAL_DB_ERROR = 0xe004; + // Interface Recovery error. 0xe005 + SL_INTF_RECOVERY_ERROR = 0xe005; + // Interface exists. 0xe006 + SL_INTF_INTERFACE_EXISTS = 0xe006; + // Interface not found. 0xe007 + SL_INTF_INTERFACE_NOT_FOUND = 0xe007; + + // !!! Error codes Reserved for internal errors. + + // Offset for Internal errors. 0x100000 + SL_INTERNAL_START_OFFSET = 0x100000; + } + SLErrno Status = 1; +} + +// Registration Operations. +enum SLRegOp { + // Reserved. 0x0 + SL_REGOP_RESERVED = 0x0; + // Register. 0x1 + SL_REGOP_REGISTER = 0x1; + // Un-Register. 0x2 + SL_REGOP_UNREGISTER = 0x2; + // End Of File. 0x3 + SL_REGOP_EOF = 0x3; +} + +// Object Operations. +enum SLObjectOp { + // Reserved. 0x0 + SL_OBJOP_RESERVED = 0x0; + // Add. 0x1 + SL_OBJOP_ADD = 0x1; + // Update. 0x2 + SL_OBJOP_UPDATE = 0x2; + // Delete. 0x3 + SL_OBJOP_DELETE = 0x3; +} + +// Notification Operations. +enum SLNotifOp { + // Reserved. 0x0 + SL_NOTIFOP_RESERVED = 0x0; + // Enable. 0x1 + SL_NOTIFOP_ENABLE = 0x1; + // Disable. 0x2 + SL_NOTIFOP_DISABLE = 0x2; +} + +// Interface info. +message SLInterface { + // One of Interface name or handle + oneof Interface { + // Interface name. + string Name = 1; + + // Interface handle. Can be retrieved from Interface API. + uint32 Handle = 2; + } +} + +// One of IPv4 or IPv6 addresses. +message SLIpAddress { + // One of IPv4 or IPv6 address + oneof Address { + uint32 V4Address = 1; + bytes V6Address = 2; + } +} + +// @} diff --git a/proto/sla/sl_global.pb.go b/proto/sla/sl_global.pb.go new file mode 100644 index 0000000..872fccb --- /dev/null +++ b/proto/sla/sl_global.pb.go @@ -0,0 +1,620 @@ +// Code generated by protoc-gen-go. +// source: sl_global.proto +// DO NOT EDIT! + +package service_layer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Global Event Notification types. +type SLGlobalNotifType int32 + +const ( + // Reserved. 0x0 + SLGlobalNotifType_SL_GLOBAL_EVENT_TYPE_RESERVED SLGlobalNotifType = 0 + // Error. ErrStatus field elaborates on the message. 0x1 + SLGlobalNotifType_SL_GLOBAL_EVENT_TYPE_ERROR SLGlobalNotifType = 1 + // HeartBeat. 0x2 + SLGlobalNotifType_SL_GLOBAL_EVENT_TYPE_HEARTBEAT SLGlobalNotifType = 2 + // Version. SLInitMsgRsp field elaborates on the server version. 0x3 + SLGlobalNotifType_SL_GLOBAL_EVENT_TYPE_VERSION SLGlobalNotifType = 3 +) + +var SLGlobalNotifType_name = map[int32]string{ + 0: "SL_GLOBAL_EVENT_TYPE_RESERVED", + 1: "SL_GLOBAL_EVENT_TYPE_ERROR", + 2: "SL_GLOBAL_EVENT_TYPE_HEARTBEAT", + 3: "SL_GLOBAL_EVENT_TYPE_VERSION", +} +var SLGlobalNotifType_value = map[string]int32{ + "SL_GLOBAL_EVENT_TYPE_RESERVED": 0, + "SL_GLOBAL_EVENT_TYPE_ERROR": 1, + "SL_GLOBAL_EVENT_TYPE_HEARTBEAT": 2, + "SL_GLOBAL_EVENT_TYPE_VERSION": 3, +} + +func (x SLGlobalNotifType) String() string { + return proto.EnumName(SLGlobalNotifType_name, int32(x)) +} +func (SLGlobalNotifType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +// Initialization message sent to the server. +// If the client and server are running compatible version numbers, a +// connection will be made and the server response will be received +// with a successful status code. +type SLInitMsg struct { + // Client's Major version of service-layer API (refer to sl_version.proto) + MajorVer uint32 `protobuf:"varint,1,opt,name=MajorVer" json:"MajorVer,omitempty"` + // Minor Version + MinorVer uint32 `protobuf:"varint,2,opt,name=MinorVer" json:"MinorVer,omitempty"` + // Sub-Version + SubVer uint32 `protobuf:"varint,3,opt,name=SubVer" json:"SubVer,omitempty"` +} + +func (m *SLInitMsg) Reset() { *m = SLInitMsg{} } +func (m *SLInitMsg) String() string { return proto.CompactTextString(m) } +func (*SLInitMsg) ProtoMessage() {} +func (*SLInitMsg) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *SLInitMsg) GetMajorVer() uint32 { + if m != nil { + return m.MajorVer + } + return 0 +} + +func (m *SLInitMsg) GetMinorVer() uint32 { + if m != nil { + return m.MinorVer + } + return 0 +} + +func (m *SLInitMsg) GetSubVer() uint32 { + if m != nil { + return m.SubVer + } + return 0 +} + +// Server's response to the SLInitMsg. +// On Success (ErrStatus), the session with the server is established +// and the client is allowed to proceed. +type SLInitMsgRsp struct { + // Server's version of service-layer API (refer to sl_version.proto) + // Major-number revisions are NOT backwards compatible, + // unless otherwise specified. The Server may reject a session if there + // is a version number mismatch or non-backwards compatibility. + MajorVer uint32 `protobuf:"varint,1,opt,name=MajorVer" json:"MajorVer,omitempty"` + // Minor Version + MinorVer uint32 `protobuf:"varint,2,opt,name=MinorVer" json:"MinorVer,omitempty"` + // Sub-Version + SubVer uint32 `protobuf:"varint,3,opt,name=SubVer" json:"SubVer,omitempty"` +} + +func (m *SLInitMsgRsp) Reset() { *m = SLInitMsgRsp{} } +func (m *SLInitMsgRsp) String() string { return proto.CompactTextString(m) } +func (*SLInitMsgRsp) ProtoMessage() {} +func (*SLInitMsgRsp) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *SLInitMsgRsp) GetMajorVer() uint32 { + if m != nil { + return m.MajorVer + } + return 0 +} + +func (m *SLInitMsgRsp) GetMinorVer() uint32 { + if m != nil { + return m.MinorVer + } + return 0 +} + +func (m *SLInitMsgRsp) GetSubVer() uint32 { + if m != nil { + return m.SubVer + } + return 0 +} + +// Globals query message. +type SLGlobalNotif struct { + // Event Type. + EventType SLGlobalNotifType `protobuf:"varint,1,opt,name=EventType,enum=service_layer.SLGlobalNotifType" json:"EventType,omitempty"` + // Status code, interpreted based on the Event Type. + // + // case EventType == SL_GLOBAL_EVENT_TYPE_ERROR: + // case ErrStatus == SL_NOTIF_TERM: + // => Another client is attempting to take over the session. + // This session will be closed. + // case ErrStatus == (some error from SLErrorStatus) + // => Client must look into the specific error message returned. + // + // case EventType == SL_GLOBAL_EVENT_TYPE_HEARTBEAT: + // case ErrStatus == SL_SUCCESS + // => Client can safely ignore this heartbeat message. + // + // case EventType == SL_GLOBAL_EVENT_TYPE_VERSION: + // case ErrStatus == SL_SUCCESS + // => Client version accepted. + // case ErrStatus == SL_INIT_STATE_READY + // => Client version accepted. + // Any previous state was sucessfully recovered. + // case ErrStatus == SL_INIT_STATE_CLEAR + // => Client version accepted. Any previous state was lost. + // Client must replay all previous objects to server. + // case ErrStatus == SL_UNSUPPORTED_VER + // => Client and Server version mismatch. The client is not + // allowed to proceed, and the channel will be closed. + // case ErrStatus == (some error from SLErrorStatus) + // => Client must either try again, or look into the specific + // error message returned. + ErrStatus *SLErrorStatus `protobuf:"bytes,2,opt,name=ErrStatus" json:"ErrStatus,omitempty"` + // Further info based on EventType. + // + // Types that are valid to be assigned to Event: + // *SLGlobalNotif_InitRspMsg + Event isSLGlobalNotif_Event `protobuf_oneof:"Event"` +} + +func (m *SLGlobalNotif) Reset() { *m = SLGlobalNotif{} } +func (m *SLGlobalNotif) String() string { return proto.CompactTextString(m) } +func (*SLGlobalNotif) ProtoMessage() {} +func (*SLGlobalNotif) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +type isSLGlobalNotif_Event interface { + isSLGlobalNotif_Event() +} + +type SLGlobalNotif_InitRspMsg struct { + InitRspMsg *SLInitMsgRsp `protobuf:"bytes,3,opt,name=InitRspMsg,oneof"` +} + +func (*SLGlobalNotif_InitRspMsg) isSLGlobalNotif_Event() {} + +func (m *SLGlobalNotif) GetEvent() isSLGlobalNotif_Event { + if m != nil { + return m.Event + } + return nil +} + +func (m *SLGlobalNotif) GetEventType() SLGlobalNotifType { + if m != nil { + return m.EventType + } + return SLGlobalNotifType_SL_GLOBAL_EVENT_TYPE_RESERVED +} + +func (m *SLGlobalNotif) GetErrStatus() *SLErrorStatus { + if m != nil { + return m.ErrStatus + } + return nil +} + +func (m *SLGlobalNotif) GetInitRspMsg() *SLInitMsgRsp { + if x, ok := m.GetEvent().(*SLGlobalNotif_InitRspMsg); ok { + return x.InitRspMsg + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SLGlobalNotif) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SLGlobalNotif_OneofMarshaler, _SLGlobalNotif_OneofUnmarshaler, _SLGlobalNotif_OneofSizer, []interface{}{ + (*SLGlobalNotif_InitRspMsg)(nil), + } +} + +func _SLGlobalNotif_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SLGlobalNotif) + // Event + switch x := m.Event.(type) { + case *SLGlobalNotif_InitRspMsg: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InitRspMsg); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SLGlobalNotif.Event has unexpected type %T", x) + } + return nil +} + +func _SLGlobalNotif_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SLGlobalNotif) + switch tag { + case 3: // Event.InitRspMsg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SLInitMsgRsp) + err := b.DecodeMessage(msg) + m.Event = &SLGlobalNotif_InitRspMsg{msg} + return true, err + default: + return false, nil + } +} + +func _SLGlobalNotif_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SLGlobalNotif) + // Event + switch x := m.Event.(type) { + case *SLGlobalNotif_InitRspMsg: + s := proto.Size(x.InitRspMsg) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Globals query message. +type SLGlobalsGetMsg struct { +} + +func (m *SLGlobalsGetMsg) Reset() { *m = SLGlobalsGetMsg{} } +func (m *SLGlobalsGetMsg) String() string { return proto.CompactTextString(m) } +func (*SLGlobalsGetMsg) ProtoMessage() {} +func (*SLGlobalsGetMsg) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +// Platform specific globals Response. +type SLGlobalsGetMsgRsp struct { + // Corresponding error code + ErrStatus *SLErrorStatus `protobuf:"bytes,1,opt,name=ErrStatus" json:"ErrStatus,omitempty"` + // Maximum vrf name length. + MaxVrfNameLength uint32 `protobuf:"varint,2,opt,name=MaxVrfNameLength" json:"MaxVrfNameLength,omitempty"` + // Maximum interface name length. + MaxInterfaceNameLength uint32 `protobuf:"varint,3,opt,name=MaxInterfaceNameLength" json:"MaxInterfaceNameLength,omitempty"` + // Maximum paths per Route/ILM Entry. + MaxPathsPerEntry uint32 `protobuf:"varint,4,opt,name=MaxPathsPerEntry" json:"MaxPathsPerEntry,omitempty"` + // Maximum primary paths per Route/ILM Entry. + MaxPrimaryPathPerEntry uint32 `protobuf:"varint,5,opt,name=MaxPrimaryPathPerEntry" json:"MaxPrimaryPathPerEntry,omitempty"` + // Maximum backup paths per Route/ILM Entry. + MaxBackupPathPerEntry uint32 `protobuf:"varint,6,opt,name=MaxBackupPathPerEntry" json:"MaxBackupPathPerEntry,omitempty"` + // Maximum MPLS labels per Route/ILM Entry. + MaxMplsLabelsPerPath uint32 `protobuf:"varint,7,opt,name=MaxMplsLabelsPerPath" json:"MaxMplsLabelsPerPath,omitempty"` + // Minimum Primary path id number. + MinPrimaryPathIdNum uint32 `protobuf:"varint,8,opt,name=MinPrimaryPathIdNum" json:"MinPrimaryPathIdNum,omitempty"` + // Maximum Primary path id number. + MaxPrimaryPathIdNum uint32 `protobuf:"varint,9,opt,name=MaxPrimaryPathIdNum" json:"MaxPrimaryPathIdNum,omitempty"` + // Minimum Pure Backup path id number. + MinBackupPathIdNum uint32 `protobuf:"varint,10,opt,name=MinBackupPathIdNum" json:"MinBackupPathIdNum,omitempty"` + // Maximum Pure Backup path id number. + MaxBackupPathIdNum uint32 `protobuf:"varint,11,opt,name=MaxBackupPathIdNum" json:"MaxBackupPathIdNum,omitempty"` + // Maximum number of remote addresses + MaxRemoteAddressNum uint32 `protobuf:"varint,12,opt,name=MaxRemoteAddressNum" json:"MaxRemoteAddressNum,omitempty"` +} + +func (m *SLGlobalsGetMsgRsp) Reset() { *m = SLGlobalsGetMsgRsp{} } +func (m *SLGlobalsGetMsgRsp) String() string { return proto.CompactTextString(m) } +func (*SLGlobalsGetMsgRsp) ProtoMessage() {} +func (*SLGlobalsGetMsgRsp) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *SLGlobalsGetMsgRsp) GetErrStatus() *SLErrorStatus { + if m != nil { + return m.ErrStatus + } + return nil +} + +func (m *SLGlobalsGetMsgRsp) GetMaxVrfNameLength() uint32 { + if m != nil { + return m.MaxVrfNameLength + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMaxInterfaceNameLength() uint32 { + if m != nil { + return m.MaxInterfaceNameLength + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMaxPathsPerEntry() uint32 { + if m != nil { + return m.MaxPathsPerEntry + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMaxPrimaryPathPerEntry() uint32 { + if m != nil { + return m.MaxPrimaryPathPerEntry + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMaxBackupPathPerEntry() uint32 { + if m != nil { + return m.MaxBackupPathPerEntry + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMaxMplsLabelsPerPath() uint32 { + if m != nil { + return m.MaxMplsLabelsPerPath + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMinPrimaryPathIdNum() uint32 { + if m != nil { + return m.MinPrimaryPathIdNum + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMaxPrimaryPathIdNum() uint32 { + if m != nil { + return m.MaxPrimaryPathIdNum + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMinBackupPathIdNum() uint32 { + if m != nil { + return m.MinBackupPathIdNum + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMaxBackupPathIdNum() uint32 { + if m != nil { + return m.MaxBackupPathIdNum + } + return 0 +} + +func (m *SLGlobalsGetMsgRsp) GetMaxRemoteAddressNum() uint32 { + if m != nil { + return m.MaxRemoteAddressNum + } + return 0 +} + +func init() { + proto.RegisterType((*SLInitMsg)(nil), "service_layer.SLInitMsg") + proto.RegisterType((*SLInitMsgRsp)(nil), "service_layer.SLInitMsgRsp") + proto.RegisterType((*SLGlobalNotif)(nil), "service_layer.SLGlobalNotif") + proto.RegisterType((*SLGlobalsGetMsg)(nil), "service_layer.SLGlobalsGetMsg") + proto.RegisterType((*SLGlobalsGetMsgRsp)(nil), "service_layer.SLGlobalsGetMsgRsp") + proto.RegisterEnum("service_layer.SLGlobalNotifType", SLGlobalNotifType_name, SLGlobalNotifType_value) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for SLGlobal service + +type SLGlobalClient interface { + // Initialize the connection, and setup a notification channel. + // This MUST be the first call to setup the Service Layer connection. + // + // The caller MUST maintain the notification channel to be able to + // communicate with the server. + // If this channel is not properly established and maintained, all other + // RPC requests are rejected. + // + // The caller must send its version information as part of the SLInitMsg + // message. The server will reply with SL_GLOBAL_EVENT_TYPE_VERSION + // that tells the caller whether he can proceed or not. + // Refer to message SLGlobalNotif below for further details. + // + // After the version handshake, the notification channel is used for + // "push" event notifications, such as: + // - SLGlobalNotif.EventType = SL_GLOBAL_EVENT_TYPE_HEARTBEAT + // heartbeat notification messages are sent to the client on + // a periodic basis. + // Refer to SLGlobalNotif definition for further info. + SLGlobalInitNotif(ctx context.Context, in *SLInitMsg, opts ...grpc.CallOption) (SLGlobal_SLGlobalInitNotifClient, error) + // Get platform specific globals + SLGlobalsGet(ctx context.Context, in *SLGlobalsGetMsg, opts ...grpc.CallOption) (*SLGlobalsGetMsgRsp, error) +} + +type sLGlobalClient struct { + cc *grpc.ClientConn +} + +func NewSLGlobalClient(cc *grpc.ClientConn) SLGlobalClient { + return &sLGlobalClient{cc} +} + +func (c *sLGlobalClient) SLGlobalInitNotif(ctx context.Context, in *SLInitMsg, opts ...grpc.CallOption) (SLGlobal_SLGlobalInitNotifClient, error) { + stream, err := grpc.NewClientStream(ctx, &_SLGlobal_serviceDesc.Streams[0], c.cc, "/service_layer.SLGlobal/SLGlobalInitNotif", opts...) + if err != nil { + return nil, err + } + x := &sLGlobalSLGlobalInitNotifClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type SLGlobal_SLGlobalInitNotifClient interface { + Recv() (*SLGlobalNotif, error) + grpc.ClientStream +} + +type sLGlobalSLGlobalInitNotifClient struct { + grpc.ClientStream +} + +func (x *sLGlobalSLGlobalInitNotifClient) Recv() (*SLGlobalNotif, error) { + m := new(SLGlobalNotif) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *sLGlobalClient) SLGlobalsGet(ctx context.Context, in *SLGlobalsGetMsg, opts ...grpc.CallOption) (*SLGlobalsGetMsgRsp, error) { + out := new(SLGlobalsGetMsgRsp) + err := grpc.Invoke(ctx, "/service_layer.SLGlobal/SLGlobalsGet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for SLGlobal service + +type SLGlobalServer interface { + // Initialize the connection, and setup a notification channel. + // This MUST be the first call to setup the Service Layer connection. + // + // The caller MUST maintain the notification channel to be able to + // communicate with the server. + // If this channel is not properly established and maintained, all other + // RPC requests are rejected. + // + // The caller must send its version information as part of the SLInitMsg + // message. The server will reply with SL_GLOBAL_EVENT_TYPE_VERSION + // that tells the caller whether he can proceed or not. + // Refer to message SLGlobalNotif below for further details. + // + // After the version handshake, the notification channel is used for + // "push" event notifications, such as: + // - SLGlobalNotif.EventType = SL_GLOBAL_EVENT_TYPE_HEARTBEAT + // heartbeat notification messages are sent to the client on + // a periodic basis. + // Refer to SLGlobalNotif definition for further info. + SLGlobalInitNotif(*SLInitMsg, SLGlobal_SLGlobalInitNotifServer) error + // Get platform specific globals + SLGlobalsGet(context.Context, *SLGlobalsGetMsg) (*SLGlobalsGetMsgRsp, error) +} + +func RegisterSLGlobalServer(s *grpc.Server, srv SLGlobalServer) { + s.RegisterService(&_SLGlobal_serviceDesc, srv) +} + +func _SLGlobal_SLGlobalInitNotif_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SLInitMsg) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(SLGlobalServer).SLGlobalInitNotif(m, &sLGlobalSLGlobalInitNotifServer{stream}) +} + +type SLGlobal_SLGlobalInitNotifServer interface { + Send(*SLGlobalNotif) error + grpc.ServerStream +} + +type sLGlobalSLGlobalInitNotifServer struct { + grpc.ServerStream +} + +func (x *sLGlobalSLGlobalInitNotifServer) Send(m *SLGlobalNotif) error { + return x.ServerStream.SendMsg(m) +} + +func _SLGlobal_SLGlobalsGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SLGlobalsGetMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SLGlobalServer).SLGlobalsGet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service_layer.SLGlobal/SLGlobalsGet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SLGlobalServer).SLGlobalsGet(ctx, req.(*SLGlobalsGetMsg)) + } + return interceptor(ctx, in, info, handler) +} + +var _SLGlobal_serviceDesc = grpc.ServiceDesc{ + ServiceName: "service_layer.SLGlobal", + HandlerType: (*SLGlobalServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SLGlobalsGet", + Handler: _SLGlobal_SLGlobalsGet_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SLGlobalInitNotif", + Handler: _SLGlobal_SLGlobalInitNotif_Handler, + ServerStreams: true, + }, + }, + Metadata: "sl_global.proto", +} + +func init() { proto.RegisterFile("sl_global.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 588 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x94, 0xdf, 0x6a, 0xdb, 0x30, + 0x14, 0xc6, 0xeb, 0xfe, 0xcf, 0x69, 0xbb, 0xa6, 0xda, 0x5a, 0x42, 0xd6, 0x95, 0x36, 0x57, 0xa3, + 0x17, 0xa1, 0x64, 0x63, 0x17, 0x83, 0x0d, 0x12, 0x26, 0xd2, 0x80, 0x9d, 0x64, 0x72, 0x08, 0x8c, + 0xc1, 0x8c, 0x92, 0x28, 0xa9, 0x37, 0xff, 0x43, 0x52, 0x4a, 0xf2, 0x2e, 0x7b, 0x84, 0xbd, 0xcd, + 0x5e, 0x66, 0x97, 0xc3, 0xb2, 0x6b, 0xc7, 0xb5, 0x53, 0x18, 0xec, 0x52, 0xfa, 0x7d, 0x9f, 0xcf, + 0xa7, 0x63, 0xce, 0x81, 0x63, 0xe1, 0x58, 0x33, 0xc7, 0x1f, 0x51, 0xa7, 0x1e, 0x70, 0x5f, 0xfa, + 0xe8, 0x48, 0x30, 0x7e, 0x6f, 0x8f, 0x99, 0xe5, 0xd0, 0x25, 0xe3, 0xd5, 0x53, 0xe1, 0x58, 0x63, + 0xdf, 0x75, 0x7d, 0xcf, 0x92, 0xcb, 0x80, 0x89, 0x48, 0x55, 0xfb, 0x0a, 0x25, 0x53, 0xef, 0x78, + 0xb6, 0x34, 0xc4, 0x0c, 0x55, 0x61, 0xdf, 0xa0, 0xdf, 0x7d, 0x3e, 0x64, 0xbc, 0xa2, 0x5d, 0x6a, + 0xaf, 0x8f, 0x48, 0x72, 0x56, 0xcc, 0xf6, 0x22, 0xb6, 0x19, 0xb3, 0xf8, 0x8c, 0xce, 0x60, 0xd7, + 0x9c, 0x8f, 0x42, 0xb2, 0xa5, 0x48, 0x7c, 0xaa, 0x7d, 0x83, 0xc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0x27, 0xa9, + 0x51, 0x40, 0xd1, 0x5b, 0x38, 0x35, 0xe8, 0xa2, 0x45, 0xc7, 0x3f, 0xe6, 0x41, 0xc6, 0xb6, 0xab, + 0x6c, 0xc5, 0x10, 0x35, 0xe0, 0x85, 0x41, 0x17, 0x46, 0xe0, 0x08, 0x9d, 0x8e, 0x98, 0x13, 0xc6, + 0x08, 0x79, 0x65, 0x4f, 0x99, 0x0a, 0x19, 0xba, 0x81, 0xe7, 0x86, 0xed, 0xad, 0x64, 0xe8, 0x4c, + 0xba, 0x73, 0xb7, 0xb2, 0xaf, 0x2c, 0x45, 0x48, 0x39, 0x32, 0xa9, 0x23, 0x47, 0x29, 0x76, 0xe4, + 0x11, 0xaa, 0x03, 0x32, 0x6c, 0x2f, 0x0d, 0x1c, 0x19, 0x40, 0x19, 0x0a, 0x88, 0xd2, 0xaf, 0x3e, + 0x30, 0xd2, 0x1f, 0xc4, 0xfa, 0x1c, 0x89, 0x13, 0x11, 0xe6, 0xfa, 0x92, 0x35, 0x27, 0x13, 0xce, + 0x84, 0x08, 0x0d, 0x87, 0x49, 0xa2, 0xc7, 0xe8, 0xfa, 0xa7, 0x06, 0x27, 0xb9, 0x91, 0x41, 0x57, + 0xf0, 0xca, 0xd4, 0xad, 0xb6, 0xde, 0x6b, 0x35, 0x75, 0x0b, 0x0f, 0x71, 0x77, 0x60, 0x0d, 0xbe, + 0xf4, 0xb1, 0x45, 0xb0, 0x89, 0xc9, 0x10, 0x7f, 0x2a, 0x6f, 0xa0, 0x0b, 0xa8, 0x16, 0x4a, 0x30, + 0x21, 0x3d, 0x52, 0xd6, 0x50, 0x0d, 0x2e, 0x0a, 0xf9, 0x2d, 0x6e, 0x92, 0x41, 0x0b, 0x37, 0x07, + 0xe5, 0x4d, 0x74, 0x09, 0xe7, 0x85, 0x9a, 0x21, 0x26, 0x66, 0xa7, 0xd7, 0x2d, 0x6f, 0x35, 0x7e, + 0x69, 0xb0, 0xff, 0x10, 0x0f, 0x19, 0x69, 0xd4, 0x70, 0xb0, 0xa2, 0x95, 0x50, 0x59, 0x37, 0x82, + 0xd5, 0xf3, 0xa7, 0x36, 0xc3, 0x8d, 0x86, 0x3e, 0x87, 0xeb, 0x2b, 0x1d, 0x3a, 0x74, 0xb1, 0x46, + 0x1f, 0x4f, 0x64, 0xf5, 0xea, 0x69, 0x4e, 0x44, 0x30, 0xda, 0x55, 0x5b, 0xf7, 0xcd, 0xdf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x2a, 0xef, 0xf1, 0x6e, 0xae, 0x05, 0x00, 0x00, +} diff --git a/proto/sla/sl_global.proto b/proto/sla/sl_global.proto new file mode 100755 index 0000000..16e2984 --- /dev/null +++ b/proto/sla/sl_global.proto @@ -0,0 +1,189 @@ +// @file +// @brief Server RPC proto file. Client invokes to init the session +// on server. +// +// ---------------------------------------------------------------- +// Copyright (c) 2016 by Cisco Systems, Inc. +// All rights reserved. +// ----------------------------------------------------------------- +// +// + +syntax = "proto3"; +package service_layer; + +import "sl_common_types.proto"; + +// @defgroup SLGlobal +// @ingroup Common +// Global Initialization and Notifications. +// The following RPCs are used in global initialization and capability queries. +// @{ +service SLGlobal { + //@addtogroup SLGlobal + //@{ + ///; + + // Initialize the connection, and setup a notification channel. + // This MUST be the first call to setup the Service Layer connection. + // + // The caller MUST maintain the notification channel to be able to + // communicate with the server. + // If this channel is not properly established and maintained, all other + // RPC requests are rejected. + // + // The caller must send its version information as part of the SLInitMsg + // message. The server will reply with SL_GLOBAL_EVENT_TYPE_VERSION + // that tells the caller whether he can proceed or not. + // Refer to message SLGlobalNotif below for further details. + // + // After the version handshake, the notification channel is used for + // "push" event notifications, such as: + // - SLGlobalNotif.EventType = SL_GLOBAL_EVENT_TYPE_HEARTBEAT + // heartbeat notification messages are sent to the client on + // a periodic basis. + // Refer to SLGlobalNotif definition for further info. + rpc SLGlobalInitNotif(SLInitMsg) returns (stream SLGlobalNotif); + + // Get platform specific globals + rpc SLGlobalsGet(SLGlobalsGetMsg) returns (SLGlobalsGetMsgRsp); + //@} +} + +// Initialization message sent to the server. +// If the client and server are running compatible version numbers, a +// connection will be made and the server response will be received +// with a successful status code. +message SLInitMsg { + // Client's Major version of service-layer API (refer to sl_version.proto) + uint32 MajorVer = 1; + + // Minor Version + uint32 MinorVer = 2; + + // Sub-Version + uint32 SubVer = 3; +} + +// Server's response to the SLInitMsg. +// On Success (ErrStatus), the session with the server is established +// and the client is allowed to proceed. +message SLInitMsgRsp { + // Server's version of service-layer API (refer to sl_version.proto) + // Major-number revisions are NOT backwards compatible, + // unless otherwise specified. The Server may reject a session if there + // is a version number mismatch or non-backwards compatibility. + uint32 MajorVer = 1; + + // Minor Version + uint32 MinorVer = 2; + + // Sub-Version + uint32 SubVer = 3; +} + + +// Global Event Notification types. +enum SLGlobalNotifType { + // Reserved. 0x0 + SL_GLOBAL_EVENT_TYPE_RESERVED = 0x0; + + // Error. ErrStatus field elaborates on the message. 0x1 + SL_GLOBAL_EVENT_TYPE_ERROR = 0x1; + + // HeartBeat. 0x2 + SL_GLOBAL_EVENT_TYPE_HEARTBEAT = 0x2; + + // Version. SLInitMsgRsp field elaborates on the server version. 0x3 + SL_GLOBAL_EVENT_TYPE_VERSION = 0x3; +} + + +// Globals query message. +message SLGlobalNotif { + // Event Type. + SLGlobalNotifType EventType = 1; + + // Status code, interpreted based on the Event Type. + // + // case EventType == SL_GLOBAL_EVENT_TYPE_ERROR: + // case ErrStatus == SL_NOTIF_TERM: + // => Another client is attempting to take over the session. + // This session will be closed. + // case ErrStatus == (some error from SLErrorStatus) + // => Client must look into the specific error message returned. + // + // case EventType == SL_GLOBAL_EVENT_TYPE_HEARTBEAT: + // case ErrStatus == SL_SUCCESS + // => Client can safely ignore this heartbeat message. + // + // case EventType == SL_GLOBAL_EVENT_TYPE_VERSION: + // case ErrStatus == SL_SUCCESS + // => Client version accepted. + // case ErrStatus == SL_INIT_STATE_READY + // => Client version accepted. + // Any previous state was sucessfully recovered. + // case ErrStatus == SL_INIT_STATE_CLEAR + // => Client version accepted. Any previous state was lost. + // Client must replay all previous objects to server. + // case ErrStatus == SL_UNSUPPORTED_VER + // => Client and Server version mismatch. The client is not + // allowed to proceed, and the channel will be closed. + // case ErrStatus == (some error from SLErrorStatus) + // => Client must either try again, or look into the specific + // error message returned. + SLErrorStatus ErrStatus = 2; + + // Further info based on EventType. + oneof Event { + // case EventType == SL_GLOBAL_EVENT_TYPE_VERSION: + // => this field carries the Server version number. + SLInitMsgRsp InitRspMsg = 3; + } +} + +// Globals query message. +message SLGlobalsGetMsg { + +} + +// Platform specific globals Response. +message SLGlobalsGetMsgRsp { + // Corresponding error code + SLErrorStatus ErrStatus = 1; + + // Maximum vrf name length. + uint32 MaxVrfNameLength = 2; + + // Maximum interface name length. + uint32 MaxInterfaceNameLength = 3; + + // Maximum paths per Route/ILM Entry. + uint32 MaxPathsPerEntry = 4; + + // Maximum primary paths per Route/ILM Entry. + uint32 MaxPrimaryPathPerEntry = 5; + + // Maximum backup paths per Route/ILM Entry. + uint32 MaxBackupPathPerEntry = 6; + + // Maximum MPLS labels per Route/ILM Entry. + uint32 MaxMplsLabelsPerPath = 7; + + // Minimum Primary path id number. + uint32 MinPrimaryPathIdNum = 8; + + // Maximum Primary path id number. + uint32 MaxPrimaryPathIdNum = 9; + + // Minimum Pure Backup path id number. + uint32 MinBackupPathIdNum = 10; + + // Maximum Pure Backup path id number. + uint32 MaxBackupPathIdNum = 11; + + // Maximum number of remote addresses + uint32 MaxRemoteAddressNum = 12; +} + +// @} diff --git a/proto/sla/sl_route_common.pb.go b/proto/sla/sl_route_common.pb.go new file mode 100644 index 0000000..c6b0583 --- /dev/null +++ b/proto/sla/sl_route_common.pb.go @@ -0,0 +1,647 @@ +// Code generated by protoc-gen-go. +// source: sl_route_common.proto +// DO NOT EDIT! + +package service_layer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Route Globals Get Message +type SLRouteGlobalsGetMsg struct { +} + +func (m *SLRouteGlobalsGetMsg) Reset() { *m = SLRouteGlobalsGetMsg{} } +func (m *SLRouteGlobalsGetMsg) String() string { return proto.CompactTextString(m) } +func (*SLRouteGlobalsGetMsg) ProtoMessage() {} +func (*SLRouteGlobalsGetMsg) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +// Route Globals Get Message Response +type SLRouteGlobalsGetMsgRsp struct { + // Corresponding error code + ErrStatus *SLErrorStatus `protobuf:"bytes,1,opt,name=ErrStatus" json:"ErrStatus,omitempty"` + // Max VrfReg objects within a single VrfRegMsg message. + MaxVrfregPerVrfregmsg uint32 `protobuf:"varint,2,opt,name=MaxVrfregPerVrfregmsg" json:"MaxVrfregPerVrfregmsg,omitempty"` + // Max Route objects within a single RouteMsg message. + MaxRoutePerRoutemsg uint32 `protobuf:"varint,3,opt,name=MaxRoutePerRoutemsg" json:"MaxRoutePerRoutemsg,omitempty"` +} + +func (m *SLRouteGlobalsGetMsgRsp) Reset() { *m = SLRouteGlobalsGetMsgRsp{} } +func (m *SLRouteGlobalsGetMsgRsp) String() string { return proto.CompactTextString(m) } +func (*SLRouteGlobalsGetMsgRsp) ProtoMessage() {} +func (*SLRouteGlobalsGetMsgRsp) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *SLRouteGlobalsGetMsgRsp) GetErrStatus() *SLErrorStatus { + if m != nil { + return m.ErrStatus + } + return nil +} + +func (m *SLRouteGlobalsGetMsgRsp) GetMaxVrfregPerVrfregmsg() uint32 { + if m != nil { + return m.MaxVrfregPerVrfregmsg + } + return 0 +} + +func (m *SLRouteGlobalsGetMsgRsp) GetMaxRoutePerRoutemsg() uint32 { + if m != nil { + return m.MaxRoutePerRoutemsg + } + return 0 +} + +// Route Global Stats Get Message +type SLRouteGlobalStatsGetMsg struct { +} + +func (m *SLRouteGlobalStatsGetMsg) Reset() { *m = SLRouteGlobalStatsGetMsg{} } +func (m *SLRouteGlobalStatsGetMsg) String() string { return proto.CompactTextString(m) } +func (*SLRouteGlobalStatsGetMsg) ProtoMessage() {} +func (*SLRouteGlobalStatsGetMsg) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +// Route Global Stats Get Message Response +type SLRouteGlobalStatsGetMsgRsp struct { + // Corresponding error code + ErrStatus *SLErrorStatus `protobuf:"bytes,1,opt,name=ErrStatus" json:"ErrStatus,omitempty"` + // Num VRFs registered through the service layer. + VrfCount uint32 `protobuf:"varint,2,opt,name=VrfCount" json:"VrfCount,omitempty"` + // Num Routes added through the service layer. + RouteCount uint32 `protobuf:"varint,3,opt,name=RouteCount" json:"RouteCount,omitempty"` +} + +func (m *SLRouteGlobalStatsGetMsgRsp) Reset() { *m = SLRouteGlobalStatsGetMsgRsp{} } +func (m *SLRouteGlobalStatsGetMsgRsp) String() string { return proto.CompactTextString(m) } +func (*SLRouteGlobalStatsGetMsgRsp) ProtoMessage() {} +func (*SLRouteGlobalStatsGetMsgRsp) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *SLRouteGlobalStatsGetMsgRsp) GetErrStatus() *SLErrorStatus { + if m != nil { + return m.ErrStatus + } + return nil +} + +func (m *SLRouteGlobalStatsGetMsgRsp) GetVrfCount() uint32 { + if m != nil { + return m.VrfCount + } + return 0 +} + +func (m *SLRouteGlobalStatsGetMsgRsp) GetRouteCount() uint32 { + if m != nil { + return m.RouteCount + } + return 0 +} + +// VRF Registration message +type SLVrfReg struct { + // VRF Name. + VrfName string `protobuf:"bytes,1,opt,name=VrfName" json:"VrfName,omitempty"` + // Default Admin distance for routes programmed by this application + // Range [0-255] + // This default value is used if route objects' AdminDistance is 0. + // Refer to SLRouteCommon + AdminDistance uint32 `protobuf:"varint,2,opt,name=AdminDistance" json:"AdminDistance,omitempty"` + // In case the Service Layer -> RIB connection is lost, this specifies the + // timeout period after which RIB will automatically purge the installed + // routes, unless the service layer: + // 1. Re-registers (VRF) + // 2. Replay all routes + // 3. And send EOF, before the purge timeout + VrfPurgeIntervalSeconds uint32 `protobuf:"varint,3,opt,name=VrfPurgeIntervalSeconds" json:"VrfPurgeIntervalSeconds,omitempty"` +} + +func (m *SLVrfReg) Reset() { *m = SLVrfReg{} } +func (m *SLVrfReg) String() string { return proto.CompactTextString(m) } +func (*SLVrfReg) ProtoMessage() {} +func (*SLVrfReg) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *SLVrfReg) GetVrfName() string { + if m != nil { + return m.VrfName + } + return "" +} + +func (m *SLVrfReg) GetAdminDistance() uint32 { + if m != nil { + return m.AdminDistance + } + return 0 +} + +func (m *SLVrfReg) GetVrfPurgeIntervalSeconds() uint32 { + if m != nil { + return m.VrfPurgeIntervalSeconds + } + return 0 +} + +// VRF Registration messages. +type SLVrfRegMsg struct { + // Registration Operation + Oper SLRegOp `protobuf:"varint,1,opt,name=Oper,enum=service_layer.SLRegOp" json:"Oper,omitempty"` + // List of VRF registrations + VrfRegMsgs []*SLVrfReg `protobuf:"bytes,2,rep,name=VrfRegMsgs" json:"VrfRegMsgs,omitempty"` +} + +func (m *SLVrfRegMsg) Reset() { *m = SLVrfRegMsg{} } +func (m *SLVrfRegMsg) String() string { return proto.CompactTextString(m) } +func (*SLVrfRegMsg) ProtoMessage() {} +func (*SLVrfRegMsg) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *SLVrfRegMsg) GetOper() SLRegOp { + if m != nil { + return m.Oper + } + return SLRegOp_SL_REGOP_RESERVED +} + +func (m *SLVrfRegMsg) GetVrfRegMsgs() []*SLVrfReg { + if m != nil { + return m.VrfRegMsgs + } + return nil +} + +// VRF Registration message Result +type SLVrfRegMsgRes struct { + // Corresponding error code + ErrStatus *SLErrorStatus `protobuf:"bytes,1,opt,name=ErrStatus" json:"ErrStatus,omitempty"` + // VRF Name + VrfName string `protobuf:"bytes,2,opt,name=VrfName" json:"VrfName,omitempty"` +} + +func (m *SLVrfRegMsgRes) Reset() { *m = SLVrfRegMsgRes{} } +func (m *SLVrfRegMsgRes) String() string { return proto.CompactTextString(m) } +func (*SLVrfRegMsgRes) ProtoMessage() {} +func (*SLVrfRegMsgRes) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +func (m *SLVrfRegMsgRes) GetErrStatus() *SLErrorStatus { + if m != nil { + return m.ErrStatus + } + return nil +} + +func (m *SLVrfRegMsgRes) GetVrfName() string { + if m != nil { + return m.VrfName + } + return "" +} + +// VRF Registration message Response. +type SLVrfRegMsgRsp struct { + // Summary result of the bulk operation (refer to enum SLErrorStatus) + // In general, the StatusSummary implies one of 3 things: + // 1. SL_SUCCESS: signifies that the entire bulk operation was successful. + // In this case, the Results list is empty. + // 2. SL_SOME_ERR: signifies that the operation failed for one or more + // entries. In this case, Results holds the result for + // each individual entry in the bulk. + // 3. SL_RPC_XXX: signifies that the entire bulk operation failed. + // In this case, the Results list is empty. + StatusSummary *SLErrorStatus `protobuf:"bytes,1,opt,name=StatusSummary" json:"StatusSummary,omitempty"` + // In case of errors, this field indicates which entry in the bulk was + // erroneous. + Results []*SLVrfRegMsgRes `protobuf:"bytes,2,rep,name=Results" json:"Results,omitempty"` +} + +func (m *SLVrfRegMsgRsp) Reset() { *m = SLVrfRegMsgRsp{} } +func (m *SLVrfRegMsgRsp) String() string { return proto.CompactTextString(m) } +func (*SLVrfRegMsgRsp) ProtoMessage() {} +func (*SLVrfRegMsgRsp) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *SLVrfRegMsgRsp) GetStatusSummary() *SLErrorStatus { + if m != nil { + return m.StatusSummary + } + return nil +} + +func (m *SLVrfRegMsgRsp) GetResults() []*SLVrfRegMsgRes { + if m != nil { + return m.Results + } + return nil +} + +// VRF Get Message +type SLVrfRegGetMsg struct { + // VRF name (key). + // If the Key is not specified, then request up to the first + // 'EntriesCount' entries. + VrfName string `protobuf:"bytes,1,opt,name=VrfName" json:"VrfName,omitempty"` + // Number of entries requested + EntriesCount uint32 `protobuf:"varint,2,opt,name=EntriesCount" json:"EntriesCount,omitempty"` + // if GetNext is FALSE: + // request up to 'EntriesCount' entries starting from the key + // If GetNext is TRUE, or if the key exact match is not found: + // request up to 'EntriesCount' entries starting from the key's next + GetNext bool `protobuf:"varint,3,opt,name=GetNext" json:"GetNext,omitempty"` +} + +func (m *SLVrfRegGetMsg) Reset() { *m = SLVrfRegGetMsg{} } +func (m *SLVrfRegGetMsg) String() string { return proto.CompactTextString(m) } +func (*SLVrfRegGetMsg) ProtoMessage() {} +func (*SLVrfRegGetMsg) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} } + +func (m *SLVrfRegGetMsg) GetVrfName() string { + if m != nil { + return m.VrfName + } + return "" +} + +func (m *SLVrfRegGetMsg) GetEntriesCount() uint32 { + if m != nil { + return m.EntriesCount + } + return 0 +} + +func (m *SLVrfRegGetMsg) GetGetNext() bool { + if m != nil { + return m.GetNext + } + return false +} + +// VRF Get Message Response +type SLVrfRegGetMsgRsp struct { + // End Of File. + // When set to True, it indicates that the server has returned M, where + // M < N, of the original N requested Entries. + Eof bool `protobuf:"varint,1,opt,name=Eof" json:"Eof,omitempty"` + // Status of the Get operation + ErrStatus *SLErrorStatus `protobuf:"bytes,2,opt,name=ErrStatus" json:"ErrStatus,omitempty"` + // Returned entries as requested in the Get operation. + // if ErrStatus is SL_SUCCESS, Entries contains the info requested + Entries []*SLVrfReg `protobuf:"bytes,3,rep,name=Entries" json:"Entries,omitempty"` +} + +func (m *SLVrfRegGetMsgRsp) Reset() { *m = SLVrfRegGetMsgRsp{} } +func (m *SLVrfRegGetMsgRsp) String() string { return proto.CompactTextString(m) } +func (*SLVrfRegGetMsgRsp) ProtoMessage() {} +func (*SLVrfRegGetMsgRsp) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} } + +func (m *SLVrfRegGetMsgRsp) GetEof() bool { + if m != nil { + return m.Eof + } + return false +} + +func (m *SLVrfRegGetMsgRsp) GetErrStatus() *SLErrorStatus { + if m != nil { + return m.ErrStatus + } + return nil +} + +func (m *SLVrfRegGetMsgRsp) GetEntries() []*SLVrfReg { + if m != nil { + return m.Entries + } + return nil +} + +// VRF Get Stats Message Response +type SLVRFGetStatsMsgRes struct { + // VRF name as key + VrfName string `protobuf:"bytes,1,opt,name=VrfName" json:"VrfName,omitempty"` + // Num VRF Routes added through the service layer. + RouteCount uint32 `protobuf:"varint,2,opt,name=RouteCount" json:"RouteCount,omitempty"` +} + +func (m *SLVRFGetStatsMsgRes) Reset() { *m = SLVRFGetStatsMsgRes{} } +func (m *SLVRFGetStatsMsgRes) String() string { return proto.CompactTextString(m) } +func (*SLVRFGetStatsMsgRes) ProtoMessage() {} +func (*SLVRFGetStatsMsgRes) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{10} } + +func (m *SLVRFGetStatsMsgRes) GetVrfName() string { + if m != nil { + return m.VrfName + } + return "" +} + +func (m *SLVRFGetStatsMsgRes) GetRouteCount() uint32 { + if m != nil { + return m.RouteCount + } + return 0 +} + +// VRF Get Stats Message Response +type SLVRFGetStatsMsgRsp struct { + // End Of File. + // When set to True, it indicates that the server has returned M, where + // M < N, of the original N requested Entries. + Eof bool `protobuf:"varint,1,opt,name=Eof" json:"Eof,omitempty"` + // Status of the Get Stats operation + ErrStatus *SLErrorStatus `protobuf:"bytes,2,opt,name=ErrStatus" json:"ErrStatus,omitempty"` + // Returned entries as requested in the Get Stats operation. + // if ErrStatus is SL_SUCCESS, Entries contains the info requested + Entries []*SLVRFGetStatsMsgRes `protobuf:"bytes,3,rep,name=Entries" json:"Entries,omitempty"` +} + +func (m *SLVRFGetStatsMsgRsp) Reset() { *m = SLVRFGetStatsMsgRsp{} } +func (m *SLVRFGetStatsMsgRsp) String() string { return proto.CompactTextString(m) } +func (*SLVRFGetStatsMsgRsp) ProtoMessage() {} +func (*SLVRFGetStatsMsgRsp) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{11} } + +func (m *SLVRFGetStatsMsgRsp) GetEof() bool { + if m != nil { + return m.Eof + } + return false +} + +func (m *SLVRFGetStatsMsgRsp) GetErrStatus() *SLErrorStatus { + if m != nil { + return m.ErrStatus + } + return nil +} + +func (m *SLVRFGetStatsMsgRsp) GetEntries() []*SLVRFGetStatsMsgRes { + if m != nil { + return m.Entries + } + return nil +} + +// Common IPv4/IPv6 route attributes. +type SLRouteCommon struct { + // Adminstrative distance of the route. [0-255]. + // RIB uses this field to break the tie when multiple + // sources install the same route. + // Lower distance is preferred over higher distance. + // The per route object admin distance overrides the default's admin + // distance set at VRF registration. see SLVrfReg + AdminDistance uint32 `protobuf:"varint,1,opt,name=AdminDistance" json:"AdminDistance,omitempty"` + // Local label associated with this route. + // This is an optional field that can be used to simulatenously setup an + // ILM entry (e.g. head end of an MPLS LSP) for the same route. + // This is especially useful when setting up an MPLS LSP (a /32-route + // towards the remote LSP peer e.g. 2.2.2.2/32) which is required for MPLS + // VPN labeled routes. + // + // Note: MPLS VPN labeled routes can resolve only on: + // - /32-routes with valid LocalLabel and a valid egress MPLS path label + LocalLabel uint32 `protobuf:"varint,2,opt,name=LocalLabel" json:"LocalLabel,omitempty"` + // Route Tag. + // Routes are usually tagged to prevent loops during redistribution between + // protocols. + Tag uint32 `protobuf:"varint,3,opt,name=Tag" json:"Tag,omitempty"` +} + +func (m *SLRouteCommon) Reset() { *m = SLRouteCommon{} } +func (m *SLRouteCommon) String() string { return proto.CompactTextString(m) } +func (*SLRouteCommon) ProtoMessage() {} +func (*SLRouteCommon) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{12} } + +func (m *SLRouteCommon) GetAdminDistance() uint32 { + if m != nil { + return m.AdminDistance + } + return 0 +} + +func (m *SLRouteCommon) GetLocalLabel() uint32 { + if m != nil { + return m.LocalLabel + } + return 0 +} + +func (m *SLRouteCommon) GetTag() uint32 { + if m != nil { + return m.Tag + } + return 0 +} + +// Route Path attributes. +// +// FRR Note: +// Failover from primary to backup is based on the trigger used (e.g. +// link down, BFD, etc.). Revertion is mainly timeout based. The timeout +// value is platform specific and is not configurable. +type SLRoutePath struct { + // One of IPv4 or IPv6 address + NexthopAddress *SLIpAddress `protobuf:"bytes,1,opt,name=NexthopAddress" json:"NexthopAddress,omitempty"` + // Outgoing interface name for the path. + NexthopInterface *SLInterface `protobuf:"bytes,2,opt,name=NexthopInterface" json:"NexthopInterface,omitempty"` + // Load metric for this path. + // Used for equal/unequal cost load balancing of traffic distribution. + LoadMetric uint32 `protobuf:"varint,3,opt,name=LoadMetric" json:"LoadMetric,omitempty"` + // Path VRF name. This field is used ONLY if the path is in a different + // VRF than the route (e.g. VPN cases) + VrfName string `protobuf:"bytes,4,opt,name=VrfName" json:"VrfName,omitempty"` + // Route Metric. + // The metric is typically based on information like load, hop count, + // MTU, reliability of the path, etc. + Metric uint32 `protobuf:"varint,5,opt,name=Metric" json:"Metric,omitempty"` + // Path identifier. + // Path-id is used to uniquely identify a path when it comes to + // protection (Fast Re-Route - FRR). It is not used otherwise. + // + // In general, for FRR, There are 3 main path attributes: + // 1. Primary. The path is the main path to carry traffic. + // 2. Protected. A primary path with a configured backup path. + // 3. Backup. The path is protecting a primary path. + // + // NOTE1: a primary path (A) can be simultaneously protected (by B), and + // acting as a backup for another path (C). + // In this example, the primary path C is protected by A (which happens to + // be primary). So the primary path (A) is Primary, Protected, and Backup. + // + // The following are various path types based on combinations of attributes: + // 1. Pure Primary i.e. Not Protected and is not a Backup. + // => PathId is optional. ProtectedPathBitmap = 0x0 + // 2. Primary and Protected. Path is not a Backup. + // => PathId is mandatory. ProtectedPathBitmap = 0x0 + // 3. Primary and Not Protected. Path is also a Backup. + // => PathId is mandatory. ProtectedPathBitmap = 0xYYYY + // 4. Primary and Protected. Path is also a Backup. + // => PathId is mandatory. ProtectedPathBitmap = 0xYYYY + // 5. Pure Backup. Protection is not allowed for backup paths. + // => PathId is mandatory. ProtectedPathBitmap = 0xYYYY + // + // NOTE2: Pure backup path-id uses a different range than primary path-ids. + // The valid range of primary path IDs, and pure backup path IDS are + // platform dependent and can be retrieved through the client init message. + PathId uint32 `protobuf:"varint,6,opt,name=PathId" json:"PathId,omitempty"` + // Path protection bitmap. + // The bitmap of paths this Backup path is protecting. + // Example: If this path is protecting paths with IDs 4, 5 and 6, then + // set bitmap to: + // 0x38 ==> 0011 1000 + // || |-- path 4 + // ||-- path 5 + // |-- path 6 + // (1 << (pathId_1 - 1)) | (1 << (pathId_2 - 1)) | (1 << (pathId_3 - 1)) + ProtectedPathBitmap []uint64 `protobuf:"varint,7,rep,packed,name=ProtectedPathBitmap" json:"ProtectedPathBitmap,omitempty"` + // MPLS label stack. + // Stack of labels that is pushed when the packet is switched out. + // Label size is LSB 20 bits. Forwarding will set EXP, TTL and BOS. + // For primary path, typically only 1 label is used. + // For backup paths, more than 1 label can be used. If more than one label + // is used, remote backup addresses must be specified. + // The maximum number of labels pushed for primary and backup are + // platform dependent. + LabelStack []uint32 `protobuf:"varint,8,rep,packed,name=LabelStack" json:"LabelStack,omitempty"` + // MPLS Remote router backup address. + // This field is used only for backup MPLS path with more than one label + // For N+1 backup labels, N remote backup addresses must be specified. + RemoteAddress []*SLIpAddress `protobuf:"bytes,9,rep,name=RemoteAddress" json:"RemoteAddress,omitempty"` +} + +func (m *SLRoutePath) Reset() { *m = SLRoutePath{} } +func (m *SLRoutePath) String() string { return proto.CompactTextString(m) } +func (*SLRoutePath) ProtoMessage() {} +func (*SLRoutePath) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{13} } + +func (m *SLRoutePath) GetNexthopAddress() *SLIpAddress { + if m != nil { + return m.NexthopAddress + } + return nil +} + +func (m *SLRoutePath) GetNexthopInterface() *SLInterface { + if m != nil { + return m.NexthopInterface + } + return nil +} + +func (m *SLRoutePath) GetLoadMetric() uint32 { + if m != nil { + return m.LoadMetric + } + return 0 +} + +func (m *SLRoutePath) GetVrfName() string { + if m != nil { + return m.VrfName + } + return "" +} + +func (m *SLRoutePath) GetMetric() uint32 { + if m != nil { + return m.Metric + } + return 0 +} + +func (m *SLRoutePath) GetPathId() uint32 { + if m != nil { + return m.PathId + } + return 0 +} + +func (m *SLRoutePath) GetProtectedPathBitmap() []uint64 { + if m != nil { + return m.ProtectedPathBitmap + } + return nil +} + +func (m *SLRoutePath) GetLabelStack() []uint32 { + if m != nil { + return m.LabelStack + } + return nil +} + +func (m *SLRoutePath) GetRemoteAddress() []*SLIpAddress { + if m != nil { + return m.RemoteAddress + } + return nil +} + +func init() { + proto.RegisterType((*SLRouteGlobalsGetMsg)(nil), "service_layer.SLRouteGlobalsGetMsg") + proto.RegisterType((*SLRouteGlobalsGetMsgRsp)(nil), "service_layer.SLRouteGlobalsGetMsgRsp") + proto.RegisterType((*SLRouteGlobalStatsGetMsg)(nil), "service_layer.SLRouteGlobalStatsGetMsg") + proto.RegisterType((*SLRouteGlobalStatsGetMsgRsp)(nil), "service_layer.SLRouteGlobalStatsGetMsgRsp") + proto.RegisterType((*SLVrfReg)(nil), "service_layer.SLVrfReg") + proto.RegisterType((*SLVrfRegMsg)(nil), "service_layer.SLVrfRegMsg") + proto.RegisterType((*SLVrfRegMsgRes)(nil), "service_layer.SLVrfRegMsgRes") + proto.RegisterType((*SLVrfRegMsgRsp)(nil), "service_layer.SLVrfRegMsgRsp") + proto.RegisterType((*SLVrfRegGetMsg)(nil), "service_layer.SLVrfRegGetMsg") + proto.RegisterType((*SLVrfRegGetMsgRsp)(nil), "service_layer.SLVrfRegGetMsgRsp") + proto.RegisterType((*SLVRFGetStatsMsgRes)(nil), "service_layer.SLVRFGetStatsMsgRes") + proto.RegisterType((*SLVRFGetStatsMsgRsp)(nil), "service_layer.SLVRFGetStatsMsgRsp") + proto.RegisterType((*SLRouteCommon)(nil), "service_layer.SLRouteCommon") + proto.RegisterType((*SLRoutePath)(nil), "service_layer.SLRoutePath") +} + +func init() { proto.RegisterFile("sl_route_common.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 716 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff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bd, 0x6f, 0x65, + 0x35, 0xcb, 0x66, 0x39, 0x32, 0x79, 0x45, 0x8e, 0x61, 0x43, 0x35, 0xc3, 0x55, 0x9a, 0x1d, 0x0d, + 0x87, 0x1c, 0x85, 0x9d, 0xac, 0xfa, 0x1c, 0xfb, 0x33, 0x1b, 0x41, 0xef, 0x21, 0xc8, 0x29, 0x6c, + 0xe6, 0x16, 0xbd, 0x38, 0x42, 0x96, 0x6f, 0xa0, 0x85, 0xff, 0x62, 0x23, 0xe8, 0x1c, 0xc6, 0xa8, + 0x61, 0xc3, 0x2e, 0x4a, 0x3e, 0x0a, 0xec, 0x36, 0x9c, 0x5a, 0x66, 0x5b, 0x60, 0xa5, 0xd8, 0x02, + 0x3b, 0xb0, 0x9a, 0xa3, 0xfe, 0xd2, 0xa8, 0xfc, 0xa6, 0xec, 0x4a, 0xe5, 0xd9, 0xd0, 0x5d, 0x35, + 0x76, 0x73, 0x53, 0x5f, 0x8f, 0x1e, 0x4f, 0x25, 0x06, 0x12, 0x87, 0xca, 0x74, 0x3c, 0x92, 0x09, + 0xcb, 0xdc, 0x4a, 0xa3, 0xdc, 0x5c, 0xa1, 0x8b, 0x5c, 0x9a, 0x9b, 0x2a, 0xa9, 0x2f, 0x59, 0xf0, + 0xd1, 0xad, 0x36, 0xca, 0x9a, 0xdb, 0x9d, 0x85, 0xbc, 0x83, 0x1a, 0xc5, 0x24, 0x95, 0x68, 0xcb, + 0xb8, 0xa6, 0x9b, 0xe0, 0xa1, 0x32, 0x16, 0x01, 0x97, 0xab, 0xfa, 0xf3, 0xfb, 0xf2, 0x67, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x26, 0x5d, 0x76, 0xea, 0xbd, 0x07, 0x00, 0x00, +} diff --git a/proto/sla/sl_route_common.proto b/proto/sla/sl_route_common.proto new file mode 100755 index 0000000..efc3edf --- /dev/null +++ b/proto/sla/sl_route_common.proto @@ -0,0 +1,287 @@ +// @file +// @brief Client RPC proto file for common route types. +// This file defines common route features, including the Prefix, +// VRF information, path information, administrative distance, and +// default route status for a route object. +// +// ---------------------------------------------------------------- +// Copyright (c) 2016 by Cisco Systems, Inc. +// All rights reserved. +// ----------------------------------------------------------------- +// +// + +//@defgroup Route +//@brief Route service definitions. + +syntax = "proto3"; +package service_layer; + +import "sl_common_types.proto"; + +// @defgroup SLRouteCommon +// @ingroup Route +// Common IPv4, IPv6 Route messages. +// The following messages are used in both IPv4 and IPv6 Route operations. +// @{ +//; + +// Route Globals Get Message +message SLRouteGlobalsGetMsg { + +} + +// Route Globals Get Message Response +message SLRouteGlobalsGetMsgRsp { + // Corresponding error code + SLErrorStatus ErrStatus = 1; + + // Max VrfReg objects within a single VrfRegMsg message. + uint32 MaxVrfregPerVrfregmsg = 2; + + // Max Route objects within a single RouteMsg message. + uint32 MaxRoutePerRoutemsg = 3; +} + +// Route Global Stats Get Message +message SLRouteGlobalStatsGetMsg { + +} + +// Route Global Stats Get Message Response +message SLRouteGlobalStatsGetMsgRsp { + // Corresponding error code + SLErrorStatus ErrStatus = 1; + + // Num VRFs registered through the service layer. + uint32 VrfCount = 2; + + // Num Routes added through the service layer. + uint32 RouteCount = 3; +} + + +// VRF Registration message +message SLVrfReg { + // VRF Name. + string VrfName = 1; + + // Default Admin distance for routes programmed by this application + // Range [0-255] + // This default value is used if route objects' AdminDistance is 0. + // Refer to SLRouteCommon + uint32 AdminDistance = 2; + + // In case the Service Layer -> RIB connection is lost, this specifies the + // timeout period after which RIB will automatically purge the installed + // routes, unless the service layer: + // 1. Re-registers (VRF) + // 2. Replay all routes + // 3. And send EOF, before the purge timeout + uint32 VrfPurgeIntervalSeconds = 3; +} + +// VRF Registration messages. +message SLVrfRegMsg { + // Registration Operation + SLRegOp Oper = 1; + + // List of VRF registrations + repeated SLVrfReg VrfRegMsgs = 2; +} + +// VRF Registration message Result +message SLVrfRegMsgRes { + // Corresponding error code + SLErrorStatus ErrStatus = 1; + + // VRF Name + string VrfName = 2; +} + +// VRF Registration message Response. +message SLVrfRegMsgRsp { + // Summary result of the bulk operation (refer to enum SLErrorStatus) + // In general, the StatusSummary implies one of 3 things: + // 1. SL_SUCCESS: signifies that the entire bulk operation was successful. + // In this case, the Results list is empty. + // 2. SL_SOME_ERR: signifies that the operation failed for one or more + // entries. In this case, Results holds the result for + // each individual entry in the bulk. + // 3. SL_RPC_XXX: signifies that the entire bulk operation failed. + // In this case, the Results list is empty. + SLErrorStatus StatusSummary = 1; + + // In case of errors, this field indicates which entry in the bulk was + // erroneous. + repeated SLVrfRegMsgRes Results = 2; +} + +// VRF Get Message +message SLVrfRegGetMsg { + // VRF name (key). + // If the Key is not specified, then request up to the first + // 'EntriesCount' entries. + string VrfName = 1; + + // Number of entries requested + uint32 EntriesCount = 2; + + // if GetNext is FALSE: + // request up to 'EntriesCount' entries starting from the key + // If GetNext is TRUE, or if the key exact match is not found: + // request up to 'EntriesCount' entries starting from the key's next + bool GetNext = 3; +} + +// VRF Get Message Response +message SLVrfRegGetMsgRsp { + // End Of File. + // When set to True, it indicates that the server has returned M, where + // M < N, of the original N requested Entries. + bool Eof = 1; + + // Status of the Get operation + SLErrorStatus ErrStatus = 2; + + // Returned entries as requested in the Get operation. + // if ErrStatus is SL_SUCCESS, Entries contains the info requested + repeated SLVrfReg Entries = 3; +} + +// VRF Get Stats Message Response +message SLVRFGetStatsMsgRes { + // VRF name as key + string VrfName = 1; + + // Num VRF Routes added through the service layer. + uint32 RouteCount = 2; +} + +// VRF Get Stats Message Response +message SLVRFGetStatsMsgRsp { + // End Of File. + // When set to True, it indicates that the server has returned M, where + // M < N, of the original N requested Entries. + bool Eof = 1; + + // Status of the Get Stats operation + SLErrorStatus ErrStatus = 2; + + // Returned entries as requested in the Get Stats operation. + // if ErrStatus is SL_SUCCESS, Entries contains the info requested + repeated SLVRFGetStatsMsgRes Entries = 3; +} + +// Common IPv4/IPv6 route attributes. +message SLRouteCommon { + // Adminstrative distance of the route. [0-255]. + // RIB uses this field to break the tie when multiple + // sources install the same route. + // Lower distance is preferred over higher distance. + // The per route object admin distance overrides the default's admin + // distance set at VRF registration. see SLVrfReg + uint32 AdminDistance = 1; + + // Local label associated with this route. + // This is an optional field that can be used to simulatenously setup an + // ILM entry (e.g. head end of an MPLS LSP) for the same route. + // This is especially useful when setting up an MPLS LSP (a /32-route + // towards the remote LSP peer e.g. 2.2.2.2/32) which is required for MPLS + // VPN labeled routes. + // + // Note: MPLS VPN labeled routes can resolve only on: + // - /32-routes with valid LocalLabel and a valid egress MPLS path label + uint32 LocalLabel = 2; + + // Route Tag. + // Routes are usually tagged to prevent loops during redistribution between + // protocols. + uint32 Tag = 3; +} + +// Route Path attributes. +// +// FRR Note: +// Failover from primary to backup is based on the trigger used (e.g. +// link down, BFD, etc.). Revertion is mainly timeout based. The timeout +// value is platform specific and is not configurable. +message SLRoutePath { + // One of IPv4 or IPv6 address + SLIpAddress NexthopAddress = 1; + + // Outgoing interface name for the path. + SLInterface NexthopInterface = 2; + + // Load metric for this path. + // Used for equal/unequal cost load balancing of traffic distribution. + uint32 LoadMetric = 3; + + // Path VRF name. This field is used ONLY if the path is in a different + // VRF than the route (e.g. VPN cases) + string VrfName = 4; + + // Route Metric. + // The metric is typically based on information like load, hop count, + // MTU, reliability of the path, etc. + uint32 Metric = 5; + + // Path identifier. + // Path-id is used to uniquely identify a path when it comes to + // protection (Fast Re-Route - FRR). It is not used otherwise. + // + // In general, for FRR, There are 3 main path attributes: + // 1. Primary. The path is the main path to carry traffic. + // 2. Protected. A primary path with a configured backup path. + // 3. Backup. The path is protecting a primary path. + // + // NOTE1: a primary path (A) can be simultaneously protected (by B), and + // acting as a backup for another path (C). + // In this example, the primary path C is protected by A (which happens to + // be primary). So the primary path (A) is Primary, Protected, and Backup. + // + // The following are various path types based on combinations of attributes: + // 1. Pure Primary i.e. Not Protected and is not a Backup. + // => PathId is optional. ProtectedPathBitmap = 0x0 + // 2. Primary and Protected. Path is not a Backup. + // => PathId is mandatory. ProtectedPathBitmap = 0x0 + // 3. Primary and Not Protected. Path is also a Backup. + // => PathId is mandatory. ProtectedPathBitmap = 0xYYYY + // 4. Primary and Protected. Path is also a Backup. + // => PathId is mandatory. ProtectedPathBitmap = 0xYYYY + // 5. Pure Backup. Protection is not allowed for backup paths. + // => PathId is mandatory. ProtectedPathBitmap = 0xYYYY + // + // NOTE2: Pure backup path-id uses a different range than primary path-ids. + // The valid range of primary path IDs, and pure backup path IDS are + // platform dependent and can be retrieved through the client init message. + uint32 PathId = 6; + + // Path protection bitmap. + // The bitmap of paths this Backup path is protecting. + // Example: If this path is protecting paths with IDs 4, 5 and 6, then + // set bitmap to: + // 0x38 ==> 0011 1000 + // || |-- path 4 + // ||-- path 5 + // |-- path 6 + // (1 << (pathId_1 - 1)) | (1 << (pathId_2 - 1)) | (1 << (pathId_3 - 1)) + repeated uint64 ProtectedPathBitmap = 7; + + // MPLS label stack. + // Stack of labels that is pushed when the packet is switched out. + // Label size is LSB 20 bits. Forwarding will set EXP, TTL and BOS. + // For primary path, typically only 1 label is used. + // For backup paths, more than 1 label can be used. If more than one label + // is used, remote backup addresses must be specified. + // The maximum number of labels pushed for primary and backup are + // platform dependent. + repeated uint32 LabelStack = 8; + + // MPLS Remote router backup address. + // This field is used only for backup MPLS path with more than one label + // For N+1 backup labels, N remote backup addresses must be specified. + repeated SLIpAddress RemoteAddress = 9; +} + +// @} diff --git a/proto/sla/sl_route_ipv6.pb.go b/proto/sla/sl_route_ipv6.pb.go new file mode 100644 index 0000000..cade5eb --- /dev/null +++ b/proto/sla/sl_route_ipv6.pb.go @@ -0,0 +1,867 @@ +// Code generated by protoc-gen-go. +// source: sl_route_ipv6.proto +// DO NOT EDIT! + +package service_layer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// IPv6 route +type SLRoutev6 struct { + // IPv6 Prefix + // 0:: - ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff + Prefix []byte `protobuf:"bytes,1,opt,name=Prefix,proto3" json:"Prefix,omitempty"` + // IPv6 prefix length [0-128] + PrefixLen uint32 `protobuf:"varint,2,opt,name=PrefixLen" json:"PrefixLen,omitempty"` + // Common route attributes + RouteCommon *SLRouteCommon `protobuf:"bytes,3,opt,name=RouteCommon" json:"RouteCommon,omitempty"` + // List of route paths for a particular route. + // Specifying more than one path is allowed for ECMP/UCMP cases + PathList []*SLRoutePath `protobuf:"bytes,4,rep,name=PathList" json:"PathList,omitempty"` +} + +func (m *SLRoutev6) Reset() { *m = SLRoutev6{} } +func (m *SLRoutev6) String() string { return proto.CompactTextString(m) } +func (*SLRoutev6) ProtoMessage() {} +func (*SLRoutev6) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *SLRoutev6) GetPrefix() []byte { + if m != nil { + return m.Prefix + } + return nil +} + +func (m *SLRoutev6) GetPrefixLen() uint32 { + if m != nil { + return m.PrefixLen + } + return 0 +} + +func (m *SLRoutev6) GetRouteCommon() *SLRouteCommon { + if m != nil { + return m.RouteCommon + } + return nil +} + +func (m *SLRoutev6) GetPathList() []*SLRoutePath { + if m != nil { + return m.PathList + } + return nil +} + +// List of routes for bulk download +type SLRoutev6Msg struct { + // Route Object Operations + Oper SLObjectOp `protobuf:"varint,1,opt,name=Oper,enum=service_layer.SLObjectOp" json:"Oper,omitempty"` + // Correlator. This can be used to correlate replies with requests. + // The Server simply reflects this field back in the reply. + Correlator uint64 `protobuf:"varint,2,opt,name=Correlator" json:"Correlator,omitempty"` + // VRF name. + VrfName string `protobuf:"bytes,3,opt,name=VrfName" json:"VrfName,omitempty"` + // List of routes for the VRF specified above + Routes []*SLRoutev6 `protobuf:"bytes,4,rep,name=Routes" json:"Routes,omitempty"` +} + +func (m *SLRoutev6Msg) Reset() { *m = SLRoutev6Msg{} } +func (m *SLRoutev6Msg) String() string { return proto.CompactTextString(m) } +func (*SLRoutev6Msg) ProtoMessage() {} +func (*SLRoutev6Msg) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *SLRoutev6Msg) GetOper() SLObjectOp { + if m != nil { + return m.Oper + } + return SLObjectOp_SL_OBJOP_RESERVED +} + +func (m *SLRoutev6Msg) GetCorrelator() uint64 { + if m != nil { + return m.Correlator + } + return 0 +} + +func (m *SLRoutev6Msg) GetVrfName() string { + if m != nil { + return m.VrfName + } + return "" +} + +func (m *SLRoutev6Msg) GetRoutes() []*SLRoutev6 { + if m != nil { + return m.Routes + } + return nil +} + +// IPv6 route result, uniquely identified by the Prefix/PrefixLen pair +type SLRoutev6Res struct { + // Corresponding error code + ErrStatus *SLErrorStatus `protobuf:"bytes,1,opt,name=ErrStatus" json:"ErrStatus,omitempty"` + // IPv6 Prefix + Prefix []byte `protobuf:"bytes,2,opt,name=Prefix,proto3" json:"Prefix,omitempty"` + // IPv6 prefix length, [0-32] + PrefixLen uint32 `protobuf:"varint,3,opt,name=PrefixLen" json:"PrefixLen,omitempty"` +} + +func (m *SLRoutev6Res) Reset() { *m = SLRoutev6Res{} } +func (m *SLRoutev6Res) String() string { return proto.CompactTextString(m) } +func (*SLRoutev6Res) ProtoMessage() {} +func (*SLRoutev6Res) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} } + +func (m *SLRoutev6Res) GetErrStatus() *SLErrorStatus { + if m != nil { + return m.ErrStatus + } + return nil +} + +func (m *SLRoutev6Res) GetPrefix() []byte { + if m != nil { + return m.Prefix + } + return nil +} + +func (m *SLRoutev6Res) GetPrefixLen() uint32 { + if m != nil { + return m.PrefixLen + } + return 0 +} + +// IPv6 bulk route result status +type SLRoutev6MsgRsp struct { + // Correlator. This can be used to correlate replies with requests. + // The Server simply reflects this field back in the reply. + Correlator uint64 `protobuf:"varint,1,opt,name=Correlator" json:"Correlator,omitempty"` + // VRF name (matches the VRF name of the original operation) + VrfName string `protobuf:"bytes,2,opt,name=VrfName" json:"VrfName,omitempty"` + // Summary result of the bulk operation (refer to enum SLErrorStatus) + // In general, the StatusSummary implies one of 3 things: + // 1. SL_SUCCESS: signifies that the entire bulk operation was successful. + // In this case, the Results list is empty. + // 2. SL_SOME_ERR: signifies that the operation failed for one or more + // entries. In this case, Results holds the result for + // each individual entry in the bulk. + // 3. SL_RPC_XXX: signifies that the entire bulk operation failed. + // In this case, the Results list is empty. + StatusSummary *SLErrorStatus `protobuf:"bytes,3,opt,name=StatusSummary" json:"StatusSummary,omitempty"` + // In case of errors, this field indicates which entry in the bulk was + // erroneous. + Results []*SLRoutev6Res `protobuf:"bytes,4,rep,name=Results" json:"Results,omitempty"` +} + +func (m *SLRoutev6MsgRsp) Reset() { *m = SLRoutev6MsgRsp{} } +func (m *SLRoutev6MsgRsp) String() string { return proto.CompactTextString(m) } +func (*SLRoutev6MsgRsp) ProtoMessage() {} +func (*SLRoutev6MsgRsp) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} } + +func (m *SLRoutev6MsgRsp) GetCorrelator() uint64 { + if m != nil { + return m.Correlator + } + return 0 +} + +func (m *SLRoutev6MsgRsp) GetVrfName() string { + if m != nil { + return m.VrfName + } + return "" +} + +func (m *SLRoutev6MsgRsp) GetStatusSummary() *SLErrorStatus { + if m != nil { + return m.StatusSummary + } + return nil +} + +func (m *SLRoutev6MsgRsp) GetResults() []*SLRoutev6Res { + if m != nil { + return m.Results + } + return nil +} + +// Used to retrieve route attributes +type SLRoutev6GetMsg struct { + // Correlator. This can be used to correlate replies with requests. + // The Server simply reflects this field back in the reply. + Correlator uint64 `protobuf:"varint,1,opt,name=Correlator" json:"Correlator,omitempty"` + // VRF name. + // If the Key is not specified, then request up to the first + // 'EntriesCount' entries. + VrfName string `protobuf:"bytes,2,opt,name=VrfName" json:"VrfName,omitempty"` + // IPv6 Prefix + Prefix []byte `protobuf:"bytes,3,opt,name=Prefix,proto3" json:"Prefix,omitempty"` + // IPv6 prefix length, [0-32] + PrefixLen uint32 `protobuf:"varint,4,opt,name=PrefixLen" json:"PrefixLen,omitempty"` + // Number of entries requested + EntriesCount uint32 `protobuf:"varint,5,opt,name=EntriesCount" json:"EntriesCount,omitempty"` + // if GetNext is FALSE: + // request up to 'EntriesCount' entries starting from the key + // If GetNext is TRUE, or if the key exact match is not found: + // request up to 'EntriesCount' entries starting from the key's next + GetNext bool `protobuf:"varint,6,opt,name=GetNext" json:"GetNext,omitempty"` +} + +func (m *SLRoutev6GetMsg) Reset() { *m = SLRoutev6GetMsg{} } +func (m *SLRoutev6GetMsg) String() string { return proto.CompactTextString(m) } +func (*SLRoutev6GetMsg) ProtoMessage() {} +func (*SLRoutev6GetMsg) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{4} } + +func (m *SLRoutev6GetMsg) GetCorrelator() uint64 { + if m != nil { + return m.Correlator + } + return 0 +} + +func (m *SLRoutev6GetMsg) GetVrfName() string { + if m != nil { + return m.VrfName + } + return "" +} + +func (m *SLRoutev6GetMsg) GetPrefix() []byte { + if m != nil { + return m.Prefix + } + return nil +} + +func (m *SLRoutev6GetMsg) GetPrefixLen() uint32 { + if m != nil { + return m.PrefixLen + } + return 0 +} + +func (m *SLRoutev6GetMsg) GetEntriesCount() uint32 { + if m != nil { + return m.EntriesCount + } + return 0 +} + +func (m *SLRoutev6GetMsg) GetGetNext() bool { + if m != nil { + return m.GetNext + } + return false +} + +// Gt Route message response +type SLRoutev6GetMsgRsp struct { + // Correlator. This can be used to correlate replies with requests. + // The Server simply reflects this field back in the reply. + Correlator uint64 `protobuf:"varint,1,opt,name=Correlator" json:"Correlator,omitempty"` + // End Of File. + // When set to True, it indicates that the server has returned M, where + // M < N, of the original N requested Entries. + Eof bool `protobuf:"varint,2,opt,name=Eof" json:"Eof,omitempty"` + // VRF name. + VrfName string `protobuf:"bytes,3,opt,name=VrfName" json:"VrfName,omitempty"` + // Status of the Get operation + ErrStatus *SLErrorStatus `protobuf:"bytes,4,opt,name=ErrStatus" json:"ErrStatus,omitempty"` + // Returned entries as requested in the Get operation. + // if ErrStatus is SL_SUCCESS, Entries contains the info requested + Entries []*SLRoutev6 `protobuf:"bytes,5,rep,name=Entries" json:"Entries,omitempty"` +} + +func (m *SLRoutev6GetMsgRsp) Reset() { *m = SLRoutev6GetMsgRsp{} } +func (m *SLRoutev6GetMsgRsp) String() string { return proto.CompactTextString(m) } +func (*SLRoutev6GetMsgRsp) ProtoMessage() {} +func (*SLRoutev6GetMsgRsp) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{5} } + +func (m *SLRoutev6GetMsgRsp) GetCorrelator() uint64 { + if m != nil { + return m.Correlator + } + return 0 +} + +func (m *SLRoutev6GetMsgRsp) GetEof() bool { + if m != nil { + return m.Eof + } + return false +} + +func (m *SLRoutev6GetMsgRsp) GetVrfName() string { + if m != nil { + return m.VrfName + } + return "" +} + +func (m *SLRoutev6GetMsgRsp) GetErrStatus() *SLErrorStatus { + if m != nil { + return m.ErrStatus + } + return nil +} + +func (m *SLRoutev6GetMsgRsp) GetEntries() []*SLRoutev6 { + if m != nil { + return m.Entries + } + return nil +} + +func init() { + proto.RegisterType((*SLRoutev6)(nil), "service_layer.SLRoutev6") + proto.RegisterType((*SLRoutev6Msg)(nil), "service_layer.SLRoutev6Msg") + proto.RegisterType((*SLRoutev6Res)(nil), "service_layer.SLRoutev6Res") + proto.RegisterType((*SLRoutev6MsgRsp)(nil), "service_layer.SLRoutev6MsgRsp") + proto.RegisterType((*SLRoutev6GetMsg)(nil), "service_layer.SLRoutev6GetMsg") + proto.RegisterType((*SLRoutev6GetMsgRsp)(nil), "service_layer.SLRoutev6GetMsgRsp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for SLRoutev6Oper service + +type SLRoutev6OperClient interface { + // Used to retrieve Global Route information + SLRoutev6GlobalsGet(ctx context.Context, in *SLRouteGlobalsGetMsg, opts ...grpc.CallOption) (*SLRouteGlobalsGetMsgRsp, error) + // Used to retrieve Global Route Stats + SLRoutev6GlobalStatsGet(ctx context.Context, in *SLRouteGlobalStatsGetMsg, opts ...grpc.CallOption) (*SLRouteGlobalStatsGetMsgRsp, error) + // SLVrfRegMsg.Oper = SL_REGOP_REGISTER: + // VRF registration: Sends a list of VRF registration messages + // and expects a list of registration responses. + // A client Must Register a VRF BEFORE routes can be added/modified in + // the associated VRF. + // + // SLVrfRegMsg.Oper = SL_REGOP_UNREGISTER: + // VRF Un-registeration: Sends a list of VRF un-registration messages + // and expects a list of un-registration responses. + // This can be used to convey that the client is no longer interested + // in this VRF. All previously installed routes would be lost. + // + // SLVrfRegMsg.Oper = SL_REGOP_EOF: + // VRF End Of File message. + // After Registration, the client is expected to send an EOF + // message to convey the end of replay of the client's known objects. + // This is especially useful under certain restart scenarios when the + // client and the server are trying to synchronize their Routes. + SLRoutev6VrfRegOp(ctx context.Context, in *SLVrfRegMsg, opts ...grpc.CallOption) (*SLVrfRegMsgRsp, error) + // VRF get. Used to retrieve VRF attributes from the server. + SLRoutev6VrfRegGet(ctx context.Context, in *SLVrfRegGetMsg, opts ...grpc.CallOption) (*SLVrfRegGetMsgRsp, error) + // Used to retrieve VRF Stats from the server. + SLRoutev6VrfGetStats(ctx context.Context, in *SLVrfRegGetMsg, opts ...grpc.CallOption) (*SLVRFGetStatsMsgRsp, error) + // SLRoutev6Msg.Oper = SL_OBJOP_ADD: + // Route add. Fails if the route already exists. + // + // SLRoutev6Msg.Oper = SL_OBJOP_UPDATE: + // Route update. Creates or updates the route. + // + // SLRoutev6Msg.Oper = SL_OBJOP_DELETE: + // Route delete. The route path is not necessary to delete the route. + SLRoutev6Op(ctx context.Context, in *SLRoutev6Msg, opts ...grpc.CallOption) (*SLRoutev6MsgRsp, error) + // Retrieves route attributes. + SLRoutev6Get(ctx context.Context, in *SLRoutev6GetMsg, opts ...grpc.CallOption) (*SLRoutev6GetMsgRsp, error) + // SLRoutev6Msg.Oper = SL_OBJOP_ADD: + // Route add. Fails if the route already exists. + // + // SLRoutev6Msg.Oper = SL_OBJOP_UPDATE: + // Route update. Creates or updates the route. + // + // SLRoutev6Msg.Oper = SL_OBJOP_DELETE: + // Route delete. The route path is not necessary to delete the route. + SLRoutev6OpStream(ctx context.Context, opts ...grpc.CallOption) (SLRoutev6Oper_SLRoutev6OpStreamClient, error) + // Retrieves route attributes. + SLRoutev6GetStream(ctx context.Context, opts ...grpc.CallOption) (SLRoutev6Oper_SLRoutev6GetStreamClient, error) +} + +type sLRoutev6OperClient struct { + cc *grpc.ClientConn +} + +func NewSLRoutev6OperClient(cc *grpc.ClientConn) SLRoutev6OperClient { + return &sLRoutev6OperClient{cc} +} + +func (c *sLRoutev6OperClient) SLRoutev6GlobalsGet(ctx context.Context, in *SLRouteGlobalsGetMsg, opts ...grpc.CallOption) (*SLRouteGlobalsGetMsgRsp, error) { + out := new(SLRouteGlobalsGetMsgRsp) + err := grpc.Invoke(ctx, "/service_layer.SLRoutev6Oper/SLRoutev6GlobalsGet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sLRoutev6OperClient) SLRoutev6GlobalStatsGet(ctx context.Context, in *SLRouteGlobalStatsGetMsg, opts ...grpc.CallOption) (*SLRouteGlobalStatsGetMsgRsp, error) { + out := new(SLRouteGlobalStatsGetMsgRsp) + err := grpc.Invoke(ctx, "/service_layer.SLRoutev6Oper/SLRoutev6GlobalStatsGet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sLRoutev6OperClient) SLRoutev6VrfRegOp(ctx context.Context, in *SLVrfRegMsg, opts ...grpc.CallOption) (*SLVrfRegMsgRsp, error) { + out := new(SLVrfRegMsgRsp) + err := grpc.Invoke(ctx, "/service_layer.SLRoutev6Oper/SLRoutev6VrfRegOp", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sLRoutev6OperClient) SLRoutev6VrfRegGet(ctx context.Context, in *SLVrfRegGetMsg, opts ...grpc.CallOption) (*SLVrfRegGetMsgRsp, error) { + out := new(SLVrfRegGetMsgRsp) + err := grpc.Invoke(ctx, "/service_layer.SLRoutev6Oper/SLRoutev6VrfRegGet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sLRoutev6OperClient) SLRoutev6VrfGetStats(ctx context.Context, in *SLVrfRegGetMsg, opts ...grpc.CallOption) (*SLVRFGetStatsMsgRsp, error) { + out := new(SLVRFGetStatsMsgRsp) + err := grpc.Invoke(ctx, "/service_layer.SLRoutev6Oper/SLRoutev6VrfGetStats", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sLRoutev6OperClient) SLRoutev6Op(ctx context.Context, in *SLRoutev6Msg, opts ...grpc.CallOption) (*SLRoutev6MsgRsp, error) { + out := new(SLRoutev6MsgRsp) + err := grpc.Invoke(ctx, "/service_layer.SLRoutev6Oper/SLRoutev6Op", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sLRoutev6OperClient) SLRoutev6Get(ctx context.Context, in *SLRoutev6GetMsg, opts ...grpc.CallOption) (*SLRoutev6GetMsgRsp, error) { + out := new(SLRoutev6GetMsgRsp) + err := grpc.Invoke(ctx, "/service_layer.SLRoutev6Oper/SLRoutev6Get", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sLRoutev6OperClient) SLRoutev6OpStream(ctx context.Context, opts ...grpc.CallOption) (SLRoutev6Oper_SLRoutev6OpStreamClient, error) { + stream, err := grpc.NewClientStream(ctx, &_SLRoutev6Oper_serviceDesc.Streams[0], c.cc, "/service_layer.SLRoutev6Oper/SLRoutev6OpStream", opts...) + if err != nil { + return nil, err + } + x := &sLRoutev6OperSLRoutev6OpStreamClient{stream} + return x, nil +} + +type SLRoutev6Oper_SLRoutev6OpStreamClient interface { + Send(*SLRoutev6Msg) error + Recv() (*SLRoutev6MsgRsp, error) + grpc.ClientStream +} + +type sLRoutev6OperSLRoutev6OpStreamClient struct { + grpc.ClientStream +} + +func (x *sLRoutev6OperSLRoutev6OpStreamClient) Send(m *SLRoutev6Msg) error { + return x.ClientStream.SendMsg(m) +} + +func (x *sLRoutev6OperSLRoutev6OpStreamClient) Recv() (*SLRoutev6MsgRsp, error) { + m := new(SLRoutev6MsgRsp) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *sLRoutev6OperClient) SLRoutev6GetStream(ctx context.Context, opts ...grpc.CallOption) (SLRoutev6Oper_SLRoutev6GetStreamClient, error) { + stream, err := grpc.NewClientStream(ctx, &_SLRoutev6Oper_serviceDesc.Streams[1], c.cc, "/service_layer.SLRoutev6Oper/SLRoutev6GetStream", opts...) + if err != nil { + return nil, err + } + x := &sLRoutev6OperSLRoutev6GetStreamClient{stream} + return x, nil +} + +type SLRoutev6Oper_SLRoutev6GetStreamClient interface { + Send(*SLRoutev6GetMsg) error + Recv() (*SLRoutev6GetMsgRsp, error) + grpc.ClientStream +} + +type sLRoutev6OperSLRoutev6GetStreamClient struct { + grpc.ClientStream +} + +func (x *sLRoutev6OperSLRoutev6GetStreamClient) Send(m *SLRoutev6GetMsg) error { + return x.ClientStream.SendMsg(m) +} + +func (x *sLRoutev6OperSLRoutev6GetStreamClient) Recv() (*SLRoutev6GetMsgRsp, error) { + m := new(SLRoutev6GetMsgRsp) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for SLRoutev6Oper service + +type SLRoutev6OperServer interface { + // Used to retrieve Global Route information + SLRoutev6GlobalsGet(context.Context, *SLRouteGlobalsGetMsg) (*SLRouteGlobalsGetMsgRsp, error) + // Used to retrieve Global Route Stats + SLRoutev6GlobalStatsGet(context.Context, *SLRouteGlobalStatsGetMsg) (*SLRouteGlobalStatsGetMsgRsp, error) + // SLVrfRegMsg.Oper = SL_REGOP_REGISTER: + // VRF registration: Sends a list of VRF registration messages + // and expects a list of registration responses. + // A client Must Register a VRF BEFORE routes can be added/modified in + // the associated VRF. + // + // SLVrfRegMsg.Oper = SL_REGOP_UNREGISTER: + // VRF Un-registeration: Sends a list of VRF un-registration messages + // and expects a list of un-registration responses. + // This can be used to convey that the client is no longer interested + // in this VRF. All previously installed routes would be lost. + // + // SLVrfRegMsg.Oper = SL_REGOP_EOF: + // VRF End Of File message. + // After Registration, the client is expected to send an EOF + // message to convey the end of replay of the client's known objects. + // This is especially useful under certain restart scenarios when the + // client and the server are trying to synchronize their Routes. + SLRoutev6VrfRegOp(context.Context, *SLVrfRegMsg) (*SLVrfRegMsgRsp, error) + // VRF get. Used to retrieve VRF attributes from the server. + SLRoutev6VrfRegGet(context.Context, *SLVrfRegGetMsg) (*SLVrfRegGetMsgRsp, error) + // Used to retrieve VRF Stats from the server. + SLRoutev6VrfGetStats(context.Context, *SLVrfRegGetMsg) (*SLVRFGetStatsMsgRsp, error) + // SLRoutev6Msg.Oper = SL_OBJOP_ADD: + // Route add. Fails if the route already exists. + // + // SLRoutev6Msg.Oper = SL_OBJOP_UPDATE: + // Route update. Creates or updates the route. + // + // SLRoutev6Msg.Oper = SL_OBJOP_DELETE: + // Route delete. The route path is not necessary to delete the route. + SLRoutev6Op(context.Context, *SLRoutev6Msg) (*SLRoutev6MsgRsp, error) + // Retrieves route attributes. + SLRoutev6Get(context.Context, *SLRoutev6GetMsg) (*SLRoutev6GetMsgRsp, error) + // SLRoutev6Msg.Oper = SL_OBJOP_ADD: + // Route add. Fails if the route already exists. + // + // SLRoutev6Msg.Oper = SL_OBJOP_UPDATE: + // Route update. Creates or updates the route. + // + // SLRoutev6Msg.Oper = SL_OBJOP_DELETE: + // Route delete. The route path is not necessary to delete the route. + SLRoutev6OpStream(SLRoutev6Oper_SLRoutev6OpStreamServer) error + // Retrieves route attributes. + SLRoutev6GetStream(SLRoutev6Oper_SLRoutev6GetStreamServer) error +} + +func RegisterSLRoutev6OperServer(s *grpc.Server, srv SLRoutev6OperServer) { + s.RegisterService(&_SLRoutev6Oper_serviceDesc, srv) +} + +func _SLRoutev6Oper_SLRoutev6GlobalsGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SLRouteGlobalsGetMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SLRoutev6OperServer).SLRoutev6GlobalsGet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service_layer.SLRoutev6Oper/SLRoutev6GlobalsGet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SLRoutev6OperServer).SLRoutev6GlobalsGet(ctx, req.(*SLRouteGlobalsGetMsg)) + } + return interceptor(ctx, in, info, handler) +} + +func _SLRoutev6Oper_SLRoutev6GlobalStatsGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SLRouteGlobalStatsGetMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SLRoutev6OperServer).SLRoutev6GlobalStatsGet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service_layer.SLRoutev6Oper/SLRoutev6GlobalStatsGet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SLRoutev6OperServer).SLRoutev6GlobalStatsGet(ctx, req.(*SLRouteGlobalStatsGetMsg)) + } + return interceptor(ctx, in, info, handler) +} + +func _SLRoutev6Oper_SLRoutev6VrfRegOp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SLVrfRegMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SLRoutev6OperServer).SLRoutev6VrfRegOp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service_layer.SLRoutev6Oper/SLRoutev6VrfRegOp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SLRoutev6OperServer).SLRoutev6VrfRegOp(ctx, req.(*SLVrfRegMsg)) + } + return interceptor(ctx, in, info, handler) +} + +func _SLRoutev6Oper_SLRoutev6VrfRegGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SLVrfRegGetMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SLRoutev6OperServer).SLRoutev6VrfRegGet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service_layer.SLRoutev6Oper/SLRoutev6VrfRegGet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SLRoutev6OperServer).SLRoutev6VrfRegGet(ctx, req.(*SLVrfRegGetMsg)) + } + return interceptor(ctx, in, info, handler) +} + +func _SLRoutev6Oper_SLRoutev6VrfGetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SLVrfRegGetMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SLRoutev6OperServer).SLRoutev6VrfGetStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service_layer.SLRoutev6Oper/SLRoutev6VrfGetStats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SLRoutev6OperServer).SLRoutev6VrfGetStats(ctx, req.(*SLVrfRegGetMsg)) + } + return interceptor(ctx, in, info, handler) +} + +func _SLRoutev6Oper_SLRoutev6Op_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SLRoutev6Msg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SLRoutev6OperServer).SLRoutev6Op(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service_layer.SLRoutev6Oper/SLRoutev6Op", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SLRoutev6OperServer).SLRoutev6Op(ctx, req.(*SLRoutev6Msg)) + } + return interceptor(ctx, in, info, handler) +} + +func _SLRoutev6Oper_SLRoutev6Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SLRoutev6GetMsg) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SLRoutev6OperServer).SLRoutev6Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service_layer.SLRoutev6Oper/SLRoutev6Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SLRoutev6OperServer).SLRoutev6Get(ctx, req.(*SLRoutev6GetMsg)) + } + return interceptor(ctx, in, info, handler) +} + +func _SLRoutev6Oper_SLRoutev6OpStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SLRoutev6OperServer).SLRoutev6OpStream(&sLRoutev6OperSLRoutev6OpStreamServer{stream}) +} + +type SLRoutev6Oper_SLRoutev6OpStreamServer interface { + Send(*SLRoutev6MsgRsp) error + Recv() (*SLRoutev6Msg, error) + grpc.ServerStream +} + +type sLRoutev6OperSLRoutev6OpStreamServer struct { + grpc.ServerStream +} + +func (x *sLRoutev6OperSLRoutev6OpStreamServer) Send(m *SLRoutev6MsgRsp) error { + return x.ServerStream.SendMsg(m) +} + +func (x *sLRoutev6OperSLRoutev6OpStreamServer) Recv() (*SLRoutev6Msg, error) { + m := new(SLRoutev6Msg) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _SLRoutev6Oper_SLRoutev6GetStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SLRoutev6OperServer).SLRoutev6GetStream(&sLRoutev6OperSLRoutev6GetStreamServer{stream}) +} + +type SLRoutev6Oper_SLRoutev6GetStreamServer interface { + Send(*SLRoutev6GetMsgRsp) error + Recv() (*SLRoutev6GetMsg, error) + grpc.ServerStream +} + +type sLRoutev6OperSLRoutev6GetStreamServer struct { + grpc.ServerStream +} + +func (x *sLRoutev6OperSLRoutev6GetStreamServer) Send(m *SLRoutev6GetMsgRsp) error { + return x.ServerStream.SendMsg(m) +} + +func (x *sLRoutev6OperSLRoutev6GetStreamServer) Recv() (*SLRoutev6GetMsg, error) { + m := new(SLRoutev6GetMsg) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _SLRoutev6Oper_serviceDesc = grpc.ServiceDesc{ + ServiceName: "service_layer.SLRoutev6Oper", + HandlerType: (*SLRoutev6OperServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SLRoutev6GlobalsGet", + Handler: _SLRoutev6Oper_SLRoutev6GlobalsGet_Handler, + }, + { + MethodName: "SLRoutev6GlobalStatsGet", + Handler: _SLRoutev6Oper_SLRoutev6GlobalStatsGet_Handler, + }, + { + MethodName: "SLRoutev6VrfRegOp", + Handler: _SLRoutev6Oper_SLRoutev6VrfRegOp_Handler, + }, + { + MethodName: "SLRoutev6VrfRegGet", + Handler: _SLRoutev6Oper_SLRoutev6VrfRegGet_Handler, + }, + { + MethodName: "SLRoutev6VrfGetStats", + Handler: _SLRoutev6Oper_SLRoutev6VrfGetStats_Handler, + }, + { + MethodName: "SLRoutev6Op", + Handler: _SLRoutev6Oper_SLRoutev6Op_Handler, + }, + { + MethodName: "SLRoutev6Get", + Handler: _SLRoutev6Oper_SLRoutev6Get_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SLRoutev6OpStream", + Handler: _SLRoutev6Oper_SLRoutev6OpStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "SLRoutev6GetStream", + Handler: _SLRoutev6Oper_SLRoutev6GetStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "sl_route_ipv6.proto", +} + +func init() { proto.RegisterFile("sl_route_ipv6.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 647 bytes of a gzipped FileDesc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7a, 0x5a, 0x51, 0x24, 0xd8, 0xcc, 0x4c, 0x4b, 0xda, 0x8f, 0x70, 0x4b, 0xa7, + 0x6d, 0x52, 0xa1, 0x7c, 0x5c, 0x45, 0x6c, 0xad, 0xa7, 0xc9, 0x9b, 0xb8, 0x38, 0xa2, 0x7e, 0x0b, + 0x25, 0x6d, 0xcd, 0x38, 0xf5, 0x8d, 0x95, 0x7c, 0x27, 0x19, 0x49, 0xc9, 0xf5, 0x4e, 0xfb, 0x26, + 0x4a, 0xdf, 0xa9, 0xf8, 0x48, 0xdf, 0xc3, 0xec, 0xbc, 0xa4, 0x7c, 0xaf, 0x2d, 0xa8, 0x13, 0x74, + 0x05, 0xa3, 0x8e, 0x77, 0x2d, 0x91, 0x36, 0x3a, 0x45, 0xf8, 0x53, 0xf2, 0x75, 0x8d, 0x68, 0xaf, + 0x2f, 0x57, 0x92, 0xf7, 0x0b, 0xea, 0x9f, 0xf8, 0xf9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x27, + 0x27, 0x99, 0x86, 0xdd, 0x07, 0x00, 0x00, +} diff --git a/proto/sla/sl_route_ipv6.proto b/proto/sla/sl_route_ipv6.proto new file mode 100755 index 0000000..f724cfd --- /dev/null +++ b/proto/sla/sl_route_ipv6.proto @@ -0,0 +1,223 @@ +// @file +// @brief Server RPC proto file for IPv6. +// +// ---------------------------------------------------------------- +// Copyright (c) 2016 by cisco Systems, Inc. +// All rights reserved. +// ----------------------------------------------------------------- +// +// + +syntax = "proto3"; +package service_layer; + +import "sl_common_types.proto"; +import "sl_route_common.proto"; + +// @defgroup SLRouteIPv6Oper +// @ingroup Route +// Defines RPC calls for IPv6 route changes and VRF registration. +// This service declares both the Vrf Registration, as well as adding, deleting +// and getting IPv6 routes. +// @{ +service SLRoutev6Oper { + //@addtogroup SLRouteIPv6Oper + //@{ + //; + + // + // Global Route operations + // + + // Used to retrieve Global Route information + rpc SLRoutev6GlobalsGet(SLRouteGlobalsGetMsg) returns (SLRouteGlobalsGetMsgRsp); + + // Used to retrieve Global Route Stats + rpc SLRoutev6GlobalStatsGet(SLRouteGlobalStatsGetMsg) returns (SLRouteGlobalStatsGetMsgRsp); + + // + // VRF registration operations + // + + // SLVrfRegMsg.Oper = SL_REGOP_REGISTER: + // VRF registration: Sends a list of VRF registration messages + // and expects a list of registration responses. + // A client Must Register a VRF BEFORE routes can be added/modified in + // the associated VRF. + // + // SLVrfRegMsg.Oper = SL_REGOP_UNREGISTER: + // VRF Un-registeration: Sends a list of VRF un-registration messages + // and expects a list of un-registration responses. + // This can be used to convey that the client is no longer interested + // in this VRF. All previously installed routes would be lost. + // + // SLVrfRegMsg.Oper = SL_REGOP_EOF: + // VRF End Of File message. + // After Registration, the client is expected to send an EOF + // message to convey the end of replay of the client's known objects. + // This is especially useful under certain restart scenarios when the + // client and the server are trying to synchronize their Routes. + rpc SLRoutev6VrfRegOp(SLVrfRegMsg) returns (SLVrfRegMsgRsp); + + // VRF get. Used to retrieve VRF attributes from the server. + rpc SLRoutev6VrfRegGet(SLVrfRegGetMsg) returns (SLVrfRegGetMsgRsp); + + // Used to retrieve VRF Stats from the server. + rpc SLRoutev6VrfGetStats(SLVrfRegGetMsg) returns (SLVRFGetStatsMsgRsp); + + // + // Route operations + // + + // SLRoutev6Msg.Oper = SL_OBJOP_ADD: + // Route add. Fails if the route already exists. + // + // SLRoutev6Msg.Oper = SL_OBJOP_UPDATE: + // Route update. Creates or updates the route. + // + // SLRoutev6Msg.Oper = SL_OBJOP_DELETE: + // Route delete. The route path is not necessary to delete the route. + rpc SLRoutev6Op(SLRoutev6Msg) returns (SLRoutev6MsgRsp); + + // Retrieves route attributes. + rpc SLRoutev6Get(SLRoutev6GetMsg) returns (SLRoutev6GetMsgRsp); + + // + // Stream Route operations + // + + // SLRoutev6Msg.Oper = SL_OBJOP_ADD: + // Route add. Fails if the route already exists. + // + // SLRoutev6Msg.Oper = SL_OBJOP_UPDATE: + // Route update. Creates or updates the route. + // + // SLRoutev6Msg.Oper = SL_OBJOP_DELETE: + // Route delete. The route path is not necessary to delete the route. + rpc SLRoutev6OpStream(stream SLRoutev6Msg) returns (stream SLRoutev6MsgRsp); + + // Retrieves route attributes. + rpc SLRoutev6GetStream(stream SLRoutev6GetMsg) returns (stream SLRoutev6GetMsgRsp); + //@} +} + +// IPv6 route +message SLRoutev6 { + // IPv6 Prefix + //0:: - ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff + bytes Prefix = 1; + + // IPv6 prefix length [0-128] + uint32 PrefixLen = 2; + + // Common route attributes + SLRouteCommon RouteCommon = 3; + + // List of route paths for a particular route. + // Specifying more than one path is allowed for ECMP/UCMP cases + repeated SLRoutePath PathList = 4; +} + +// List of routes for bulk download +message SLRoutev6Msg { + // Route Object Operations + SLObjectOp Oper = 1; + + // Correlator. This can be used to correlate replies with requests. + // The Server simply reflects this field back in the reply. + uint64 Correlator = 2; + + // VRF name. + string VrfName = 3; + + // List of routes for the VRF specified above + repeated SLRoutev6 Routes = 4; +} + +// IPv6 route result, uniquely identified by the Prefix/PrefixLen pair +message SLRoutev6Res { + // Corresponding error code + SLErrorStatus ErrStatus = 1; + + // IPv6 Prefix + bytes Prefix = 2; + + // IPv6 prefix length, [0-32] + uint32 PrefixLen = 3; +} + +// IPv6 bulk route result status +message SLRoutev6MsgRsp { + // Correlator. This can be used to correlate replies with requests. + // The Server simply reflects this field back in the reply. + uint64 Correlator = 1; + + // VRF name (matches the VRF name of the original operation) + string VrfName = 2; + + // Summary result of the bulk operation (refer to enum SLErrorStatus) + // In general, the StatusSummary implies one of 3 things: + // 1. SL_SUCCESS: signifies that the entire bulk operation was successful. + // In this case, the Results list is empty. + // 2. SL_SOME_ERR: signifies that the operation failed for one or more + // entries. In this case, Results holds the result for + // each individual entry in the bulk. + // 3. SL_RPC_XXX: signifies that the entire bulk operation failed. + // In this case, the Results list is empty. + SLErrorStatus StatusSummary = 3; + + // In case of errors, this field indicates which entry in the bulk was + // erroneous. + repeated SLRoutev6Res Results = 4; +} + +// Used to retrieve route attributes +message SLRoutev6GetMsg { + // Correlator. This can be used to correlate replies with requests. + // The Server simply reflects this field back in the reply. + uint64 Correlator = 1; + + // VRF name. + // If the Key is not specified, then request up to the first + // 'EntriesCount' entries. + string VrfName = 2; + + // IPv6 Prefix + bytes Prefix = 3; + + // IPv6 prefix length, [0-32] + uint32 PrefixLen = 4; + + // Number of entries requested + uint32 EntriesCount = 5; + + // if GetNext is FALSE: + // request up to 'EntriesCount' entries starting from the key + // If GetNext is TRUE, or if the key exact match is not found: + // request up to 'EntriesCount' entries starting from the key's next + bool GetNext = 6; +} + +// Gt Route message response +message SLRoutev6GetMsgRsp { + // Correlator. This can be used to correlate replies with requests. + // The Server simply reflects this field back in the reply. + uint64 Correlator = 1; + + // End Of File. + // When set to True, it indicates that the server has returned M, where + // M < N, of the original N requested Entries. + bool Eof = 2; + + // VRF name. + string VrfName = 3; + + // Status of the Get operation + SLErrorStatus ErrStatus = 4; + + // Returned entries as requested in the Get operation. + // if ErrStatus is SL_SUCCESS, Entries contains the info requested + repeated SLRoutev6 Entries = 5; +} + +//@} diff --git a/proto/sla/sl_version.pb.go b/proto/sla/sl_version.pb.go new file mode 100644 index 0000000..90a44d0 --- /dev/null +++ b/proto/sla/sl_version.pb.go @@ -0,0 +1,63 @@ +// Code generated by protoc-gen-go. +// source: sl_version.proto +// DO NOT EDIT! + +package service_layer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Service Layer API version. +// This is used in the Global init message exchange to handshake client/server +// Version numbers. +type SLVersion int32 + +const ( + SLVersion_SL_VERSION_UNUSED SLVersion = 0 + SLVersion_SL_MAJOR_VERSION SLVersion = 0 + SLVersion_SL_MINOR_VERSION SLVersion = 0 + SLVersion_SL_SUB_VERSION SLVersion = 1 +) + +var SLVersion_name = map[int32]string{ + 0: "SL_VERSION_UNUSED", + // Duplicate value: 0: "SL_MAJOR_VERSION", + // Duplicate value: 0: "SL_MINOR_VERSION", + 1: "SL_SUB_VERSION", +} +var SLVersion_value = map[string]int32{ + "SL_VERSION_UNUSED": 0, + "SL_MAJOR_VERSION": 0, + "SL_MINOR_VERSION": 0, + "SL_SUB_VERSION": 1, +} + +func (x SLVersion) String() string { + return proto.EnumName(SLVersion_name, int32(x)) +} +func (SLVersion) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func init() { + proto.RegisterEnum("service_layer.SLVersion", SLVersion_name, SLVersion_value) +} + +func init() { proto.RegisterFile("sl_version.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 130 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0x28, 0xce, 0x89, 0x2f, + 0x4b, 0x2d, 0x2a, 0xce, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x2d, 0x4e, + 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0x8d, 0xcf, 0x49, 0xac, 0x4c, 0x2d, 0xd2, 0x4a, 0xe3, 0xe2, 0x0c, + 0xf6, 0x09, 0x83, 0xa8, 0x10, 0x12, 0xe5, 0x12, 0x0c, 0xf6, 0x89, 0x0f, 0x73, 0x0d, 0x0a, 0xf6, + 0xf4, 0xf7, 0x8b, 0x0f, 0xf5, 0x0b, 0x0d, 0x76, 0x75, 0x11, 0x60, 0x10, 0x12, 0xe1, 0x12, 0x08, + 0xf6, 0x89, 0xf7, 0x75, 0xf4, 0xf2, 0x0f, 0x82, 0x49, 0x22, 0x44, 0x3d, 0xfd, 0x50, 0x44, 0x85, + 0xb8, 0xf8, 0x82, 0x7d, 0xe2, 0x83, 0x43, 0x9d, 0xe0, 0x62, 0x8c, 0x52, 0x4c, 0x02, 0x8c, 0x49, + 0x6c, 0x60, 0xdb, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xef, 0x8c, 0xa8, 0x91, 0x00, + 0x00, 0x00, +} diff --git a/proto/sla/sl_version.proto b/proto/sla/sl_version.proto new file mode 100755 index 0000000..c1db792 --- /dev/null +++ b/proto/sla/sl_version.proto @@ -0,0 +1,30 @@ +// @file +// @brief Specifies the API version number +// +// ---------------------------------------------------------------- +// Copyright (c) 2016 by cisco Systems, Inc. +// All rights reserved. +// ----------------------------------------------------------------- +// +// + +syntax = "proto3"; +package service_layer; + +// @addtogroup SLVersion +// @ingroup Common +// @{ +// Version Major.Minor.Subversion define the API's version. + +// Service Layer API version. +// This is used in the Global init message exchange to handshake client/server +// Version numbers. +enum SLVersion { + option allow_alias = true; + SL_VERSION_UNUSED = 0; + SL_MAJOR_VERSION = 0; + SL_MINOR_VERSION = 0; + SL_SUB_VERSION = 1; +} + +// @} diff --git a/sla.go b/sla.go new file mode 100644 index 0000000..c918f25 --- /dev/null +++ b/sla.go @@ -0,0 +1,242 @@ +package xrgrpc + +import ( + "fmt" + "io" + "net" + + pb "github.com/nleiva/xrgrpc/proto/sla" + "github.com/pkg/errors" + "golang.org/x/net/context" + "google.golang.org/grpc" +) + +// VRFOperation handles VRF registration operations +// SL_REGOP_REGISTER = 0x1 // VRF registration +// SL_REGOP_UNREGISTER = 0x2 // VRF Un-registeration +// SL_REGOP_EOF = 0x3 // After Registration, the client is expected to send an EOF +func VRFOperation(conn *grpc.ClientConn, o int, d uint32) error { + // These are two hard-coded variables. TODO; take them as input + v := "default" + var p uint32 = 500 + + op := new(pb.SLRegOp) + switch o { + case 1: + *op = pb.SLRegOp_SL_REGOP_REGISTER + case 2: + *op = pb.SLRegOp_SL_REGOP_UNREGISTER + case 3: + *op = pb.SLRegOp_SL_REGOP_EOF + default: + return errors.New("Unidentified VRF Operation") + } + + // 'c' is the gRPC stub. + c := pb.NewSLRoutev6OperClient(conn) + + // 'a' is the object we send to the router via the stub. + a := pb.SLVrfRegMsg{ + Oper: *op, + VrfRegMsgs: []*pb.SLVrfReg{ + &pb.SLVrfReg{ + VrfName: v, + AdminDistance: d, + VrfPurgeIntervalSeconds: p, + }, + }, + } + + // 'r' is the result that comes back from the target. + r, err := c.SLRoutev6VrfRegOp(context.Background(), &a) + if err != nil { + return errors.Wrap(err, "gRPC SLRoutev6VrfRegOp failed") + } + + // SL_SUCCESS: Entire bulk operation was successful. + // SL_SOME_ERR: Operation failed for one or more entries. + // SL_RPC_XXX: Eentire bulk operation failed. + if r.GetStatusSummary().GetStatus() != pb.SLErrorStatus_SL_SUCCESS { + // TODO: Add cases for partial errors + return fmt.Errorf("Error triggered by remote host: %s", r.GetStatusSummary().GetStatus().String()) + } + return nil +} + +// SetRoute ... +// SL_OBJOP_ADD = 1 // Route add. Fails if the route already exists. +// SL_OBJOP_UPDATE = 2 // Route update. Creates or updates the route. +// SL_OBJOP_DELETE = 3 // Route delete. The route path is not necessary to delete the route. +// SLRoutev6Op(ctx context.Context, in *SLRoutev6Msg, opts ...grpc.CallOption) (*SLRoutev6MsgRsp, error) +func SetRoute(conn *grpc.ClientConn, o int, ad string, d uint32, nh string) error { + // These are two hard-coded variables. TODO; take them as input + v := "default" + //intf := "HundredGigE0/0/0/1" + _, nw, err := net.ParseCIDR(ad) + if err != nil { + return errors.Errorf("Could not parse address: %s", ad) + } + mk, _ := nw.Mask.Size() + + op := new(pb.SLObjectOp) + switch o { + case 1: + *op = pb.SLObjectOp_SL_OBJOP_ADD + case 2: + *op = pb.SLObjectOp_SL_OBJOP_UPDATE + case 3: + *op = pb.SLObjectOp_SL_OBJOP_DELETE + default: + return errors.New("Unidentified Object Operation") + } + + // 'c' is the gRPC stub. + c := pb.NewSLRoutev6OperClient(conn) + + // 'a' is the object we send to the router via the stub. + a := pb.SLRoutev6Msg{ + Oper: *op, + // Correlator: x, + VrfName: v, + Routes: []*pb.SLRoutev6{ + &pb.SLRoutev6{ + Prefix: nw.IP, + PrefixLen: uint32(mk), + RouteCommon: &pb.SLRouteCommon{ + AdminDistance: d, + }, + PathList: []*pb.SLRoutePath{ + &pb.SLRoutePath{ + // NexthopInterface: x, + NexthopAddress: &pb.SLIpAddress{ + Address: &pb.SLIpAddress_V6Address{ + V6Address: net.ParseIP(nh), + }, + }, + }, + }, + }, + }, + } + + // 'r' is the result that comes back from the target. + r, err := c.SLRoutev6Op(context.Background(), &a) + if err != nil { + return errors.Wrap(err, "gRPC SLRoutev6Op failed") + } + + // SL_SUCCESS: Entire bulk operation was successful. + // SL_SOME_ERR: Operation failed for one or more entries. + // SL_RPC_XXX: Eentire bulk operation failed. + if r.GetStatusSummary().GetStatus() != pb.SLErrorStatus_SL_SUCCESS { + // TODO: Add cases for partial errors + return fmt.Errorf("Error triggered by remote host: %s, AND %v", + r.GetStatusSummary().GetStatus().String(), r.GetResults()[0].GetErrStatus().GetStatus()) + } + return nil +} + +// ClientInit takes care of global initialization and setup +// a notification channel +func ClientInit(conn *grpc.ClientConn) error { + ch := make(chan int) + /* Setup the notification channel */ + go setupNotifChannel(conn, ch) + + /* Wait for response 0: error. 1: all ok*/ + if w := <-ch; w == 0 { + return errors.New("Error triggered by remote host") + } + + // 'c' is the gRPC stub. + c := pb.NewSLGlobalClient(conn) + + // 'a' is the object we send to the router via the stub. + a := pb.SLGlobalsGetMsg{} + + // 'r' is the result that comes back from the target. + _, err := c.SLGlobalsGet(context.Background(), &a) + if err != nil { + return errors.Wrap(err, "gRPC SLGlobalsGet failed") + } + return nil +} + +func setupNotifChannel(conn *grpc.ClientConn, ch chan int) { + // 'c' is the gRPC stub. + c := pb.NewSLGlobalClient(conn) + + // 'a' is the object we send to the router via the stub. + // Version Major.Minor.Subversion define the API's version. + // Hardcoded to 0.0.1 for now + a := pb.SLInitMsg{ + MajorVer: uint32(0), + MinorVer: uint32(0), + SubVer: uint32(1), + } + + // 'st' is the streamed result that comes back from the target. + st, err := c.SLGlobalInitNotif(context.Background(), &a) + if err != nil { + ch <- 0 + return + // return errors.Wrap(err, "gRPC SLGlobalInitNotif failed") + } + + for { + // Loop through the responses in the stream until there is nothing left. + r, err := st.Recv() + if err == io.EOF { + return + //return nil + } + if err != nil { + return + // return errors.Wrap(err, "Recive Stream failed") + } + + // Status code, interpreted based on the Event Type. + // + // case EventType == SL_GLOBAL_EVENT_TYPE_ERROR: + // case ErrStatus == SL_NOTIF_TERM: + // => Another client is attempting to take over the session. + // This session will be closed. + // case ErrStatus == (some error from SLErrorStatus) + // => Client must look into the specific error message returned. + // + // case EventType == SL_GLOBAL_EVENT_TYPE_HEARTBEAT: + // case ErrStatus == SL_SUCCESS + // => Client can safely ignore this heartbeat message. + // + // case EventType == SL_GLOBAL_EVENT_TYPE_VERSION: + // case ErrStatus == SL_SUCCESS + // => Client version accepted. + // case ErrStatus == SL_INIT_STATE_READY + // => Client version accepted. + // Any previous state was sucessfully recovered. + // case ErrStatus == SL_INIT_STATE_CLEAR + // => Client version accepted. Any previous state was lost. + // Client must replay all previous objects to server. + // case ErrStatus == SL_UNSUPPORTED_VER + // => Client and Server version mismatch. The client is not + // allowed to proceed, and the channel will be closed. + // case ErrStatus == (some error from SLErrorStatus) + // => Client must either try again, or look into the specific + // error message returned. + + // Need to Fix this!! + switch r.EventType { + case pb.SLGlobalNotifType_SL_GLOBAL_EVENT_TYPE_VERSION: + ch <- 1 + continue + case pb.SLGlobalNotifType_SL_GLOBAL_EVENT_TYPE_ERROR: + err = fmt.Errorf("%s", r.ErrStatus.String()) + break + case pb.SLGlobalNotifType_SL_GLOBAL_EVENT_TYPE_HEARTBEAT: + continue + default: + err = fmt.Errorf("%s", r.ErrStatus.String()) + return + } + } +}