diff --git a/src/auth.cpp b/src/auth.cpp index c947b51..126fbef 100644 --- a/src/auth.cpp +++ b/src/auth.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "auth.h" @@ -38,7 +38,7 @@ Auth::Response Auth::getResponse(const Challenge &challenge) const hasher.Input(&challenge[0], challenge.size()); hasher.Result((unsigned int *)response.data); - + for (int i = 0; i < 5; i++) response.data[i] = htonl(response.data[i]); diff --git a/src/auth.h b/src/auth.h index 683353a..7188733 100644 --- a/src/auth.h +++ b/src/auth.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #ifndef AUTH_H diff --git a/src/client.cpp b/src/client.cpp index 19a9ba3..93fbe86 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "client.h" diff --git a/src/client.h b/src/client.h index 465a239..ffd32ee 100644 --- a/src/client.h +++ b/src/client.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #ifndef CLIENT_H diff --git a/src/config.h b/src/config.h index fdd384e..7d5d6c8 100644 --- a/src/config.h +++ b/src/config.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #define MAX_BUFFERED_PACKETS 20 diff --git a/src/echo.cpp b/src/echo.cpp index e41d0f7..de80565 100644 --- a/src/echo.cpp +++ b/src/echo.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "echo.h" @@ -111,12 +111,12 @@ uint16_t Echo::icmpChecksum(const char *data, int length) { uint16_t *data16 = (uint16_t *)data; uint32_t sum = 0; - + for (sum = 0; length > 1; length -= 2) sum += *data16++; if (length == 1) sum += *(unsigned char *)data16; - + sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); return ~sum; diff --git a/src/echo.h b/src/echo.h index 41db860..ebb1780 100644 --- a/src/echo.h +++ b/src/echo.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #ifndef ECHO_H diff --git a/src/exception.cpp b/src/exception.cpp index 1c7318b..480bfca 100644 --- a/src/exception.cpp +++ b/src/exception.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "exception.h" diff --git a/src/exception.h b/src/exception.h index d873ebd..df2ad63 100644 --- a/src/exception.h +++ b/src/exception.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include diff --git a/src/main.cpp b/src/main.cpp index 45cf81b..ae2dd50 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "client.h" @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) break; case 'p': password = strdup(optarg); - memset(optarg, 0, strlen(optarg)); + memset(optarg, 0, strlen(optarg)); break; case 'c': isClient = true; diff --git a/src/server.cpp b/src/server.cpp index 620b6fd..ba3e4c5 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "server.h" @@ -210,7 +210,7 @@ Server::ClientData *Server::getClientByTunnelIp(uint32_t ip) ClientIpMap::iterator clientMapIterator = clientTunnelIpMap.find(ip); if (clientMapIterator == clientTunnelIpMap.end()) return NULL; - + return &clientList[clientMapIterator->second]; } @@ -219,7 +219,7 @@ Server::ClientData *Server::getClientByRealIp(uint32_t ip) ClientIpMap::iterator clientMapIterator = clientRealIpMap.find(ip); if (clientMapIterator == clientRealIpMap.end()) return NULL; - + return &clientList[clientMapIterator->second]; } diff --git a/src/server.h b/src/server.h index 6f84dc7..47a5421 100644 --- a/src/server.h +++ b/src/server.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #ifndef SERVER_H diff --git a/src/time.cpp b/src/time.cpp index e6920a3..abdffae 100644 --- a/src/time.cpp +++ b/src/time.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "time.h" @@ -32,13 +32,13 @@ Time Time::operator-(const Time &other) const Time result; result.tv.tv_sec = tv.tv_sec - other.tv.tv_sec; result.tv.tv_usec = tv.tv_usec - other.tv.tv_usec; - + if (result.tv.tv_usec < 0) { result.tv.tv_usec += 1000000; result.tv.tv_sec -= 1; } - + return result; } @@ -47,13 +47,13 @@ Time Time::operator+(const Time &other) const Time result; result.tv.tv_sec = tv.tv_sec + other.tv.tv_sec; result.tv.tv_usec = tv.tv_usec + other.tv.tv_usec; - + if (result.tv.tv_usec >= 1000000) { result.tv.tv_usec -= 1000000; result.tv.tv_sec += 1; } - + return result; } diff --git a/src/time.h b/src/time.h index ad3c61e..878db78 100644 --- a/src/time.h +++ b/src/time.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #ifndef TIME_H diff --git a/src/tun.cpp b/src/tun.cpp index f42ea80..2d624ea 100644 --- a/src/tun.cpp +++ b/src/tun.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "tun.h" diff --git a/src/tun.h b/src/tun.h index b0a80a6..814ee36 100644 --- a/src/tun.h +++ b/src/tun.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #ifndef TUN_H diff --git a/src/tun_dev_darwin_emu.c b/src/tun_dev_darwin_emu.c index 0730306..fc93873 100644 --- a/src/tun_dev_darwin_emu.c +++ b/src/tun_dev_darwin_emu.c @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "tunemu.h" diff --git a/src/utility.cpp b/src/utility.cpp index 56cc684..5c1c235 100644 --- a/src/utility.cpp +++ b/src/utility.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "utility.h" diff --git a/src/utility.h b/src/utility.h index 686991d..ed1359c 100644 --- a/src/utility.h +++ b/src/utility.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #ifndef UTILITY_H diff --git a/src/worker.cpp b/src/worker.cpp index 1c77e10..3d91c15 100644 --- a/src/worker.cpp +++ b/src/worker.cpp @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #include "worker.h" diff --git a/src/worker.h b/src/worker.h index 7c3ffb1..146aca9 100644 --- a/src/worker.h +++ b/src/worker.h @@ -1,20 +1,20 @@ /* * Hans - IP over ICMP * Copyright (C) 2009 Friedrich Schöller - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #ifndef WORKER_H