---
title: llarp/messages/link_message_parser.hpp

---

# llarp/messages/link_message_parser.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |

## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::LinkMessageParser](Classes/structllarp_1_1LinkMessageParser.md)**  |




## Source code

```cpp
#pragma once

#include <llarp/router_id.hpp>
#include <llarp/util/bencode.h>

#include <memory>

namespace llarp
{
  struct AbstractRouter;
  struct ILinkMessage;
  struct ILinkSession;

  struct LinkMessageParser
  {
    LinkMessageParser(AbstractRouter* router);
    ~LinkMessageParser();

    bool
    operator()(llarp_buffer_t* buffer, llarp_buffer_t* key);

    bool
    ProcessFrom(ILinkSession* from, const llarp_buffer_t& buf);

    bool
    MessageDone();

    void
    Reset();

   private:
    RouterID
    GetCurrentFrom();

   private:
    bool firstkey;
    AbstractRouter* router;
    ILinkSession* from;
    ILinkMessage* msg;

    struct msg_holder_t;

    std::unique_ptr<msg_holder_t> holder;
  };
}  // namespace llarp
```


-------------------------------

Updated on 2025-01-26 at 05:10:09 +0000
