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
55f170b5
Commit
55f170b5
authored
6 years ago
by
Daniel Czerwonk
Browse files
Options
Downloads
Patches
Plain Diff
applied changes to new netlink pkg
parent
fd8036de
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/netlink/netlink.go
+2
-2
2 additions, 2 deletions
protocols/netlink/netlink.go
protocols/netlink/netlink_reader.go
+6
-10
6 additions, 10 deletions
protocols/netlink/netlink_reader.go
with
8 additions
and
12 deletions
protocols/netlink/netlink.go
+
2
−
2
View file @
55f170b5
...
@@ -35,10 +35,10 @@ func (n *Netlink) Start() {
...
@@ -35,10 +35,10 @@ func (n *Netlink) Start() {
}
}
// 1. from locRib to Kernel
// 1. from locRib to Kernel
n
.
locRib
.
ClientManager
.
RegisterWithOptions
(
n
.
writer
,
options
)
n
.
locRib
.
RegisterWithOptions
(
n
.
writer
,
options
)
// 2. from Kernel to locRib
// 2. from Kernel to locRib
n
.
reader
.
C
lientManager
.
RegisterWithOptions
(
n
.
locRib
,
options
)
n
.
reader
.
c
lientManager
.
RegisterWithOptions
(
n
.
locRib
,
options
)
// Listen for new routes from kernel
// Listen for new routes from kernel
go
n
.
reader
.
Read
()
go
n
.
reader
.
Read
()
...
...
This diff is collapsed.
Click to expand it.
protocols/netlink/netlink_reader.go
+
6
−
10
View file @
55f170b5
...
@@ -22,9 +22,9 @@ const (
...
@@ -22,9 +22,9 @@ const (
// NetlinkReader read routes from the Linux Kernel and propagates it to the locRIB
// NetlinkReader read routes from the Linux Kernel and propagates it to the locRIB
type
NetlinkReader
struct
{
type
NetlinkReader
struct
{
options
*
config
.
Netlink
clientManager
*
routingtable
.
ClientManager
routingtable
.
ClientManager
options
*
config
.
Netlink
filter
*
filter
.
Filter
filter
*
filter
.
Filter
mu
sync
.
RWMutex
mu
sync
.
RWMutex
routes
[]
netlink
.
Route
routes
[]
netlink
.
Route
...
@@ -37,7 +37,7 @@ func NewNetlinkReader(options *config.Netlink) *NetlinkReader {
...
@@ -37,7 +37,7 @@ func NewNetlinkReader(options *config.Netlink) *NetlinkReader {
filter
:
options
.
ImportFilter
,
filter
:
options
.
ImportFilter
,
}
}
nr
.
C
lientManager
=
routingtable
.
NewClientManager
(
nr
)
nr
.
c
lientManager
=
routingtable
.
NewClientManager
(
nr
)
return
nr
return
nr
}
}
...
@@ -124,7 +124,7 @@ func (nr *NetlinkReader) addPathsToClients(routes []netlink.Route) {
...
@@ -124,7 +124,7 @@ func (nr *NetlinkReader) addPathsToClients(routes []netlink.Route) {
}
}
}
}
for
_
,
client
:=
range
nr
.
C
lientManager
.
Clients
()
{
for
_
,
client
:=
range
nr
.
c
lientManager
.
Clients
()
{
log
.
WithFields
(
log
.
Fields
{
log
.
WithFields
(
log
.
Fields
{
"pfx"
:
pfx
,
"pfx"
:
pfx
,
"path"
:
path
,
"path"
:
path
,
...
@@ -179,7 +179,7 @@ func (nr *NetlinkReader) removePathsFromClients(routes []netlink.Route) {
...
@@ -179,7 +179,7 @@ func (nr *NetlinkReader) removePathsFromClients(routes []netlink.Route) {
}
}
}
}
for
_
,
client
:=
range
nr
.
C
lientManager
.
Clients
()
{
for
_
,
client
:=
range
nr
.
c
lientManager
.
Clients
()
{
log
.
WithFields
(
log
.
Fields
{
log
.
WithFields
(
log
.
Fields
{
"pfx"
:
pfx
,
"pfx"
:
pfx
,
"path"
:
path
,
"path"
:
path
,
...
@@ -231,10 +231,6 @@ func (nr *NetlinkReader) UpdateNewClient(routingtable.RouteTableClient) error {
...
@@ -231,10 +231,6 @@ func (nr *NetlinkReader) UpdateNewClient(routingtable.RouteTableClient) error {
func
(
nr
*
NetlinkReader
)
Register
(
routingtable
.
RouteTableClient
)
{
func
(
nr
*
NetlinkReader
)
Register
(
routingtable
.
RouteTableClient
)
{
}
}
// RegisterWithOptions is Not supported
func
(
nr
*
NetlinkReader
)
RegisterWithOptions
(
routingtable
.
RouteTableClient
,
routingtable
.
ClientOptions
)
{
}
// Unregister is Not supported
// Unregister is Not supported
func
(
nr
*
NetlinkReader
)
Unregister
(
routingtable
.
RouteTableClient
)
{
func
(
nr
*
NetlinkReader
)
Unregister
(
routingtable
.
RouteTableClient
)
{
}
}
...
...
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