guile: Fix `priorities' test to use `run-test'.
[gnutls.git] / lib / gnutls_handshake.h
blob2232ffa687d84c56ad5ca1b0ea993c45d3850d75
1 /*
2 * Copyright (C) 2000-2011 Free Software Foundation, Inc.
4 * Author: Nikos Mavrogiannopoulos
6 * This file is part of GnuTLS.
8 * The GnuTLS is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>
23 #ifndef HANDSHAKE_H
24 #define HANDSHAKE_H
26 typedef enum Optional
27 { OPTIONAL_PACKET, MANDATORY_PACKET } optional_t;
29 int _gnutls_send_handshake (gnutls_session_t session, mbuffer_st * bufel,
30 gnutls_handshake_description_t type);
31 int _gnutls_recv_hello_request (gnutls_session_t session, void *data,
32 uint32_t data_size);
33 int _gnutls_send_hello (gnutls_session_t session, int again);
34 int _gnutls_recv_hello (gnutls_session_t session, opaque * data, int datalen);
35 int _gnutls_recv_handshake (gnutls_session_t session,
36 gnutls_handshake_description_t type,
37 optional_t optional, gnutls_buffer_st* buf);
38 int _gnutls_generate_session_id (opaque * session_id, uint8_t * len);
39 int _gnutls_handshake_common (gnutls_session_t session);
40 int _gnutls_handshake_client (gnutls_session_t session);
41 int _gnutls_handshake_server (gnutls_session_t session);
42 void _gnutls_set_server_random (gnutls_session_t session, uint8_t * rnd);
43 void _gnutls_set_client_random (gnutls_session_t session, uint8_t * rnd);
44 int _gnutls_tls_create_random (opaque * dst);
46 int _gnutls_find_pk_algos_in_ciphersuites (opaque * data, int datalen);
47 int _gnutls_server_select_suite (gnutls_session_t session, opaque * data,
48 int datalen);
50 int _gnutls_negotiate_version (gnutls_session_t session,
51 gnutls_protocol_t adv_version);
52 int _gnutls_user_hello_func (gnutls_session_t session,
53 gnutls_protocol_t adv_version);
55 void _gnutls_handshake_hash_buffers_clear (gnutls_session_t session);
57 #define STATE session->internals.handshake_state
58 /* This returns true if we have got there
59 * before (and not finished due to an interrupt).
61 #define AGAIN(target) (STATE==target?1:0)
62 #define AGAIN2(state, target) (state==target?1:0)
64 #endif