ripng

package
v0.577.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ripng decodes RIPng (RFC 2080) — the IPv6 distance-vector routing protocol (UDP 521). It is the IPv6 sibling of the project's internal/rip (RIPv1/v2, IPv4): a routing-reconnaissance and route-injection surface. RIPng has no authentication of its own, so a captured Response reveals the routes a router advertises (each IPv6 prefix, its route tag and hop-count metric) and, because the protocol trusts any Response on the segment, an attacker on-link can inject or blackhole routes — decoding the advertisement is the first step of auditing that exposure.

Wrap-vs-native judgement

Native. RIPng is a 4-byte header (command / version / reserved)
followed by an array of fixed 20-byte route table entries
(128-bit prefix / route tag / prefix length / metric). A byte-field
read + an array walk; stdlib only (net for the IPv6 formatting), no
new go.mod dep.

Verifiable / no confidently-wrong output

The header and the route-table-entry layout — including the two
special entries of RFC 2080: the next-hop RTE (metric 0xFF, the
prefix field carries a next-hop address) and the infinity metric
(16, an unreachable route) — were verified field-for-field against
scapy's RIPng layer (scapy.contrib.ripng). Nothing is heuristically
guessed; every byte maps to a defined field.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	IsNextHop    bool   `json:"is_next_hop"`
	NextHop      string `json:"next_hop,omitempty"`
	Prefix       string `json:"prefix,omitempty"`
	PrefixLength int    `json:"prefix_length,omitempty"`
	RouteTag     int    `json:"route_tag,omitempty"`
	Metric       int    `json:"metric,omitempty"`
	MetricName   string `json:"metric_name,omitempty"`
}

Entry is one decoded RIPng route table entry.

type Result

type Result struct {
	Command           int      `json:"command"`
	CommandName       string   `json:"command_name"`
	Version           int      `json:"version"`
	Entries           []Entry  `json:"entries"`
	WholeTableRequest bool     `json:"whole_table_request,omitempty"`
	Notes             []string `json:"notes,omitempty"`
}

Result is the decoded view of a RIPng message.

func Decode

func Decode(input string) (*Result, error)

Decode parses a RIPng message (the UDP-521 payload) from hex (whitespace / ':' / '-' / '_' separators and a '0x' prefix tolerated).

Jump to

Keyboard shortcuts

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