lemming

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 18 Imported by: 1

README

Lemming the Openconfig reference device implementation

Purpose

To provide a reference implementation of a device which provides the collection of customers APIs used for Openconfig. This includes:

  • gNMI
  • gNOI
  • gRIBI
  • P4RT
  • BGP
  • ISIS

to clearly and authoritatively specify the expected behavior of an OpenConfig-compliant device, and to aid in its test development and debugging. Anyone can use this reference implementation to quickly write device tests independent of the availability of a real and compliant implementation. The reference can also be used to augment the consumer contract when a fake-derived test suite is delivered to network device vendors, serving as a tool for consensus in the device-implementor <-> device-consumer relationship.

Running the Fake gNMI Server

go run cmd/lemming/lemming.go
gnmic -a localhost:6030 --insecure subscribe --mode stream --path openconfig:/system/state/current-datetime -u foo -p bar --target fakedut

Running integration tests

Prerequisites:

  • KNE setup and cluster deployed

Setup:

  • Run setup script to install KNE CLI and create Ondatra config: kne/setup.sh

Deploy and Test:

  • Run deploy script to build image and load into k8s: kne/deploy.sh
  • Run integration tests: go test -v ./integration_tests -args -config $(pwd)/kne/config.yaml -testbed $(pwd)/kne/testbed.pb.txt

Documentation

Overview

Package lemming provides reference device to be used with ondatra.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	// contains filtered or unexported fields
}

Device is the reference device implementation.

func New

func New(lis net.Listener, targetName, zapiURL string, opts ...grpc.ServerOption) (*Device, error)

New returns a new initialized device.

func (*Device) Addr

func (d *Device) Addr() string

Addr returns the currently configured ip:port for the listening services.

func (*Device) GNMI

func (d *Device) GNMI() *fgnmi.Server

GNMI returns the gNMI server implementation.

func (*Device) GNSI

func (d *Device) GNSI() *fgnsi.Server

GNSI returns the gNSI server implementation.

func (*Device) Stop

func (d *Device) Stop() error

Stop stops the listening services. If error is not nil, it will contain why the server failed.

Directories

