Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

int nla_memcpy ( void *  dest,
struct nlattr *  src,
int  count 
)

Copy attribute payload to another memory area.

  • dest Pointer to destination memory area.
  • src Attribute
  • count Number of bytes to copy at most.
Note: The number of bytes copied is limited by the length of the attribute payload.

Returns:
The number of bytes copied to dest.

Definition at line 695 of file attr.c.

References nla_data(), and nla_len().

Referenced by nla_get_u64().

{
      int minlen;

      if (!src)
            return 0;
      
      minlen = min_t(int, count, nla_len(src));
      memcpy(dest, nla_data(src), minlen);

      return minlen;
}


Generated by  Doxygen 1.6.0   Back to index