~ubuntu-branches/ubuntu/oneiric/libotr/oneiric-security

« back to all changes in this revision

Viewing changes to src/tlv.h

  • Committer: Bazaar Package Importer
  • Author(s): Thibaut VARENE
  • Date: 2005-11-19 00:08:41 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051119000841-xvh66l22yco8u2m4
Tags: 3.0.0-1
* New upstream release (closes: #337851)
* Support for OTR protocol version 2

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
/* Make a single TLV, copying the supplied data */
40
40
OtrlTLV *otrl_tlv_new(unsigned short type, unsigned short len,
41
 
        unsigned char *data);
 
41
        const unsigned char *data);
42
42
 
43
43
/* Construct a chain of TLVs from the given data */
44
 
OtrlTLV *otrl_tlv_parse(unsigned char *serialized, size_t seriallen);
 
44
OtrlTLV *otrl_tlv_parse(const unsigned char *serialized, size_t seriallen);
45
45
 
46
46
/* Deallocate a chain of TLVs */
47
47
void otrl_tlv_free(OtrlTLV *tlv);
48
48
 
49
49
/* Find the serialized length of a chain of TLVs */
50
 
size_t otrl_tlv_seriallen(OtrlTLV *tlv);
 
50
size_t otrl_tlv_seriallen(const OtrlTLV *tlv);
51
51
 
52
52
/* Serialize a chain of TLVs.  The supplied buffer must already be large
53
53
 * enough. */
54
 
void otrl_tlv_serialize(unsigned char *buf, OtrlTLV *tlv);
 
54
void otrl_tlv_serialize(unsigned char *buf, const OtrlTLV *tlv);
55
55
 
56
56
/* Return the first TLV with the given type in the chain, or NULL if one
57
 
 * isn't found.*/
 
57
 * isn't found.  (The tlvs argument isn't const because the return type
 
58
 * needs to be non-const.) */
58
59
OtrlTLV *otrl_tlv_find(OtrlTLV *tlvs, unsigned short type);
59
60
 
60
61
#endif