Пример #1
0
        public void RestoreFromFile()
        {
            var arpTable = new ArpTable();

            arpTable.RestoreFromFile();

            foreach (var item in arpTable.Entries)
            {
                output.WriteLine(item.ToString());
            }
        }
Пример #2
0
        // IProtocol interfaces
        // ------------------------
        public bool Initialize(ProtocolParams parameters)
        {
            Debug.Assert(parameters == null || parameters["name"] == "ARP");

            int size = ProtocolParams.LookupInt32(parameters, "cacheSize",
                                                  128);
            int age = ProtocolParams.LookupInt32(parameters, "max-age",
                                                 ArpTable.MaxAge);

            arpTable        = new ArpTable(size, age, this);
            pendingRequests = new ArrayList();

            Core core = Core.Instance();

            core.RegisterProtocol(this);
            if (!core.packetTypes.RegisterTypeHandler(PacketTypes.ARP, this))
            {
                core.DeregisterProtocol(this);
                return(false);
            }
            return(true);
        }
Пример #3
0
 public bool DestroyModule()
 {
     arpTable = null;
     return(true);
 }