~kai-mast/ynetwork/trunk

« back to all changes in this revision

Viewing changes to .svn/text-base/common.h.svn-base

  • Committer: Kai Mast
  • Date: 2010-01-25 00:23:11 UTC
  • Revision ID: kai@kai-desktop-20100125002311-bdg7ujck0kpvs55w
removed .svn files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _OpenNetwork_INCLUDE_COMMON_
2
 
#define _OpenNetwork_INCLUDE_COMMON_
3
 
 
4
 
/*!
5
 
    Copright: Kai "DrHalan" Mast - www.freakybytes.org
6
 
 
7
 
    This file is part of OpenNetwork. See OpenNetwork.h for license information.
8
 
*/
9
 
 
10
 
#ifdef __WINDOWS__
11
 
#include <winsock2.h>
12
 
#include <Ws2tcpip.h>
13
 
#elif defined(__unix__)
14
 
#include <sys/types.h>
15
 
#include <sys/socket.h>
16
 
#include <netinet/in.h>
17
 
#include <arpa/inet.h>
18
 
#else
19
 
#error "What's your operating system?"
20
 
#endif
21
 
 
22
 
#include <OpenNetwork/SNetworkAddress.h>
23
 
 
24
 
namespace onet
25
 
{
26
 
    //! Helper functions
27
 
    //! Gets the IPv4 / IPv6 adress
28
 
    bool getSockAddress6(sockaddr_in6& addr, const SNetworkAddress& netAddr);
29
 
    bool getSockAddress(sockaddr_in& addr, const SNetworkAddress& netAddr);
30
 
 
31
 
    //! The other way around
32
 
    bool getNetworkAddress6(const sockaddr_in6& addr, SNetworkAddress& netAddr);
33
 
    bool getNetworkAddress(const sockaddr_in& addr, SNetworkAddress& netAddr);
34
 
 
35
 
} //!end namespace onet
36
 
 
37
 
#endif