5 Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
7 Copyright (C) 1997 - 2000 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
24 /* Forward declaration for Channel Message Payload parsed from packet. The
25 actual structure is defined in source file and is private data. */
26 typedef struct SilcChannelPayloadStruct *SilcChannelPayload;
28 /* Forward declaration for Channel Key Payload parsed from packet. The
29 actual structure is defined in source file and is private data. */
30 typedef struct SilcChannelKeyPayloadStruct *SilcChannelKeyPayload;
33 int silc_channel_payload_decrypt(unsigned char *data,
37 SilcChannelPayload silc_channel_payload_parse(SilcBuffer buffer,
40 SilcBuffer silc_channel_payload_encode(unsigned short data_len,
42 unsigned short iv_len,
47 void silc_channel_payload_free(SilcChannelPayload payload);
48 unsigned char *silc_channel_get_data(SilcChannelPayload payload,
49 unsigned int *data_len);
50 unsigned char *silc_channel_get_mac(SilcChannelPayload payload);
51 unsigned char *silc_channel_get_iv(SilcChannelPayload payload);
52 SilcChannelKeyPayload silc_channel_key_payload_parse(SilcBuffer buffer);
53 SilcBuffer silc_channel_key_payload_encode(unsigned short id_len,
55 unsigned short cipher_len,
56 unsigned char *cipher,
57 unsigned short key_len,
59 void silc_channel_key_payload_free(SilcChannelKeyPayload payload);
60 unsigned char *silc_channel_key_get_id(SilcChannelKeyPayload payload,
61 unsigned int *id_len);
62 unsigned char *silc_channel_key_get_cipher(SilcChannelKeyPayload payload,
63 unsigned int *cipher_len);
64 unsigned char *silc_channel_key_get_key(SilcChannelKeyPayload payload,
65 unsigned int *key_len);