not working
Cubio opened this issue · 6 comments
Would you mind sending me the output from the following code using the contact form on PowerShell Gallery?
$Packet = Capture-LLDPPacket
[System.Convert]::ToBase64String($Packet)
@Cubio: I would need the packet you captured to be sure, but I think I know what is going on.
Does it work if you remove the following code from Parse-LLDPPacket
?
1 {
# Chassis ID
$Subtype = $Packet[$Offset]
$Offset += 1
$Length -= 1
if ($Subtype -eq 4)
{
$ChassisID = [PSCustomObject] @{
Type = 'MAC Address'
ID = [PhysicalAddress]::new($Packet[$Offset..($Offset + 5)])
}
$Offset += 6
}
if ($Subtype -eq 6)
{
$ChassisID = [PSCustomObject] @{
Type = 'Interface Name'
ID = [System.Text.Encoding]::ASCII.GetString($Packet[$Offset..($Offset + $Length)])
}
$Offset += $Length
}
break
}
ok, I will to thous at the next Monday (output and removing some code).
Did it work when you removed the ChassisID section from Parse-LLDPPacket
?
I'm going to close this issue now because I don't have enough information.
I do think, however, that commit 1842bc9 or commit 5e4ead7 could fix your issue. You can update to version 1.0.1 by running Update-Module -Name PSDiscoveryProtocol
.
Please note that some devices only include the mandatory TLVs in their LLDP packets. The mandatory TLVs are ChassisID, PortID and Time To Live. This module will only return PortID and some of the optional TLVs.
Try to do a packet capture with Wireshark and have a look at what information is available in your LLDP packets. If you think I should include some of that information, please let me know.