face: minor code reorganization and doxygen cleanups
Change-Id: I280bd2f4d282f246ef491e327a5b990ca7600dd3
diff --git a/daemon/face/lp-fragmenter.hpp b/daemon/face/lp-fragmenter.hpp
index 40e429b..fa364f8 100644
--- a/daemon/face/lp-fragmenter.hpp
+++ b/daemon/face/lp-fragmenter.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,17 +32,20 @@
namespace nfd::face {
-/** \brief Fragments network-layer packets into NDNLPv2 link-layer packets.
- * \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
+/**
+ * \brief Fragments network-layer packets into NDNLPv2 link-layer packets.
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
*/
class LpFragmenter
{
public:
- /** \brief %Options that control the behavior of LpFragmenter.
+ /**
+ * \brief %Options that control the behavior of LpFragmenter.
*/
struct Options
{
- /** \brief Maximum number of fragments in a packet.
+ /**
+ * \brief Maximum number of fragments in a packet.
*/
size_t nMaxFragments = 400;
};
@@ -50,23 +53,32 @@
explicit
LpFragmenter(const Options& options, const LinkService* linkService = nullptr);
- /** \brief Set options for fragmenter.
+ /**
+ * \brief Set options for fragmenter.
*/
void
- setOptions(const Options& options);
+ setOptions(const Options& options)
+ {
+ m_options = options;
+ }
- /** \return LinkService that owns this instance
+ /**
+ * \brief Returns the LinkService that owns this instance.
*
- * This is only used for logging, and may be nullptr.
+ * This is only used for logging, and may be nullptr.
*/
const LinkService*
- getLinkService() const;
+ getLinkService() const noexcept
+ {
+ return m_linkService;
+ }
- /** \brief Fragments a network-layer packet into link-layer packets.
- * \param packet an LpPacket that contains a network-layer packet;
- * must have Fragment field, must not have FragIndex and FragCount fields
- * \param mtu maximum allowable LpPacket size after fragmentation and sequence number assignment
- * \return whether fragmentation succeeded, fragmented packets without sequence number
+ /**
+ * \brief Fragments a network-layer packet into link-layer packets.
+ * \param packet an LpPacket that contains a network-layer packet;
+ * must have Fragment field, must not have FragIndex and FragCount fields
+ * \param mtu maximum allowable LpPacket size after fragmentation and sequence number assignment
+ * \return whether fragmentation succeeded, fragmented packets without sequence number
*/
std::tuple<bool, std::vector<lp::Packet>>
fragmentPacket(const lp::Packet& packet, size_t mtu);