PageRenderTime 27ms CodeModel.GetById 15ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llmessage/llpacketbuffer.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 56 lines | 22 code | 8 blank | 26 comment | 0 complexity | a0a15e1368e14b78129f876a4046c20b MD5 | raw file
 1/** 
 2 * @file llpacketbuffer.h
 3 * @brief definition of LLPacketBuffer class for implementing a
 4 * resend, drop, or delay in packet transmissions.
 5 *
 6 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28#ifndef LL_LLPACKETBUFFER_H
29#define LL_LLPACKETBUFFER_H
30
31#include "net.h"		// for NET_BUFFER_SIZE
32#include "llhost.h"
33
34class LLPacketBuffer
35{
36public:
37	LLPacketBuffer(const LLHost &host, const char *datap, const S32 size);
38	LLPacketBuffer(S32 hSocket);           // receive a packet
39	~LLPacketBuffer();
40
41	S32			getSize() const					{ return mSize; }
42	const char	*getData() const				{ return mData; }
43	LLHost		getHost() const					{ return mHost; }
44	LLHost		getReceivingInterface() const	{ return mReceivingIF; }
45	void init(S32 hSocket);
46
47protected:
48	char	mData[NET_BUFFER_SIZE];        // packet data		/* Flawfinder : ignore */
49	S32		mSize;          // size of buffer in bytes
50	LLHost	mHost;         // source/dest IP and port
51	LLHost	mReceivingIF;         // source/dest IP and port
52};
53
54#endif
55
56