diff --git a/pkg/networkservice/connectioncontext/client.go b/pkg/networkservice/connectioncontext/client.go index 79c8cb0e..facf80e7 100644 --- a/pkg/networkservice/connectioncontext/client.go +++ b/pkg/networkservice/connectioncontext/client.go @@ -33,25 +33,25 @@ import ( // NewClient creates a NetworkServiceClient chain element to set the ip address on a vpp interface // It applies the connection context to the *vpp* side of an interface leaving the // Endpoint. -// Endpoint -// +-------------------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// | networkservice.NewClient()+-------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +-------------------------------------+ // +// Endpoint +// +-------------------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// | networkservice.NewClient()+-------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +-------------------------------------+ func NewClient(vppConn api.Connection) networkservice.NetworkServiceClient { return chain.NewNetworkServiceClient( mtu.NewClient(vppConn), diff --git a/pkg/networkservice/connectioncontext/ipcontext/ipaddress/client.go b/pkg/networkservice/connectioncontext/ipcontext/ipaddress/client.go index 5bf91cf9..489e4e41 100644 --- a/pkg/networkservice/connectioncontext/ipcontext/ipaddress/client.go +++ b/pkg/networkservice/connectioncontext/ipcontext/ipaddress/client.go @@ -43,25 +43,25 @@ type ipaddressClient struct { // NewClient creates a NetworkServiceClient chain element to set the ip address on a vpp interface // It sets the IP Address on the *vpp* side of an interface leaving the // Endpoint. -// Endpoint -// +---------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// | ipaddress.NewClient()+-------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +---------------------------+ // +// Endpoint +// +---------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// | ipaddress.NewClient()+-------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +---------------------------+ func NewClient(vppConn api.Connection, opts ...Option) networkservice.NetworkServiceClient { o := &options{ loadIfIndex: ifindex.Load, diff --git a/pkg/networkservice/connectioncontext/ipcontext/ipaddress/server.go b/pkg/networkservice/connectioncontext/ipcontext/ipaddress/server.go index 00233bbf..ccb8d2d9 100644 --- a/pkg/networkservice/connectioncontext/ipcontext/ipaddress/server.go +++ b/pkg/networkservice/connectioncontext/ipcontext/ipaddress/server.go @@ -42,25 +42,25 @@ type ipaddressServer struct { // NewServer creates a NetworkServiceServer chain element to set the ip address on a vpp interface // It sets the IP Address on the *vpp* side of an interface plugged into the // Endpoint. -// Endpoint -// +---------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +-------------------+ ipaddress.NewServer() | -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +---------------------------+ // +// Endpoint +// +---------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +-------------------+ ipaddress.NewServer() | +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +---------------------------+ func NewServer(vppConn api.Connection, opts ...Option) networkservice.NetworkServiceServer { o := &options{ loadIfIndex: ifindex.Load, diff --git a/pkg/networkservice/connectioncontext/ipcontext/routes/client.go b/pkg/networkservice/connectioncontext/ipcontext/routes/client.go index 1aa79897..fd48179a 100644 --- a/pkg/networkservice/connectioncontext/ipcontext/routes/client.go +++ b/pkg/networkservice/connectioncontext/ipcontext/routes/client.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 Cisco and/or its affiliates. +// Copyright (c) 2020-2022 Cisco and/or its affiliates. // // SPDX-License-Identifier: Apache-2.0 // @@ -35,25 +35,25 @@ type routesClient struct { } // NewClient creates a NetworkServiceClient chain element to set routes in vpp -// Client -// +---------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// | routes.NewClient() +-------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +---------------------------+ // +// Client +// +---------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// | routes.NewClient() +-------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +---------------------------+ func NewClient(vppConn api.Connection) networkservice.NetworkServiceClient { return &routesClient{ vppConn: vppConn, diff --git a/pkg/networkservice/connectioncontext/ipcontext/routes/server.go b/pkg/networkservice/connectioncontext/ipcontext/routes/server.go index 00f92dbd..4295372e 100644 --- a/pkg/networkservice/connectioncontext/ipcontext/routes/server.go +++ b/pkg/networkservice/connectioncontext/ipcontext/routes/server.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 Cisco and/or its affiliates. +// Copyright (c) 2020-2022 Cisco and/or its affiliates. // // SPDX-License-Identifier: Apache-2.0 // @@ -36,25 +36,25 @@ type routesServer struct { // NewServer creates a NetworkServiceServer chain element to set the ip address on a vpp interface // It sets the IP Address on the *vpp* side of an interface plugged into the // Endpoint. -// Endpoint -// +---------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +-------------------+ ipaddress.NewServer() | -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +---------------------------+ // +// Endpoint +// +---------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +-------------------+ ipaddress.NewServer() | +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +---------------------------+ func NewServer(vppConn api.Connection) networkservice.NetworkServiceServer { return &routesServer{ vppConn: vppConn, diff --git a/pkg/networkservice/connectioncontext/mtu/client.go b/pkg/networkservice/connectioncontext/mtu/client.go index 82e36e6b..bce5933f 100644 --- a/pkg/networkservice/connectioncontext/mtu/client.go +++ b/pkg/networkservice/connectioncontext/mtu/client.go @@ -40,25 +40,25 @@ type mtuClient struct { // NewClient creates a NetworkServiceClient chain element to set the mtu on a vpp interface // It sets the mtu on the *vpp* side of an interface leaving the // Endpoint. -// Endpoint -// +---------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// | mtu.NewClient()+-------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +---------------------------+ // +// Endpoint +// +---------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// | mtu.NewClient()+-------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +---------------------------+ func NewClient(vppConn api.Connection) networkservice.NetworkServiceClient { return &mtuClient{ vppConn: vppConn, diff --git a/pkg/networkservice/connectioncontext/mtu/server.go b/pkg/networkservice/connectioncontext/mtu/server.go index 5d72e9c5..31c0d430 100644 --- a/pkg/networkservice/connectioncontext/mtu/server.go +++ b/pkg/networkservice/connectioncontext/mtu/server.go @@ -36,25 +36,25 @@ type mtuServer struct { // NewServer creates a NetworkServiceServer chain element to set the MTU on a vpp interface // It sets the MTU on the *vpp* side of an interface plugged into the // Endpoint. -// Endpoint -// +---------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +-------------------+ mtu.NewServer() | -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +---------------------------+ // +// Endpoint +// +---------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +-------------------+ mtu.NewServer() | +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +---------------------------+ func NewServer(vppConn api.Connection) networkservice.NetworkServiceServer { return &mtuServer{ vppConn: vppConn, diff --git a/pkg/networkservice/connectioncontext/server.go b/pkg/networkservice/connectioncontext/server.go index b31d83d9..0887d7b0 100644 --- a/pkg/networkservice/connectioncontext/server.go +++ b/pkg/networkservice/connectioncontext/server.go @@ -34,25 +34,25 @@ import ( // NewServer creates a NetworkServiceServer chain element to set the ip address on a vpp interface // It applies the connection context to the *vpp* side of an interface plugged into the // Endpoint. -// Endpoint -// +------------------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +-------------------+ networkservice.NewServer() | -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +------------------------------------+ // +// Endpoint +// +------------------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +-------------------+ networkservice.NewServer() | +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +------------------------------------+ func NewServer(vppConn api.Connection) networkservice.NetworkServiceServer { return chain.NewNetworkServiceServer( mtu.NewServer(vppConn), diff --git a/pkg/networkservice/mechanisms/kernel/kernelvethpair/mtu/client.go b/pkg/networkservice/mechanisms/kernel/kernelvethpair/mtu/client.go index 21217026..65dbcbb0 100644 --- a/pkg/networkservice/mechanisms/kernel/kernelvethpair/mtu/client.go +++ b/pkg/networkservice/mechanisms/kernel/kernelvethpair/mtu/client.go @@ -44,25 +44,25 @@ type mtuClient struct{} // It sets the MTU on the *kernel* side of an interface leaving the // Client. Generally only used by privileged Clients like those implementing // the Cross Connect Network Service for K8s (formerly known as NSM Forwarder). -// Client -// +---------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// | +-------------------+ -// | | mtu.NewClient() -// | | -// | | -// | | -// | | -// | | -// | | -// +---------------------------+ // +// Client +// +---------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// | +-------------------+ +// | | mtu.NewClient() +// | | +// | | +// | | +// | | +// | | +// | | +// +---------------------------+ func NewClient() networkservice.NetworkServiceClient { return &mtuClient{} } diff --git a/pkg/networkservice/mechanisms/kernel/kernelvethpair/mtu/server.go b/pkg/networkservice/mechanisms/kernel/kernelvethpair/mtu/server.go index 915a1f01..efa2da57 100644 --- a/pkg/networkservice/mechanisms/kernel/kernelvethpair/mtu/server.go +++ b/pkg/networkservice/mechanisms/kernel/kernelvethpair/mtu/server.go @@ -44,25 +44,25 @@ type mtuServer struct { // It sets the MTU on the *kernel* side of an interface plugged into the // Endpoint. Generally only used by privileged Endpoints like those implementing // the Cross Connect Network Service for K8s (formerly known as NSM Forwarder). -// Endpoint -// +---------------------------+ -// | | -// | | -// | | -// | | -// | | -// | | -// | | -// +-------------------+ | -// mtu.NewServer() | | -// | | -// | | -// | | -// | | -// | | -// | | -// +---------------------------+ // +// Endpoint +// +---------------------------+ +// | | +// | | +// | | +// | | +// | | +// | | +// | | +// +-------------------+ | +// mtu.NewServer() | | +// | | +// | | +// | | +// | | +// | | +// | | +// +---------------------------+ func NewServer() networkservice.NetworkServiceServer { return &mtuServer{} } diff --git a/pkg/tools/mechutils/mechutils.go b/pkg/tools/mechutils/mechutils.go index 4407fed5..cce89994 100644 --- a/pkg/tools/mechutils/mechutils.go +++ b/pkg/tools/mechutils/mechutils.go @@ -47,7 +47,8 @@ func ToNSFilename(mechanism *kernel.Mechanism) (string, error) { } // ToAlias - create interface alias/tag from conn for client or server side for forwarder. -// Note: Don't use this in a non-forwarder context +// +// Note: Don't use this in a non-forwarder context func ToAlias(conn *networkservice.Connection, isClient bool) string { // Naming is tricky. We want to name based on either the next or prev connection id depending on whether we // are on the client or server side. Since this chain element is designed for use in a Forwarder, diff --git a/pkg/tools/types/route.go b/pkg/tools/types/route.go index 477e791a..6db42b57 100644 --- a/pkg/tools/types/route.go +++ b/pkg/tools/types/route.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Cisco and/or its affiliates. +// Copyright (c) 2020-2022 Cisco and/or its affiliates. // // SPDX-License-Identifier: Apache-2.0 // @@ -21,10 +21,13 @@ import ( ) // IsV6toFibProto - returns fib_types.FIB_API_PATH_NH_PROTO_IP6 if isv6 is true -// fib_types.FIB_API_PATH_NH_PROTO_IP4 if isv6 is false +// +// fib_types.FIB_API_PATH_NH_PROTO_IP4 if isv6 is false +// // Example: -// Given a *net.IPNet dst: -// types.IsV6toFibProto(dst.IP.To4() == nil) +// +// Given a *net.IPNet dst: +// types.IsV6toFibProto(dst.IP.To4() == nil) func IsV6toFibProto(isv6 bool) fib_types.FibPathNhProto { if isv6 { return fib_types.FIB_API_PATH_NH_PROTO_IP6