public void InitializePacket(SnmpPacket packet)
{
if (packet is SnmpV1Packet)
{
SnmpV1Packet pkt = (SnmpV1Packet)packet;
pkt.Community.Set(_community);
}
else if (packet is SnmpV2Packet)
{
SnmpV2Packet pkt = (SnmpV2Packet)packet;
pkt.Community.Set(_community);
}
else
throw new SnmpInvalidVersionException("Invalid SNMP version.");
}