updates.
[silc.git] / lib / silccore / silcpacket.h
1 /****h* silccore/silcpacket.h
2  *
3  * NAME
4  *
5  * silcpacket.h
6  *
7  * COPYRIGHT
8  *
9  * Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
10  *
11  * Copyright (C) 1997 - 2001 Pekka Riikonen
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * DESCRIPTION
24  *
25  * Implementation of the packet routines for sending and receiving
26  * SILC Packets. These includes the data sending routines and data
27  * reading routines, encrypting and decrypting routines, packet assembling
28  * and packet parsing routines.
29  *
30  ***/
31
32 #ifndef SILCPACKET_H
33 #define SILCPACKET_H
34
35 /* Amount of bytes to be read from the socket connection at once. */
36 #define SILC_PACKET_READ_SIZE 16384
37
38 /* Default byte size of the packet. */
39 #define SILC_PACKET_DEFAULT_SIZE 1024
40
41 /* Header length without source and destination ID's. */
42 #define SILC_PACKET_HEADER_LEN 8 + 2
43
44 /* Minimum length of SILC Packet Header. This much is decrypted always
45    when packet is received to be able to get all the relevant data out
46    from the header. */
47 #define SILC_PACKET_MIN_HEADER_LEN 16 + 2
48
49 /* Maximum padding length */
50 #define SILC_PACKET_MAX_PADLEN 16
51
52 /* Minimum packet length */
53 #define SILC_PACKET_MIN_LEN (SILC_PACKET_HEADER_LEN + 1)
54
55 /* Maximum length of ID */
56 #define SILC_PACKET_MAX_ID_LEN 16
57
58 /****d* silccore/SilcPacketAPI/SilcPacketType
59  *
60  * NAME
61  * 
62  *    typedef unsigned char SilcPacketType;
63  *
64  * DESCRIPTION
65  *
66  *    SILC packet type definition and all the packet types.
67  *
68  * SOURCE
69  */
70 typedef unsigned char SilcPacketType;
71
72 /* SILC Packet types. */
73 #define SILC_PACKET_NONE                 0       /* NULL, never sent */
74 #define SILC_PACKET_DISCONNECT           1       /* Disconnection */
75 #define SILC_PACKET_SUCCESS              2       /* Success */
76 #define SILC_PACKET_FAILURE              3       /* Failure */
77 #define SILC_PACKET_REJECT               4       /* Rejected */
78 #define SILC_PACKET_NOTIFY               5       /* Notify message */
79 #define SILC_PACKET_ERROR                6       /* Error message */
80 #define SILC_PACKET_CHANNEL_MESSAGE      7       /* Message for channel */
81 #define SILC_PACKET_CHANNEL_KEY          8       /* Key of the channel */
82 #define SILC_PACKET_PRIVATE_MESSAGE      9       /* Private message */
83 #define SILC_PACKET_PRIVATE_MESSAGE_KEY  10      /* Private message key*/
84 #define SILC_PACKET_COMMAND              11      /* Command */
85 #define SILC_PACKET_COMMAND_REPLY        12      /* Reply to a command */
86 #define SILC_PACKET_KEY_EXCHANGE         13      /* Start of KE */
87 #define SILC_PACKET_KEY_EXCHANGE_1       14      /* KE1 */
88 #define SILC_PACKET_KEY_EXCHANGE_2       15      /* KE2 */
89 #define SILC_PACKET_CONNECTION_AUTH_REQUEST 16   /* Request of auth meth */
90 #define SILC_PACKET_CONNECTION_AUTH      17      /* Connectinon auth */
91 #define SILC_PACKET_NEW_ID               18      /* Sending new ID */
92 #define SILC_PACKET_NEW_CLIENT           19      /* Client registering */
93 #define SILC_PACKET_NEW_SERVER           20      /* Server registering */
94 #define SILC_PACKET_NEW_CHANNEL          21      /* Channel registering */
95 #define SILC_PACKET_REKEY                22      /* Re-key start */
96 #define SILC_PACKET_REKEY_DONE           23      /* Re-key done */
97 #define SILC_PACKET_HEARTBEAT            24      /* Heartbeat */
98 #define SILC_PACKET_KEY_AGREEMENT        25      /* Key Agreement request */
99 #define SILC_PACKET_CELL_ROUTERS         26      /* Cell routers backup */
100
101 #define SILC_PACKET_PRIVATE              200     /* Private range start  */
102 #define SILC_PACKET_MAX                  255     /* RESERVED */
103 /***/
104
105 /****d* silccore/SilcPacketAPI/SilcPacketVersion
106  *
107  * NAME
108  * 
109  *    typedef unsigned char SilcPacketVersion;
110  *
111  * DESCRIPTION
112  *
113  *    SILC packet version type definition.
114  *
115  ***/
116 typedef unsigned char SilcPacketVersion;
117
118 /****d* silccore/SilcPacketAPI/SilcPacketFlags
119  *
120  * NAME
121  * 
122  *    typedef unsigned char SilcPacketFlags;
123  *
124  * DESCRIPTION
125  *
126  *    SILC packet flags type definition and all the packet flags.
127  *
128  * SOURCE
129  */
130 typedef unsigned char SilcPacketFlags;
131
132 /* All defined packet flags */
133 #define SILC_PACKET_FLAG_NONE             0x00    /* No flags */
134 #define SILC_PACKET_FLAG_PRIVMSG_KEY      0x01    /* Private message key */
135 #define SILC_PACKET_FLAG_LIST             0x02    /* Packet is a list */
136 #define SILC_PACKET_FLAG_BROADCAST        0x04    /* Packet is a broadcast */
137 /***/
138
139 /* Rest of flags still available
140 #define SILC_PACKET_FLAG_XXX              0x08
141 #define SILC_PACKET_FLAG_XXX              0x10
142 #define SILC_PACKET_FLAG_XXX              0x20
143 #define SILC_PACKET_FLAG_XXX              0x40
144 #define SILC_PACKET_FLAG_XXX              0x80
145 */
146
147 /****s* silccore/SilcPacketAPI/SilcPacketContext
148  *
149  * NAME
150  * 
151  *    typedef struct { ... } SilcPacketContext;
152  *
153  * DESCRIPTION
154  *
155  *    In packet sending this is filled and sent to silc_packet_assemble 
156  *    which then uses it to assemble new packet. In packet reception pointer 
157  *    to this context is sent to silc_packet_parse which parses the packet 
158  *    and returns the relevant information to this structure. On packet 
159  *    reception returned ID's are always the hash values of the ID's from 
160  *    the packet. 
161  *
162  *    Short description of the fields following:
163  *
164  *    SilcBuffer buffer
165  *
166  *      The data buffer.
167  *
168  *    SilcPacketType type
169  *
170  *      Type of the packet. Types are defined below.
171  *
172  *    SilcPacketFlags flags
173  *
174  *      Packet flags. Flags are defined above.
175  *
176  *    unsigned char *src_id
177  *    uint16 src_id_len
178  *    unsigned char src_id_type
179  *
180  *      Source ID, its length and type. On packet reception retuned ID's
181  *      are always the hash values of the ID's from the packet.
182  *
183  *    unsigned char *dst_id;
184  *    uint16 dst_id_len;
185  *    unsigned char src_id_type;
186  *
187  *      Destination ID, its length and type. On packet reception retuned
188  *      ID's are always the hash values of the ID's from the packet.
189  *
190  *    uint16 truelen
191  *    uint16 padlen
192  *
193  *      The true lenght of the packet and the padded length of the packet.
194  *      These may be set by the caller before calling any of the 
195  *      silc_packet_* routines. If not provided the library will calculate
196  *      the values.
197  *
198  *    in users;
199  *
200  *      Reference counter for this context. The context is freed only 
201  *      after the reference counter hits zero. The counter is added
202  *      calling silc_packet_context_dup and decreased by calling the
203  *      silc_packet_context_free.
204  *
205  ***/
206 typedef struct {
207   SilcBuffer buffer;
208   SilcPacketType type;
209   SilcPacketFlags flags;
210
211   unsigned char *src_id;
212   uint16 src_id_len;
213   unsigned char src_id_type;
214
215   unsigned char *dst_id;
216   uint16 dst_id_len;
217   unsigned char dst_id_type;
218
219   uint16 truelen;
220   uint16 padlen;
221
222   /* Back pointers */
223   void *context;
224   SilcSocketConnection sock;
225
226   int users;
227 } SilcPacketContext;
228
229 /****s* silccore/SilcPacketAPI/SilcPacketParserContext
230  *
231  * NAME
232  * 
233  *    typedef struct { ... } SilcPacketParserContext;
234  *
235  * DESCRIPTION
236  *
237  *    This context is used in packet reception when silc_packet_receive_process
238  *    function calls parser callback that performs the actual packet decryption
239  *    and parsing. This context is sent as argument to the parser function.
240  *    This context must be free'd by the parser callback function.
241  *
242  *    Following description of the fields:
243  *
244  *    SilcPacketContext *packet
245  *
246  *      The actual packet received from the network. In this phase the
247  *      context is not parsed, only the packet->buffer is allocated and
248  *      it includes the raw packet data, which is encrypted.
249  *
250  *    SilcSocketConnection sock
251  *
252  *      The associated connection.
253  *
254  *    void *context
255  *
256  *      User context that is sent to the silc_packet_receive_process
257  *      function. This usually includes application and connection specific
258  *      data.
259  *
260  ***/
261 typedef struct {
262   SilcPacketContext *packet;
263   SilcSocketConnection sock;
264   void *context;
265 } SilcPacketParserContext;
266
267 /****f* silccore/SilcPacketAPI/SilcPacketParserCallback
268  *
269  * SYNOPSIS
270  *
271  *    typedef void (*SilcPacketParserCallback)(SilcPacketParserContext 
272  *                                             *parse_context);
273  *
274  * DESCRIPTION
275  *
276  *    This callback is given to the silc_packet_receive_process function.
277  *    The callback is called by the library every time a packet is
278  *    received from the network. After the packet has been decrypted
279  *    and at least partially parsed it is passed to the application
280  *    for further parsing using this callback and the SilcPacketParserContext
281  *    context. The application receiving the SilcPacketParserContext
282  *    must free it.
283  *
284  ***/
285 typedef void (*SilcPacketParserCallback)(SilcPacketParserContext 
286                                          *parse_context);
287
288 /****f* silccore/SilcPacketAPI/SilcPacketCheckDecrypt
289  *
290  * SYNOPSIS
291  *
292  *    typedef int (*SilcPacketCheckDecrypt)(SilcPacketType packet_type,
293  *                                          SilcBuffer buffer,
294  *                                          SilcPacketContext *packet,
295  *                                          void *context);
296  *
297  * DESCRIPTION
298  *
299  *    This callback function relates to the checking whether the packet is
300  *    normal packet or special packet and how it should be processed.  If
301  *    the callback returns TRUE the packet is normal and FALSE if the packet
302  *    is special and requires special procesing. Some of the packets in
303  *    SILC are special (like channel message packets that are encrypted
304  *    using channel specific keys) and requires special processing. That
305  *    is the reason for this callback function.
306  *
307  *    The library will call this function if provided for the
308  *    silc_packet_decrypt function. The `packet_type' is the type of
309  *    packet received (this is also actually the first time application
310  *    receives information of the received packet, next time it receives
311  *    it is when the SilcPacketParserCallback function is called),
312  *    the `buffer' is the raw packet data the `packet' the allocated
313  *    SilcPacketContext that is filled when parsing the packet and `context'
314  *    is application specific user context.
315  *
316  ***/
317 typedef int (*SilcPacketCheckDecrypt)(SilcPacketType packet_type,
318                                       SilcBuffer buffer,
319                                       SilcPacketContext *packet,
320                                       void *context);
321
322 /* Macros */
323
324 /****d* silccore/SilcPacketAPI/SILC_PACKET_LENGTH
325  *
326  * NAME
327  * 
328  *    #define SILC_PACKET_LENGTH ...
329  *
330  * DESCRIPTION
331  *
332  *    Returns true length of the packet and padded length of the packet.
333  *    This is primarily used by the libary in packet parsing phase but
334  *    the application may use it as well if needed.
335  *
336  * SOURCE
337  */
338 #define SILC_PACKET_LENGTH(__packet, __ret_truelen, __ret_padlen)            \
339 do {                                                                         \
340   SILC_GET16_MSB((__ret_truelen), (__packet)->data);                         \
341   (__ret_padlen) = (((__ret_truelen) - 2) +                                  \
342                     SILC_PACKET_MAX_PADLEN) & ~(SILC_PACKET_MAX_PADLEN - 1); \
343 } while(0)
344 /***/
345
346 /****d* silccore/SilcPacketAPI/SILC_PACKET_PADLEN
347  *
348  * NAME
349  * 
350  *    #define SILC_PACKET_PADLEN ...
351  *
352  * DESCRIPTION
353  *
354  *    Returns the length of the padding in the packet. This is used
355  *    by various library routines to determine needed padding length.
356  *
357  * SOURCE
358  */
359 #define SILC_PACKET_PADLEN(__packetlen)                                  \
360   SILC_PACKET_MAX_PADLEN - ((__packetlen) - 2) % SILC_PACKET_MAX_PADLEN;
361 /***/
362
363 /* Prototypes */
364
365 /****f* silccore/SilcPacketAPI/silc_packet_write
366  *
367  * SYNOPSIS
368  *
369  *    int silc_packet_write(int sock, SilcBuffer src);
370  *
371  * DESCRIPTION
372  *
373  *    Writes data from encrypted buffer to the socket connection. If the
374  *    data cannot be written at once, it will be written later with a timeout. 
375  *    The data is written from the data section of the buffer, not from head
376  *    or tail section. This automatically pulls the data section towards end
377  *    after writing the data.
378  *
379  ***/
380 int silc_packet_write(int sock, SilcBuffer src);
381
382 /****f* silccore/SilcPacketAPI/silc_packet_send
383  *
384  * SYNOPSIS
385  *
386  *    int silc_packet_send(SilcSocketConnection sock, int force_send);
387  *
388  * DESCRIPTION
389  *
390  *    Actually sends the packet. This flushes the connections outgoing data
391  *    buffer. If data is sent directly to the network this returns the bytes
392  *    written, if error occured this returns -1 and if the data could not
393  *    be written directly to the network at this time this returns -2, in
394  *    which case the data should be queued by the caller and sent at some
395  *    later time. If `force_send' is TRUE this attempts to write the data
396  *    directly to the network, if FALSE, this returns -2.
397  *
398  ***/
399 int silc_packet_send(SilcSocketConnection sock, int force_send);
400
401 /****f* silccore/SilcPacketAPI/silc_packet_encrypt
402  *
403  * SYNOPSIS
404  *
405  *    void silc_packet_encrypt(SilcCipher cipher, SilcHmac hmac, 
406  *                             SilcBuffer buffer, uint32 len);
407  *
408  * DESCRIPTION
409  *
410  *    Encrypts a packet. This also creates HMAC of the packet before 
411  *    encryption and adds the HMAC at the end of the buffer. This assumes
412  *    that there is enough free space at the end of the buffer to add the
413  *    computed HMAC. This is the normal way of encrypting packets, if some
414  *    other process of HMAC computing and encryption is needed this function
415  *    cannot be used. 
416  *
417  ***/
418 void silc_packet_encrypt(SilcCipher cipher, SilcHmac hmac, 
419                          SilcBuffer buffer, uint32 len);
420
421 /****f* silccore/SilcPacketAPI/silc_packet_assemble
422  *
423  * SYNOPSIS
424  *
425  *    void silc_packet_assemble(SilcPacketContext *ctx);
426  *
427  * DESCRIPTION
428  *
429  *    Assembles a new packet to be ready for send out. The buffer sent as
430  *    argument must include the data to be sent and it must not be encrypted. 
431  *    The packet also must have enough free space so that the SILC header
432  *    and padding maybe added to the packet. The packet is encrypted after 
433  *    this function has returned.
434  *
435  *    The buffer sent as argument should be something like following:
436  *
437  *    --------------------------------------------
438  *    | head             | data           | tail |
439  *    --------------------------------------------
440  *    ^                  ^
441  *    58 bytes           x bytes
442  *
443  *    So that the SILC header and 1 - 16 bytes of padding can fit to
444  *    the buffer. After assembly the buffer might look like this:
445  *
446  *    --------------------------------------------
447  *    | data                              |      |
448  *    --------------------------------------------
449  *    ^                                   ^
450  *    Start of assembled packet
451  *
452  *    Packet construct is as follows (* = won't be encrypted):
453  *
454  *    n bytes       SILC Header
455  *      2 bytes     Payload length  (*)
456  *      1 byte      Flags
457  *      1 byte      Packet type
458  *      2 bytes     Source ID Length
459  *      2 bytes     Destination ID Length
460  *      1 byte      Source ID Type
461  *      n bytes     Source ID
462  *      1 byte      Destination ID Type
463  *      n bytes     Destination ID
464  *
465  *    1 - 16 bytes    Padding
466  *
467  *    n bytes        Data payload
468  *
469  *    All fields in the packet will be authenticated by MAC. The MAC is
470  *    not computed here, it must be computed separately before encrypting
471  *    the packet.
472  *
473  ***/
474 void silc_packet_assemble(SilcPacketContext *ctx);
475
476 /****f* silccore/SilcPacketAPI/silc_packet_send_prepare
477  *
478  * SYNOPSIS
479  *
480  *    void silc_packet_send_prepare(SilcSocketConnection sock,
481  *                                  uint32 header_len,
482  *                                  uint32 padlen,
483  *                                  uint32 data_len);
484  *
485  * DESCRIPTION
486  *
487  *    Prepare outgoing data buffer for packet sending. This moves the data
488  *    area so that new packet may be added into it. If needed this allocates
489  *    more space to the buffer. This handles directly the connection's
490  *    outgoing buffer in SilcSocketConnection object.
491  *
492  ***/
493 void silc_packet_send_prepare(SilcSocketConnection sock,
494                               uint32 header_len,
495                               uint32 padlen,
496                               uint32 data_len);
497
498 /****f* silccore/SilcPacketAPI/silc_packet_read
499  *
500  * SYNOPSIS
501  *
502  *    int silc_packet_read(int fd, SilcSocketConnection sock);
503  *
504  * DESCRIPTION
505  *
506  *    Reads data from the socket connection into the incoming data buffer.
507  *    However, this does not parse the packet, it only reads some amount from
508  *    the network. If there are more data available that can be read at a time
509  *    the rest of the data will be read later with a timeout and only after
510  *    that the packet is ready to be parsed. 
511  *
512  *    The destination buffer sent as argument must be initialized before 
513  *    calling this function, and, the data section and the start of the tail
514  *    section must be same. Ie. we add the read data to the tail section of
515  *    the buffer hence the data section is the start of the buffer.
516  *
517  *    This returns amount of bytes read or -1 on error or -2 on case where
518  *    all of the data could not be read at once.
519  *
520  ***/
521 int silc_packet_read(int fd, SilcSocketConnection sock);
522
523 /****f* silccore/SilcPacketAPI/silc_packet_receive
524  *
525  * SYNOPSIS
526  *
527  *    int silc_packet_receive(SilcSocketConnection sock);
528  *
529  * DESCRIPTION
530  *
531  *    Receives packet from network and reads the data into connection's
532  *    incoming data buffer. If the data was read directly this returns the
533  *    read bytes, if error occured this returns -1, if the data could not
534  *    be read directly at this time this returns -2 in which case the data
535  *    should be read again at some later time, or If EOF occured this returns
536  *    0.
537  *
538  ***/
539 int silc_packet_receive(SilcSocketConnection sock);
540
541 /****f* silccore/SilcPacketAPI/silc_packet_decrypt
542  *
543  * SYNOPSIS
544  *
545  *    int silc_packet_decrypt(SilcCipher cipher, SilcHmac hmac,
546  *                            SilcBuffer buffer, SilcPacketContext *packet,
547  *                            SilcPacketCheckDecrypt check_packet,
548  *                            void *context);
549  *
550  * DESCRIPTION
551  *
552  *    Decrypts a packet. This assumes that typical SILC packet is the
553  *    packet to be decrypted and thus checks for normal and special SILC
554  *    packets and can handle both of them. This also computes and checks
555  *    the HMAC of the packet. If any other special or customized decryption
556  *    processing is required this function cannot be used. This returns
557  *    -1 on error, 0 when packet is normal packet and 1 when the packet
558  *    is special and requires special processing. 
559  *
560  *    The `check_packet' is a callback funtion that this function will 
561  *    call.  The callback relates to the checking whether the packet is
562  *    normal packet or special packet and how it should be processed.  If
563  *    the callback return TRUE the packet is normal and FALSE if the packet
564  *    is special and requires special procesing.
565  *
566  ***/
567 int silc_packet_decrypt(SilcCipher cipher, SilcHmac hmac,
568                         SilcBuffer buffer, SilcPacketContext *packet,
569                         SilcPacketCheckDecrypt check_packet,
570                         void *context);
571
572 /****f* silccore/SilcPacketAPI/silc_packet_receive_process
573  *
574  * SYNOPSIS
575  *
576  *    void silc_packet_receive_process(SilcSocketConnection sock,
577  *                                     SilcCipher cipher, SilcHmac hmac,
578  *                                     SilcPacketParserCallback parser,
579  *                                     void *context);
580  *
581  * DESCRIPTION
582  *
583  *    Processes the received data. This checks the received data and 
584  *    calls parser callback that handles the actual packet decryption
585  *    and parsing. If more than one packet was received this calls the
586  *    parser multiple times. The parser callback will get context
587  *    SilcPacketParserContext that includes the packet and the `context'
588  *    sent to this function.
589  *
590  ***/
591 void silc_packet_receive_process(SilcSocketConnection sock,
592                                  SilcCipher cipher, SilcHmac hmac,
593                                  SilcPacketParserCallback parser,
594                                  void *context);
595
596 /****f* silccore/SilcPacketAPI/silc_packet_parse
597  *
598  * SYNOPSIS
599  *
600  *    SilcPacketType silc_packet_parse(SilcPacketContext *ctx);
601  *
602  * DESCRIPTION
603  *
604  *    Parses the packet. This is called when a whole packet is ready to be
605  *    parsed. The buffer sent must be already decrypted before calling this 
606  *    function. The len argument must be the true length of the packet. This 
607  *    function returns the type of the packet. The data section of the 
608  *    buffer is parsed, not head or tail sections.
609  *
610  ***/
611 SilcPacketType silc_packet_parse(SilcPacketContext *ctx);
612
613 /****f* silccore/SilcPacketAPI/silc_packet_parse_special
614  *
615  * SYNOPSIS
616  *
617  *    SilcPacketType silc_packet_parse_special(SilcPacketContext *ctx);
618  *
619  * DESCRIPTION
620  *
621  *    Perform special SILC Packet header parsing. This is required to some
622  *    packet types that have the data payload encrypted with different key
623  *    than the header area plus padding of the packet. Hence, this parses
624  *    the header in a way that it does not take the data area into account
625  *    and parses the header and padding area only.
626  *
627  ***/
628 SilcPacketType silc_packet_parse_special(SilcPacketContext *ctx);
629
630 /****f* silccore/SilcPacketAPI/silc_packet_context_alloc
631  *
632  * SYNOPSIS
633  *
634  *    SilcPacketContext *silc_packet_context_alloc();
635  *
636  * DESCRIPTION
637  *
638  *    Allocates a packet context. Packet contexts are used when 
639  *    packets are assembled and parsed. The context is freed by the
640  *    silc_packet_context_free function.
641  *
642  ***/
643 SilcPacketContext *silc_packet_context_alloc();
644
645 /****f* silccore/SilcPacketAPI/silc_packet_context_dup
646  *
647  * SYNOPSIS
648  *
649  *    SilcPacketContext *silc_packet_context_dup(SilcPacketContext *ctx);
650  *
651  * DESCRIPTION
652  *
653  *    Duplicates the packet context. It actually does not duplicate
654  *    any data, instead a reference counter is increased.
655  *
656  ***/
657 SilcPacketContext *silc_packet_context_dup(SilcPacketContext *ctx);
658
659 /****f* silccore/SilcPacketAPI/silc_packet_context_free
660  *
661  * SYNOPSIS
662  *
663  *    void silc_packet_context_free(SilcPacketContext *ctx);
664  *
665  * DESCRIPTION
666  *
667  *    Frees the packet context. The context is actually freed when the
668  *    reference counter hits zero.
669  *
670  ***/
671 void silc_packet_context_free(SilcPacketContext *ctx);
672
673 #endif