开发者

logic for checking what is the input data

can any one help me开发者_开发百科 in this logic, when i enter a source ip is should call a particular function XXX()if i enter destination ip or destination port or source port it should call a different function say YYY(), my doubt is how can i recognise whether the input address is source ip address or destination address


With assumption that you are referring to Command Line Arguments. You should have options to your program. For example :

program_name --source-ip <source ip> --source-port <source-port> --destination-ip <destination-ip> --destination-port <destination-port>

You should then parse those and call the functions accordingly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