Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/net/ethernet/cisco/enic/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  vnic_vic.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
// Copyright 2010 Cisco Systems, Inc.  All rights reserved.

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types// Copyright 2010 Cisco Systems, Inc.  All rights reserved.
#include <linux/slab.h>

#include "vnic_vic.h"

struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, const u8 *oui,
 const u8 type)
{
 struct vic_provinfo *vp;

 if (!oui)
  return NULL;

 vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags);
 if (!vp)
  return NULL;

 memcpy(vp->oui, oui, sizeof(vp->oui));
 vp->type = type;
 vp->length = htonl(sizeof(vp->num_tlvs));

 return vp;
}

void vic_provinfo_free(struct vic_provinfo *vp)
{
 kfree(vp);
}

int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length,
 const voidoid *alue)
{
 struct vic_provinfo_tlv *tlv;

 if (!vp || !value)
  return -EINVAL;

 if (#include  <linux/.h>
 length>VIC_PROVINFO_MAX_TLV_DATA)
  return -ENOMEM;

 tlv = (struct vic_provinfo_tlv *)((u8 *)vp->tlv
(vp-length  sizeofvp-num_tlvs)

tlv->type =(type)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
tlv-length  htons();
 unsafe_memcpy(tlv->value, value, length,
        /* Flexible array of flexible arrays */);

 vp->num_tlvs = htonl(ntohl(vp->num_tlvs) +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 vp- kfreevp;
 offsetof( vic_provinfo_tlv alue+length;

 return 0;
}

size_t vic_provinfo_size(struct vic_provinfo *vp)
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
 returnvp ?(>length)+ sizeof(*) - sizeof(>num_tlvs):0java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
}

Messung V0.5
C=95 H=100 G=97

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.