xref: /netbsd-src/crypto/external/bsd/netpgp/dist/src/lib/packet-show.h (revision 93bf6008f8b7982c1d1a9486e4a4a0e687fe36eb)
1 /*
2  * Copyright (c) 2005-2008 Nominet UK (www.nic.uk)
3  * All rights reserved.
4  * Contributors: Ben Laurie, Rachel Willmer. The Contributors have asserted
5  * their moral rights under the UK Copyright Design and Patents Act 1988 to
6  * be recorded as the authors of this copyright work.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
9  * use this file except in compliance with the License.
10  *
11  * You may obtain a copy of the License at
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  *
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 /** \file
23  */
24 
25 #ifndef OPS_PACKET_TO_TEXT_H
26 #define OPS_PACKET_TO_TEXT_H
27 
28 #include "packet.h"
29 
30 /** __ops_list_t
31  */
32 typedef struct {
33 	unsigned int    size;	/* num of array slots allocated */
34 	unsigned int    used;	/* num of array slots currently used */
35 	char          **strings;
36 }               __ops_list_t;
37 
38 /** __ops_text_t
39  */
40 typedef struct {
41 	__ops_list_t      known;
42 	__ops_list_t      unknown;
43 }               __ops_text_t;
44 
45 /** __ops_bit_map_t
46  */
47 typedef struct {
48 	unsigned char   mask;
49 	const char     *string;
50 }               __ops_bit_map_t;
51 
52 void            __ops_text_init(__ops_text_t * text);
53 void            __ops_text_free(__ops_text_t * text);
54 
55 const char     *__ops_show_packet_tag(__ops_packet_tag_t packet_tag);
56 const char     *__ops_show_ss_type(__ops_ss_type_t ss_type);
57 
58 const char     *__ops_show_sig_type(__ops_sig_type_t sig_type);
59 const char     *__ops_show_pka(__ops_public_key_algorithm_t pka);
60 
61 __ops_text_t     *__ops_showall_ss_preferred_compression(__ops_ss_preferred_compression_t ss_preferred_compression);
62 const char     *__ops_show_ss_preferred_compression(unsigned char octet);
63 
64 __ops_text_t     *__ops_showall_ss_preferred_hash(__ops_ss_preferred_hash_t ss_preferred_hash);
65 const char     *__ops_show_hash_algorithm(unsigned char octet);
66 const char     *__ops_show_symmetric_algorithm(unsigned char hash);
67 
68 __ops_text_t     *__ops_showall_ss_preferred_ska(__ops_ss_preferred_ska_t ss_preferred_ska);
69 const char     *__ops_show_ss_preferred_ska(unsigned char octet);
70 
71 const char     *__ops_show_ss_rr_code(__ops_ss_rr_code_t ss_rr_code);
72 
73 __ops_text_t     *__ops_showall_ss_features(__ops_ss_features_t ss_features);
74 
75 __ops_text_t     *__ops_showall_ss_key_flags(__ops_ss_key_flags_t ss_key_flags);
76 const char     *__ops_show_ss_key_flag(unsigned char octet, __ops_bit_map_t * map);
77 
78 __ops_text_t     *__ops_showall_ss_key_server_prefs(__ops_ss_key_server_prefs_t ss_key_server_prefs);
79 const char     *
80 __ops_show_ss_key_server_prefs(unsigned char octet,
81 			     __ops_bit_map_t * map);
82 
83 __ops_text_t     *__ops_showall_ss_notation_data_flags(__ops_ss_notation_data_t ss_notation_data);
84 
85 #endif				/* OPS_PACKET_TO_TEXT_H */
86