forked from abort/Prowl-for-C
-
Notifications
You must be signed in to change notification settings - Fork 4
/
nma.h
64 lines (52 loc) · 1.27 KB
/
nma.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* nma.h
* nma
*
* Created by J. Dijkstra ([email protected]) on 29-04-10.
* Copyright 2010 Digitalise.NET. All rights reserved.
* Modified by Adriano Maia ([email protected]) on 4/17/2011.
*
*/
#ifndef NMA_H_
#define NMA_H_
#define STRICT
#define SSL_PORT 443
#define HOSTNAME "nma.usk.bz"
#define MESSAGESIZE 11400
#define BUFFERSIZE 512
/* priorities */
#define NMA_PRIORITY_VERY_LOW -2
#define NMA_PRIORITY_MODERATE -1
#define NMA_PRIORITY_NORMAL 0
#define NMA_PRIORITY_HIGH 1
#define NMA_PRIORITY_EMERGENCY 2
#ifdef _WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "ssleay32MT.lib")
#pragma comment(lib, "libeay32MT.lib")
#else
#define SOCKET int
#define SOCKET_ERROR -1
#define closesocket(socket) close(socket)
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#endif
#include <string.h>
#include <stdio.h>
#include <ctype.h>
/* openssl headers */
#include <openssl/ssl.h>
#include <openssl/err.h>
/* ssl/connection structure */
typedef struct {
SOCKET socket;
SSL* ssl_handle;
SSL_CTX* ssl_context;
} nma_connection;
int nma_push_msg(char* api_key, int priority, char* application_name, char* event_name, char* description);
#endif