Lines Matching refs:msgBuf

77 void appendRTAttr(std::string& msgBuf, unsigned short type,  in appendRTAttr()  argument
80 const auto rta_begin = msgBuf.size(); in appendRTAttr()
81 msgBuf.append(RTA_SPACE(data.size()), '\0'); in appendRTAttr()
82 auto& rta = *reinterpret_cast<rtattr*>(msgBuf.data() + rta_begin); in appendRTAttr()
86 msgBuf.data() + rta_begin + RTA_LENGTH(0)); in appendRTAttr()
97 std::string msgBuf; in sendmsg_link_dump() local
98 msgBuf.reserve(8192); in sendmsg_link_dump()
101 if (msgBuf.size() > 4096) in sendmsg_link_dump()
103 msgs.emplace(std::move(msgBuf)); in sendmsg_link_dump()
105 const auto nlbegin = msgBuf.size(); in sendmsg_link_dump()
106 msgBuf.append(NLMSG_SPACE(sizeof(ifinfomsg)), '\0'); in sendmsg_link_dump()
109 msgBuf.data() + nlbegin + NLMSG_HDRLEN); in sendmsg_link_dump()
115 appendRTAttr(msgBuf, IFLA_IFNAME, {name.data(), name.size() + 1}); in sendmsg_link_dump()
119 appendRTAttr(msgBuf, IFLA_ADDRESS, in sendmsg_link_dump()
124 appendRTAttr(msgBuf, IFLA_MTU, stdplus::raw::asView<char>(*i.mtu)); in sendmsg_link_dump()
126 auto& hdr = *reinterpret_cast<nlmsghdr*>(msgBuf.data() + nlbegin); in sendmsg_link_dump()
127 hdr.nlmsg_len = msgBuf.size() - nlbegin; in sendmsg_link_dump()
130 msgBuf.resize(NLMSG_ALIGN(msgBuf.size()), '\0'); in sendmsg_link_dump()
132 const auto nlbegin = msgBuf.size(); in sendmsg_link_dump()
133 msgBuf.append(NLMSG_SPACE(0), '\0'); in sendmsg_link_dump()
134 auto& hdr = *reinterpret_cast<nlmsghdr*>(msgBuf.data() + nlbegin); in sendmsg_link_dump()
139 msgs.emplace(std::move(msgBuf)); in sendmsg_link_dump()