no need for netinet/ip.h
[gnutls.git] / src / common.h
blob09f19332caf0c4da2fbb53790e7d7b11ee5c9003
1 /*
2 * Copyright (C) 2000-2012 Free Software Foundation, Inc.
3 * Author: Nikos Mavrogiannopoulos
5 * This file is part of GnuTLS.
7 * GnuTLS is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * GnuTLS is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #define SERVER "127.0.0.1"
23 #include <config.h>
24 #include <gnutls/gnutls.h>
26 #include <sys/socket.h>
27 #include <netdb.h>
28 #include <unistd.h>
29 #ifndef _WIN32
30 # include <netinet/in.h>
31 #endif
33 #include <signal.h>
34 #ifdef _WIN32
35 #include <io.h>
36 #include <winbase.h>
37 #endif
39 #ifndef __attribute__
40 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
41 #define __attribute__(Spec) /* empty */
42 #endif
43 #endif
45 /* the number of elements in the priority structures.
47 #define PRI_MAX 16
49 extern const char str_unknown[];
51 int print_info (gnutls_session_t state, int print_cert);
52 void print_cert_info (gnutls_session_t, int flag, int print_cert);
53 void print_cert_info_compact (gnutls_session_t session);
55 void print_list (const char* priorities, int verbose);
56 int cert_verify (gnutls_session_t session, const char* hostname);
58 const char *raw_to_string (const unsigned char *raw, size_t raw_size);
59 void pkcs11_common (void);
60 int check_command(gnutls_session_t session, const char* str);