1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/net/ccn_lite/ccnl-pdu.h
2014-11-08 20:09:55 +01:00

37 lines
1.5 KiB
C

/*
* @f ccnl-pdu.h
*
* Copyright (C) 2013, Christian Mehlis, Freie University Berlin
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef __cplusplus
extern "C" {
#endif
int dehead(unsigned char **buf, int *len, int *num, int *typ);
int mkHeader(unsigned char *buf, unsigned int num, unsigned int tt);
int mkBlob(unsigned char *out, unsigned int num, unsigned int tt, char *cp, int cnt);
int mkStrBlob(unsigned char *out, unsigned int num, unsigned int tt, char *str);
int mkBinaryInt(unsigned char *out, unsigned int num, unsigned int tt,
unsigned int val, int bytes);
int unmkBinaryInt(unsigned char **data, int *datalen, unsigned int *result,
unsigned char *width);
int mkInterest(char **namecomp, unsigned int *nonce, unsigned char *out);
int mkContent(char **namecomp, char *data, int datalen, unsigned char *out);
#ifdef __cplusplus
}
#endif