Path Synopsis
Package bgp contains a BGP implementation (using GoBGP) whose API is OpenConfig.
Package bgp contains a BGP implementation (using GoBGP) whose API is OpenConfig.
cmd
decodepacket command
Package main takes a packet hex string and prints the decoded packet.
Package main takes a packet hex string and prints the decoded packet.
lemming command
release command
Package dataplane is an implementation of the dataplane HAL API.
Package dataplane is an implementation of the dataplane HAL API.
forwarding
Package forwarding manages forwarding contexts and forwarding objects.
Package forwarding manages forwarding contexts and forwarding objects.
forwarding/fwdaction
Package fwdaction contains routines and types to manage forwarding actions.
Package fwdaction contains routines and types to manage forwarding actions.
forwarding/fwdaction/actions
Package actions implements various types of actions supported within Lucius.
Package actions implements various types of actions supported within Lucius.
forwarding/fwdaction/mock_fwdpacket
Package mock_fwdpacket is a generated GoMock package.
Package mock_fwdpacket is a generated GoMock package.
forwarding/fwdaction/mock_fwdport
Package mock_fwdport is a generated GoMock package.
Package mock_fwdport is a generated GoMock package.
forwarding/fwdaction/mock_fwdtable
Package mock_fwdtable is a generated GoMock package.
Package mock_fwdtable is a generated GoMock package.
forwarding/fwdport
Package fwdport contains routines and types to manage forwarding ports.
Package fwdport contains routines and types to manage forwarding ports.
forwarding/fwdport/mock_fwdpacket
Package mock_fwdpacket is a generated GoMock package.
Package mock_fwdpacket is a generated GoMock package.
forwarding/fwdport/ports
Package ports implements various types of ports supported within Lucius.
Package ports implements various types of ports supported within Lucius.
forwarding/fwdport/porttestutil
Package porttestutil contains routines used to create and manage ports for test cases.
Package porttestutil contains routines used to create and manage ports for test cases.
forwarding/fwdtable
Package fwdtable contains routines and types to manage forwarding tables.
Package fwdtable contains routines and types to manage forwarding tables.
forwarding/fwdtable/bridge
Package bridge implements an exact match table that operates on the packet's mac address.
Package bridge implements an exact match table that operates on the packet's mac address.
forwarding/fwdtable/exact
Package exact implements a Lucius table that performs packet matches using an exact match match and satisfies the interface fwdtable.Table.
Package exact implements a Lucius table that performs packet matches using an exact match match and satisfies the interface fwdtable.Table.
forwarding/fwdtable/flow
Package flow implements a Lucius table that performs packet matches using an flow matching and satisfies the interface fwdtable.Table.
Package flow implements a Lucius table that performs packet matches using an flow matching and satisfies the interface fwdtable.Table.
forwarding/fwdtable/mock_fwdpacket
Package mock_fwdpacket is a generated GoMock package.
Package mock_fwdpacket is a generated GoMock package.
forwarding/fwdtable/prefix
Package prefix implements a Lucius table that performs packet matches using the longest prefix match and satisfies the interface fwdtable.Table.
Package prefix implements a Lucius table that performs packet matches using the longest prefix match and satisfies the interface fwdtable.Table.
forwarding/fwdtable/tabletestutil
Package tabletestutil consists of routines used to test Lucius tables like prefix match, exact match and flow match tables.
Package tabletestutil consists of routines used to test Lucius tables like prefix match, exact match and flow match tables.
forwarding/fwdtable/tableutil
Package tableutil contains utilites used to implement tables in Lucius like prefix, flow and exact match.
Package tableutil contains utilites used to implement tables in Lucius like prefix, flow and exact match.
forwarding/infra/deadlock
Package deadlock is a set of simple utilities meant to detect deadlocks based on timeouts.
Package deadlock is a set of simple utilities meant to detect deadlocks based on timeouts.
forwarding/infra/fwdattribute
Package fwdattribute provides types and mechanisms used to manage attributes for forwarding objects.
Package fwdattribute provides types and mechanisms used to manage attributes for forwarding objects.
forwarding/infra/fwdcontext
Package fwdcontext contains routines for managing the context of the forwarding engine.
Package fwdcontext contains routines for managing the context of the forwarding engine.
forwarding/infra/fwdflowcounter
Package fwdflowcounter implements the functionality of Flow Counters.
Package fwdflowcounter implements the functionality of Flow Counters.
forwarding/infra/fwdobject
Package fwdobject contains routines and interfaces used to implement various forwarding objects.
Package fwdobject contains routines and interfaces used to implement various forwarding objects.
forwarding/infra/fwdpacket
Package fwdpacket contains routines and types for manipulating packets.
Package fwdpacket contains routines and types for manipulating packets.
forwarding/infra/fwdset
Package fwdset implements a set of members.
Package fwdset implements a set of members.
forwarding/protocol
Package protocol enables Lucius to uniformly query and mutate network packets containing various protocols.
Package protocol enables Lucius to uniformly query and mutate network packets containing various protocols.
forwarding/protocol/arp
Package arp implements the ARP header.
Package arp implements the ARP header.
forwarding/protocol/ethernet
Package ethernet implements the Ethernet header.
Package ethernet implements the Ethernet header.
forwarding/protocol/icmp
Package icmp implements the ICMP header support in Lucius.
Package icmp implements the ICMP header support in Lucius.
forwarding/protocol/ip
Package ip handles the IP L3 portion of the packet.
Package ip handles the IP L3 portion of the packet.
forwarding/protocol/metadata
Package metadata implements the metadata packet header.
Package metadata implements the metadata packet header.
forwarding/protocol/opaque
Package opaque implements the opaque packet header.
Package opaque implements the opaque packet header.
forwarding/protocol/packettestutil
Package packettestutil contains a set of routines used to test the processing of packet headers and fields.
Package packettestutil contains a set of routines used to test the processing of packet headers and fields.
forwarding/protocol/tcp
Package tcp implements the TCP header support in Lucius.
Package tcp implements the TCP header support in Lucius.
forwarding/protocol/udp
Package udp implements the UDP header support in Lucius.
Package udp implements the UDP header support in Lucius.
forwarding/util/frame
Package frame contains utilities to implement various network protocols and describe their relationship within Lucius.
Package frame contains utilities to implement various network protocols and describe their relationship within Lucius.
forwarding/util/hash/crc16
Package crc16 computes the 16 bit checksum over a series of bytes.
Package crc16 computes the 16 bit checksum over a series of bytes.
forwarding/util/hash/csum16
Package csum16 computes the 16 bit Internet checksum.
Package csum16 computes the 16 bit Internet checksum.
forwarding/util/hash/hash16
Package hash16 provides interfaces for functions computing 16 bit hashes.
Package hash16 provides interfaces for functions computing 16 bit hashes.
forwarding/util/queue
Package queue provides a queue to processes elements in FIFO order using a specified handler, while allowing non-blocking writes to the queue.
Package queue provides a queue to processes elements in FIFO order using a specified handler, while allowing non-blocking writes to the queue.
forwarding/util/stats
Package stats implements Stats that collects data.
Package stats implements Stats that collects data.
handlers
Package handlers contains gNMI task handlers.
Package handlers contains gNMI task handlers.
internal/engine
Package engine contains funcs for interacting with the forwarding engine.
Package engine contains funcs for interacting with the forwarding engine.
internal/kernel
Package kernel contains funcs that interact with the kernel (sycalls, netlink).
Package kernel contains funcs that interact with the kernel (sycalls, netlink).
Package gnmi contains a reference on-device gNMI implementation.
Package gnmi contains a reference on-device gNMI implementation.
gnmiclient
Package gnmiclient contains a funcs to create gNMI for the local cache.
Package gnmiclient contains a funcs to create gNMI for the local cache.
oc
Package oc is a generated package which contains definitions of structs which represent a YANG schema.
Package oc is a generated package which contains definitions of structs which represent a YANG schema.
oc/acl
Package acl is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package acl is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/bgpgue
Package bgpgue is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package bgpgue is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/interfaces
Package interfaces is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package interfaces is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/keychain
Package keychain is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package keychain is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/lacp
Package lacp is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package lacp is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/lldp
Package lldp is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package lldp is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/networkinstance
Package networkinstance is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package networkinstance is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/ocpath
Package ocpath is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package ocpath is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/platform
Package platform is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package platform is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/qos
Package qos is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package qos is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/routingpolicy
Package routingpolicy is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package routingpolicy is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
oc/system
Package system is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
Package system is a generated package which contains definitions of structs which generate gNMI paths for a YANG schema.
reconciler
Package reconciler contains a common interface for gNMI reconciler.
Package reconciler contains a common interface for gNMI reconciler.
integration_tests
binding
Package binding wraps knebind to allow running integration tests without the need to supply kne/ondatra flags for configuration files.
Package binding wraps knebind to allow running integration tests without the need to supply kne/ondatra flags for configuration files.
operator module
proto
Package sysrib implements a system-level RIB that is populated initially using an OpenConfig configuration.
Package sysrib implements a system-level RIB that is populated initially using an OpenConfig configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL