modulepackage
0.0.0-20210207150015-bd2ea513f61a
Repository: https://github.com/mrspock/godocsis.git
Documentation: pkg.go.dev
# README
go-docsis
Implementation of basic CM operations. Part of larger closed source project. Code is not using concurrency at the moment.
Example that will fetch DS/US RF levels from CM:
package main
import (
"flag"
"fmt"
"os"
"github.com/mrspock/godocsis"
)
func main() {
//var ip string
flag.Parse()
if len(flag.Args()) < 1 {
fmt.Println("Usage: cmparams <ip> <ip>")
return
}
s := godocsis.Session
for _, ip := range flag.Args() {
s.Target = ip
rs, err := godocsis.RFLevel(s)
if err != nil {
fmt.Fprintf(os.Stderr, "Problem: %v", err)
//panic(err)
} else {
fmt.Printf("%s:", ip)
fmt.Printf("%.01f:", float32(rs.RF.USLevel[0])/10)
separator := ","
for no, ds := range rs.RF.DSLevel {
if no == rs.RF.DsBondingSize()-1 {
separator = ""
}
fmt.Printf("%.01f%v", float32(ds)/10, separator)
}
fmt.Println("")
}
}
}
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
AddOidSuffix will add index suffix and return full OID.
CmGetFwdRuleCount return number of alredy present forwarding rules providing SNMP index where to pun new one without overrwriting exisiting one.
CmGetNetiaPlayerList is Netia specific function that return local side (LAN) IP address for every connected and detected NetiaPLayer STB.
CmSetForwardRule sets new firewall forwarding rule for TC7200 CM.
GetModemList - provides list of modems seen on CMTS.
CmUpgrade request cable modem upgradeparams are gosnmp.GoSNMP object, server IP address (string) and path relative to tftp root (string).
No description provided by the author
GetConnetedDevices show devicess connected to CM LAN side.
No description provided by the author
GetRouterIP return built-in e-Router external (WAN) ip address used for NAT all user traffic.
legacy helper function to convert []byte array to human readable form of IP currently this is handled by net/ip package functions.
Oid2MAC Replace SNMP integer encoded MAC ("4.222.110.11.22.224") MAC address.
PanicIf wrapper for commonly used code for handling errors.
ResetCm function resets cable modem by setting docsDevResetNow.0 to one This will make cable modem to reinitialize itself The only param is cable modem IP address string.
Return Cable modem struct with filled fields related to CM RF parameters This will work on any cable modem since those are generic DOCSIS MIBS.
# Constants
Both SNMP code.
OID table definitions.
OID table definitions.
OID table definitions.
deprecated.
OID table definitions.
OID table definitions.
OID table definitions.
OID table definitions.
cm upgrade.
DsOid contans table of active downstreams.
No description provided by the author
No description provided by the author
IPAdEntIfIndex will provide tree with list of IP addressess.
No description provided by the author
ResetOid - generic DOCSIS cable modem reset oid.
Tcp SNMP code.
Udp SNMP code.
UsOid contains table of used upstream channels.
# Variables
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
cable modem structure.
Basic structure used to hold misc CM RF parameters.
# Type aliases
No description provided by the author
No description provided by the author
IPAddrType SNMP ipaddr type.
No description provided by the author
Protocol type used insted uint.