-
Notifications
You must be signed in to change notification settings - Fork 0
/
samknowsDTMAPI.h
107 lines (80 loc) · 2.57 KB
/
samknowsDTMAPI.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
* Dated : 12/July/2018 , 16:50PM
* Author Amber Pachauri
* Purpose: This is Header file for library specific data
* to perform operations with CURL-library, and request to URL
* for diagnostics of Network activity - bandwith, lookup, connection etc.
*
*
* This file is implemented to support library interface - libsmknwsDTMAPI.so
*
*/
#ifndef __SMKWSDTMAPI_H_
#define __SMKWSDTMAPI_H_
#include <curl/curl.h>
typedef enum {
eSAMURLINFO_APPCONNECT_TIME = CURLINFO_APPCONNECT_TIME,
eSAMURLINFO_CONNECT_TIME = CURLINFO_CONNECT_TIME,
eSAMURLINFO_NAMELOKUP_TIME = CURLINFO_NAMELOOKUP_TIME,
eSAMURLINFO_TRANSFER_TIME = CURLINFO_PRETRANSFER_TIME,
eSAMURLINFO_REDIRECT_TIME = CURLINFO_REDIRECT_TIME,
eSAMURLINFO_START_TIME = CURLINFO_STARTTRANSFER_TIME,
/* ... */
eSAMURLINFO_TOTAL_TIME = CURLINFO_TOTAL_TIME,
/* ... */
eSAMURLINFO_SPEED_DOWNLOAD = CURLINFO_SPEED_DOWNLOAD,
eSAMURLINFO_SIZE_DOWNLOAD = CURLINFO_SIZE_DOWNLOAD,
/* ... */
/* ... */
}tesamknowsUrlInfo;
typedef enum {
eSAMURLOPT_URL = 0x0300,
/* ... */
/* ... */
eSAMURLOPT_ERRBUFFER = 0x0020,
eSAMURLOPT_STDERR = 0x0400, //= CURLOPT_STDERR,
/* ... */
/* ... */
eSAMURLOPT_MAX = 0xFFFF
}tesamknowsOptNetwork;
//typedef enum { eSAMKNWSSTATUS_OK = 0, eSAMKNWSSTATUS_ERR = -1 } esamknwsDTMAPIStatus;
/* pre-defined struct header */
//
//struct CURLMsg {
// CURLMSG msg; /* what this message means */
// CURL *easy_handle; /* the handle it concerns */
// union {
// void *whatever; /* message-specific data */
// CURLcode result; /* return code for transfer */
// } data;
// };
/*library structure internal*/
typedef struct __st_curlinfo {
double dconnect;
double dappconnect;
double dnmlookup;
double dpretransfer;
double dtransfer;
double dredirect;
double dspeed;
double dsize;
double dtime;
/* ... */
/* ... */
}CURLInfo;
/*library structure internal*/
typedef struct __st_samknowsDTMAPI {
CURL *pcurl;
CURLcode curlcode;
CURLMsg curlmessage;
CURLInfo curlinfo;
void *message;
void *error;
int status;
int msglen;
char **headers;
struct curl_slist *curlheader;
char curlbufferr[CURL_ERROR_SIZE];
char url[256];
} st_samknowsDTMAPI;
#endif