2013-10-28 10:25:17 +01:00
|
|
|
/*
|
|
|
|
* @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.
|
|
|
|
*/
|
|
|
|
|
2014-10-10 11:51:11 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-10-28 10:25:17 +01:00
|
|
|
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);
|
2014-10-10 11:51:11 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|