summaryrefslogtreecommitdiff
path: root/indra/llmessage/llpacketbuffer.h
blob: 13841aaa082ea1c09e72824113675bb575e48caa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/** 
 * @file llpacketbuffer.h
 * @brief definition of LLPacketBuffer class for implementing a
 * resend, drop, or delay in packet transmissions.
 *
 * Copyright (c) 2001-$CurrentYear$, Linden Research, Inc.
 * $License$
 */

#ifndef LL_LLPACKETBUFFER_H
#define LL_LLPACKETBUFFER_H

#include "net.h"		// for NET_BUFFER_SIZE
#include "llhost.h"

class LLPacketBuffer
{
public:
	LLPacketBuffer(const LLHost &host, const char *datap, const S32 size);
	LLPacketBuffer(S32 hSocket);           // receive a packet
	~LLPacketBuffer();

	S32			getSize() const		{ return mSize; }
	const char	*getData() const	{ return mData; }
	LLHost		getHost() const		{ return mHost; }
	void init(S32 hSocket);
	void free();

protected:
	char	mData[NET_BUFFER_SIZE];        // packet data		/* Flawfinder : ignore */
	S32		mSize;          // size of buffer in bytes
	LLHost	mHost;         // source/dest IP and port
};

#endif