- struct protoent *proto = NULL;
- proto = getprotobyname("ICMP");
- sendSocket = socket(PF_INET, SOCK_RAW, proto->p_proto);
- recvSocket = socket(PF_INET, SOCK_RAW, proto->p_proto);
- nonstop = true;
- pid = (int) getpid() % 65535;
- if (sendSocket < 0 || recvSocket < 0)
- {
- errorStr = "Cannot create socket.";
- return -1;
- }
+struct protoent *proto = NULL;
+proto = getprotobyname("ICMP");
+sendSocket = socket(PF_INET, SOCK_RAW, proto->p_proto);
+recvSocket = socket(PF_INET, SOCK_RAW, proto->p_proto);
+nonstop = true;
+pid = (int) getpid() % 65535;
+if (sendSocket < 0 || recvSocket < 0)
+ {
+ errorStr = "Cannot create socket.";
+ return -1;
+ }