---
title: llarp::net::ProtocolInfo
summary: information about an IP protocol 

---

# llarp::net::ProtocolInfo



information about an IP protocol 


`#include <traffic_policy.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| bool | **[BEncode](Classes/structllarp_1_1net_1_1ProtocolInfo.md#function-bencode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const |
| bool | **[BDecode](Classes/structllarp_1_1net_1_1ProtocolInfo.md#function-bdecode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) |
| util::StatusObject | **[ExtractStatus](Classes/structllarp_1_1net_1_1ProtocolInfo.md#function-extractstatus)**() const |
| bool | **[MatchesPacket](Classes/structllarp_1_1net_1_1ProtocolInfo.md#function-matchespacket)**(const [IPPacket](Classes/structllarp_1_1net_1_1IPPacket.md) & pkt) const<br>returns true if an ip packet looks like it matches this protocol info returns false otherwise  |
| bool | **[operator<](Classes/structllarp_1_1net_1_1ProtocolInfo.md#function-operator<)**(const [ProtocolInfo](Classes/structllarp_1_1net_1_1ProtocolInfo.md) & other) const |
| | **[ProtocolInfo](Classes/structllarp_1_1net_1_1ProtocolInfo.md#function-protocolinfo)**() =default |
| | **[ProtocolInfo](Classes/structllarp_1_1net_1_1ProtocolInfo.md#function-protocolinfo)**(std::string_view spec) |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| IPProtocol | **[protocol](Classes/structllarp_1_1net_1_1ProtocolInfo.md#variable-protocol)** <br>ip protocol byte of this protocol  |
| std::optional< nuint16_t > | **[port](Classes/structllarp_1_1net_1_1ProtocolInfo.md#variable-port)** <br>the layer 3 port if applicable  |

## Public Functions Documentation

### function BEncode

```cpp
bool BEncode(
    llarp_buffer_t * buf
) const
```


### function BDecode

```cpp
bool BDecode(
    llarp_buffer_t * buf
)
```


### function ExtractStatus

```cpp
util::StatusObject ExtractStatus() const
```


### function MatchesPacket

```cpp
bool MatchesPacket(
    const IPPacket & pkt
) const
```

returns true if an ip packet looks like it matches this protocol info returns false otherwise 

### function operator<

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


### function ProtocolInfo

```cpp
ProtocolInfo() =default
```


### function ProtocolInfo

```cpp
explicit ProtocolInfo(
    std::string_view spec
)
```


## Public Attributes Documentation

### variable protocol

```cpp
IPProtocol protocol;
```

ip protocol byte of this protocol 

### variable port

```cpp
std::optional< nuint16_t > port;
```

the layer 3 port if applicable 

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

Updated on 2022-09-01 at 18:16:53 +0000