-
Notifications
You must be signed in to change notification settings - Fork 32
Add binary for gNMI+gRIBI server, add TLS support. #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 42 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
c9606fd
Add initial RIB management.
robshakir 74a88d6
Add support for different network instances in the RIB.
robshakir fb91477
Add support for adding NHG and NH values.
robshakir b1b0104
validate entries against schema before allowing them.#
robshakir 2bd0bc1
Update comments.
robshakir e73db09
Address review comments.
robshakir 7514349
Merge branch 'rib1' into rib2
robshakir 7a7caaa
Merge branch 'main' into rib2
robshakir c4d17e1
Merge branch 'main' into rib2
robshakir 5803e14
Add support for a callback after each RIB operation.
robshakir 1aef65f
Add an initial implementation of a resolved-RIB. (#22)
robshakir 8208a66
Add gNMI cache for target to use.
robshakir d6a2a06
Improve commenting and avoid hostname repetition.
robshakir 3d957e1
Merge branch 'main' into rib4
robshakir 2eee535
Fix bad merge.
robshakir 6996899
Fix commenting.
robshakir b5bc01b
start to integrate services for device.
robshakir fd1a4b8
Add test file.
robshakir 12cc0a0
Move to latest version of ygot, server goroutines.
robshakir 85ce82d
Deflake test by validating correct semantics.
robshakir f49693f
Merge branch 'rib4' into rib4.5
robshakir 4b20ff9
Add support for entries in fluent, improve coverage.
robshakir b61e8b9
Add support for adding IPv4 Entries.
robshakir 0540a61
Merge branch 'rib4.6' into rib5
robshakir ae26c50
Refactor RIB implementation.
robshakir a9afd5f
Add initial 'device' function which acts as a combined server.
robshakir bb0b789
Add main package.
robshakir 245e4c0
Split into separate tests rather than using subtests.
robshakir aa061b0
Merge branch 'rib4' into rib4.5
robshakir 85795df
Merge branch 'main' into rib4.5
robshakir 8041fe3
Merge branch 'rib4.5' into rib4.6
robshakir ed26938
Remove stale comment.
robshakir b82d9a6
Merge branch 'rib4.5' into rib4.6
robshakir 69ed249
Add test coverage, robustness, cleaner election handling.
robshakir 3a3e934
Resolve race.
robshakir 84f1e2e
🧹
robshakir b5d9589
Add lock to check whether the RIB is valid.
robshakir 0e80281
Merge branch 'rib4.6' into rib5
robshakir 4aa7fd1
Remove const package.
robshakir 7e1a0ad
Plumb TLS through the client.
robshakir e274145
Update CI to exclude files from race testing.
robshakir 4b12cc7
Switch to race testing everything.
robshakir bdcf19e
Merge branch 'main' into rib5
robshakir d2e6e88
Merge branch 'main' into rib5
robshakir 4f222c8
Remove duplicate default network instance name const.
robshakir f554887
Fix stale references.
robshakir 98ae8be
Address review comments.
robshakir 0e70e5d
Clean up use of context.
robshakir b788c46
Fix tests.
robshakir 6dbf870
gofmt.
robshakir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "context" | ||
| "flag" | ||
|
|
||
| log "github.com/golang/glog" | ||
| "github.com/openconfig/gribigo/device" | ||
| ) | ||
|
|
||
| var ( | ||
| certFile = flag.String("cert", "", "cert is the path to the server TLS certificate file") | ||
| keyFile = flag.String("key", "", "key is the path to the server TLS key file") | ||
| ) | ||
|
|
||
| func main() { | ||
| flag.Parse() | ||
|
|
||
| if *certFile == "" || *keyFile == "" { | ||
| log.Exitf("must specify a TLS certificate and key file") | ||
| } | ||
|
|
||
| ctx := context.Background() | ||
| creds, err := device.TLSCredsFromFile(*certFile, *keyFile) | ||
| if err != nil { | ||
| log.Exitf("cannot initialise TLS, got: %v", err) | ||
| } | ||
| d, cancel, err := device.New(context.Background(), creds) | ||
| defer cancel() | ||
| if err != nil { | ||
| log.Exitf("cannot start device, %v", err) | ||
| } | ||
| log.Infof("listening on:\n\tgRIBI: %s\n\tgNMI: %s", d.GRIBIAddr(), d.GNMIAddr()) | ||
| <-ctx.Done() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // package constants defines constants that are shared amongst multiple gRIBIgo packages. | ||
| package constants | ||
|
|
||
| // OpType indicates the type of operation that was performed in contexts where it | ||
| // is not available, such as callbacks to user-provided functions. | ||
| type OpType int64 | ||
|
|
||
| const ( | ||
| _ OpType = iota | ||
| // ADD indicates that the operation called was an Add. | ||
| ADD | ||
| // DELETE indicates that the operation called was a Delete. | ||
| DELETE | ||
| // MODIFY indicates that the operation called was a Modify. | ||
| MODIFY | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // Package ipv4 is a very simple (test) demo package that shows | ||
| // an IPv4 entry being sent to the gRIBI server using the fluent | ||
| // API and client packages defined in this package. | ||
| package ipv4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package ipv4 | ||
|
|
||
| import ( | ||
| "flag" | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/openconfig/gribigo/compliance" | ||
| ) | ||
|
|
||
| var ( | ||
| addr = flag.String("addr", "", "address of the gRIBI target") | ||
| run = flag.Bool("run", false, "whether to run the tests, this stops this file causing failures in CI") | ||
| ) | ||
|
|
||
| func TestDemo(t *testing.T) { | ||
| flag.Parse() | ||
| if !*run { | ||
| return | ||
| } | ||
| if *addr == "" { | ||
| t.Fatalf("must specify an address") | ||
| } | ||
| compliance.AddIPv4EntrySuccess(*addr, t) | ||
| time.Sleep(2 * time.Second) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.