Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExportNode ¶
type ExportNode struct {
CIDR string `json:"cidr"`
FirstIP string `json:"firstIP"`
LastIP string `json:"lastIP"`
BroadcastAddr string `json:"broadcastAddr"`
SubnetMask string `json:"subnetMask"`
Hosts uint `json:"hosts"`
Children []*ExportNode `json:"children,omitempty"`
}
ExportNode is a JSON-serializable representation of a subnet.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubble Tea model for the TUI.
func NewModel ¶
NewModel creates a new TUI model from a CIDR string. Optional targetBits parameter specifies initial split depth (0 means no initial split).
type SubnetNode ¶
type SubnetNode struct {
CIDR netip.Prefix
FirstIP netip.Addr
LastIP netip.Addr
BroadcastAddr netip.Addr
SubnetMask netip.Addr
Hosts uint
Parent *SubnetNode
Children []*SubnetNode
IsSplit bool
}
SubnetNode represents a node in the subnet tree.
func (*SubnetNode) ExportJSON ¶
func (n *SubnetNode) ExportJSON() (string, error)
ExportJSON returns the tree as a JSON string.
func (*SubnetNode) Join ¶
func (n *SubnetNode) Join() bool
Join merges the children back into the parent.
func (*SubnetNode) Split ¶
func (n *SubnetNode) Split() bool
Split splits a subnet node into two children.
func (*SubnetNode) SplitToDepth ¶
func (n *SubnetNode) SplitToDepth(targetBits int)
SplitToDepth recursively splits the subnet until reaching the target bit depth.
Click to show internal directories.
Click to hide internal directories.