开发者

logic for checking what is the input data

开发者 https://www.devze.com 2023-03-01 01:38 出处:网络
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 diffe

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

精彩评论

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