Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bio-rd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
bio-rd
Commits
21327b96
Commit
21327b96
authored
6 years ago
by
Oliver Herms
Browse files
Options
Downloads
Patches
Plain Diff
Renaming LPM to RT
parent
ce9ad6cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
protocols/bgp/server/fsm.go
+2
-2
2 additions, 2 deletions
protocols/bgp/server/fsm.go
rt/routing_table.go
+9
-9
9 additions, 9 deletions
rt/routing_table.go
with
11 additions
and
11 deletions
protocols/bgp/server/fsm.go
+
2
−
2
View file @
21327b96
...
...
@@ -83,8 +83,8 @@ type FSM struct {
msgRecvFailCh
chan
msgRecvErr
stopMsgRecvCh
chan
struct
{}
adjRibIn
*
rt
.
LPM
adjRibOut
*
rt
.
LPM
adjRibIn
*
rt
.
RT
adjRibOut
*
rt
.
RT
}
type
msgRecvMsg
struct
{
...
...
This diff is collapsed.
Click to expand it.
rt/routing_table.go
+
9
−
9
View file @
21327b96
...
...
@@ -4,7 +4,7 @@ import (
"github.com/bio-routing/bio-rd/net"
)
type
LPM
struct
{
type
RT
struct
{
root
*
node
nodes
uint64
}
...
...
@@ -18,8 +18,8 @@ type node struct {
}
// New creates a new empty LPM
func
New
()
*
LPM
{
return
&
LPM
{}
func
New
()
*
RT
{
return
&
RT
{}
}
func
newNode
(
route
*
Route
,
skip
uint8
,
dummy
bool
)
*
node
{
...
...
@@ -32,7 +32,7 @@ func newNode(route *Route, skip uint8, dummy bool) *node {
}
// LPM performs a longest prefix match for pfx on lpm
func
(
lpm
*
LPM
)
LPM
(
pfx
*
net
.
Prefix
)
(
res
[]
*
Route
)
{
func
(
lpm
*
RT
)
LPM
(
pfx
*
net
.
Prefix
)
(
res
[]
*
Route
)
{
if
lpm
.
root
==
nil
{
return
nil
}
...
...
@@ -42,16 +42,16 @@ func (lpm *LPM) LPM(pfx *net.Prefix) (res []*Route) {
}
// RemovePath removes a path from the trie
func
(
lpm
*
LPM
)
RemovePath
(
route
*
Route
)
{
func
(
lpm
*
RT
)
RemovePath
(
route
*
Route
)
{
lpm
.
root
.
removePath
(
route
)
}
func
(
lpm
*
LPM
)
RemovePfx
(
pfx
*
net
.
Prefix
)
{
func
(
lpm
*
RT
)
RemovePfx
(
pfx
*
net
.
Prefix
)
{
lpm
.
root
.
removePfx
(
pfx
)
}
// Get get's prefix pfx from the LPM
func
(
lpm
*
LPM
)
Get
(
pfx
*
net
.
Prefix
,
moreSpecifics
bool
)
(
res
[]
*
Route
)
{
func
(
lpm
*
RT
)
Get
(
pfx
*
net
.
Prefix
,
moreSpecifics
bool
)
(
res
[]
*
Route
)
{
if
lpm
.
root
==
nil
{
return
nil
}
...
...
@@ -71,7 +71,7 @@ func (lpm *LPM) Get(pfx *net.Prefix, moreSpecifics bool) (res []*Route) {
}
// Insert inserts a route into the LPM
func
(
lpm
*
LPM
)
Insert
(
route
*
Route
)
{
func
(
lpm
*
RT
)
Insert
(
route
*
Route
)
{
if
lpm
.
root
==
nil
{
lpm
.
root
=
newNode
(
route
,
route
.
Pfxlen
(),
false
)
return
...
...
@@ -288,7 +288,7 @@ func (n *node) insertBefore(route *Route, parentPfxLen uint8) *node {
return
new
}
func
(
lpm
*
LPM
)
Dump
()
[]
*
Route
{
func
(
lpm
*
RT
)
Dump
()
[]
*
Route
{
res
:=
make
([]
*
Route
,
0
)
return
lpm
.
root
.
dump
(
res
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment