/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. #ifndef LL_LLPACKETBUFFER_H
  28. #define LL_LLPACKETBUFFER_H
  29. #include "net.h" // for NET_BUFFER_SIZE
  30. #include "llhost.h"
  31. class LLPacketBuffer
  32. {
  33. public:
  34. LLPacketBuffer(const LLHost &host, const char *datap, const S32 size);
  35. LLPacketBuffer(S32 hSocket); // receive a packet
  36. ~LLPacketBuffer();
  37. S32 getSize() const { return mSize; }
  38. const char *getData() const { return mData; }
  39. LLHost getHost() const { return mHost; }
  40. LLHost getReceivingInterface() const { return mReceivingIF; }
  41. void init(S32 hSocket);
  42. protected:
  43. char mData[NET_BUFFER_SIZE]; // packet data /* Flawfinder : ignore */
  44. S32 mSize; // size of buffer in bytes
  45. LLHost mHost; // source/dest IP and port
  46. LLHost mReceivingIF; // source/dest IP and port
  47. };
  48. #endif