transportlayerlog.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  4. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. // Original author: ekr@rtfm.com
  6. #ifndef transportlayerlog_h__
  7. #define transportlayerlog_h__
  8. #include "m_cpp_utils.h"
  9. #include "transportflow.h"
  10. #include "transportlayer.h"
  11. namespace mozilla {
  12. class TransportLayerLogging : public TransportLayer {
  13. public:
  14. TransportLayerLogging() {}
  15. // Overrides for TransportLayer
  16. virtual TransportResult SendPacket(const unsigned char *data, size_t len);
  17. // Signals (forwarded to upper layer)
  18. void StateChange(TransportLayer *layer, State state);
  19. void PacketReceived(TransportLayer* layer, const unsigned char *data,
  20. size_t len);
  21. TRANSPORT_LAYER_ID("log")
  22. protected:
  23. virtual void WasInserted();
  24. private:
  25. DISALLOW_COPY_ASSIGN(TransportLayerLogging);
  26. };
  27. } // close namespace
  28. #endif