Add functions to check the validation of the arguments

Fix function dircheck();
Add function ipcheck();
Add function filecheck();
Add function portcheck();
ps. Fix the arguments of getopt.