Last change
on this file since 9304 was
9304,
checked in by bensch, 18 years ago
|
orxonox/trunk: virtual public and an ip class
|
File size:
616 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file ip.cc |
---|
3 | * @brief A IP class, that handles all about time. |
---|
4 | * |
---|
5 | * code taken from audiere. |
---|
6 | */ |
---|
7 | |
---|
8 | #include "ip.h" |
---|
9 | |
---|
10 | IP::IP() |
---|
11 | {} |
---|
12 | |
---|
13 | |
---|
14 | IP::IP(int ip) |
---|
15 | { |
---|
16 | this->_ip = ip; |
---|
17 | } |
---|
18 | |
---|
19 | IP::IP(const std::string& ip) |
---|
20 | { |
---|
21 | this->_ip = IP::stringToIP(ip); |
---|
22 | } |
---|
23 | |
---|
24 | |
---|
25 | int IP::stringToIP(const std::string& ip) |
---|
26 | { |
---|
27 | |
---|
28 | |
---|
29 | } |
---|
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.