C# Class WinLLDPService.WinLLDP

显示文件 Open project: raspi/WinLLDPService Class Usage Examples

Public Methods

Method Description
FriendlyName ( ) : string

Get OS "friendly name" for example "Windows 7 Ultimate edition"

HKLM_GetString ( string path, string key ) : string
Run ( ) : bool
Stop ( ) : void

Private Methods

Method Description
CloseDevices ( ) : void

Close devices for sending

CreateLLDPPacket ( NetworkInterface adapter, PacketInfo pinfo ) : PacketDotNet.Packet

Generate LLDP packet for adapter

CreateTlvString ( string>.Dictionary dict ) : string

TLV value's lenght can be only 0-511 octets Organizational spesific TLV value's lenght can be only 0-507 octets

GetCapabilityOptions ( ) : List

List possible LLDP capabilities such as: - Bridge - Router - WLAN Access Point - Station

GetCapabilityOptionsBits ( List capabilities ) : ushort

Get LLDP capabilities as bits

GetTickCount64 ( ) : System.UInt64
GetUsers ( ) : List

Get list of users We cant use Environment.UserName or System.Security.Principal.WindowsIdentity.GetCurrent().Name because those return ("SYSTEM" or "NT AUTHORITY\SYSTEM"). This is because it is reading Windows Service user, not logged in user(s). So different approach finding correct logged in user(s) have to be used.

OpenDevices ( ) : void

Open devices for sending

ReadableSize ( double size, int unit ) : string

Change for example adapter link speed into more human readable format

getCIDRFromIPMaskAddress ( IPAddress ip ) : int

Convert network mask to CIDR notation

sendRawPacket ( NetworkInterface adapter, PacketDotNet.Packet payload ) : bool

Method Details

FriendlyName() public method

Get OS "friendly name" for example "Windows 7 Ultimate edition"
public FriendlyName ( ) : string
return string

HKLM_GetString() public method

public HKLM_GetString ( string path, string key ) : string
path string
key string
return string

Run() public method

public Run ( ) : bool
return bool

Stop() public method

public Stop ( ) : void
return void