core

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package core provides core networking information retrieval functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkInfo

type NetworkInfo struct {
	// IP Configuration
	Ipv4           string `json:"ipv4"`
	Ipv6           string `json:"ipv6"`
	Subnet         string `json:"subnet"`
	Gateway        string `json:"gateway"`
	DhcpEnabled    bool   `json:"dhcpEnabled"`
	DhcpServer     string `json:"dhcpServer,omitempty"`
	DhcpLeaseStart string `json:"dhcpLeaseStart,omitempty"`
	DhcpLeaseEnd   string `json:"dhcpLeaseEnd,omitempty"`

	// Gateway/Router Information
	GatewayMac     string  `json:"gatewayMac"`
	GatewayLatency float64 `json:"gatewayLatency"`
	GatewayVendor  string  `json:"gatewayVendor,omitempty"`
	HopsToInternet int     `json:"hopsToInternet"`

	// DNS
	DnsServers []string `json:"dnsServers"`

	// Interface Information
	InterfaceName string `json:"interfaceName"`
	MacAddress    string `json:"macAddress"`
	LinkSpeed     string `json:"linkSpeed"`
	Mtu           int    `json:"mtu"`
	Duplex        string `json:"duplex"`

	// Connection Status
	ConnectionType string  `json:"connectionType"` // "Ethernet" or "WiFi"
	Connected      bool    `json:"connected"`
	Uptime         int64   `json:"uptime"`
	Latency        float64 `json:"latency"`
	PacketLoss     float64 `json:"packetLoss"`

	// WiFi specific (if applicable)
	Ssid           string `json:"ssid,omitempty"`
	SignalStrength int    `json:"signalStrength,omitempty"`
	WifiChannel    int    `json:"wifiChannel,omitempty"`
	WifiFrequency  string `json:"wifiFrequency,omitempty"`
	WifiBssid      string `json:"wifiBssid,omitempty"`

	// Switch/Network Detection
	SwitchDetected bool   `json:"switchDetected"`
	SwitchPort     string `json:"switchPort,omitempty"`
	SwitchInfo     string `json:"switchInfo,omitempty"`

	// VLAN Information
	VlanEnabled bool   `json:"vlanEnabled"`
	VlanId      int    `json:"vlanId,omitempty"`
	VlanName    string `json:"vlanName,omitempty"`

	// Traffic Statistics (kept for compatibility but not shown on simplified dashboard)
	BytesReceived   int64 `json:"bytesReceived"`
	BytesSent       int64 `json:"bytesSent"`
	PacketsReceived int64 `json:"packetsReceived"`
	PacketsSent     int64 `json:"packetsSent"`

	// Additional Network Info
	PublicIp      string `json:"publicIp,omitempty"`
	NetworkPrefix string `json:"networkPrefix,omitempty"`
	BroadcastAddr string `json:"broadcastAddr,omitempty"`

	Timestamp time.Time `json:"timestamp"`
}

NetworkInfo represents the complete network information for the device Field names match frontend expectations (camelCase)

func GetNetworkInfo

func GetNetworkInfo() (*NetworkInfo, error)

GetNetworkInfo retrieves comprehensive network information

Jump to

Keyboard shortcuts

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