Mixe for Privacy and Anonymity in the Internet
CADatagramSocket.hpp
Go to the documentation of this file.
1
/*
2
Copyright (c) 2000, The JAP-Team
3
All rights reserved.
4
Redistribution and use in source and binary forms, with or without modification,
5
are permitted provided that the following conditions are met:
6
7
- Redistributions of source code must retain the above copyright notice,
8
this list of conditions and the following disclaimer.
9
10
- Redistributions in binary form must reproduce the above copyright notice,
11
this list of conditions and the following disclaimer in the documentation and/or
12
other materials provided with the distribution.
13
14
- Neither the name of the University of Technology Dresden, Germany nor the names of its contributors
15
may be used to endorse or promote products derived from this software without specific
16
prior written permission.
17
18
19
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
20
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
22
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
27
*/
28
29
#ifndef __CADATAGRAMSOCKET__
30
#define __CADATAGRAMSOCKET__
31
#include "
CASocketAddr.hpp
"
32
33
class
CADatagramSocket
34
{
35
public
:
36
CADatagramSocket
();
37
~CADatagramSocket
(){
close
();}
38
39
SINT32
create
();
40
SINT32
create
(
int
type
);
41
42
SINT32
close
();
43
SINT32
bind
(
CASocketAddr
& psa);
44
SINT32
bind
(
UINT16
port);
45
SINT32
send
(
UINT8
* buff,
UINT32
len
,
CASocketAddr
& to);
46
SINT32
receive
(
UINT8
* buff,
UINT32
len
,
CASocketAddr
* from);
47
SOCKET
getSocket
(){
return
m_Socket
;}
48
// SINT32 getLocalPort();
49
/* int setReuseAddr(bool b);
50
int setRecvLowWat(UINT32 r);
51
int setRecvBuff(UINT32 r);
52
int setSendBuff(UINT32 r);
53
int setKeepAlive(bool b);
54
*/
55
private
:
56
SOCKET
m_Socket
;
57
// temporary hack...
58
// int localPort;
59
};
60
#endif
CASocketAddr.hpp
SOCKET
#define SOCKET
Definition:
StdAfx.h:460
UINT16
unsigned short UINT16
Definition:
basetypedefs.h:133
SINT32
signed int SINT32
Definition:
basetypedefs.h:132
UINT8
unsigned char UINT8
Definition:
basetypedefs.h:135
UINT32
unsigned int UINT32
Definition:
basetypedefs.h:131
CADatagramSocket
Definition:
CADatagramSocket.hpp:34
CADatagramSocket::CADatagramSocket
CADatagramSocket()
Definition:
CADatagramSocket.cpp:38
CADatagramSocket::getSocket
SOCKET getSocket()
Definition:
CADatagramSocket.hpp:47
CADatagramSocket::send
SINT32 send(UINT8 *buff, UINT32 len, CASocketAddr &to)
Definition:
CADatagramSocket.cpp:102
CADatagramSocket::receive
SINT32 receive(UINT8 *buff, UINT32 len, CASocketAddr *from)
Definition:
CADatagramSocket.cpp:110
CADatagramSocket::close
SINT32 close()
Definition:
CADatagramSocket.cpp:60
CADatagramSocket::m_Socket
SOCKET m_Socket
Definition:
CADatagramSocket.hpp:56
CADatagramSocket::bind
SINT32 bind(CASocketAddr &psa)
Definition:
CADatagramSocket.cpp:86
CADatagramSocket::~CADatagramSocket
~CADatagramSocket()
Definition:
CADatagramSocket.hpp:37
CADatagramSocket::create
SINT32 create()
Definition:
CADatagramSocket.cpp:44
CASocketAddr
This is an abstract class for representing a socket address used in CASocket, CADatagramSocket and CA...
Definition:
CASocketAddr.hpp:33
type
UINT8 type
Definition:
typedefs.hpp:1
len
UINT16 len
Definition:
typedefs.hpp:0
Generated on Sat Jul 22 2023 00:20:07 for Mixe for Privacy and Anonymity in the Internet by
1.9.1