server

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToGoSnmpPDU

func ToGoSnmpPDU(pbSnmpPdu *pb.SnmpPDU) (pdu gosnmp.SnmpPDU)

ToGoSnmpPDU helper converts protobuf snmppdu to go snmpPDU

func ToPbSnmpPDU

func ToPbSnmpPDU(pdu gosnmp.SnmpPDU) (pbSnmpPdu *pb.SnmpPDU)

ToPbSnmpPDU helper comverts SnmpPDU to protobuf SnmpPDU

Types

type CommandServer

type CommandServer struct {
	ListenAddr       string
	DefaultVersion   gosnmp.SnmpVersion
	DefaultCommunity string
	Logger           Logger
	SNMPLogger       gosnmp.Logger
}

CommandServer is the GRPC Service for snmp.Command

func (*CommandServer) Get

func (s *CommandServer) Get(ctx context.Context, oids *pb.OidList) (snmpPacket *pb.SnmpPacket, err error)

Get implements snmpget command

func (*CommandServer) Set

func (s *CommandServer) Set(ctx context.Context, pdus *pb.SnmpPDUs) (snmpPacket *pb.SnmpPacket, err error)

Set implements snmpset command

func (*CommandServer) StreamWalk

func (s *CommandServer) StreamWalk(oid *pb.Oid, srv pb.Command_StreamWalkServer) error

StreamWalk implements snmpwalk command in a stream

func (*CommandServer) Walk

func (s *CommandServer) Walk(ctx context.Context, oid *pb.Oid) (snmpPacket *pb.SnmpPDUs, err error)

Walk implements snmpwalk command as a oneshot data

type Logger

type Logger interface{}

Logger should implement logging functionality

Jump to

Keyboard shortcuts

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