GNU CommonC++
Main Page
Namespaces
Classes
Files
Examples
File List
File Members
inc
cc++
network.h
Go to the documentation of this file.
1
// Copyright (C) 2002-2010 Christian Prochnow <cproch@seculogix.de>
2
//
3
// This program is free software; you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation; either version 2 of the License, or
6
// (at your option) any later version.
7
//
8
// This program is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with this program; if not, write to the Free Software
15
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
//
17
// As a special exception, you may use this file as part of a free software
18
// library without restriction. Specifically, if other files instantiate
19
// templates or use macros or inline functions from this file, or you compile
20
// this file and link it with other files to produce an executable, this
21
// file does not by itself cause the resulting executable to be covered by
22
// the GNU General Public License. This exception does not however
23
// invalidate any other reasons why the executable file might be covered by
24
// the GNU General Public License.
25
//
26
// This exception applies only to the code released under the name GNU
27
// Common C++. If you copy code from other releases into a copy of GNU
28
// Common C++, as the General Public License permits, the exception does
29
// not apply to the code that you add in this way. To avoid misleading
30
// anyone as to the status of such modified files, you must delete
31
// this exception notice from them.
32
//
33
// If you write modifications of your own for GNU Common C++, it is your choice
34
// whether to permit this exception to apply to your modifications.
35
// If you do not wish that, delete this exception notice.
36
//
37
44
#ifndef CCXX_NETWORK_H_
45
#define CCXX_NETWORK_H_
46
47
#ifndef CCXX_MISSING_H_
48
#include <
cc++/missing.h
>
49
#endif
50
51
#ifndef CCXX_SOCKET_H_
52
#include <
cc++/socket.h
>
53
#endif
54
55
#ifndef CCXX_STRING_H_
56
#include <
cc++/string.h
>
57
#endif
58
59
#include <vector>
60
61
#ifdef CCXX_NAMESPACES
62
namespace
ost {
63
#endif
64
65
67
72
class
__EXPORT
NetworkDeviceInfo
73
{
74
private
:
75
String
_name;
76
InetHostAddress
_addr;
77
BroadcastAddress
_broadcast;
78
InetMaskAddress
_netmask;
79
int
_mtu;
80
81
protected
:
82
NetworkDeviceInfo
(
const
String
& name,
const
InetHostAddress
& addr,
83
const
BroadcastAddress
& broadcast,
84
const
InetMaskAddress
& netmask,
int
mtu);
85
86
public
:
87
NetworkDeviceInfo
(
const
NetworkDeviceInfo
& ndi);
88
~
NetworkDeviceInfo
();
89
91
inline
const
String
&
name
()
const
92
{
return
_name; }
93
95
inline
const
InetHostAddress
&
address
()
const
96
{
return
_addr; }
97
99
inline
const
BroadcastAddress
&
broadcast
()
const
100
{
return
_broadcast; }
101
103
inline
const
InetMaskAddress
&
netmask
()
const
104
{
return
_netmask; }
105
107
inline
const
int
mtu
()
const
108
{
return
_mtu; }
109
111
friend
__EXPORT
bool
enumNetworkDevices(std::vector<NetworkDeviceInfo>& devs);
112
};
113
114
#ifdef CCXX_NAMESPACES
115
}
116
#endif
117
118
#endif
119
Generated by
1.8.4