Skip to content

Modules and Capabilities

Ryan Madsen edited this page May 20, 2015 · 7 revisions

EOS SDK Modules and Capabilities

EOS SDK has a wide variety of APIs for programming EOS, organized into modules. The APIs that a given module provides is described by the header file under the eos/ directory. Modules also define any value types in a header file under eos/types/.

This document provides a high level overview of the capabilities each module provides.

Network Manipulation

Routing

EOS SDK has rich support for letting users manage IP routing and tunneling, via the following modules:

Module Description
ip_route.h Lets agents manipulate IPv4 and IPv6 route configuration.
fib.h Lets agents react to routes being programmed into the FIB.
mpls_route.h Configure how the device should forward traffic based on the top level MPLS tag.
nexthop_group.h Low level control over how traffic matching a given route should be forwarded. Lets agents forward traffic into GRE, IP-over-IP, and MPLS tunnels, and provides the ability to perform unequal cost multipathing (UCMP).
decap_group.h Let agents configure tunnel endpoints so traffic can be decapsulated and forwarded.
vrf.h Query and react to the status of VRFs on the system. Provide a utility to let agents open a socket inside of a named VRF.
types/ip.h Utilities for handling IP addresses.

Switching

Module Description
mac_table.h Let agents manipulate and react to MAC entries being learned on the switch.
neighbor_table.h Let agents manipulate and react to ARP entries and IPv6 neighbor discovery entries on the switch.

Traffic filtering and specialized forwarding

Module Description
acl.h Configure ACLs to permit or deny traffic based on packet characteristics.
policy_map.h Configure policy maps, which affords both Policy Based Routing (PBR)—specialized routing actions for packets that match a given policy/ACL—as well as Quality of Service (QoS) controls—set DSCP bits based on the packet's characteristics.
class_map.h Configure class maps, to be used with Policy Maps.
directflow.h Manage the DirectFlow feature, which lets agents use fine grained controls to redirect traffic flows matching a specified set of characteristics.

Interface Manipulation

EOS has many different types of interfaces, including physical Ethernet and Management ports, logical Port-Channels (a.k.a LAGs), Vlan and Vxlan interfaces, Loopback interfaces, and more. The SDK provides different modules which expose various facets of each interface. An interface can often be used with multiple modules: for example a Port-Channel has meaningful information exposed by intf.h, eth_intf.h, and eth_lag_intf.h.

Module Description
intf.h Exposes attributes and handlers common to all interfaces, including abilities to react to operating status, methods to change the description or enable/disable the interface, and more.
eth_intf.h Functionality common to interfaces which can have a MAC address assigned. Lets agents perform actions like changing interface switchport mode, configuring the MAC address or setting the allowed VLAN set.
eth_phy_intf.h Functionality for physical, front panel interfaces, including Ethernet interfaces and Management interfaces. Lets agents react to interface speed changes and, in modular systems, know when linecards are inserted or removed.
eth_lag_intf.h Methods for managing Port-Channels (a.k.a LAGs). Lets agents add or remove physical interfaces from a LAG and configure LACP parameters.
ip_intf.h Functionality to modify and react to IPv4 and IPv6 addresses assigned to an interface.
subintf.h Manipulate "subinterfaces", a logical routed interfaces nested under an Ethernet or LAG routed interface.

Whether an interface can be used with a given module depends on its type:

Example intf eos::INTF_TYPE intf eth_intf ip_intf eth_phy_intf eth_lag_intf subintf
Ethernet3/1 _ETH X X X X
Management1 _ETH X X X X
Port-Chanel6 _LAG X X X X
Ethernet2.2 inherited X X X
Vlan3 _VLAN X X X
Vxlan8 _VXLAN X X
Loopback2 _LOOPBACK X X

Device APIs

Module Description
agent.h React to lifecycle occurring for the EOS SDK agent. For example, provides APIs to handle agent initialization, shutdown, and configuration changes.
fd.h Handle file descriptors becoming readable or writable. Useful for asynchronous network connections.
timer.h Lets agents set and react to timers firing.
tracing.h Provides functionality to let an agent to output debug statements to /var/log/agents/
system.h View and react to attributes of the system changing, including hostname, serial number, and switch model.
version.h Details about the EOS SDK version installed on the switch.
aresolve.h Manage asynchronous DNS resolution.
mlag.h Configure whether this switch is in an MLAG