---
title: llarp::path::TransitHop

---

# llarp::path::TransitHop





Inherits from [llarp::path::IHopHandler](Classes/structllarp_1_1path_1_1IHopHandler.md), [llarp::routing::IMessageHandler](Classes/structllarp_1_1routing_1_1IMessageHandler.md), std::enable_shared_from_this< TransitHop >

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[TransitHop](Classes/structllarp_1_1path_1_1TransitHop.md#function-transithop)**() |
| virtual [PathID_t](Classes/structllarp_1_1PathID__t.md) | **[RXID](Classes/structllarp_1_1path_1_1TransitHop.md#function-rxid)**() const override |
| void | **[Stop](Classes/structllarp_1_1path_1_1TransitHop.md#function-stop)**() |
| bool | **[operator<](Classes/structllarp_1_1path_1_1TransitHop.md#function-operator<)**(const [TransitHop](Classes/structllarp_1_1path_1_1TransitHop.md) & other) const |
| bool | **[IsEndpoint](Classes/structllarp_1_1path_1_1TransitHop.md#function-isendpoint)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & us) const |
| llarp_time_t | **[ExpireTime](Classes/structllarp_1_1path_1_1TransitHop.md#function-expiretime)**() const |
| virtual llarp_time_t | **[LastRemoteActivityAt](Classes/structllarp_1_1path_1_1TransitHop.md#function-lastremoteactivityat)**() const override<br>return timestamp last remote activity happened at  |
| virtual bool | **[HandleLRSM](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlelrsm)**(uint64_t status, std::array< [EncryptedFrame](Classes/structllarp_1_1EncryptedFrame.md), 8 > & frames, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| std::string | **[ToString](Classes/structllarp_1_1path_1_1TransitHop.md#function-tostring)**() const |
| virtual bool | **[Expired](Classes/structllarp_1_1path_1_1TransitHop.md#function-expired)**(llarp_time_t now) const override |
| virtual bool | **[ExpiresSoon](Classes/structllarp_1_1path_1_1TransitHop.md#function-expiressoon)**(llarp_time_t now, llarp_time_t dlt) const override |
| virtual bool | **[SendRoutingMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-sendroutingmessage)**(const [routing::IMessage](Classes/structllarp_1_1routing_1_1IMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override<br>send routing message and increment sequence number  |
| bool | **[HandleRoutingMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handleroutingmessage)**(const [routing::IMessage](Classes/structllarp_1_1routing_1_1IMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) |
| virtual bool | **[HandleDataDiscardMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handledatadiscardmessage)**(const [routing::DataDiscardMessage](Classes/structllarp_1_1routing_1_1DataDiscardMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| bool | **[HandlePathConfirmMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlepathconfirmmessage)**([AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) |
| virtual bool | **[HandlePathConfirmMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlepathconfirmmessage)**(const [routing::PathConfirmMessage](Classes/structllarp_1_1routing_1_1PathConfirmMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandlePathTransferMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlepathtransfermessage)**(const [routing::PathTransferMessage](Classes/structllarp_1_1routing_1_1PathTransferMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandlePathLatencyMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlepathlatencymessage)**(const [routing::PathLatencyMessage](Classes/structllarp_1_1routing_1_1PathLatencyMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandleObtainExitMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handleobtainexitmessage)**(const [routing::ObtainExitMessage](Classes/structllarp_1_1routing_1_1ObtainExitMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandleUpdateExitVerifyMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handleupdateexitverifymessage)**(const [routing::UpdateExitVerifyMessage](Classes/structllarp_1_1routing_1_1UpdateExitVerifyMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandleTransferTrafficMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handletransfertrafficmessage)**(const [routing::TransferTrafficMessage](Classes/structllarp_1_1routing_1_1TransferTrafficMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandleUpdateExitMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handleupdateexitmessage)**(const [routing::UpdateExitMessage](Classes/structllarp_1_1routing_1_1UpdateExitMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandleGrantExitMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlegrantexitmessage)**(const [routing::GrantExitMessage](Classes/structllarp_1_1routing_1_1GrantExitMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandleRejectExitMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlerejectexitmessage)**(const [routing::RejectExitMessage](Classes/structllarp_1_1routing_1_1RejectExitMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandleCloseExitMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlecloseexitmessage)**(const [routing::CloseExitMessage](Classes/structllarp_1_1routing_1_1CloseExitMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual bool | **[HandleHiddenServiceFrame](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlehiddenserviceframe)**(const [service::ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) & ) override |
| bool | **[HandleGotIntroMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handlegotintromessage)**(const [dht::GotIntroMessage](Classes/structllarp_1_1dht_1_1GotIntroMessage.md) & msg) |
| virtual bool | **[HandleDHTMessage](Classes/structllarp_1_1path_1_1TransitHop.md#function-handledhtmessage)**(const [dht::IMessage](Classes/structllarp_1_1dht_1_1IMessage.md) & msg, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual void | **[FlushUpstream](Classes/structllarp_1_1path_1_1TransitHop.md#function-flushupstream)**([AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| virtual void | **[FlushDownstream](Classes/structllarp_1_1path_1_1TransitHop.md#function-flushdownstream)**([AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) override |
| void | **[QueueDestroySelf](Classes/structllarp_1_1path_1_1TransitHop.md#function-queuedestroyself)**([AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) |

## Protected Functions

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

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| [TransitHopInfo](Classes/structllarp_1_1path_1_1TransitHopInfo.md) | **[info](Classes/structllarp_1_1path_1_1TransitHop.md#variable-info)**  |
| [SharedSecret](Classes/structllarp_1_1AlignedBuffer.md) | **[pathKey](Classes/structllarp_1_1path_1_1TransitHop.md#variable-pathkey)**  |
| [ShortHash](Classes/structllarp_1_1AlignedBuffer.md) | **[nonceXOR](Classes/structllarp_1_1path_1_1TransitHop.md#variable-noncexor)**  |
| llarp_time_t | **[started](Classes/structllarp_1_1path_1_1TransitHop.md#variable-started)**  |
| llarp_time_t | **[lifetime](Classes/structllarp_1_1path_1_1TransitHop.md#variable-lifetime)**  |
| llarp_proto_version_t | **[version](Classes/structllarp_1_1path_1_1TransitHop.md#variable-version)**  |
| llarp_time_t | **[m_LastActivity](Classes/structllarp_1_1path_1_1TransitHop.md#variable-m-lastactivity)**  |
| bool | **[destroy](Classes/structllarp_1_1path_1_1TransitHop.md#variable-destroy)**  |

## Additional inherited members

**Public Types inherited from [llarp::path::IHopHandler](Classes/structllarp_1_1path_1_1IHopHandler.md)**

|                | 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 inherited from [llarp::path::IHopHandler](Classes/structllarp_1_1path_1_1IHopHandler.md)**

|                | Name           |
| -------------- | -------------- |
| virtual | **[~IHopHandler](Classes/structllarp_1_1path_1_1IHopHandler.md#function-~ihophandler)**() =default |
| void | **[DecayFilters](Classes/structllarp_1_1path_1_1IHopHandler.md#function-decayfilters)**(llarp_time_t now) |
| 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) * ) |
| uint64_t | **[NextSeqNo](Classes/structllarp_1_1path_1_1IHopHandler.md#function-nextseqno)**() |

**Protected Attributes inherited from [llarp::path::IHopHandler](Classes/structllarp_1_1path_1_1IHopHandler.md)**

|                | 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 Functions Documentation

### function TransitHop

```cpp
TransitHop()
```


### function RXID

```cpp
inline virtual PathID_t RXID() const override
```


**Reimplements**: [llarp::path::IHopHandler::RXID](Classes/structllarp_1_1path_1_1IHopHandler.md#function-rxid)


### function Stop

```cpp
void Stop()
```


### function operator<

```cpp
inline bool operator<(
    const TransitHop & other
) const
```


### function IsEndpoint

```cpp
inline bool IsEndpoint(
    const RouterID & us
) const
```


### function ExpireTime

```cpp
llarp_time_t ExpireTime() const
```


### function LastRemoteActivityAt

```cpp
inline virtual llarp_time_t LastRemoteActivityAt() const override
```

return timestamp last remote activity happened at 

**Reimplements**: [llarp::path::IHopHandler::LastRemoteActivityAt](Classes/structllarp_1_1path_1_1IHopHandler.md#function-lastremoteactivityat)


### function HandleLRSM

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


**Reimplements**: [llarp::path::IHopHandler::HandleLRSM](Classes/structllarp_1_1path_1_1IHopHandler.md#function-handlelrsm)


### function ToString

```cpp
std::string ToString() const
```


### function Expired

```cpp
virtual bool Expired(
    llarp_time_t now
) const override
```


**Reimplements**: [llarp::path::IHopHandler::Expired](Classes/structllarp_1_1path_1_1IHopHandler.md#function-expired)


### function ExpiresSoon

```cpp
inline virtual bool ExpiresSoon(
    llarp_time_t now,
    llarp_time_t dlt
) const override
```


**Reimplements**: [llarp::path::IHopHandler::ExpiresSoon](Classes/structllarp_1_1path_1_1IHopHandler.md#function-expiressoon)


### function SendRoutingMessage

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

send routing message and increment sequence number 

**Reimplements**: [llarp::path::IHopHandler::SendRoutingMessage](Classes/structllarp_1_1path_1_1IHopHandler.md#function-sendroutingmessage)


### function HandleRoutingMessage

```cpp
bool HandleRoutingMessage(
    const routing::IMessage & msg,
    AbstractRouter * r
)
```


### function HandleDataDiscardMessage

```cpp
virtual bool HandleDataDiscardMessage(
    const routing::DataDiscardMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleDataDiscardMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handledatadiscardmessage)


### function HandlePathConfirmMessage

```cpp
bool HandlePathConfirmMessage(
    AbstractRouter * r
)
```


### function HandlePathConfirmMessage

```cpp
virtual bool HandlePathConfirmMessage(
    const routing::PathConfirmMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandlePathConfirmMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handlepathconfirmmessage)


### function HandlePathTransferMessage

```cpp
virtual bool HandlePathTransferMessage(
    const routing::PathTransferMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandlePathTransferMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handlepathtransfermessage)


### function HandlePathLatencyMessage

```cpp
virtual bool HandlePathLatencyMessage(
    const routing::PathLatencyMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandlePathLatencyMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handlepathlatencymessage)


### function HandleObtainExitMessage

```cpp
virtual bool HandleObtainExitMessage(
    const routing::ObtainExitMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleObtainExitMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handleobtainexitmessage)


### function HandleUpdateExitVerifyMessage

```cpp
virtual bool HandleUpdateExitVerifyMessage(
    const routing::UpdateExitVerifyMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleUpdateExitVerifyMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handleupdateexitverifymessage)


### function HandleTransferTrafficMessage

```cpp
virtual bool HandleTransferTrafficMessage(
    const routing::TransferTrafficMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleTransferTrafficMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handletransfertrafficmessage)


### function HandleUpdateExitMessage

```cpp
virtual bool HandleUpdateExitMessage(
    const routing::UpdateExitMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleUpdateExitMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handleupdateexitmessage)


### function HandleGrantExitMessage

```cpp
virtual bool HandleGrantExitMessage(
    const routing::GrantExitMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleGrantExitMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handlegrantexitmessage)


### function HandleRejectExitMessage

```cpp
virtual bool HandleRejectExitMessage(
    const routing::RejectExitMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleRejectExitMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handlerejectexitmessage)


### function HandleCloseExitMessage

```cpp
virtual bool HandleCloseExitMessage(
    const routing::CloseExitMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleCloseExitMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handlecloseexitmessage)


### function HandleHiddenServiceFrame

```cpp
inline virtual bool HandleHiddenServiceFrame(
    const service::ProtocolFrame & 
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleHiddenServiceFrame](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handlehiddenserviceframe)


TODO: implement me


### function HandleGotIntroMessage

```cpp
bool HandleGotIntroMessage(
    const dht::GotIntroMessage & msg
)
```


### function HandleDHTMessage

```cpp
virtual bool HandleDHTMessage(
    const dht::IMessage & msg,
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::routing::IMessageHandler::HandleDHTMessage](Classes/structllarp_1_1routing_1_1IMessageHandler.md#function-handledhtmessage)


### function FlushUpstream

```cpp
virtual void FlushUpstream(
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::path::IHopHandler::FlushUpstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-flushupstream)


### function FlushDownstream

```cpp
virtual void FlushDownstream(
    AbstractRouter * r
) override
```


**Reimplements**: [llarp::path::IHopHandler::FlushDownstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-flushdownstream)


### function QueueDestroySelf

```cpp
void QueueDestroySelf(
    AbstractRouter * r
)
```


## Protected Functions Documentation

### function UpstreamWork

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


**Reimplements**: [llarp::path::IHopHandler::UpstreamWork](Classes/structllarp_1_1path_1_1IHopHandler.md#function-upstreamwork)


### function DownstreamWork

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


**Reimplements**: [llarp::path::IHopHandler::DownstreamWork](Classes/structllarp_1_1path_1_1IHopHandler.md#function-downstreamwork)


### function HandleAllUpstream

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


**Reimplements**: [llarp::path::IHopHandler::HandleAllUpstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-handleallupstream)


### function HandleAllDownstream

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


**Reimplements**: [llarp::path::IHopHandler::HandleAllDownstream](Classes/structllarp_1_1path_1_1IHopHandler.md#function-handlealldownstream)


## Public Attributes Documentation

### variable info

```cpp
TransitHopInfo info;
```


### variable pathKey

```cpp
SharedSecret pathKey;
```


### variable nonceXOR

```cpp
ShortHash nonceXOR;
```


### variable started

```cpp
llarp_time_t started = 0s;
```


### variable lifetime

```cpp
llarp_time_t lifetime = default_lifetime;
```


### variable version

```cpp
llarp_proto_version_t version;
```


### variable m_LastActivity

```cpp
llarp_time_t m_LastActivity = 0s;
```


### variable destroy

```cpp
bool destroy = false;
```


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

Updated on 2023-03-26 at 04:03:14 +0000