Can post a code but afraid of plagiarism

indar kumar indarkumar59 at gmail.com
Wed Jan 22 11:33:30 EST 2014


On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
> 
> 
> 
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Description of each of the commands:
• config

◦ Parameters: <host_id> <mac addr> <ip addr> <cache timeout>
▪ <cache timeout> is the host's ARP cache timeout, in seconds
◦ Actions:
▪ Update simulator's configuration database.
• If <host_id> already exists, its information should be updated. Otherwise, it should
be added.
▪ Print “<host_id> connected.”
▪ Have the host send a gratuitous ARP request .
• If any other hosts have an outdated entry for the MAC or IP address, they should
update their caches.
• If there are any responses to that request, that means that somebody else has this IP
address. If that is the case, you should print:
Error: <host_id> detected IP address conflict. It will be disconnected.
Then, you should “disconnect” the host from the simulated network, in order to
prevent further problems. You can implement this by removing it from the
configuration database.
◦ Note: any ARP packets generated by the command should be printed in the previously
specified format


Sample Output:

config
Please enter <host_id> <mac addr> <ip addr> <cache timeout>
PC1 01:01:01:01:01:01 192.168.0.1 200
PC1 connected.
ARP request 01:01:01:01:01:01 FF:FF:FF:FF:FF:FF 192.168.0.1 192.168.0.1



More information about the Python-list mailing list