---
title: llarp::path::IHopHandler

---

# llarp::path::IHopHandler





Inherited by [llarp::path::Path](Classes/structllarp_1_1path_1_1Path.md), [llarp::path::TransitHop](Classes/structllarp_1_1path_1_1TransitHop.md)

## Public Types

|                | Name           |
| -------------- | -------------- |
| using std::pair< std::vector< byte_t >, [TunnelNonce](Classes/structllarp_1_1AlignedBuffer.md) > | **[TrafficEvent_t](Classes/structllarp_1_1path_1_1IHopHandler.md#using-trafficevent-t)**  |
| using std::list< TrafficEvent_t > | **[TrafficQueue_t](Classes/structllarp_1_1path_1_1IHopHandler.md#using-trafficqueue-t)**  |

## Public Functions

|                | Name           |
| -------------- | -------------- |
| virtual | **[~IHopHandler](Classes/structllarp_1_1path_1_1IHopHandler.md#function-~ihophandler)**() =default |
| virtual [PathID_t](Classes/structllarp_1_1PathID__t.md) | **[RXID](Classes/structllarp_1_1path_1_1IHopHandler.md#function-rxid)**() const =0 |
| void | **[DecayFilters](Classes/structllarp_1_1path_1_1IHopHandler.md#function-decayfilters)**(llarp_time_t now) |
| virtual bool | **[Expired](Classes/structllarp_1_1path_1_1IHopHandler.md#function-expired)**(llarp_time_t now) const =0 |
| virtual bool | **[ExpiresSoon](Classes/structllarp_1_1path_1_1IHopHandler.md#function-expiressoon)**(llarp_time_t now, llarp_time_t dlt) const =0 |
| virtual bool | **[SendRoutingMessage](Classes/structllarp_1_1path_1_1IHopHandler.md#function-sendroutingmessage)**(const [routing::IMessage](Classes/structllarp_1_1routing_1_1IMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) =0<br>send routing message and increment sequence number  |
| virtual bool | **[HandleUpstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-handleupstream)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & X, const [TunnelNonce](Classes/structllarp_1_1AlignedBuffer.md) & Y, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * ) |
| virtual bool | **[HandleDownstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-handledownstream)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & X, const [TunnelNonce](Classes/structllarp_1_1AlignedBuffer.md) & Y, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * ) |
| virtual llarp_time_t | **[LastRemoteActivityAt](Classes/structllarp_1_1path_1_1IHopHandler.md#function-lastremoteactivityat)**() const =0<br>return timestamp last remote activity happened at  |
| virtual bool | **[HandleLRSM](Classes/structllarp_1_1path_1_1IHopHandler.md#function-handlelrsm)**(uint64_t status, std::array< [EncryptedFrame](Classes/structllarp_1_1EncryptedFrame.md), 8 > & frames, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) =0 |
| uint64_t | **[NextSeqNo](Classes/structllarp_1_1path_1_1IHopHandler.md#function-nextseqno)**() |
| virtual void | **[FlushUpstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-flushupstream)**([AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) =0 |
| virtual void | **[FlushDownstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-flushdownstream)**([AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) =0 |

## Protected Functions

|                | Name           |
| -------------- | -------------- |
| virtual void | **[UpstreamWork](Classes/structllarp_1_1path_1_1IHopHandler.md#function-upstreamwork)**(TrafficQueue_t queue, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) =0 |
| virtual void | **[DownstreamWork](Classes/structllarp_1_1path_1_1IHopHandler.md#function-downstreamwork)**(TrafficQueue_t queue, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) =0 |
| virtual void | **[HandleAllUpstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-handleallupstream)**(std::vector< [RelayUpstreamMessage](Classes/structllarp_1_1RelayUpstreamMessage.md) > msgs, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) =0 |
| virtual void | **[HandleAllDownstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-handlealldownstream)**(std::vector< [RelayDownstreamMessage](Classes/structllarp_1_1RelayDownstreamMessage.md) > msgs, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) =0 |

## Protected Attributes

|                | Name           |
| -------------- | -------------- |
| uint64_t | **[m_SequenceNum](Classes/structllarp_1_1path_1_1IHopHandler.md#variable-m-sequencenum)**  |
| TrafficQueue_t | **[m_UpstreamQueue](Classes/structllarp_1_1path_1_1IHopHandler.md#variable-m-upstreamqueue)**  |
| TrafficQueue_t | **[m_DownstreamQueue](Classes/structllarp_1_1path_1_1IHopHandler.md#variable-m-downstreamqueue)**  |
| [util::DecayingHashSet](Classes/structllarp_1_1util_1_1DecayingHashSet.md)< [TunnelNonce](Classes/structllarp_1_1AlignedBuffer.md) > | **[m_UpstreamReplayFilter](Classes/structllarp_1_1path_1_1IHopHandler.md#variable-m-upstreamreplayfilter)**  |
| [util::DecayingHashSet](Classes/structllarp_1_1util_1_1DecayingHashSet.md)< [TunnelNonce](Classes/structllarp_1_1AlignedBuffer.md) > | **[m_DownstreamReplayFilter](Classes/structllarp_1_1path_1_1IHopHandler.md#variable-m-downstreamreplayfilter)**  |

## Public Types Documentation

### using TrafficEvent_t

```cpp
using llarp::path::IHopHandler::TrafficEvent_t =  std::pair<std::vector<byte_t>, TunnelNonce>;
```


### using TrafficQueue_t

```cpp
using llarp::path::IHopHandler::TrafficQueue_t =  std::list<TrafficEvent_t>;
```


## Public Functions Documentation

### function ~IHopHandler

```cpp
virtual ~IHopHandler() =default
```


### function RXID

```cpp
virtual PathID_t RXID() const =0
```


**Reimplemented by**: [llarp::path::Path::RXID](Classes/structllarp_1_1path_1_1Path.md#function-rxid), [llarp::path::TransitHop::RXID](Classes/structllarp_1_1path_1_1TransitHop.md#function-rxid)


### function DecayFilters

```cpp
void DecayFilters(
    llarp_time_t now
)
```


### function Expired

```cpp
virtual bool Expired(
    llarp_time_t now
) const =0
```


**Reimplemented by**: [llarp::path::Path::Expired](Classes/structllarp_1_1path_1_1Path.md#function-expired), [llarp::path::TransitHop::Expired](Classes/structllarp_1_1path_1_1TransitHop.md#function-expired)


### function ExpiresSoon

```cpp
virtual bool ExpiresSoon(
    llarp_time_t now,
    llarp_time_t dlt
) const =0
```


**Reimplemented by**: [llarp::path::TransitHop::ExpiresSoon](Classes/structllarp_1_1path_1_1TransitHop.md#function-expiressoon), [llarp::path::Path::ExpiresSoon](Classes/structllarp_1_1path_1_1Path.md#function-expiressoon)


### function SendRoutingMessage

```cpp
virtual bool SendRoutingMessage(
    const routing::IMessage & msg,
    AbstractRouter * r
) =0
```

send routing message and increment sequence number 

**Reimplemented by**: [llarp::path::Path::SendRoutingMessage](Classes/structllarp_1_1path_1_1Path.md#function-sendroutingmessage), [llarp::path::TransitHop::SendRoutingMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-sendroutingmessage)


### function HandleUpstream

```cpp
virtual bool HandleUpstream(
    const llarp_buffer_t & X,
    const TunnelNonce & Y,
    AbstractRouter * 
)
```


**Reimplemented by**: [llarp::path::Path::HandleUpstream](Classes/structllarp_1_1path_1_1Path.md#function-handleupstream)


### function HandleDownstream

```cpp
virtual bool HandleDownstream(
    const llarp_buffer_t & X,
    const TunnelNonce & Y,
    AbstractRouter * 
)
```


**Reimplemented by**: [llarp::path::Path::HandleDownstream](Classes/structllarp_1_1path_1_1Path.md#function-handledownstream)


### function LastRemoteActivityAt

```cpp
virtual llarp_time_t LastRemoteActivityAt() const =0
```

return timestamp last remote activity happened at 

**Reimplemented by**: [llarp::path::Path::LastRemoteActivityAt](Classes/structllarp_1_1path_1_1Path.md#function-lastremoteactivityat), [llarp::path::TransitHop::LastRemoteActivityAt](Classes/structllarp_1_1path_1_1TransitHop.md#function-lastremoteactivityat)


### function HandleLRSM

```cpp
virtual bool HandleLRSM(
    uint64_t status,
    std::array< EncryptedFrame, 8 > & frames,
    AbstractRouter * r
) =0
```


**Reimplemented by**: [llarp::path::Path::HandleLRSM](Classes/structllarp_1_1path_1_1Path.md#function-handlelrsm), [llarp::path::TransitHop::HandleLRSM](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlelrsm)


### function NextSeqNo

```cpp
inline uint64_t NextSeqNo()
```


### function FlushUpstream

```cpp
virtual void FlushUpstream(
    AbstractRouter * r
) =0
```


**Reimplemented by**: [llarp::path::Path::FlushUpstream](Classes/structllarp_1_1path_1_1Path.md#function-flushupstream), [llarp::path::TransitHop::FlushUpstream](Classes/structllarp_1_1path_1_1TransitHop.md#function-flushupstream)


### function FlushDownstream

```cpp
virtual void FlushDownstream(
    AbstractRouter * r
) =0
```


**Reimplemented by**: [llarp::path::Path::FlushDownstream](Classes/structllarp_1_1path_1_1Path.md#function-flushdownstream), [llarp::path::TransitHop::FlushDownstream](Classes/structllarp_1_1path_1_1TransitHop.md#function-flushdownstream)


## Protected Functions Documentation

### function UpstreamWork

```cpp
virtual void UpstreamWork(
    TrafficQueue_t queue,
    AbstractRouter * r
) =0
```


**Reimplemented by**: [llarp::path::Path::UpstreamWork](Classes/structllarp_1_1path_1_1Path.md#function-upstreamwork), [llarp::path::TransitHop::UpstreamWork](Classes/structllarp_1_1path_1_1TransitHop.md#function-upstreamwork)


### function DownstreamWork

```cpp
virtual void DownstreamWork(
    TrafficQueue_t queue,
    AbstractRouter * r
) =0
```


**Reimplemented by**: [llarp::path::Path::DownstreamWork](Classes/structllarp_1_1path_1_1Path.md#function-downstreamwork), [llarp::path::TransitHop::DownstreamWork](Classes/structllarp_1_1path_1_1TransitHop.md#function-downstreamwork)


### function HandleAllUpstream

```cpp
virtual void HandleAllUpstream(
    std::vector< RelayUpstreamMessage > msgs,
    AbstractRouter * r
) =0
```


**Reimplemented by**: [llarp::path::Path::HandleAllUpstream](Classes/structllarp_1_1path_1_1Path.md#function-handleallupstream), [llarp::path::TransitHop::HandleAllUpstream](Classes/structllarp_1_1path_1_1TransitHop.md#function-handleallupstream)


### function HandleAllDownstream

```cpp
virtual void HandleAllDownstream(
    std::vector< RelayDownstreamMessage > msgs,
    AbstractRouter * r
) =0
```


**Reimplemented by**: [llarp::path::Path::HandleAllDownstream](Classes/structllarp_1_1path_1_1Path.md#function-handlealldownstream), [llarp::path::TransitHop::HandleAllDownstream](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlealldownstream)


## Protected Attributes Documentation

### variable m_SequenceNum

```cpp
uint64_t m_SequenceNum = 0;
```


### variable m_UpstreamQueue

```cpp
TrafficQueue_t m_UpstreamQueue;
```


### variable m_DownstreamQueue

```cpp
TrafficQueue_t m_DownstreamQueue;
```


### variable m_UpstreamReplayFilter

```cpp
util::DecayingHashSet< TunnelNonce > m_UpstreamReplayFilter;
```


### variable m_DownstreamReplayFilter

```cpp
util::DecayingHashSet< TunnelNonce > m_DownstreamReplayFilter;
```


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

Updated on 2023-01-20 at 23:19:39 +0000