pkt6.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #ifndef PKT6_H
  15. #define PKT6_H
  16. #include <iostream>
  17. #include <boost/shared_array.hpp>
  18. #include "io_address.h"
  19. namespace isc {
  20. class Pkt6 {
  21. public:
  22. Pkt6(int len);
  23. ~Pkt6();
  24. // XXX: probably need getter/setter wrappers
  25. // and hide fields as protected
  26. // buffer that holds memory. It is shared_array as options may
  27. // share pointer to this buffer
  28. boost::shared_array<char> data_;
  29. // length of the data
  30. int data_len_;
  31. // local address (destination if receiving packet, source if sending packet)
  32. isc::asiolink::IOAddress local_addr_;
  33. // remote address (source if receiving packet, destination if sending packet)
  34. isc::asiolink::IOAddress remote_addr_;
  35. // name of the network interface the packet was received/to be sent over
  36. std::string iface_;
  37. // interface index (each network interface has assigned unique ifindex
  38. // it is functional equvalent of name, but sometimes more useful, e.g.
  39. // when using crazy systems that allow spaces in interface names (Windows)
  40. int ifindex_;
  41. // local TDP or UDP port
  42. int local_port_;
  43. // remote TCP or UDP port
  44. int remote_port_;
  45. // XXX: add *a lot* here
  46. };
  47. }
  48. #endif