Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Android/device/device/generic/trusty/dhcp/client/   (Android Betriebssystem Version 17©)  Datei vom 26.5.2026 mit Größe 848 B image not shown  

Quelle  netlink.h

  Sprache: C
 

#pragma once

#include <linux/rtnetlink.h>

template <class Request>
inline void addRouterAttribute(Request& r, int type, const void* data, size_t size) {
    // Calculate the offset into the character buffer where the RTA data lives
    // We use offsetof on the buffer to get it. This avoids undefined behavior
    // by casting the buffer (which is safe because it's char) instead of the
    // Request struct.(which is undefined because of aliasing)
    size_t offset = NLMSG_ALIGN(r.hdr.nlmsg_len) - offsetof(Request, buf);
    auto attr = reinterpret_cast<struct rtattr*>(r.buf + offset);
    attr->rta_type = type;
    attr->rta_len = RTA_LENGTH(size);
    memcpy(RTA_DATA(attr), data, size);

    // Update the message length to include the router attribute.
    r.hdr.nlmsg_len = NLMSG_ALIGN(r.hdr.nlmsg_len) + RTA_ALIGN(attr->rta_len);
}

Messung V0.5 in Prozent
C=94 H=96 G=94

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-06-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.