NG_CISCO(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… NG_CISCO(4) β€” cisco node type, bestie edition ✨

okay so this is a page from the Kernel Interfaces Manual (section 4, kernel interfaces, iykyk) and it's all about the ng_cisco node type. buckle up πŸ’–


🌸 NAME 🌸

ng_cisco β€” the Cisco HDLC protocol netgraph node type. periodt.


✨ SYNOPSIS ✨

#include <sys/types.h>
#include <netinet/in.h>
#include <netgraph/ng_cisco.h>

like, include these three headers and you're in 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

The cisco node type does the encapsulation and de-encapsulation of packets using the Cisco HDLC protocol. It's honestly a pretty simple protocol for sending packets across high speed synchronous lines β€” lowkey elegant ngl. Every packet gets an Ethertype prepended to it, which is the thing that says which protocol it is. It also has a "keep alive" capability and an "inquire" capability. two little bonus features, we love that for it πŸ’…

The downstream hook is the one that should connect to the synchronous line. On the other side of the node you've got the inet, inet6, atalk, and ipx hooks, and those transmit and receive raw IP, IPv6, AppleTalk, and IPX packets respectively. typically these hooks would connect to the corresponding hooks on an ng_iface(4) type node. match made in heaven fr fr πŸŽ€

🐚 IP Configuration 🐚

so for this node to function properly for IP traffic, it must be told the local IP address and netmask setting. why? because the protocol includes an "inquire" packet and we gotta be ready to answer it, bestie. there are two ways to make this happen: manually and automatically. two paths, both valid ✨

Whenever such an inquire packet is received, the node sends a NGM_CISCO_GET_IPADDR control message to the peer node connected to the inet hook (if any). If the peer responds, then that response gets used. that's the automatic method, and it's giving main character energy honestly πŸ‘‘

If the peer does not respond, the node falls back on its cached value for the IP address and netmask. That cached value can be set at any time with a NGM_CISCO_SET_IPADDR message β€” and that's the manual method. good to have a backup plan πŸ’œ

If the inet hook is connected to the inet hook of an ng_iface(4) node β€” which is usually the case β€” then configuration is automatic, because ng_iface(4) understands the NGM_CISCO_GET_IPADDR message. it just gets it. iconic behaviour 🌈


πŸŽ€ HOOKS πŸŽ€

This node type supports the following hooks, and yes we're listing all of them:

  • downstream β€” The connection to the synchronous line. the big one πŸ”₯
  • inet β€” IP hook.
  • inet6 β€” IPv6 hook.
  • atalk β€” AppleTalk hook.
  • ipx β€” IPX hook.

five hooks, all accounted for, no cap πŸ’–


⭐ CONTROL MESSAGES ⭐

This node type supports the generic control messages, plus the following cuties:

  • NGM_CISCO_SET_IPADDR (setipaddr) β€” This command takes an array of two struct in_addr arguments. The first is the IP address of the corresponding interface and the second is the netmask.
  • NGM_CISCO_GET_IPADDR (getipaddr) β€” This command returns the IP configuration in the same format used by NGM_CISCO_SET_IPADDR. This command is also sent by this node type to the inet peer whenever an IP address inquiry packet is received. multitasking queen πŸ’…
  • NGM_CISCO_GET_STATUS (getstats) β€” Returns a struct ngciscostat:
struct ngciscostat {
  uint32_t   seqRetries;        /* # unack'd retries */
  uint32_t   keepAlivePeriod;   /* in seconds */
};

look at that struct. beautiful. two uint32_ts and a dream πŸ¦‹


🌸 SHUTDOWN 🌸

This node shuts down upon receipt of a NGM_SHUTDOWN control message, or when all hooks have been disconnected. that's it, that's the whole vibe check 😭


πŸ’œ SEE ALSO πŸ’œ

also this absolute classic:

  • D. Perkins, Requirements for an Internet Standard Point-to-Point Protocol, RFC 1547.

go read the RFC bestie, it's giving required reading πŸ“šβœ¨


Cisco is a trademark of Cisco Systems, Inc. gotta say it, legal said so πŸ™ˆ


🧚 HISTORY 🧚

The ng_cisco node type was implemented in FreeBSD 4.0. vintage. retro. we stan a legacy icon πŸ’€βœ¨


πŸ“ AUTHORS πŸ“

  • Julian Elischer <julian@FreeBSD.org>
  • Archie Cobbs <archie@FreeBSD.org>

two legends, one node type 🫢


πŸ’€ BUGS πŸ’€

Not all of the functionality has been implemented. For example, the node does not support querying the remote end for its IP address and netmask. yeah. that part's just... not there yet. we're aware. it's on the list πŸ˜­πŸ™ˆ


okay that's the whole page, no skips, every flag and hook and message intact πŸ’– sending you good netgraph vibes and reminding you to actually set your IP config before you wonder why inquire packets are ghosting you πŸŽ€

Debian Β· January 19, 1999 Β· that's the source, the version and the date babes, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from