27 static_assert(
sizeof(
radius_header) == 20,
"radius_header size is not 20 bytes");
47 if (m_Data ==
nullptr)
50 return static_cast<size_t>(m_Data->recordLen);
55 if (m_Data ==
nullptr)
58 return static_cast<size_t>(m_Data->recordLen) - 2 *
sizeof(uint8_t);
122 TLVRecordBuilder::operator=(other);
138 uint8_t* getAttributesBasePtr()
const
163 RadiusLayer(uint8_t code, uint8_t
id,
const uint8_t* authenticator, uint8_t authenticatorArrSize);
172 RadiusLayer(uint8_t code, uint8_t
id,
const std::string& authenticator);
245 static bool isDataValid(
const uint8_t* udpData,
size_t udpDataLen);
Definition: IpAddress.h:28
Definition: RadiusLayer.h:66
RadiusAttributeBuilder & operator=(const RadiusAttributeBuilder &other)
Definition: RadiusLayer.h:120
RadiusAttribute build() const
RadiusAttributeBuilder(uint8_t attrType, uint8_t attrValue)
Definition: RadiusLayer.h:82
RadiusAttributeBuilder(uint8_t attrType, const std::string &attrValue)
Definition: RadiusLayer.h:110
RadiusAttributeBuilder(uint8_t attrType, uint32_t attrValue)
Definition: RadiusLayer.h:96
RadiusAttributeBuilder(uint8_t attrType, uint16_t attrValue)
Definition: RadiusLayer.h:89
RadiusAttributeBuilder(uint8_t attrType, const IPv4Address &attrValue)
Definition: RadiusLayer.h:103
RadiusAttributeBuilder(const RadiusAttributeBuilder &other)
Definition: RadiusLayer.h:115
RadiusAttributeBuilder(uint8_t attrType, const uint8_t *attrValue, uint8_t attrValueLen)
Definition: RadiusLayer.h:74
Definition: RadiusLayer.h:33
~RadiusAttribute() override=default
A d'tor for this class, currently does nothing.
RadiusAttribute(uint8_t *attrRawData)
Definition: RadiusLayer.h:37
size_t getTotalSize() const override
Definition: RadiusLayer.h:45
size_t getDataSize() const override
Definition: RadiusLayer.h:53
Definition: RadiusLayer.h:134
size_t getHeaderLen() const override
RadiusAttribute getAttribute(uint8_t attrType) const
bool removeAllAttributes()
RadiusAttribute getNextAttribute(RadiusAttribute &attr) const
radius_header * getRadiusHeader() const
Definition: RadiusLayer.h:180
RadiusLayer(uint8_t code, uint8_t id, const uint8_t *authenticator, uint8_t authenticatorArrSize)
~RadiusLayer() override=default
A d'tor for this layer, currently does nothing.
RadiusAttribute getFirstAttribute() const
static bool isDataValid(const uint8_t *udpData, size_t udpDataLen)
RadiusAttribute addAttributeAfter(const RadiusAttributeBuilder &attrBuilder, uint8_t prevAttrType)
std::string getAuthenticatorValue() const
void setAuthenticatorValue(const std::string &authValue)
RadiusLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: RadiusLayer.h:151
RadiusAttribute addAttribute(const RadiusAttributeBuilder &attrBuilder)
size_t getAttributeCount() const
std::string toString() const override
bool removeAttribute(uint8_t attrType)
void parseNextLayer() override
Does nothing for this layer, RADIUS is always last.
Definition: RadiusLayer.h:257
static std::string getRadiusMessageString(uint8_t radiusMessageCode)
OsiModelLayer getOsiModelLayer() const override
Definition: RadiusLayer.h:265
RadiusLayer(uint8_t code, uint8_t id, const std::string &authenticator)
void computeCalculateFields() override
Calculate and store the value of radius_header::length according to the layer size.
static bool isRadiusPort(uint16_t port)
Definition: RadiusLayer.h:273
Definition: TLVData.h:357
Definition: TLVData.h:204
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
An enum representing OSI model layers.
Definition: ProtocolType.h:225
@ OsiModelApplicationLayer
Application layer (layer 7)
Definition: ProtocolType.h:239
const ProtocolType Radius
RADIUS protocol.
Definition: ProtocolType.h:131