source:
orxonox.OLD/branches/proxy/src/lib/util/ip.cc
@
9304
Last change on this file since 9304 was 9304, checked in by bensch, 18 years ago | |
---|---|
File size: 616 bytes |
Rev | Line | |
---|---|---|
[7899] | 1 | /** |
[9304] | 2 | * @file ip.cc |
3 | * @brief A IP class, that handles all about time. | |
[7899] | 4 | * |
5 | * code taken from audiere. | |
6 | */ | |
7 | ||
[9304] | 8 | #include "ip.h" |
[7899] | 9 | |
[9304] | 10 | IP::IP() |
11 | {} | |
[7899] | 12 | |
13 | ||
[9304] | 14 | IP::IP(int ip) |
15 | { | |
16 | this->_ip = ip; | |
[7909] | 17 | } |
18 | ||
[9304] | 19 | IP::IP(const std::string& ip) |
20 | { | |
21 | this->_ip = IP::stringToIP(ip); | |
22 | } | |
[7899] | 23 | |
[7909] | 24 | |
[9304] | 25 | int IP::stringToIP(const std::string& ip) |
26 | { | |
[7899] | 27 | |
[9304] | 28 | |
[7899] | 29 | } |
[9304] | 30 | |
31 | const std::string& IP::ipToString(int ip) | |
32 | { | |
33 | std::string ipaddr; | |
34 | ||
35 | number = SDLNet_Read32 (&addr.host); | |
36 | printf ("Host-Reihenfolge: %d.%d.%d.%d\n", | |
37 | (number & 0xFF000000)>>24, (number & 0x00FF0000)>>16, | |
38 | (number & 0x0000FF00)>>8, (number & 0x000000FF)); | |
39 | } | |
40 |
Note: See TracBrowser
for help on using the repository browser.