~ubuntu-branches/ubuntu/raring/sip-tester/raring

« back to all changes in this revision

Viewing changes to sslcommon.h

  • Committer: Bazaar Package Importer
  • Author(s): ARAKI Yasuhiro
  • Date: 2005-04-11 11:53:53 UTC
  • Revision ID: james.westby@ubuntu.com-20050411115353-o33qn3noyjwjgnpd
Tags: upstream-1.1rc1
ImportĀ upstreamĀ versionĀ 1.1rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  This program is free software; you can redistribute it and/or modify
 
3
 *  it under the terms of the GNU General Public License as published by
 
4
 *  the Free Software Foundation; either version 2 of the License, or
 
5
 *  (at your option) any later version.
 
6
 *
 
7
 *  This program is distributed in the hope that it will be useful,
 
8
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
 *  GNU General Public License for more details.
 
11
 *
 
12
 *  You should have received a copy of the GNU General Public License
 
13
 *  along with this program; if not, write to the Free Software
 
14
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
 *
 
16
 *  Author : Gundu RAO - 16 Jul 2004
 
17
 *           From Hewlett Packard Company.
 
18
 */
 
19
#ifndef _ccnv_2_common_h_H
 
20
#define _ccnv_2_common_h_H
 
21
 
 
22
#include <openssl/bio.h>
 
23
#include <openssl/err.h>
 
24
#include <openssl/rand.h>
 
25
#include <openssl/ssl.h>
 
26
#include <openssl/x509v3.h>
 
27
#include <pthread.h>
 
28
 
 
29
#define MUTEX_TYPE pthread_mutex_t
 
30
#define MUTEX_SETUP(x) pthread_mutex_init(&(x), NULL)
 
31
#define MUTEX_CLEANUP(x) pthread_mutex_destroy(&(x))
 
32
#define MUTEX_LOCK(x) pthread_mutex_lock(&(x))
 
33
#define MUTEX_UNLOCK(x) pthread_mutex_unlock(&(x))
 
34
#define THREAD_ID pthread_self( )
 
35
 
 
36
/*
 
37
**      Define a global variable for the SSL context
 
38
*/
 
39
 
 
40
#define        CERTFILE "cacert.pem"
 
41
#define        PRIVATE_KEY_FILE "cakey.pem"
 
42
 
 
43
/* Initialises an SSL context and makes the lib thread safe */
 
44
#ifdef __cplusplus
 
45
extern "C" {
 
46
#endif
 
47
 
 
48
#ifndef SSL_MAIN
 
49
  extern
 
50
#endif
 
51
  int init_OpenSSL(void);
 
52
 
 
53
#ifndef SSL_MAIN
 
54
  extern
 
55
#endif
 
56
  int Thread_setup(void);
 
57
 
 
58
#ifndef SSL_MAIN
 
59
  extern
 
60
#endif
 
61
  SSL_CTX *setup_ssl_context(SSL_METHOD *);
 
62
 
 
63
#ifndef SSL_MAIN
 
64
  extern
 
65
#endif
 
66
  int SSL_ERROR(void);
 
67
 
 
68
#ifndef SSL_MAIN
 
69
//  extern
 
70
#endif
 
71
//    int createAuthHeader(char * user, char * password, char * method, char * uri, char * msgbody, char * auth, char * result);
 
72
 
 
73
#ifdef __cplusplus
 
74
}
 
75
#endif
 
76
 
 
77
#endif