97 changed files with 4158 additions and 10716 deletions
@ -1,17 +0,0 @@
|
||||
name: badstrings |
||||
on: [pull_request, push] |
||||
jobs: |
||||
badstrings: |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: scanning commit message for bad strings |
||||
run: | |
||||
#!/bin/bash |
||||
set -euo pipefail |
||||
IFS=$'\n\t' |
||||
message="${{ github.event.head_commit.message }}" |
||||
|
||||
strings=($(curl -s https://raw.githubusercontent.com/someara/badstrings/main/strings.txt)) |
||||
for i in ${strings[@]} ; do |
||||
echo "${message}" | grep -v "$i" &>/dev/null; |
||||
done |
||||
File diff suppressed because it is too large
Load Diff
@ -1,77 +0,0 @@
|
||||
#ifndef __CURL_CURLVER_H |
||||
#define __CURL_CURLVER_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */ |
||||
|
||||
/* This is the global package copyright */ |
||||
#define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, <daniel@haxx.se>." |
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */ |
||||
#define LIBCURL_VERSION "7.58.0" |
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */ |
||||
#define LIBCURL_VERSION_MAJOR 7 |
||||
#define LIBCURL_VERSION_MINOR 58 |
||||
#define LIBCURL_VERSION_PATCH 0 |
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will |
||||
always follow this syntax: |
||||
|
||||
0xXXYYZZ |
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in |
||||
hexadecimal (using 8 bits each). All three numbers are always represented |
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7 |
||||
appears as "0x090b07". |
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number, |
||||
and it is always a greater number in a more recent release. It makes |
||||
comparisons with greater than and less than work. |
||||
|
||||
Note: This define is the full hex number and _does not_ use the |
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it |
||||
and needs it to contain the full number. |
||||
*/ |
||||
#define LIBCURL_VERSION_NUM 0x073a00 |
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The |
||||
* timestamp is not stored in git, as the timestamp is properly set in the |
||||
* tarballs by the maketgz script. |
||||
* |
||||
* The format of the date follows this template: |
||||
* |
||||
* "2007-11-23" |
||||
*/ |
||||
#define LIBCURL_TIMESTAMP "2018-01-24" |
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) |
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \ |
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) |
||||
|
||||
#endif /* __CURL_CURLVER_H */ |
||||
@ -1,102 +0,0 @@
|
||||
#ifndef __CURL_EASY_H |
||||
#define __CURL_EASY_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void); |
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); |
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); |
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl); |
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Request internal information from the curl session with this function. The |
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a |
||||
* pointer to a double (as the documentation describes elsewhere). The data |
||||
* pointed to will be filled in accordingly and can be relied upon only if the |
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a |
||||
* performed transfer, all results from this function are undefined until the |
||||
* transfer is completed. |
||||
*/ |
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); |
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Creates a new curl session handle with the same options set for the handle |
||||
* passed in. Duplicating a handle could only be a matter of cloning data and |
||||
* options, internal state info and things like persistent connections cannot |
||||
* be transferred. It is useful in multithreaded applications when you can run |
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical |
||||
* curl_easy_setopt() invokes in every thread. |
||||
*/ |
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl); |
||||
|
||||
/*
|
||||
* NAME curl_easy_reset() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Re-initializes a CURL handle to the default values. This puts back the |
||||
* handle to the same state as it was in when it was just created. |
||||
* |
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the |
||||
* cookies. |
||||
*/ |
||||
CURL_EXTERN void curl_easy_reset(CURL *curl); |
||||
|
||||
/*
|
||||
* NAME curl_easy_recv() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Receives data from the connected socket. Use after successful |
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option. |
||||
*/ |
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, |
||||
size_t *n); |
||||
|
||||
/*
|
||||
* NAME curl_easy_send() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Sends data over the connected socket. Use after successful |
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option. |
||||
*/ |
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, |
||||
size_t buflen, size_t *n); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif |
||||
@ -1,50 +0,0 @@
|
||||
#ifndef __CURL_MPRINTF_H |
||||
#define __CURL_MPRINTF_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
#include <stdarg.h> |
||||
#include <stdio.h> /* needed for FILE */ |
||||
#include "curl.h" /* for CURL_EXTERN */ |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...); |
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); |
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); |
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, |
||||
const char *format, ...); |
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args); |
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); |
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); |
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, |
||||
const char *format, va_list args); |
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...); |
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* __CURL_MPRINTF_H */ |
||||
@ -1,439 +0,0 @@
|
||||
#ifndef __CURL_MULTI_H |
||||
#define __CURL_MULTI_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
/*
|
||||
This is an "external" header file. Don't give away any internals here! |
||||
|
||||
GOALS |
||||
|
||||
o Enable a "pull" interface. The application that uses libcurl decides where |
||||
and when to ask libcurl to get/send data. |
||||
|
||||
o Enable multiple simultaneous transfers in the same thread without making it |
||||
complicated for the application. |
||||
|
||||
o Enable the application to select() on its own file descriptors and curl's |
||||
file descriptors simultaneous easily. |
||||
|
||||
*/ |
||||
|
||||
/*
|
||||
* This header file should not really need to include "curl.h" since curl.h |
||||
* itself includes this file and we expect user applications to do #include |
||||
* <curl/curl.h> without the need for especially including multi.h. |
||||
* |
||||
* For some reason we added this include here at one point, and rather than to |
||||
* break existing (wrongly written) libcurl applications, we leave it as-is |
||||
* but with this warning attached. |
||||
*/ |
||||
#include "curl.h" |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) |
||||
typedef struct Curl_multi CURLM; |
||||
#else |
||||
typedef void CURLM; |
||||
#endif |
||||
|
||||
typedef enum { |
||||
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
|
||||
curl_multi_socket*() soon */ |
||||
CURLM_OK, |
||||
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ |
||||
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ |
||||
CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ |
||||
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ |
||||
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ |
||||
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ |
||||
CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
|
||||
attempted to get added - again */ |
||||
CURLM_LAST |
||||
} CURLMcode; |
||||
|
||||
/* just to make code nicer when using curl_multi_socket() you can now check
|
||||
for CURLM_CALL_MULTI_SOCKET too in the same style it works for |
||||
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ |
||||
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM |
||||
|
||||
/* bitmask bits for CURLMOPT_PIPELINING */ |
||||
#define CURLPIPE_NOTHING 0L |
||||
#define CURLPIPE_HTTP1 1L |
||||
#define CURLPIPE_MULTIPLEX 2L |
||||
|
||||
typedef enum { |
||||
CURLMSG_NONE, /* first, not used */ |
||||
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
|
||||
the CURLcode of the transfer */ |
||||
CURLMSG_LAST /* last, not used */ |
||||
} CURLMSG; |
||||
|
||||
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; |
||||
}; |
||||
typedef struct CURLMsg CURLMsg; |
||||
|
||||
/* Based on poll(2) structure and values.
|
||||
* We don't use pollfd and POLL* constants explicitly |
||||
* to cover platforms without poll(). */ |
||||
#define CURL_WAIT_POLLIN 0x0001 |
||||
#define CURL_WAIT_POLLPRI 0x0002 |
||||
#define CURL_WAIT_POLLOUT 0x0004 |
||||
|
||||
struct curl_waitfd { |
||||
curl_socket_t fd; |
||||
short events; |
||||
short revents; /* not supported yet */ |
||||
}; |
||||
|
||||
/*
|
||||
* Name: curl_multi_init() |
||||
* |
||||
* Desc: inititalize multi-style curl usage |
||||
* |
||||
* Returns: a new CURLM handle to use in all 'curl_multi' functions. |
||||
*/ |
||||
CURL_EXTERN CURLM *curl_multi_init(void); |
||||
|
||||
/*
|
||||
* Name: curl_multi_add_handle() |
||||
* |
||||
* Desc: add a standard curl handle to the multi stack |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, |
||||
CURL *curl_handle); |
||||
|
||||
/*
|
||||
* Name: curl_multi_remove_handle() |
||||
* |
||||
* Desc: removes a curl handle from the multi stack again |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, |
||||
CURL *curl_handle); |
||||
|
||||
/*
|
||||
* Name: curl_multi_fdset() |
||||
* |
||||
* Desc: Ask curl for its fd_set sets. The app can use these to select() or |
||||
* poll() on. We want curl_multi_perform() called as soon as one of |
||||
* them are ready. |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, |
||||
fd_set *read_fd_set, |
||||
fd_set *write_fd_set, |
||||
fd_set *exc_fd_set, |
||||
int *max_fd); |
||||
|
||||
/*
|
||||
* Name: curl_multi_wait() |
||||
* |
||||
* Desc: Poll on all fds within a CURLM set as well as any |
||||
* additional fds passed to the function. |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, |
||||
struct curl_waitfd extra_fds[], |
||||
unsigned int extra_nfds, |
||||
int timeout_ms, |
||||
int *ret); |
||||
|
||||
/*
|
||||
* Name: curl_multi_perform() |
||||
* |
||||
* Desc: When the app thinks there's data available for curl it calls this |
||||
* function to read/write whatever there is right now. This returns |
||||
* as soon as the reads and writes are done. This function does not |
||||
* require that there actually is data available for reading or that |
||||
* data can be written, it can be called just in case. It returns |
||||
* the number of handles that still transfer data in the second |
||||
* argument's integer-pointer. |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. *NOTE* that this only |
||||
* returns errors etc regarding the whole multi stack. There might |
||||
* still have occurred problems on invidual transfers even when this |
||||
* returns OK. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, |
||||
int *running_handles); |
||||
|
||||
/*
|
||||
* Name: curl_multi_cleanup() |
||||
* |
||||
* Desc: Cleans up and removes a whole multi stack. It does not free or |
||||
* touch any individual easy handles in any way. We need to define |
||||
* in what state those handles will be if this function is called |
||||
* in the middle of a transfer. |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); |
||||
|
||||
/*
|
||||
* Name: curl_multi_info_read() |
||||
* |
||||
* Desc: Ask the multi handle if there's any messages/informationals from |
||||
* the individual transfers. Messages include informationals such as |
||||
* error code from the transfer or just the fact that a transfer is |
||||
* completed. More details on these should be written down as well. |
||||
* |
||||
* Repeated calls to this function will return a new struct each |
||||
* time, until a special "end of msgs" struct is returned as a signal |
||||
* that there is no more to get at this point. |
||||
* |
||||
* The data the returned pointer points to will not survive calling |
||||
* curl_multi_cleanup(). |
||||
* |
||||
* The 'CURLMsg' struct is meant to be very simple and only contain |
||||
* very basic information. If more involved information is wanted, |
||||
* we will provide the particular "transfer handle" in that struct |
||||
* and that should/could/would be used in subsequent |
||||
* curl_easy_getinfo() calls (or similar). The point being that we |
||||
* must never expose complex structs to applications, as then we'll |
||||
* undoubtably get backwards compatibility problems in the future. |
||||
* |
||||
* Returns: A pointer to a filled-in struct, or NULL if it failed or ran out |
||||
* of structs. It also writes the number of messages left in the |
||||
* queue (after this read) in the integer the second argument points |
||||
* to. |
||||
*/ |
||||
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, |
||||
int *msgs_in_queue); |
||||
|
||||
/*
|
||||
* Name: curl_multi_strerror() |
||||
* |
||||
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode |
||||
* value into the equivalent human readable error string. This is |
||||
* useful for printing meaningful error messages. |
||||
* |
||||
* Returns: A pointer to a zero-terminated error message. |
||||
*/ |
||||
CURL_EXTERN const char *curl_multi_strerror(CURLMcode); |
||||
|
||||
/*
|
||||
* Name: curl_multi_socket() and |
||||
* curl_multi_socket_all() |
||||
* |
||||
* Desc: An alternative version of curl_multi_perform() that allows the |
||||
* application to pass in one of the file descriptors that have been |
||||
* detected to have "action" on them and let libcurl perform. |
||||
* See man page for details. |
||||
*/ |
||||
#define CURL_POLL_NONE 0 |
||||
#define CURL_POLL_IN 1 |
||||
#define CURL_POLL_OUT 2 |
||||
#define CURL_POLL_INOUT 3 |
||||
#define CURL_POLL_REMOVE 4 |
||||
|
||||
#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD |
||||
|
||||
#define CURL_CSELECT_IN 0x01 |
||||
#define CURL_CSELECT_OUT 0x02 |
||||
#define CURL_CSELECT_ERR 0x04 |
||||
|
||||
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ |
||||
curl_socket_t s, /* socket */ |
||||
int what, /* see above */ |
||||
void *userp, /* private callback
|
||||
pointer */ |
||||
void *socketp); /* private socket
|
||||
pointer */ |
||||
/*
|
||||
* Name: curl_multi_timer_callback |
||||
* |
||||
* Desc: Called by libcurl whenever the library detects a change in the |
||||
* maximum number of milliseconds the app is allowed to wait before |
||||
* curl_multi_socket() or curl_multi_perform() must be called |
||||
* (to allow libcurl's timed events to take place). |
||||
* |
||||
* Returns: The callback should return zero. |
||||
*/ |
||||
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ |
||||
long timeout_ms, /* see above */ |
||||
void *userp); /* private callback
|
||||
pointer */ |
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, |
||||
int *running_handles); |
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, |
||||
curl_socket_t s, |
||||
int ev_bitmask, |
||||
int *running_handles); |
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, |
||||
int *running_handles); |
||||
|
||||
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET |
||||
/* This macro below was added in 7.16.3 to push users who recompile to use
|
||||
the new curl_multi_socket_action() instead of the old curl_multi_socket() |
||||
*/ |
||||
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) |
||||
#endif |
||||
|
||||
/*
|
||||
* Name: curl_multi_timeout() |
||||
* |
||||
* Desc: Returns the maximum number of milliseconds the app is allowed to |
||||
* wait before curl_multi_socket() or curl_multi_perform() must be |
||||
* called (to allow libcurl's timed events to take place). |
||||
* |
||||
* Returns: CURLM error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, |
||||
long *milliseconds); |
||||
|
||||
#undef CINIT /* re-using the same name as in curl.h */ |
||||
|
||||
#ifdef CURL_ISOCPP |
||||
#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num |
||||
#else |
||||
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ |
||||
#define LONG CURLOPTTYPE_LONG |
||||
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT |
||||
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT |
||||
#define OFF_T CURLOPTTYPE_OFF_T |
||||
#define CINIT(name,type,number) CURLMOPT_/**/name = type + number |
||||
#endif |
||||
|
||||
typedef enum { |
||||
/* This is the socket callback function pointer */ |
||||
CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), |
||||
|
||||
/* This is the argument passed to the socket callback */ |
||||
CINIT(SOCKETDATA, OBJECTPOINT, 2), |
||||
|
||||
/* set to 1 to enable pipelining for this multi handle */ |
||||
CINIT(PIPELINING, LONG, 3), |
||||
|
||||
/* This is the timer callback function pointer */ |
||||
CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), |
||||
|
||||
/* This is the argument passed to the timer callback */ |
||||
CINIT(TIMERDATA, OBJECTPOINT, 5), |
||||
|
||||
/* maximum number of entries in the connection cache */ |
||||
CINIT(MAXCONNECTS, LONG, 6), |
||||
|
||||
/* maximum number of (pipelining) connections to one host */ |
||||
CINIT(MAX_HOST_CONNECTIONS, LONG, 7), |
||||
|
||||
/* maximum number of requests in a pipeline */ |
||||
CINIT(MAX_PIPELINE_LENGTH, LONG, 8), |
||||
|
||||
/* a connection with a content-length longer than this
|
||||
will not be considered for pipelining */ |
||||
CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9), |
||||
|
||||
/* a connection with a chunk length longer than this
|
||||
will not be considered for pipelining */ |
||||
CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10), |
||||
|
||||
/* a list of site names(+port) that are blacklisted from
|
||||
pipelining */ |
||||
CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11), |
||||
|
||||
/* a list of server types that are blacklisted from
|
||||
pipelining */ |
||||
CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12), |
||||
|
||||
/* maximum number of open connections in total */ |
||||
CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13), |
||||
|
||||
/* This is the server push callback function pointer */ |
||||
CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14), |
||||
|
||||
/* This is the argument passed to the server push callback */ |
||||
CINIT(PUSHDATA, OBJECTPOINT, 15), |
||||
|
||||
CURLMOPT_LASTENTRY /* the last unused */ |
||||
} CURLMoption; |
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_setopt() |
||||
* |
||||
* Desc: Sets options for the multi handle. |
||||
* |
||||
* Returns: CURLM error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, |
||||
CURLMoption option, ...); |
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_assign() |
||||
* |
||||
* Desc: This function sets an association in the multi handle between the |
||||
* given socket and a private pointer of the application. This is |
||||
* (only) useful for curl_multi_socket uses. |
||||
* |
||||
* Returns: CURLM error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, |
||||
curl_socket_t sockfd, void *sockp); |
||||
|
||||
|
||||
/*
|
||||
* Name: curl_push_callback |
||||
* |
||||
* Desc: This callback gets called when a new stream is being pushed by the |
||||
* server. It approves or denies the new stream. |
||||
* |
||||
* Returns: CURL_PUSH_OK or CURL_PUSH_DENY. |
||||
*/ |
||||
#define CURL_PUSH_OK 0 |
||||
#define CURL_PUSH_DENY 1 |
||||
|
||||
struct curl_pushheaders; /* forward declaration only */ |
||||
|
||||
CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h, |
||||
size_t num); |
||||
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h, |
||||
const char *name); |
||||
|
||||
typedef int (*curl_push_callback)(CURL *parent, |
||||
CURL *easy, |
||||
size_t num_headers, |
||||
struct curl_pushheaders *headers, |
||||
void *userp); |
||||
|
||||
#ifdef __cplusplus |
||||
} /* end of extern "C" */ |
||||
#endif |
||||
|
||||
#endif |
||||
@ -1,33 +0,0 @@
|
||||
#ifndef __STDC_HEADERS_H |
||||
#define __STDC_HEADERS_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
#include <sys/types.h> |
||||
|
||||
size_t fread(void *, size_t, size_t, FILE *); |
||||
size_t fwrite(const void *, size_t, size_t, FILE *); |
||||
|
||||
int strcasecmp(const char *, const char *); |
||||
int strncasecmp(const char *, const char *, size_t); |
||||
|
||||
#endif /* __STDC_HEADERS_H */ |
||||
@ -1,473 +0,0 @@
|
||||
#ifndef __CURL_SYSTEM_H |
||||
#define __CURL_SYSTEM_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
/*
|
||||
* Try to keep one section per platform, compiler and architecture, otherwise, |
||||
* if an existing section is reused for a different one and later on the |
||||
* original is adjusted, probably the piggybacking one can be adversely |
||||
* changed. |
||||
* |
||||
* In order to differentiate between platforms/compilers/architectures use |
||||
* only compiler built in predefined preprocessor symbols. |
||||
* |
||||
* curl_off_t |
||||
* ---------- |
||||
* |
||||
* For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit |
||||
* wide signed integral data type. The width of this data type must remain |
||||
* constant and independent of any possible large file support settings. |
||||
* |
||||
* As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit |
||||
* wide signed integral data type if there is no 64-bit type. |
||||
* |
||||
* As a general rule, curl_off_t shall not be mapped to off_t. This rule shall |
||||
* only be violated if off_t is the only 64-bit data type available and the |
||||
* size of off_t is independent of large file support settings. Keep your |
||||
* build on the safe side avoiding an off_t gating. If you have a 64-bit |
||||
* off_t then take for sure that another 64-bit data type exists, dig deeper |
||||
* and you will find it. |
||||
* |
||||
*/ |
||||
|
||||
#if defined(__DJGPP__) || defined(__GO32__) |
||||
# if defined(__DJGPP__) && (__DJGPP__ > 1) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__SALFORDC__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__BORLANDC__) |
||||
# if (__BORLANDC__ < 0x520) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__TURBOC__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__WATCOMC__) |
||||
# if defined(__386__) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__POCC__) |
||||
# if (__POCC__ < 280) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# elif defined(_MSC_VER) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__LCC__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__SYMBIAN32__) |
||||
# if defined(__EABI__) /* Treat all ARM compilers equally */ |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(__CW32__) |
||||
# pragma longlong on |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(__VC32__) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int |
||||
|
||||
#elif defined(__MWERKS__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(_WIN32_WCE) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__MINGW32__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_WS2TCPIP_H 1 |
||||
|
||||
#elif defined(__VMS) |
||||
# if defined(__VAX) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int |
||||
|
||||
#elif defined(__OS400__) |
||||
# if defined(__ILEC400__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
# endif |
||||
|
||||
#elif defined(__MVS__) |
||||
# if defined(__IBMC__) || defined(__IBMCPP__) |
||||
# if defined(_ILP32) |
||||
# elif defined(_LP64) |
||||
# endif |
||||
# if defined(_LONG_LONG) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(_LP64) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
# endif |
||||
|
||||
#elif defined(__370__) |
||||
# if defined(__IBMC__) || defined(__IBMCPP__) |
||||
# if defined(_ILP32) |
||||
# elif defined(_LP64) |
||||
# endif |
||||
# if defined(_LONG_LONG) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(_LP64) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
# endif |
||||
|
||||
#elif defined(TPF) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__TINYC__) /* also known as tcc */ |
||||
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
|
||||
#elif defined(__SUNPRO_C) /* Oracle Solaris Studio */ |
||||
# if !defined(__LP64) && (defined(__ILP32) || \ |
||||
defined(__i386) || defined(__sparcv8)) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(__LP64) || \ |
||||
defined(__amd64) || defined(__sparcv9) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
|
||||
/* ===================================== */ |
||||
/* KEEP MSVC THE PENULTIMATE ENTRY */ |
||||
/* ===================================== */ |
||||
|
||||
#elif defined(_MSC_VER) |
||||
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
/* ===================================== */ |
||||
/* KEEP GENERIC GCC THE LAST ENTRY */ |
||||
/* ===================================== */ |
||||
|
||||
#elif defined(__GNUC__) |
||||
# if !defined(__LP64__) && \ |
||||
(defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \
|
||||
defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \
|
||||
defined(__sparc__) || defined(__mips__) || defined(__sh__) || \
|
||||
defined(__XTENSA__) || \
|
||||
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \
|
||||
(defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L)) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(__LP64__) || \ |
||||
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
|
||||
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \
|
||||
(defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
|
||||
#else |
||||
/* generic "safe guess" on old 32 bit style */ |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
#endif |
||||
|
||||
#ifdef _AIX |
||||
/* AIX needs <sys/poll.h> */ |
||||
#define CURL_PULL_SYS_POLL_H |
||||
#endif |
||||
|
||||
|
||||
/* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */ |
||||
/* ws2tcpip.h is required here to properly make type definitions below. */ |
||||
#ifdef CURL_PULL_WS2TCPIP_H |
||||
# include <winsock2.h> |
||||
# include <windows.h> |
||||
# include <ws2tcpip.h> |
||||
#endif |
||||
|
||||
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */ |
||||
/* sys/types.h is required here to properly make type definitions below. */ |
||||
#ifdef CURL_PULL_SYS_TYPES_H |
||||
# include <sys/types.h> |
||||
#endif |
||||
|
||||
/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ |
||||
/* sys/socket.h is required here to properly make type definitions below. */ |
||||
#ifdef CURL_PULL_SYS_SOCKET_H |
||||
# include <sys/socket.h> |
||||
#endif |
||||
|
||||
/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */ |
||||
/* sys/poll.h is required here to properly make type definitions below. */ |
||||
#ifdef CURL_PULL_SYS_POLL_H |
||||
# include <sys/poll.h> |
||||
#endif |
||||
|
||||
/* Data type definition of curl_socklen_t. */ |
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T |
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; |
||||
#endif |
||||
|
||||
/* Data type definition of curl_off_t. */ |
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T |
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; |
||||
#endif |
||||
|
||||
/*
|
||||
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow |
||||
* these to be visible and exported by the external libcurl interface API, |
||||
* while also making them visible to the library internals, simply including |
||||
* curl_setup.h, without actually needing to include curl.h internally. |
||||
* If some day this section would grow big enough, all this should be moved |
||||
* to its own header file. |
||||
*/ |
||||
|
||||
/*
|
||||
* Figure out if we can use the ## preprocessor operator, which is supported |
||||
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ |
||||
* or __cplusplus so we need to carefully check for them too. |
||||
*/ |
||||
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ |
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
|
||||
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
|
||||
defined(__ILEC400__) |
||||
/* This compiler is believed to have an ISO compatible preprocessor */ |
||||
#define CURL_ISOCPP |
||||
#else |
||||
/* This compiler is believed NOT to have an ISO compatible preprocessor */ |
||||
#undef CURL_ISOCPP |
||||
#endif |
||||
|
||||
/*
|
||||
* Macros for minimum-width signed and unsigned curl_off_t integer constants. |
||||
*/ |
||||
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551) |
||||
# define __CURL_OFF_T_C_HLPR2(x) x |
||||
# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x) |
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ |
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T) |
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ |
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU) |
||||
#else |
||||
# ifdef CURL_ISOCPP |
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix |
||||
# else |
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix |
||||
# endif |
||||
# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix) |
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T) |
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU) |
||||
#endif |
||||
|
||||
#endif /* __CURL_SYSTEM_H */ |
||||
@ -1,683 +0,0 @@
|
||||
#ifndef __CURL_TYPECHECK_GCC_H |
||||
#define __CURL_TYPECHECK_GCC_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
/* wraps curl_easy_setopt() with typechecking */ |
||||
|
||||
/* To add a new kind of warning, add an
|
||||
* if(_curl_is_sometype_option(_curl_opt)) |
||||
* if(!_curl_is_sometype(value)) |
||||
* _curl_easy_setopt_err_sometype(); |
||||
* block and define _curl_is_sometype_option, _curl_is_sometype and |
||||
* _curl_easy_setopt_err_sometype below |
||||
* |
||||
* NOTE: We use two nested 'if' statements here instead of the && operator, in |
||||
* order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x |
||||
* when compiling with -Wlogical-op. |
||||
* |
||||
* To add an option that uses the same type as an existing option, you'll just |
||||
* need to extend the appropriate _curl_*_option macro |
||||
*/ |
||||
#define curl_easy_setopt(handle, option, value) \ |
||||
__extension__ ({ \
|
||||
__typeof__(option) _curl_opt = option; \
|
||||
if(__builtin_constant_p(_curl_opt)) { \
|
||||
if(_curl_is_long_option(_curl_opt)) \
|
||||
if(!_curl_is_long(value)) \
|
||||
_curl_easy_setopt_err_long(); \
|
||||
if(_curl_is_off_t_option(_curl_opt)) \
|
||||
if(!_curl_is_off_t(value)) \
|
||||
_curl_easy_setopt_err_curl_off_t(); \
|
||||
if(_curl_is_string_option(_curl_opt)) \
|
||||
if(!_curl_is_string(value)) \
|
||||
_curl_easy_setopt_err_string(); \
|
||||
if(_curl_is_write_cb_option(_curl_opt)) \
|
||||
if(!_curl_is_write_cb(value)) \
|
||||
_curl_easy_setopt_err_write_callback(); \
|
||||
if((_curl_opt) == CURLOPT_READFUNCTION) \
|
||||
if(!_curl_is_read_cb(value)) \
|
||||
_curl_easy_setopt_err_read_cb(); \
|
||||
if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
|
||||
if(!_curl_is_ioctl_cb(value)) \
|
||||
_curl_easy_setopt_err_ioctl_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
|
||||
if(!_curl_is_sockopt_cb(value)) \
|
||||
_curl_easy_setopt_err_sockopt_cb(); \
|
||||
if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
|
||||
if(!_curl_is_opensocket_cb(value)) \
|
||||
_curl_easy_setopt_err_opensocket_cb(); \
|
||||
if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
|
||||
if(!_curl_is_progress_cb(value)) \
|
||||
_curl_easy_setopt_err_progress_cb(); \
|
||||
if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
|
||||
if(!_curl_is_debug_cb(value)) \
|
||||
_curl_easy_setopt_err_debug_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
|
||||
if(!_curl_is_ssl_ctx_cb(value)) \
|
||||
_curl_easy_setopt_err_ssl_ctx_cb(); \
|
||||
if(_curl_is_conv_cb_option(_curl_opt)) \
|
||||
if(!_curl_is_conv_cb(value)) \
|
||||
_curl_easy_setopt_err_conv_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
|
||||
if(!_curl_is_seek_cb(value)) \
|
||||
_curl_easy_setopt_err_seek_cb(); \
|
||||
if(_curl_is_cb_data_option(_curl_opt)) \
|
||||
if(!_curl_is_cb_data(value)) \
|
||||
_curl_easy_setopt_err_cb_data(); \
|
||||
if((_curl_opt) == CURLOPT_ERRORBUFFER) \
|
||||
if(!_curl_is_error_buffer(value)) \
|
||||
_curl_easy_setopt_err_error_buffer(); \
|
||||
if((_curl_opt) == CURLOPT_STDERR) \
|
||||
if(!_curl_is_FILE(value)) \
|
||||
_curl_easy_setopt_err_FILE(); \
|
||||
if(_curl_is_postfields_option(_curl_opt)) \
|
||||
if(!_curl_is_postfields(value)) \
|
||||
_curl_easy_setopt_err_postfields(); \
|
||||
if((_curl_opt) == CURLOPT_HTTPPOST) \
|
||||
if(!_curl_is_arr((value), struct curl_httppost)) \
|
||||
_curl_easy_setopt_err_curl_httpost(); \
|
||||
if((_curl_opt) == CURLOPT_MIMEPOST) \
|
||||
if(!_curl_is_ptr((value), curl_mime)) \
|
||||
_curl_easy_setopt_err_curl_mimepost(); \
|
||||
if(_curl_is_slist_option(_curl_opt)) \
|
||||
if(!_curl_is_arr((value), struct curl_slist)) \
|
||||
_curl_easy_setopt_err_curl_slist(); \
|
||||
if((_curl_opt) == CURLOPT_SHARE) \
|
||||
if(!_curl_is_ptr((value), CURLSH)) \
|
||||
_curl_easy_setopt_err_CURLSH(); \
|
||||
} \
|
||||
curl_easy_setopt(handle, _curl_opt, value); \
|
||||
}) |
||||
|
||||
/* wraps curl_easy_getinfo() with typechecking */ |
||||
/* FIXME: don't allow const pointers */ |
||||
#define curl_easy_getinfo(handle, info, arg) \ |
||||
__extension__ ({ \
|
||||
__typeof__(info) _curl_info = info; \
|
||||
if(__builtin_constant_p(_curl_info)) { \
|
||||
if(_curl_is_string_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), char *)) \
|
||||
_curl_easy_getinfo_err_string(); \
|
||||
if(_curl_is_long_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), long)) \
|
||||
_curl_easy_getinfo_err_long(); \
|
||||
if(_curl_is_double_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), double)) \
|
||||
_curl_easy_getinfo_err_double(); \
|
||||
if(_curl_is_slist_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_slist *)) \
|
||||
_curl_easy_getinfo_err_curl_slist(); \
|
||||
if(_curl_is_tlssessioninfo_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_tlssessioninfo *)) \
|
||||
_curl_easy_getinfo_err_curl_tlssesssioninfo(); \
|
||||
if(_curl_is_certinfo_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_certinfo *)) \
|
||||
_curl_easy_getinfo_err_curl_certinfo(); \
|
||||
if(_curl_is_socket_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), curl_socket_t)) \
|
||||
_curl_easy_getinfo_err_curl_socket(); \
|
||||
if(_curl_is_off_t_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), curl_off_t)) \
|
||||
_curl_easy_getinfo_err_curl_off_t(); \
|
||||
} \
|
||||
curl_easy_getinfo(handle, _curl_info, arg); \
|
||||
}) |
||||
|
||||
/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),
|
||||
* for now just make sure that the functions are called with three |
||||
* arguments |
||||
*/ |
||||
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) |
||||
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) |
||||
|
||||
|
||||
/* the actual warnings, triggered by calling the _curl_easy_setopt_err*
|
||||
* functions */ |
||||
|
||||
/* To define a new warning, use _CURL_WARNING(identifier, "message") */ |
||||
#define _CURL_WARNING(id, message) \ |
||||
static void __attribute__((__warning__(message))) \
|
||||
__attribute__((__unused__)) __attribute__((__noinline__)) \
|
||||
id(void) { __asm__(""); } |
||||
|
||||
_CURL_WARNING(_curl_easy_setopt_err_long, |
||||
"curl_easy_setopt expects a long argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t, |
||||
"curl_easy_setopt expects a curl_off_t argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_string, |
||||
"curl_easy_setopt expects a " |
||||
"string ('char *' or char[]) argument for this option" |
||||
) |
||||
_CURL_WARNING(_curl_easy_setopt_err_write_callback, |
||||
"curl_easy_setopt expects a curl_write_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_read_cb, |
||||
"curl_easy_setopt expects a curl_read_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb, |
||||
"curl_easy_setopt expects a curl_ioctl_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb, |
||||
"curl_easy_setopt expects a curl_sockopt_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb, |
||||
"curl_easy_setopt expects a " |
||||
"curl_opensocket_callback argument for this option" |
||||
) |
||||
_CURL_WARNING(_curl_easy_setopt_err_progress_cb, |
||||
"curl_easy_setopt expects a curl_progress_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_debug_cb, |
||||
"curl_easy_setopt expects a curl_debug_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb, |
||||
"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_conv_cb, |
||||
"curl_easy_setopt expects a curl_conv_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_seek_cb, |
||||
"curl_easy_setopt expects a curl_seek_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_cb_data, |
||||
"curl_easy_setopt expects a " |
||||
"private data pointer as argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_error_buffer, |
||||
"curl_easy_setopt expects a " |
||||
"char buffer of CURL_ERROR_SIZE as argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_FILE, |
||||
"curl_easy_setopt expects a 'FILE *' argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_postfields, |
||||
"curl_easy_setopt expects a 'void *' or 'char *' argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost, |
||||
"curl_easy_setopt expects a 'struct curl_httppost *' " |
||||
"argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_mimepost, |
||||
"curl_easy_setopt expects a 'curl_mime *' " |
||||
"argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_slist, |
||||
"curl_easy_setopt expects a 'struct curl_slist *' argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_CURLSH, |
||||
"curl_easy_setopt expects a CURLSH* argument for this option") |
||||
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_string, |
||||
"curl_easy_getinfo expects a pointer to 'char *' for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_long, |
||||
"curl_easy_getinfo expects a pointer to long for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_double, |
||||
"curl_easy_getinfo expects a pointer to double for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist, |
||||
"curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo, |
||||
"curl_easy_getinfo expects a pointer to " |
||||
"'struct curl_tlssessioninfo *' for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_certinfo, |
||||
"curl_easy_getinfo expects a pointer to " |
||||
"'struct curl_certinfo *' for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_socket, |
||||
"curl_easy_getinfo expects a pointer to curl_socket_t for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_off_t, |
||||
"curl_easy_getinfo expects a pointer to curl_off_t for this info") |
||||
|
||||
/* groups of curl_easy_setops options that take the same type of argument */ |
||||
|
||||
/* To add a new option to one of the groups, just add
|
||||
* (option) == CURLOPT_SOMETHING |
||||
* to the or-expression. If the option takes a long or curl_off_t, you don't |
||||
* have to do anything |
||||
*/ |
||||
|
||||
/* evaluates to true if option takes a long argument */ |
||||
#define _curl_is_long_option(option) \ |
||||
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) |
||||
|
||||
#define _curl_is_off_t_option(option) \ |
||||
((option) > CURLOPTTYPE_OFF_T) |
||||
|
||||
/* evaluates to true if option takes a char* argument */ |
||||
#define _curl_is_string_option(option) \ |
||||
((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \
|
||||
(option) == CURLOPT_ACCEPT_ENCODING || \
|
||||
(option) == CURLOPT_CAINFO || \
|
||||
(option) == CURLOPT_CAPATH || \
|
||||
(option) == CURLOPT_COOKIE || \
|
||||
(option) == CURLOPT_COOKIEFILE || \
|
||||
(option) == CURLOPT_COOKIEJAR || \
|
||||
(option) == CURLOPT_COOKIELIST || \
|
||||
(option) == CURLOPT_CRLFILE || \
|
||||
(option) == CURLOPT_CUSTOMREQUEST || \
|
||||
(option) == CURLOPT_DEFAULT_PROTOCOL || \
|
||||
(option) == CURLOPT_DNS_INTERFACE || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP4 || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP6 || \
|
||||
(option) == CURLOPT_DNS_SERVERS || \
|
||||
(option) == CURLOPT_EGDSOCKET || \
|
||||
(option) == CURLOPT_FTPPORT || \
|
||||
(option) == CURLOPT_FTP_ACCOUNT || \
|
||||
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
|
||||
(option) == CURLOPT_INTERFACE || \
|
||||
(option) == CURLOPT_ISSUERCERT || \
|
||||
(option) == CURLOPT_KEYPASSWD || \
|
||||
(option) == CURLOPT_KRBLEVEL || \
|
||||
(option) == CURLOPT_LOGIN_OPTIONS || \
|
||||
(option) == CURLOPT_MAIL_AUTH || \
|
||||
(option) == CURLOPT_MAIL_FROM || \
|
||||
(option) == CURLOPT_NETRC_FILE || \
|
||||
(option) == CURLOPT_NOPROXY || \
|
||||
(option) == CURLOPT_PASSWORD || \
|
||||
(option) == CURLOPT_PINNEDPUBLICKEY || \
|
||||
(option) == CURLOPT_PRE_PROXY || \
|
||||
(option) == CURLOPT_PROXY || \
|
||||
(option) == CURLOPT_PROXYPASSWORD || \
|
||||
(option) == CURLOPT_PROXYUSERNAME || \
|
||||
(option) == CURLOPT_PROXYUSERPWD || \
|
||||
(option) == CURLOPT_PROXY_CAINFO || \
|
||||
(option) == CURLOPT_PROXY_CAPATH || \
|
||||
(option) == CURLOPT_PROXY_CRLFILE || \
|
||||
(option) == CURLOPT_PROXY_KEYPASSWD || \
|
||||
(option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \
|
||||
(option) == CURLOPT_PROXY_SERVICE_NAME || \
|
||||
(option) == CURLOPT_PROXY_SSLCERT || \
|
||||
(option) == CURLOPT_PROXY_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_PROXY_SSLKEY || \
|
||||
(option) == CURLOPT_PROXY_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_TYPE || \
|
||||
(option) == CURLOPT_RANDOM_FILE || \
|
||||
(option) == CURLOPT_RANGE || \
|
||||
(option) == CURLOPT_REFERER || \
|
||||
(option) == CURLOPT_RTSP_SESSION_ID || \
|
||||
(option) == CURLOPT_RTSP_STREAM_URI || \
|
||||
(option) == CURLOPT_RTSP_TRANSPORT || \
|
||||
(option) == CURLOPT_SERVICE_NAME || \
|
||||
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
||||
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
|
||||
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
||||
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
||||
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
|
||||
(option) == CURLOPT_SSLCERT || \
|
||||
(option) == CURLOPT_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_SSLENGINE || \
|
||||
(option) == CURLOPT_SSLKEY || \
|
||||
(option) == CURLOPT_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_TLSAUTH_PASSWORD || \
|
||||
(option) == CURLOPT_TLSAUTH_TYPE || \
|
||||
(option) == CURLOPT_TLSAUTH_USERNAME || \
|
||||
(option) == CURLOPT_UNIX_SOCKET_PATH || \
|
||||
(option) == CURLOPT_URL || \
|
||||
(option) == CURLOPT_USERAGENT || \
|
||||
(option) == CURLOPT_USERNAME || \
|
||||
(option) == CURLOPT_USERPWD || \
|
||||
(option) == CURLOPT_XOAUTH2_BEARER || \
|
||||
0) |
||||
|
||||
/* evaluates to true if option takes a curl_write_callback argument */ |
||||
#define _curl_is_write_cb_option(option) \ |
||||
((option) == CURLOPT_HEADERFUNCTION || \
|
||||
(option) == CURLOPT_WRITEFUNCTION) |
||||
|
||||
/* evaluates to true if option takes a curl_conv_callback argument */ |
||||
#define _curl_is_conv_cb_option(option) \ |
||||
((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) |
||||
|
||||
/* evaluates to true if option takes a data argument to pass to a callback */ |
||||
#define _curl_is_cb_data_option(option) \ |
||||
((option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_CLOSESOCKETDATA || \
|
||||
(option) == CURLOPT_DEBUGDATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
(option) == CURLOPT_HEADERDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PRIVATE || \
|
||||
(option) == CURLOPT_PROGRESSDATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_WRITEDATA || \
|
||||
0) |
||||
|
||||
/* evaluates to true if option takes a POST data argument (void* or char*) */ |
||||
#define _curl_is_postfields_option(option) \ |
||||
((option) == CURLOPT_POSTFIELDS || \
|
||||
(option) == CURLOPT_COPYPOSTFIELDS || \
|
||||
0) |
||||
|
||||
/* evaluates to true if option takes a struct curl_slist * argument */ |
||||
#define _curl_is_slist_option(option) \ |
||||
((option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_PROXYHEADER || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
(option) == CURLOPT_RESOLVE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
0) |
||||
|
||||
/* groups of curl_easy_getinfo infos that take the same type of argument */ |
||||
|
||||
/* evaluates to true if info expects a pointer to char * argument */ |
||||
#define _curl_is_string_info(info) \ |
||||
(CURLINFO_STRING < (info) && (info) < CURLINFO_LONG) |
||||
|
||||
/* evaluates to true if info expects a pointer to long argument */ |
||||
#define _curl_is_long_info(info) \ |
||||
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) |
||||
|
||||
/* evaluates to true if info expects a pointer to double argument */ |
||||
#define _curl_is_double_info(info) \ |
||||
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) |
||||
|
||||
/* true if info expects a pointer to struct curl_slist * argument */ |
||||
#define _curl_is_slist_info(info) \ |
||||
(((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST)) |
||||
|
||||
/* true if info expects a pointer to struct curl_tlssessioninfo * argument */ |
||||
#define _curl_is_tlssessioninfo_info(info) \ |
||||
(((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION)) |
||||
|
||||
/* true if info expects a pointer to struct curl_certinfo * argument */ |
||||
#define _curl_is_certinfo_info(info) ((info) == CURLINFO_CERTINFO) |
||||
|
||||
/* true if info expects a pointer to struct curl_socket_t argument */ |
||||
#define _curl_is_socket_info(info) \ |
||||
(CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T) |
||||
|
||||
/* true if info expects a pointer to curl_off_t argument */ |
||||
#define _curl_is_off_t_info(info) \ |
||||
(CURLINFO_OFF_T < (info)) |
||||
|
||||
|
||||
/* typecheck helpers -- check whether given expression has requested type*/ |
||||
|
||||
/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
|
||||
* otherwise define a new macro. Search for __builtin_types_compatible_p |
||||
* in the GCC manual. |
||||
* NOTE: these macros MUST NOT EVALUATE their arguments! The argument is |
||||
* the actual expression passed to the curl_easy_setopt macro. This |
||||
* means that you can only apply the sizeof and __typeof__ operators, no |
||||
* == or whatsoever. |
||||
*/ |
||||
|
||||
/* XXX: should evaluate to true iff expr is a pointer */ |
||||
#define _curl_is_any_ptr(expr) \ |
||||
(sizeof(expr) == sizeof(void *)) |
||||
|
||||
/* evaluates to true if expr is NULL */ |
||||
/* XXX: must not evaluate expr, so this check is not accurate */ |
||||
#define _curl_is_NULL(expr) \ |
||||
(__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL))) |
||||
|
||||
/* evaluates to true if expr is type*, const type* or NULL */ |
||||
#define _curl_is_ptr(expr, type) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), const type *)) |
||||
|
||||
/* evaluates to true if expr is one of type[], type*, NULL or const type* */ |
||||
#define _curl_is_arr(expr, type) \ |
||||
(_curl_is_ptr((expr), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type [])) |
||||
|
||||
/* evaluates to true if expr is a string */ |
||||
#define _curl_is_string(expr) \ |
||||
(_curl_is_arr((expr), char) || \
|
||||
_curl_is_arr((expr), signed char) || \
|
||||
_curl_is_arr((expr), unsigned char)) |
||||
|
||||
/* evaluates to true if expr is a long (no matter the signedness)
|
||||
* XXX: for now, int is also accepted (and therefore short and char, which |
||||
* are promoted to int when passed to a variadic function) */ |
||||
#define _curl_is_long(expr) \ |
||||
(__builtin_types_compatible_p(__typeof__(expr), long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned char)) |
||||
|
||||
/* evaluates to true if expr is of type curl_off_t */ |
||||
#define _curl_is_off_t(expr) \ |
||||
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) |
||||
|
||||
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ |
||||
/* XXX: also check size of an char[] array? */ |
||||
#define _curl_is_error_buffer(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char[])) |
||||
|
||||
/* evaluates to true if expr is of type (const) void* or (const) FILE* */ |
||||
#if 0 |
||||
#define _curl_is_cb_data(expr) \ |
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_ptr((expr), FILE)) |
||||
#else /* be less strict */ |
||||
#define _curl_is_cb_data(expr) \ |
||||
_curl_is_any_ptr(expr) |
||||
#endif |
||||
|
||||
/* evaluates to true if expr is of type FILE* */ |
||||
#define _curl_is_FILE(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), FILE *))) |
||||
|
||||
/* evaluates to true if expr can be passed as POST data (void* or char*) */ |
||||
#define _curl_is_postfields(expr) \ |
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_arr((expr), char)) |
||||
|
||||
/* FIXME: the whole callback checking is messy...
|
||||
* The idea is to tolerate char vs. void and const vs. not const |
||||
* pointers in arguments at least |
||||
*/ |
||||
/* helper: __builtin_types_compatible_p distinguishes between functions and
|
||||
* function pointers, hide it */ |
||||
#define _curl_callback_compatible(func, type) \ |
||||
(__builtin_types_compatible_p(__typeof__(func), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(func) *, type)) |
||||
|
||||
/* evaluates to true if expr is of type curl_read_callback or "similar" */ |
||||
#define _curl_is_read_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), __typeof__(fread) *) || \
|
||||
_curl_callback_compatible((expr), curl_read_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback6)) |
||||
typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *); |
||||
typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *); |
||||
typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *); |
||||
typedef size_t (*_curl_read_callback4)(void *, size_t, size_t, void *); |
||||
typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *); |
||||
typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *); |
||||
|
||||
/* evaluates to true if expr is of type curl_write_callback or "similar" */ |
||||
#define _curl_is_write_cb(expr) \ |
||||
(_curl_is_read_cb(expr) || \
|
||||
_curl_callback_compatible((expr), __typeof__(fwrite) *) || \
|
||||
_curl_callback_compatible((expr), curl_write_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback6)) |
||||
typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *); |
||||
typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t, |
||||
const void *); |
||||
typedef size_t (*_curl_write_callback3)(const char *, size_t, size_t, FILE *); |
||||
typedef size_t (*_curl_write_callback4)(const void *, size_t, size_t, void *); |
||||
typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t, |
||||
const void *); |
||||
typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *); |
||||
|
||||
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ |
||||
#define _curl_is_ioctl_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_ioctl_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback4)) |
||||
typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *); |
||||
typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *); |
||||
typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *); |
||||
typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *); |
||||
|
||||
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */ |
||||
#define _curl_is_sockopt_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_sockopt_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback2)) |
||||
typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); |
||||
typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t, |
||||
curlsocktype); |
||||
|
||||
/* evaluates to true if expr is of type curl_opensocket_callback or
|
||||
"similar" */ |
||||
#define _curl_is_opensocket_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_opensocket_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback4)) |
||||
typedef curl_socket_t (*_curl_opensocket_callback1) |
||||
(void *, curlsocktype, struct curl_sockaddr *); |
||||
typedef curl_socket_t (*_curl_opensocket_callback2) |
||||
(void *, curlsocktype, const struct curl_sockaddr *); |
||||
typedef curl_socket_t (*_curl_opensocket_callback3) |
||||
(const void *, curlsocktype, struct curl_sockaddr *); |
||||
typedef curl_socket_t (*_curl_opensocket_callback4) |
||||
(const void *, curlsocktype, const struct curl_sockaddr *); |
||||
|
||||
/* evaluates to true if expr is of type curl_progress_callback or "similar" */ |
||||
#define _curl_is_progress_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_progress_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback2)) |
||||
typedef int (*_curl_progress_callback1)(void *, |
||||
double, double, double, double); |
||||
typedef int (*_curl_progress_callback2)(const void *, |
||||
double, double, double, double); |
||||
|
||||
/* evaluates to true if expr is of type curl_debug_callback or "similar" */ |
||||
#define _curl_is_debug_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_debug_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback8)) |
||||
typedef int (*_curl_debug_callback1) (CURL *, |
||||
curl_infotype, char *, size_t, void *); |
||||
typedef int (*_curl_debug_callback2) (CURL *, |
||||
curl_infotype, char *, size_t, const void *); |
||||
typedef int (*_curl_debug_callback3) (CURL *, |
||||
curl_infotype, const char *, size_t, void *); |
||||
typedef int (*_curl_debug_callback4) (CURL *, |
||||
curl_infotype, const char *, size_t, const void *); |
||||
typedef int (*_curl_debug_callback5) (CURL *, |
||||
curl_infotype, unsigned char *, size_t, void *); |
||||
typedef int (*_curl_debug_callback6) (CURL *, |
||||
curl_infotype, unsigned char *, size_t, const void *); |
||||
typedef int (*_curl_debug_callback7) (CURL *, |
||||
curl_infotype, const unsigned char *, size_t, void *); |
||||
typedef int (*_curl_debug_callback8) (CURL *, |
||||
curl_infotype, const unsigned char *, size_t, const void *); |
||||
|
||||
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ |
||||
/* this is getting even messier... */ |
||||
#define _curl_is_ssl_ctx_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_ssl_ctx_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback8)) |
||||
typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *, |
||||
const void *); |
||||
#ifdef HEADER_SSL_H |
||||
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
|
||||
* this will of course break if we're included before OpenSSL headers... |
||||
*/ |
||||
typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, |
||||
const void *); |
||||
#else |
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; |
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; |
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7; |
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8; |
||||
#endif |
||||
|
||||
/* evaluates to true if expr is of type curl_conv_callback or "similar" */ |
||||
#define _curl_is_conv_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_conv_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback4)) |
||||
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length); |
||||
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length); |
||||
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length); |
||||
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length); |
||||
|
||||
/* evaluates to true if expr is of type curl_seek_callback or "similar" */ |
||||
#define _curl_is_seek_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_seek_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback2)) |
||||
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int); |
||||
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int); |
||||
|
||||
|
||||
#endif /* __CURL_TYPECHECK_GCC_H */ |
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,77 +0,0 @@
|
||||
#ifndef __CURL_CURLVER_H |
||||
#define __CURL_CURLVER_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */ |
||||
|
||||
/* This is the global package copyright */ |
||||
#define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, <daniel@haxx.se>." |
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */ |
||||
#define LIBCURL_VERSION "7.58.0" |
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */ |
||||
#define LIBCURL_VERSION_MAJOR 7 |
||||
#define LIBCURL_VERSION_MINOR 58 |
||||
#define LIBCURL_VERSION_PATCH 0 |
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will |
||||
always follow this syntax: |
||||
|
||||
0xXXYYZZ |
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in |
||||
hexadecimal (using 8 bits each). All three numbers are always represented |
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7 |
||||
appears as "0x090b07". |
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number, |
||||
and it is always a greater number in a more recent release. It makes |
||||
comparisons with greater than and less than work. |
||||
|
||||
Note: This define is the full hex number and _does not_ use the |
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it |
||||
and needs it to contain the full number. |
||||
*/ |
||||
#define LIBCURL_VERSION_NUM 0x073a00 |
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The |
||||
* timestamp is not stored in git, as the timestamp is properly set in the |
||||
* tarballs by the maketgz script. |
||||
* |
||||
* The format of the date follows this template: |
||||
* |
||||
* "2007-11-23" |
||||
*/ |
||||
#define LIBCURL_TIMESTAMP "2018-01-24" |
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) |
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \ |
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) |
||||
|
||||
#endif /* __CURL_CURLVER_H */ |
||||
@ -1,102 +0,0 @@
|
||||
#ifndef __CURL_EASY_H |
||||
#define __CURL_EASY_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void); |
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); |
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); |
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl); |
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Request internal information from the curl session with this function. The |
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a |
||||
* pointer to a double (as the documentation describes elsewhere). The data |
||||
* pointed to will be filled in accordingly and can be relied upon only if the |
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a |
||||
* performed transfer, all results from this function are undefined until the |
||||
* transfer is completed. |
||||
*/ |
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); |
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Creates a new curl session handle with the same options set for the handle |
||||
* passed in. Duplicating a handle could only be a matter of cloning data and |
||||
* options, internal state info and things like persistent connections cannot |
||||
* be transferred. It is useful in multithreaded applications when you can run |
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical |
||||
* curl_easy_setopt() invokes in every thread. |
||||
*/ |
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl); |
||||
|
||||
/*
|
||||
* NAME curl_easy_reset() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Re-initializes a CURL handle to the default values. This puts back the |
||||
* handle to the same state as it was in when it was just created. |
||||
* |
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the |
||||
* cookies. |
||||
*/ |
||||
CURL_EXTERN void curl_easy_reset(CURL *curl); |
||||
|
||||
/*
|
||||
* NAME curl_easy_recv() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Receives data from the connected socket. Use after successful |
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option. |
||||
*/ |
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, |
||||
size_t *n); |
||||
|
||||
/*
|
||||
* NAME curl_easy_send() |
||||
* |
||||
* DESCRIPTION |
||||
* |
||||
* Sends data over the connected socket. Use after successful |
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option. |
||||
*/ |
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, |
||||
size_t buflen, size_t *n); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif |
||||
@ -1,50 +0,0 @@
|
||||
#ifndef __CURL_MPRINTF_H |
||||
#define __CURL_MPRINTF_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
#include <stdarg.h> |
||||
#include <stdio.h> /* needed for FILE */ |
||||
#include "curl.h" /* for CURL_EXTERN */ |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...); |
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); |
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); |
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, |
||||
const char *format, ...); |
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args); |
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); |
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); |
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, |
||||
const char *format, va_list args); |
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...); |
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* __CURL_MPRINTF_H */ |
||||
@ -1,439 +0,0 @@
|
||||
#ifndef __CURL_MULTI_H |
||||
#define __CURL_MULTI_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
/*
|
||||
This is an "external" header file. Don't give away any internals here! |
||||
|
||||
GOALS |
||||
|
||||
o Enable a "pull" interface. The application that uses libcurl decides where |
||||
and when to ask libcurl to get/send data. |
||||
|
||||
o Enable multiple simultaneous transfers in the same thread without making it |
||||
complicated for the application. |
||||
|
||||
o Enable the application to select() on its own file descriptors and curl's |
||||
file descriptors simultaneous easily. |
||||
|
||||
*/ |
||||
|
||||
/*
|
||||
* This header file should not really need to include "curl.h" since curl.h |
||||
* itself includes this file and we expect user applications to do #include |
||||
* <curl/curl.h> without the need for especially including multi.h. |
||||
* |
||||
* For some reason we added this include here at one point, and rather than to |
||||
* break existing (wrongly written) libcurl applications, we leave it as-is |
||||
* but with this warning attached. |
||||
*/ |
||||
#include "curl.h" |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) |
||||
typedef struct Curl_multi CURLM; |
||||
#else |
||||
typedef void CURLM; |
||||
#endif |
||||
|
||||
typedef enum { |
||||
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
|
||||
curl_multi_socket*() soon */ |
||||
CURLM_OK, |
||||
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ |
||||
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ |
||||
CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ |
||||
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ |
||||
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ |
||||
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ |
||||
CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
|
||||
attempted to get added - again */ |
||||
CURLM_LAST |
||||
} CURLMcode; |
||||
|
||||
/* just to make code nicer when using curl_multi_socket() you can now check
|
||||
for CURLM_CALL_MULTI_SOCKET too in the same style it works for |
||||
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ |
||||
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM |
||||
|
||||
/* bitmask bits for CURLMOPT_PIPELINING */ |
||||
#define CURLPIPE_NOTHING 0L |
||||
#define CURLPIPE_HTTP1 1L |
||||
#define CURLPIPE_MULTIPLEX 2L |
||||
|
||||
typedef enum { |
||||
CURLMSG_NONE, /* first, not used */ |
||||
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
|
||||
the CURLcode of the transfer */ |
||||
CURLMSG_LAST /* last, not used */ |
||||
} CURLMSG; |
||||
|
||||
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; |
||||
}; |
||||
typedef struct CURLMsg CURLMsg; |
||||
|
||||
/* Based on poll(2) structure and values.
|
||||
* We don't use pollfd and POLL* constants explicitly |
||||
* to cover platforms without poll(). */ |
||||
#define CURL_WAIT_POLLIN 0x0001 |
||||
#define CURL_WAIT_POLLPRI 0x0002 |
||||
#define CURL_WAIT_POLLOUT 0x0004 |
||||
|
||||
struct curl_waitfd { |
||||
curl_socket_t fd; |
||||
short events; |
||||
short revents; /* not supported yet */ |
||||
}; |
||||
|
||||
/*
|
||||
* Name: curl_multi_init() |
||||
* |
||||
* Desc: inititalize multi-style curl usage |
||||
* |
||||
* Returns: a new CURLM handle to use in all 'curl_multi' functions. |
||||
*/ |
||||
CURL_EXTERN CURLM *curl_multi_init(void); |
||||
|
||||
/*
|
||||
* Name: curl_multi_add_handle() |
||||
* |
||||
* Desc: add a standard curl handle to the multi stack |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, |
||||
CURL *curl_handle); |
||||
|
||||
/*
|
||||
* Name: curl_multi_remove_handle() |
||||
* |
||||
* Desc: removes a curl handle from the multi stack again |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, |
||||
CURL *curl_handle); |
||||
|
||||
/*
|
||||
* Name: curl_multi_fdset() |
||||
* |
||||
* Desc: Ask curl for its fd_set sets. The app can use these to select() or |
||||
* poll() on. We want curl_multi_perform() called as soon as one of |
||||
* them are ready. |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, |
||||
fd_set *read_fd_set, |
||||
fd_set *write_fd_set, |
||||
fd_set *exc_fd_set, |
||||
int *max_fd); |
||||
|
||||
/*
|
||||
* Name: curl_multi_wait() |
||||
* |
||||
* Desc: Poll on all fds within a CURLM set as well as any |
||||
* additional fds passed to the function. |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, |
||||
struct curl_waitfd extra_fds[], |
||||
unsigned int extra_nfds, |
||||
int timeout_ms, |
||||
int *ret); |
||||
|
||||
/*
|
||||
* Name: curl_multi_perform() |
||||
* |
||||
* Desc: When the app thinks there's data available for curl it calls this |
||||
* function to read/write whatever there is right now. This returns |
||||
* as soon as the reads and writes are done. This function does not |
||||
* require that there actually is data available for reading or that |
||||
* data can be written, it can be called just in case. It returns |
||||
* the number of handles that still transfer data in the second |
||||
* argument's integer-pointer. |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. *NOTE* that this only |
||||
* returns errors etc regarding the whole multi stack. There might |
||||
* still have occurred problems on invidual transfers even when this |
||||
* returns OK. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, |
||||
int *running_handles); |
||||
|
||||
/*
|
||||
* Name: curl_multi_cleanup() |
||||
* |
||||
* Desc: Cleans up and removes a whole multi stack. It does not free or |
||||
* touch any individual easy handles in any way. We need to define |
||||
* in what state those handles will be if this function is called |
||||
* in the middle of a transfer. |
||||
* |
||||
* Returns: CURLMcode type, general multi error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); |
||||
|
||||
/*
|
||||
* Name: curl_multi_info_read() |
||||
* |
||||
* Desc: Ask the multi handle if there's any messages/informationals from |
||||
* the individual transfers. Messages include informationals such as |
||||
* error code from the transfer or just the fact that a transfer is |
||||
* completed. More details on these should be written down as well. |
||||
* |
||||
* Repeated calls to this function will return a new struct each |
||||
* time, until a special "end of msgs" struct is returned as a signal |
||||
* that there is no more to get at this point. |
||||
* |
||||
* The data the returned pointer points to will not survive calling |
||||
* curl_multi_cleanup(). |
||||
* |
||||
* The 'CURLMsg' struct is meant to be very simple and only contain |
||||
* very basic information. If more involved information is wanted, |
||||
* we will provide the particular "transfer handle" in that struct |
||||
* and that should/could/would be used in subsequent |
||||
* curl_easy_getinfo() calls (or similar). The point being that we |
||||
* must never expose complex structs to applications, as then we'll |
||||
* undoubtably get backwards compatibility problems in the future. |
||||
* |
||||
* Returns: A pointer to a filled-in struct, or NULL if it failed or ran out |
||||
* of structs. It also writes the number of messages left in the |
||||
* queue (after this read) in the integer the second argument points |
||||
* to. |
||||
*/ |
||||
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, |
||||
int *msgs_in_queue); |
||||
|
||||
/*
|
||||
* Name: curl_multi_strerror() |
||||
* |
||||
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode |
||||
* value into the equivalent human readable error string. This is |
||||
* useful for printing meaningful error messages. |
||||
* |
||||
* Returns: A pointer to a zero-terminated error message. |
||||
*/ |
||||
CURL_EXTERN const char *curl_multi_strerror(CURLMcode); |
||||
|
||||
/*
|
||||
* Name: curl_multi_socket() and |
||||
* curl_multi_socket_all() |
||||
* |
||||
* Desc: An alternative version of curl_multi_perform() that allows the |
||||
* application to pass in one of the file descriptors that have been |
||||
* detected to have "action" on them and let libcurl perform. |
||||
* See man page for details. |
||||
*/ |
||||
#define CURL_POLL_NONE 0 |
||||
#define CURL_POLL_IN 1 |
||||
#define CURL_POLL_OUT 2 |
||||
#define CURL_POLL_INOUT 3 |
||||
#define CURL_POLL_REMOVE 4 |
||||
|
||||
#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD |
||||
|
||||
#define CURL_CSELECT_IN 0x01 |
||||
#define CURL_CSELECT_OUT 0x02 |
||||
#define CURL_CSELECT_ERR 0x04 |
||||
|
||||
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ |
||||
curl_socket_t s, /* socket */ |
||||
int what, /* see above */ |
||||
void *userp, /* private callback
|
||||
pointer */ |
||||
void *socketp); /* private socket
|
||||
pointer */ |
||||
/*
|
||||
* Name: curl_multi_timer_callback |
||||
* |
||||
* Desc: Called by libcurl whenever the library detects a change in the |
||||
* maximum number of milliseconds the app is allowed to wait before |
||||
* curl_multi_socket() or curl_multi_perform() must be called |
||||
* (to allow libcurl's timed events to take place). |
||||
* |
||||
* Returns: The callback should return zero. |
||||
*/ |
||||
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ |
||||
long timeout_ms, /* see above */ |
||||
void *userp); /* private callback
|
||||
pointer */ |
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, |
||||
int *running_handles); |
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, |
||||
curl_socket_t s, |
||||
int ev_bitmask, |
||||
int *running_handles); |
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, |
||||
int *running_handles); |
||||
|
||||
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET |
||||
/* This macro below was added in 7.16.3 to push users who recompile to use
|
||||
the new curl_multi_socket_action() instead of the old curl_multi_socket() |
||||
*/ |
||||
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) |
||||
#endif |
||||
|
||||
/*
|
||||
* Name: curl_multi_timeout() |
||||
* |
||||
* Desc: Returns the maximum number of milliseconds the app is allowed to |
||||
* wait before curl_multi_socket() or curl_multi_perform() must be |
||||
* called (to allow libcurl's timed events to take place). |
||||
* |
||||
* Returns: CURLM error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, |
||||
long *milliseconds); |
||||
|
||||
#undef CINIT /* re-using the same name as in curl.h */ |
||||
|
||||
#ifdef CURL_ISOCPP |
||||
#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num |
||||
#else |
||||
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ |
||||
#define LONG CURLOPTTYPE_LONG |
||||
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT |
||||
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT |
||||
#define OFF_T CURLOPTTYPE_OFF_T |
||||
#define CINIT(name,type,number) CURLMOPT_/**/name = type + number |
||||
#endif |
||||
|
||||
typedef enum { |
||||
/* This is the socket callback function pointer */ |
||||
CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), |
||||
|
||||
/* This is the argument passed to the socket callback */ |
||||
CINIT(SOCKETDATA, OBJECTPOINT, 2), |
||||
|
||||
/* set to 1 to enable pipelining for this multi handle */ |
||||
CINIT(PIPELINING, LONG, 3), |
||||
|
||||
/* This is the timer callback function pointer */ |
||||
CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), |
||||
|
||||
/* This is the argument passed to the timer callback */ |
||||
CINIT(TIMERDATA, OBJECTPOINT, 5), |
||||
|
||||
/* maximum number of entries in the connection cache */ |
||||
CINIT(MAXCONNECTS, LONG, 6), |
||||
|
||||
/* maximum number of (pipelining) connections to one host */ |
||||
CINIT(MAX_HOST_CONNECTIONS, LONG, 7), |
||||
|
||||
/* maximum number of requests in a pipeline */ |
||||
CINIT(MAX_PIPELINE_LENGTH, LONG, 8), |
||||
|
||||
/* a connection with a content-length longer than this
|
||||
will not be considered for pipelining */ |
||||
CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9), |
||||
|
||||
/* a connection with a chunk length longer than this
|
||||
will not be considered for pipelining */ |
||||
CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10), |
||||
|
||||
/* a list of site names(+port) that are blacklisted from
|
||||
pipelining */ |
||||
CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11), |
||||
|
||||
/* a list of server types that are blacklisted from
|
||||
pipelining */ |
||||
CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12), |
||||
|
||||
/* maximum number of open connections in total */ |
||||
CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13), |
||||
|
||||
/* This is the server push callback function pointer */ |
||||
CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14), |
||||
|
||||
/* This is the argument passed to the server push callback */ |
||||
CINIT(PUSHDATA, OBJECTPOINT, 15), |
||||
|
||||
CURLMOPT_LASTENTRY /* the last unused */ |
||||
} CURLMoption; |
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_setopt() |
||||
* |
||||
* Desc: Sets options for the multi handle. |
||||
* |
||||
* Returns: CURLM error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, |
||||
CURLMoption option, ...); |
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_assign() |
||||
* |
||||
* Desc: This function sets an association in the multi handle between the |
||||
* given socket and a private pointer of the application. This is |
||||
* (only) useful for curl_multi_socket uses. |
||||
* |
||||
* Returns: CURLM error code. |
||||
*/ |
||||
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, |
||||
curl_socket_t sockfd, void *sockp); |
||||
|
||||
|
||||
/*
|
||||
* Name: curl_push_callback |
||||
* |
||||
* Desc: This callback gets called when a new stream is being pushed by the |
||||
* server. It approves or denies the new stream. |
||||
* |
||||
* Returns: CURL_PUSH_OK or CURL_PUSH_DENY. |
||||
*/ |
||||
#define CURL_PUSH_OK 0 |
||||
#define CURL_PUSH_DENY 1 |
||||
|
||||
struct curl_pushheaders; /* forward declaration only */ |
||||
|
||||
CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h, |
||||
size_t num); |
||||
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h, |
||||
const char *name); |
||||
|
||||
typedef int (*curl_push_callback)(CURL *parent, |
||||
CURL *easy, |
||||
size_t num_headers, |
||||
struct curl_pushheaders *headers, |
||||
void *userp); |
||||
|
||||
#ifdef __cplusplus |
||||
} /* end of extern "C" */ |
||||
#endif |
||||
|
||||
#endif |
||||
@ -1,33 +0,0 @@
|
||||
#ifndef __STDC_HEADERS_H |
||||
#define __STDC_HEADERS_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
#include <sys/types.h> |
||||
|
||||
size_t fread(void *, size_t, size_t, FILE *); |
||||
size_t fwrite(const void *, size_t, size_t, FILE *); |
||||
|
||||
int strcasecmp(const char *, const char *); |
||||
int strncasecmp(const char *, const char *, size_t); |
||||
|
||||
#endif /* __STDC_HEADERS_H */ |
||||
@ -1,473 +0,0 @@
|
||||
#ifndef __CURL_SYSTEM_H |
||||
#define __CURL_SYSTEM_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
/*
|
||||
* Try to keep one section per platform, compiler and architecture, otherwise, |
||||
* if an existing section is reused for a different one and later on the |
||||
* original is adjusted, probably the piggybacking one can be adversely |
||||
* changed. |
||||
* |
||||
* In order to differentiate between platforms/compilers/architectures use |
||||
* only compiler built in predefined preprocessor symbols. |
||||
* |
||||
* curl_off_t |
||||
* ---------- |
||||
* |
||||
* For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit |
||||
* wide signed integral data type. The width of this data type must remain |
||||
* constant and independent of any possible large file support settings. |
||||
* |
||||
* As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit |
||||
* wide signed integral data type if there is no 64-bit type. |
||||
* |
||||
* As a general rule, curl_off_t shall not be mapped to off_t. This rule shall |
||||
* only be violated if off_t is the only 64-bit data type available and the |
||||
* size of off_t is independent of large file support settings. Keep your |
||||
* build on the safe side avoiding an off_t gating. If you have a 64-bit |
||||
* off_t then take for sure that another 64-bit data type exists, dig deeper |
||||
* and you will find it. |
||||
* |
||||
*/ |
||||
|
||||
#if defined(__DJGPP__) || defined(__GO32__) |
||||
# if defined(__DJGPP__) && (__DJGPP__ > 1) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__SALFORDC__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__BORLANDC__) |
||||
# if (__BORLANDC__ < 0x520) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__TURBOC__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__WATCOMC__) |
||||
# if defined(__386__) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__POCC__) |
||||
# if (__POCC__ < 280) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# elif defined(_MSC_VER) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__LCC__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__SYMBIAN32__) |
||||
# if defined(__EABI__) /* Treat all ARM compilers equally */ |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(__CW32__) |
||||
# pragma longlong on |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(__VC32__) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int |
||||
|
||||
#elif defined(__MWERKS__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(_WIN32_WCE) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__MINGW32__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_WS2TCPIP_H 1 |
||||
|
||||
#elif defined(__VMS) |
||||
# if defined(__VAX) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int |
||||
|
||||
#elif defined(__OS400__) |
||||
# if defined(__ILEC400__) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
# endif |
||||
|
||||
#elif defined(__MVS__) |
||||
# if defined(__IBMC__) || defined(__IBMCPP__) |
||||
# if defined(_ILP32) |
||||
# elif defined(_LP64) |
||||
# endif |
||||
# if defined(_LONG_LONG) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(_LP64) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
# endif |
||||
|
||||
#elif defined(__370__) |
||||
# if defined(__IBMC__) || defined(__IBMCPP__) |
||||
# if defined(_ILP32) |
||||
# elif defined(_LP64) |
||||
# endif |
||||
# if defined(_LONG_LONG) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(_LP64) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
# endif |
||||
|
||||
#elif defined(TPF) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
#elif defined(__TINYC__) /* also known as tcc */ |
||||
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
|
||||
#elif defined(__SUNPRO_C) /* Oracle Solaris Studio */ |
||||
# if !defined(__LP64) && (defined(__ILP32) || \ |
||||
defined(__i386) || defined(__sparcv8)) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(__LP64) || \ |
||||
defined(__amd64) || defined(__sparcv9) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
|
||||
/* ===================================== */ |
||||
/* KEEP MSVC THE PENULTIMATE ENTRY */ |
||||
/* ===================================== */ |
||||
|
||||
#elif defined(_MSC_VER) |
||||
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) |
||||
# define CURL_TYPEOF_CURL_OFF_T __int64 |
||||
# define CURL_FORMAT_CURL_OFF_T "I64d" |
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u" |
||||
# define CURL_SUFFIX_CURL_OFF_T i64 |
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64 |
||||
# else |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
|
||||
/* ===================================== */ |
||||
/* KEEP GENERIC GCC THE LAST ENTRY */ |
||||
/* ===================================== */ |
||||
|
||||
#elif defined(__GNUC__) |
||||
# if !defined(__LP64__) && \ |
||||
(defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \
|
||||
defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \
|
||||
defined(__sparc__) || defined(__mips__) || defined(__sh__) || \
|
||||
defined(__XTENSA__) || \
|
||||
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \
|
||||
(defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L)) |
||||
# define CURL_TYPEOF_CURL_OFF_T long long |
||||
# define CURL_FORMAT_CURL_OFF_T "lld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "llu" |
||||
# define CURL_SUFFIX_CURL_OFF_T LL |
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL |
||||
# elif defined(__LP64__) || \ |
||||
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
|
||||
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \
|
||||
(defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L) |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# endif |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
||||
# define CURL_PULL_SYS_TYPES_H 1 |
||||
# define CURL_PULL_SYS_SOCKET_H 1 |
||||
|
||||
#else |
||||
/* generic "safe guess" on old 32 bit style */ |
||||
# define CURL_TYPEOF_CURL_OFF_T long |
||||
# define CURL_FORMAT_CURL_OFF_T "ld" |
||||
# define CURL_FORMAT_CURL_OFF_TU "lu" |
||||
# define CURL_SUFFIX_CURL_OFF_T L |
||||
# define CURL_SUFFIX_CURL_OFF_TU UL |
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int |
||||
#endif |
||||
|
||||
#ifdef _AIX |
||||
/* AIX needs <sys/poll.h> */ |
||||
#define CURL_PULL_SYS_POLL_H |
||||
#endif |
||||
|
||||
|
||||
/* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */ |
||||
/* ws2tcpip.h is required here to properly make type definitions below. */ |
||||
#ifdef CURL_PULL_WS2TCPIP_H |
||||
# include <winsock2.h> |
||||
# include <windows.h> |
||||
# include <ws2tcpip.h> |
||||
#endif |
||||
|
||||
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */ |
||||
/* sys/types.h is required here to properly make type definitions below. */ |
||||
#ifdef CURL_PULL_SYS_TYPES_H |
||||
# include <sys/types.h> |
||||
#endif |
||||
|
||||
/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ |
||||
/* sys/socket.h is required here to properly make type definitions below. */ |
||||
#ifdef CURL_PULL_SYS_SOCKET_H |
||||
# include <sys/socket.h> |
||||
#endif |
||||
|
||||
/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */ |
||||
/* sys/poll.h is required here to properly make type definitions below. */ |
||||
#ifdef CURL_PULL_SYS_POLL_H |
||||
# include <sys/poll.h> |
||||
#endif |
||||
|
||||
/* Data type definition of curl_socklen_t. */ |
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T |
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; |
||||
#endif |
||||
|
||||
/* Data type definition of curl_off_t. */ |
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T |
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; |
||||
#endif |
||||
|
||||
/*
|
||||
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow |
||||
* these to be visible and exported by the external libcurl interface API, |
||||
* while also making them visible to the library internals, simply including |
||||
* curl_setup.h, without actually needing to include curl.h internally. |
||||
* If some day this section would grow big enough, all this should be moved |
||||
* to its own header file. |
||||
*/ |
||||
|
||||
/*
|
||||
* Figure out if we can use the ## preprocessor operator, which is supported |
||||
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ |
||||
* or __cplusplus so we need to carefully check for them too. |
||||
*/ |
||||
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ |
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
|
||||
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
|
||||
defined(__ILEC400__) |
||||
/* This compiler is believed to have an ISO compatible preprocessor */ |
||||
#define CURL_ISOCPP |
||||
#else |
||||
/* This compiler is believed NOT to have an ISO compatible preprocessor */ |
||||
#undef CURL_ISOCPP |
||||
#endif |
||||
|
||||
/*
|
||||
* Macros for minimum-width signed and unsigned curl_off_t integer constants. |
||||
*/ |
||||
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551) |
||||
# define __CURL_OFF_T_C_HLPR2(x) x |
||||
# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x) |
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ |
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T) |
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ |
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU) |
||||
#else |
||||
# ifdef CURL_ISOCPP |
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix |
||||
# else |
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix |
||||
# endif |
||||
# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix) |
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T) |
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU) |
||||
#endif |
||||
|
||||
#endif /* __CURL_SYSTEM_H */ |
||||
@ -1,683 +0,0 @@
|
||||
#ifndef __CURL_TYPECHECK_GCC_H |
||||
#define __CURL_TYPECHECK_GCC_H |
||||
/***************************************************************************
|
||||
* _ _ ____ _ |
||||
* Project ___| | | | _ \| | |
||||
* / __| | | | |_) | | |
||||
* | (__| |_| | _ <| |___ |
||||
* \___|\___/|_| \_\_____| |
||||
* |
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. |
||||
* |
||||
* This software is licensed as described in the file COPYING, which |
||||
* you should have received as part of this distribution. The terms |
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* |
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell |
||||
* copies of the Software, and permit persons to whom the Software is |
||||
* furnished to do so, under the terms of the COPYING file. |
||||
* |
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
||||
* KIND, either express or implied. |
||||
* |
||||
***************************************************************************/ |
||||
|
||||
/* wraps curl_easy_setopt() with typechecking */ |
||||
|
||||
/* To add a new kind of warning, add an
|
||||
* if(_curl_is_sometype_option(_curl_opt)) |
||||
* if(!_curl_is_sometype(value)) |
||||
* _curl_easy_setopt_err_sometype(); |
||||
* block and define _curl_is_sometype_option, _curl_is_sometype and |
||||
* _curl_easy_setopt_err_sometype below |
||||
* |
||||
* NOTE: We use two nested 'if' statements here instead of the && operator, in |
||||
* order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x |
||||
* when compiling with -Wlogical-op. |
||||
* |
||||
* To add an option that uses the same type as an existing option, you'll just |
||||
* need to extend the appropriate _curl_*_option macro |
||||
*/ |
||||
#define curl_easy_setopt(handle, option, value) \ |
||||
__extension__ ({ \
|
||||
__typeof__(option) _curl_opt = option; \
|
||||
if(__builtin_constant_p(_curl_opt)) { \
|
||||
if(_curl_is_long_option(_curl_opt)) \
|
||||
if(!_curl_is_long(value)) \
|
||||
_curl_easy_setopt_err_long(); \
|
||||
if(_curl_is_off_t_option(_curl_opt)) \
|
||||
if(!_curl_is_off_t(value)) \
|
||||
_curl_easy_setopt_err_curl_off_t(); \
|
||||
if(_curl_is_string_option(_curl_opt)) \
|
||||
if(!_curl_is_string(value)) \
|
||||
_curl_easy_setopt_err_string(); \
|
||||
if(_curl_is_write_cb_option(_curl_opt)) \
|
||||
if(!_curl_is_write_cb(value)) \
|
||||
_curl_easy_setopt_err_write_callback(); \
|
||||
if((_curl_opt) == CURLOPT_READFUNCTION) \
|
||||
if(!_curl_is_read_cb(value)) \
|
||||
_curl_easy_setopt_err_read_cb(); \
|
||||
if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
|
||||
if(!_curl_is_ioctl_cb(value)) \
|
||||
_curl_easy_setopt_err_ioctl_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
|
||||
if(!_curl_is_sockopt_cb(value)) \
|
||||
_curl_easy_setopt_err_sockopt_cb(); \
|
||||
if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
|
||||
if(!_curl_is_opensocket_cb(value)) \
|
||||
_curl_easy_setopt_err_opensocket_cb(); \
|
||||
if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
|
||||
if(!_curl_is_progress_cb(value)) \
|
||||
_curl_easy_setopt_err_progress_cb(); \
|
||||
if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
|
||||
if(!_curl_is_debug_cb(value)) \
|
||||
_curl_easy_setopt_err_debug_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
|
||||
if(!_curl_is_ssl_ctx_cb(value)) \
|
||||
_curl_easy_setopt_err_ssl_ctx_cb(); \
|
||||
if(_curl_is_conv_cb_option(_curl_opt)) \
|
||||
if(!_curl_is_conv_cb(value)) \
|
||||
_curl_easy_setopt_err_conv_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
|
||||
if(!_curl_is_seek_cb(value)) \
|
||||
_curl_easy_setopt_err_seek_cb(); \
|
||||
if(_curl_is_cb_data_option(_curl_opt)) \
|
||||
if(!_curl_is_cb_data(value)) \
|
||||
_curl_easy_setopt_err_cb_data(); \
|
||||
if((_curl_opt) == CURLOPT_ERRORBUFFER) \
|
||||
if(!_curl_is_error_buffer(value)) \
|
||||
_curl_easy_setopt_err_error_buffer(); \
|
||||
if((_curl_opt) == CURLOPT_STDERR) \
|
||||
if(!_curl_is_FILE(value)) \
|
||||
_curl_easy_setopt_err_FILE(); \
|
||||
if(_curl_is_postfields_option(_curl_opt)) \
|
||||
if(!_curl_is_postfields(value)) \
|
||||
_curl_easy_setopt_err_postfields(); \
|
||||
if((_curl_opt) == CURLOPT_HTTPPOST) \
|
||||
if(!_curl_is_arr((value), struct curl_httppost)) \
|
||||
_curl_easy_setopt_err_curl_httpost(); \
|
||||
if((_curl_opt) == CURLOPT_MIMEPOST) \
|
||||
if(!_curl_is_ptr((value), curl_mime)) \
|
||||
_curl_easy_setopt_err_curl_mimepost(); \
|
||||
if(_curl_is_slist_option(_curl_opt)) \
|
||||
if(!_curl_is_arr((value), struct curl_slist)) \
|
||||
_curl_easy_setopt_err_curl_slist(); \
|
||||
if((_curl_opt) == CURLOPT_SHARE) \
|
||||
if(!_curl_is_ptr((value), CURLSH)) \
|
||||
_curl_easy_setopt_err_CURLSH(); \
|
||||
} \
|
||||
curl_easy_setopt(handle, _curl_opt, value); \
|
||||
}) |
||||
|
||||
/* wraps curl_easy_getinfo() with typechecking */ |
||||
/* FIXME: don't allow const pointers */ |
||||
#define curl_easy_getinfo(handle, info, arg) \ |
||||
__extension__ ({ \
|
||||
__typeof__(info) _curl_info = info; \
|
||||
if(__builtin_constant_p(_curl_info)) { \
|
||||
if(_curl_is_string_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), char *)) \
|
||||
_curl_easy_getinfo_err_string(); \
|
||||
if(_curl_is_long_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), long)) \
|
||||
_curl_easy_getinfo_err_long(); \
|
||||
if(_curl_is_double_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), double)) \
|
||||
_curl_easy_getinfo_err_double(); \
|
||||
if(_curl_is_slist_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_slist *)) \
|
||||
_curl_easy_getinfo_err_curl_slist(); \
|
||||
if(_curl_is_tlssessioninfo_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_tlssessioninfo *)) \
|
||||
_curl_easy_getinfo_err_curl_tlssesssioninfo(); \
|
||||
if(_curl_is_certinfo_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_certinfo *)) \
|
||||
_curl_easy_getinfo_err_curl_certinfo(); \
|
||||
if(_curl_is_socket_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), curl_socket_t)) \
|
||||
_curl_easy_getinfo_err_curl_socket(); \
|
||||
if(_curl_is_off_t_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), curl_off_t)) \
|
||||
_curl_easy_getinfo_err_curl_off_t(); \
|
||||
} \
|
||||
curl_easy_getinfo(handle, _curl_info, arg); \
|
||||
}) |
||||
|
||||
/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),
|
||||
* for now just make sure that the functions are called with three |
||||
* arguments |
||||
*/ |
||||
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) |
||||
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) |
||||
|
||||
|
||||
/* the actual warnings, triggered by calling the _curl_easy_setopt_err*
|
||||
* functions */ |
||||
|
||||
/* To define a new warning, use _CURL_WARNING(identifier, "message") */ |
||||
#define _CURL_WARNING(id, message) \ |
||||
static void __attribute__((__warning__(message))) \
|
||||
__attribute__((__unused__)) __attribute__((__noinline__)) \
|
||||
id(void) { __asm__(""); } |
||||
|
||||
_CURL_WARNING(_curl_easy_setopt_err_long, |
||||
"curl_easy_setopt expects a long argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t, |
||||
"curl_easy_setopt expects a curl_off_t argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_string, |
||||
"curl_easy_setopt expects a " |
||||
"string ('char *' or char[]) argument for this option" |
||||
) |
||||
_CURL_WARNING(_curl_easy_setopt_err_write_callback, |
||||
"curl_easy_setopt expects a curl_write_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_read_cb, |
||||
"curl_easy_setopt expects a curl_read_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb, |
||||
"curl_easy_setopt expects a curl_ioctl_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb, |
||||
"curl_easy_setopt expects a curl_sockopt_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb, |
||||
"curl_easy_setopt expects a " |
||||
"curl_opensocket_callback argument for this option" |
||||
) |
||||
_CURL_WARNING(_curl_easy_setopt_err_progress_cb, |
||||
"curl_easy_setopt expects a curl_progress_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_debug_cb, |
||||
"curl_easy_setopt expects a curl_debug_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb, |
||||
"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_conv_cb, |
||||
"curl_easy_setopt expects a curl_conv_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_seek_cb, |
||||
"curl_easy_setopt expects a curl_seek_callback argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_cb_data, |
||||
"curl_easy_setopt expects a " |
||||
"private data pointer as argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_error_buffer, |
||||
"curl_easy_setopt expects a " |
||||
"char buffer of CURL_ERROR_SIZE as argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_FILE, |
||||
"curl_easy_setopt expects a 'FILE *' argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_postfields, |
||||
"curl_easy_setopt expects a 'void *' or 'char *' argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost, |
||||
"curl_easy_setopt expects a 'struct curl_httppost *' " |
||||
"argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_mimepost, |
||||
"curl_easy_setopt expects a 'curl_mime *' " |
||||
"argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_slist, |
||||
"curl_easy_setopt expects a 'struct curl_slist *' argument for this option") |
||||
_CURL_WARNING(_curl_easy_setopt_err_CURLSH, |
||||
"curl_easy_setopt expects a CURLSH* argument for this option") |
||||
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_string, |
||||
"curl_easy_getinfo expects a pointer to 'char *' for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_long, |
||||
"curl_easy_getinfo expects a pointer to long for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_double, |
||||
"curl_easy_getinfo expects a pointer to double for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist, |
||||
"curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo, |
||||
"curl_easy_getinfo expects a pointer to " |
||||
"'struct curl_tlssessioninfo *' for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_certinfo, |
||||
"curl_easy_getinfo expects a pointer to " |
||||
"'struct curl_certinfo *' for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_socket, |
||||
"curl_easy_getinfo expects a pointer to curl_socket_t for this info") |
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_off_t, |
||||
"curl_easy_getinfo expects a pointer to curl_off_t for this info") |
||||
|
||||
/* groups of curl_easy_setops options that take the same type of argument */ |
||||
|
||||
/* To add a new option to one of the groups, just add
|
||||
* (option) == CURLOPT_SOMETHING |
||||
* to the or-expression. If the option takes a long or curl_off_t, you don't |
||||
* have to do anything |
||||
*/ |
||||
|
||||
/* evaluates to true if option takes a long argument */ |
||||
#define _curl_is_long_option(option) \ |
||||
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) |
||||
|
||||
#define _curl_is_off_t_option(option) \ |
||||
((option) > CURLOPTTYPE_OFF_T) |
||||
|
||||
/* evaluates to true if option takes a char* argument */ |
||||
#define _curl_is_string_option(option) \ |
||||
((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \
|
||||
(option) == CURLOPT_ACCEPT_ENCODING || \
|
||||
(option) == CURLOPT_CAINFO || \
|
||||
(option) == CURLOPT_CAPATH || \
|
||||
(option) == CURLOPT_COOKIE || \
|
||||
(option) == CURLOPT_COOKIEFILE || \
|
||||
(option) == CURLOPT_COOKIEJAR || \
|
||||
(option) == CURLOPT_COOKIELIST || \
|
||||
(option) == CURLOPT_CRLFILE || \
|
||||
(option) == CURLOPT_CUSTOMREQUEST || \
|
||||
(option) == CURLOPT_DEFAULT_PROTOCOL || \
|
||||
(option) == CURLOPT_DNS_INTERFACE || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP4 || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP6 || \
|
||||
(option) == CURLOPT_DNS_SERVERS || \
|
||||
(option) == CURLOPT_EGDSOCKET || \
|
||||
(option) == CURLOPT_FTPPORT || \
|
||||
(option) == CURLOPT_FTP_ACCOUNT || \
|
||||
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
|
||||
(option) == CURLOPT_INTERFACE || \
|
||||
(option) == CURLOPT_ISSUERCERT || \
|
||||
(option) == CURLOPT_KEYPASSWD || \
|
||||
(option) == CURLOPT_KRBLEVEL || \
|
||||
(option) == CURLOPT_LOGIN_OPTIONS || \
|
||||
(option) == CURLOPT_MAIL_AUTH || \
|
||||
(option) == CURLOPT_MAIL_FROM || \
|
||||
(option) == CURLOPT_NETRC_FILE || \
|
||||
(option) == CURLOPT_NOPROXY || \
|
||||
(option) == CURLOPT_PASSWORD || \
|
||||
(option) == CURLOPT_PINNEDPUBLICKEY || \
|
||||
(option) == CURLOPT_PRE_PROXY || \
|
||||
(option) == CURLOPT_PROXY || \
|
||||
(option) == CURLOPT_PROXYPASSWORD || \
|
||||
(option) == CURLOPT_PROXYUSERNAME || \
|
||||
(option) == CURLOPT_PROXYUSERPWD || \
|
||||
(option) == CURLOPT_PROXY_CAINFO || \
|
||||
(option) == CURLOPT_PROXY_CAPATH || \
|
||||
(option) == CURLOPT_PROXY_CRLFILE || \
|
||||
(option) == CURLOPT_PROXY_KEYPASSWD || \
|
||||
(option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \
|
||||
(option) == CURLOPT_PROXY_SERVICE_NAME || \
|
||||
(option) == CURLOPT_PROXY_SSLCERT || \
|
||||
(option) == CURLOPT_PROXY_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_PROXY_SSLKEY || \
|
||||
(option) == CURLOPT_PROXY_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_TYPE || \
|
||||
(option) == CURLOPT_RANDOM_FILE || \
|
||||
(option) == CURLOPT_RANGE || \
|
||||
(option) == CURLOPT_REFERER || \
|
||||
(option) == CURLOPT_RTSP_SESSION_ID || \
|
||||
(option) == CURLOPT_RTSP_STREAM_URI || \
|
||||
(option) == CURLOPT_RTSP_TRANSPORT || \
|
||||
(option) == CURLOPT_SERVICE_NAME || \
|
||||
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
||||
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
|
||||
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
||||
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
||||
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
|
||||
(option) == CURLOPT_SSLCERT || \
|
||||
(option) == CURLOPT_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_SSLENGINE || \
|
||||
(option) == CURLOPT_SSLKEY || \
|
||||
(option) == CURLOPT_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_TLSAUTH_PASSWORD || \
|
||||
(option) == CURLOPT_TLSAUTH_TYPE || \
|
||||
(option) == CURLOPT_TLSAUTH_USERNAME || \
|
||||
(option) == CURLOPT_UNIX_SOCKET_PATH || \
|
||||
(option) == CURLOPT_URL || \
|
||||
(option) == CURLOPT_USERAGENT || \
|
||||
(option) == CURLOPT_USERNAME || \
|
||||
(option) == CURLOPT_USERPWD || \
|
||||
(option) == CURLOPT_XOAUTH2_BEARER || \
|
||||
0) |
||||
|
||||
/* evaluates to true if option takes a curl_write_callback argument */ |
||||
#define _curl_is_write_cb_option(option) \ |
||||
((option) == CURLOPT_HEADERFUNCTION || \
|
||||
(option) == CURLOPT_WRITEFUNCTION) |
||||
|
||||
/* evaluates to true if option takes a curl_conv_callback argument */ |
||||
#define _curl_is_conv_cb_option(option) \ |
||||
((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) |
||||
|
||||
/* evaluates to true if option takes a data argument to pass to a callback */ |
||||
#define _curl_is_cb_data_option(option) \ |
||||
((option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_CLOSESOCKETDATA || \
|
||||
(option) == CURLOPT_DEBUGDATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
(option) == CURLOPT_HEADERDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PRIVATE || \
|
||||
(option) == CURLOPT_PROGRESSDATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_WRITEDATA || \
|
||||
0) |
||||
|
||||
/* evaluates to true if option takes a POST data argument (void* or char*) */ |
||||
#define _curl_is_postfields_option(option) \ |
||||
((option) == CURLOPT_POSTFIELDS || \
|
||||
(option) == CURLOPT_COPYPOSTFIELDS || \
|
||||
0) |
||||
|
||||
/* evaluates to true if option takes a struct curl_slist * argument */ |
||||
#define _curl_is_slist_option(option) \ |
||||
((option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_PROXYHEADER || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
(option) == CURLOPT_RESOLVE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
0) |
||||
|
||||
/* groups of curl_easy_getinfo infos that take the same type of argument */ |
||||
|
||||
/* evaluates to true if info expects a pointer to char * argument */ |
||||
#define _curl_is_string_info(info) \ |
||||
(CURLINFO_STRING < (info) && (info) < CURLINFO_LONG) |
||||
|
||||
/* evaluates to true if info expects a pointer to long argument */ |
||||
#define _curl_is_long_info(info) \ |
||||
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) |
||||
|
||||
/* evaluates to true if info expects a pointer to double argument */ |
||||
#define _curl_is_double_info(info) \ |
||||
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) |
||||
|
||||
/* true if info expects a pointer to struct curl_slist * argument */ |
||||
#define _curl_is_slist_info(info) \ |
||||
(((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST)) |
||||
|
||||
/* true if info expects a pointer to struct curl_tlssessioninfo * argument */ |
||||
#define _curl_is_tlssessioninfo_info(info) \ |
||||
(((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION)) |
||||
|
||||
/* true if info expects a pointer to struct curl_certinfo * argument */ |
||||
#define _curl_is_certinfo_info(info) ((info) == CURLINFO_CERTINFO) |
||||
|
||||
/* true if info expects a pointer to struct curl_socket_t argument */ |
||||
#define _curl_is_socket_info(info) \ |
||||
(CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T) |
||||
|
||||
/* true if info expects a pointer to curl_off_t argument */ |
||||
#define _curl_is_off_t_info(info) \ |
||||
(CURLINFO_OFF_T < (info)) |
||||
|
||||
|
||||
/* typecheck helpers -- check whether given expression has requested type*/ |
||||
|
||||
/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
|
||||
* otherwise define a new macro. Search for __builtin_types_compatible_p |
||||
* in the GCC manual. |
||||
* NOTE: these macros MUST NOT EVALUATE their arguments! The argument is |
||||
* the actual expression passed to the curl_easy_setopt macro. This |
||||
* means that you can only apply the sizeof and __typeof__ operators, no |
||||
* == or whatsoever. |
||||
*/ |
||||
|
||||
/* XXX: should evaluate to true iff expr is a pointer */ |
||||
#define _curl_is_any_ptr(expr) \ |
||||
(sizeof(expr) == sizeof(void *)) |
||||
|
||||
/* evaluates to true if expr is NULL */ |
||||
/* XXX: must not evaluate expr, so this check is not accurate */ |
||||
#define _curl_is_NULL(expr) \ |
||||
(__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL))) |
||||
|
||||
/* evaluates to true if expr is type*, const type* or NULL */ |
||||
#define _curl_is_ptr(expr, type) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), const type *)) |
||||
|
||||
/* evaluates to true if expr is one of type[], type*, NULL or const type* */ |
||||
#define _curl_is_arr(expr, type) \ |
||||
(_curl_is_ptr((expr), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type [])) |
||||
|
||||
/* evaluates to true if expr is a string */ |
||||
#define _curl_is_string(expr) \ |
||||
(_curl_is_arr((expr), char) || \
|
||||
_curl_is_arr((expr), signed char) || \
|
||||
_curl_is_arr((expr), unsigned char)) |
||||
|
||||
/* evaluates to true if expr is a long (no matter the signedness)
|
||||
* XXX: for now, int is also accepted (and therefore short and char, which |
||||
* are promoted to int when passed to a variadic function) */ |
||||
#define _curl_is_long(expr) \ |
||||
(__builtin_types_compatible_p(__typeof__(expr), long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned char)) |
||||
|
||||
/* evaluates to true if expr is of type curl_off_t */ |
||||
#define _curl_is_off_t(expr) \ |
||||
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) |
||||
|
||||
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ |
||||
/* XXX: also check size of an char[] array? */ |
||||
#define _curl_is_error_buffer(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char[])) |
||||
|
||||
/* evaluates to true if expr is of type (const) void* or (const) FILE* */ |
||||
#if 0 |
||||
#define _curl_is_cb_data(expr) \ |
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_ptr((expr), FILE)) |
||||
#else /* be less strict */ |
||||
#define _curl_is_cb_data(expr) \ |
||||
_curl_is_any_ptr(expr) |
||||
#endif |
||||
|
||||
/* evaluates to true if expr is of type FILE* */ |
||||
#define _curl_is_FILE(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), FILE *))) |
||||
|
||||
/* evaluates to true if expr can be passed as POST data (void* or char*) */ |
||||
#define _curl_is_postfields(expr) \ |
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_arr((expr), char)) |
||||
|
||||
/* FIXME: the whole callback checking is messy...
|
||||
* The idea is to tolerate char vs. void and const vs. not const |
||||
* pointers in arguments at least |
||||
*/ |
||||
/* helper: __builtin_types_compatible_p distinguishes between functions and
|
||||
* function pointers, hide it */ |
||||
#define _curl_callback_compatible(func, type) \ |
||||
(__builtin_types_compatible_p(__typeof__(func), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(func) *, type)) |
||||
|
||||
/* evaluates to true if expr is of type curl_read_callback or "similar" */ |
||||
#define _curl_is_read_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), __typeof__(fread) *) || \
|
||||
_curl_callback_compatible((expr), curl_read_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback6)) |
||||
typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *); |
||||
typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *); |
||||
typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *); |
||||
typedef size_t (*_curl_read_callback4)(void *, size_t, size_t, void *); |
||||
typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *); |
||||
typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *); |
||||
|
||||
/* evaluates to true if expr is of type curl_write_callback or "similar" */ |
||||
#define _curl_is_write_cb(expr) \ |
||||
(_curl_is_read_cb(expr) || \
|
||||
_curl_callback_compatible((expr), __typeof__(fwrite) *) || \
|
||||
_curl_callback_compatible((expr), curl_write_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback6)) |
||||
typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *); |
||||
typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t, |
||||
const void *); |
||||
typedef size_t (*_curl_write_callback3)(const char *, size_t, size_t, FILE *); |
||||
typedef size_t (*_curl_write_callback4)(const void *, size_t, size_t, void *); |
||||
typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t, |
||||
const void *); |
||||
typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *); |
||||
|
||||
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ |
||||
#define _curl_is_ioctl_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_ioctl_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback4)) |
||||
typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *); |
||||
typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *); |
||||
typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *); |
||||
typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *); |
||||
|
||||
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */ |
||||
#define _curl_is_sockopt_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_sockopt_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback2)) |
||||
typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); |
||||
typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t, |
||||
curlsocktype); |
||||
|
||||
/* evaluates to true if expr is of type curl_opensocket_callback or
|
||||
"similar" */ |
||||
#define _curl_is_opensocket_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_opensocket_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback4)) |
||||
typedef curl_socket_t (*_curl_opensocket_callback1) |
||||
(void *, curlsocktype, struct curl_sockaddr *); |
||||
typedef curl_socket_t (*_curl_opensocket_callback2) |
||||
(void *, curlsocktype, const struct curl_sockaddr *); |
||||
typedef curl_socket_t (*_curl_opensocket_callback3) |
||||
(const void *, curlsocktype, struct curl_sockaddr *); |
||||
typedef curl_socket_t (*_curl_opensocket_callback4) |
||||
(const void *, curlsocktype, const struct curl_sockaddr *); |
||||
|
||||
/* evaluates to true if expr is of type curl_progress_callback or "similar" */ |
||||
#define _curl_is_progress_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_progress_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback2)) |
||||
typedef int (*_curl_progress_callback1)(void *, |
||||
double, double, double, double); |
||||
typedef int (*_curl_progress_callback2)(const void *, |
||||
double, double, double, double); |
||||
|
||||
/* evaluates to true if expr is of type curl_debug_callback or "similar" */ |
||||
#define _curl_is_debug_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_debug_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback8)) |
||||
typedef int (*_curl_debug_callback1) (CURL *, |
||||
curl_infotype, char *, size_t, void *); |
||||
typedef int (*_curl_debug_callback2) (CURL *, |
||||
curl_infotype, char *, size_t, const void *); |
||||
typedef int (*_curl_debug_callback3) (CURL *, |
||||
curl_infotype, const char *, size_t, void *); |
||||
typedef int (*_curl_debug_callback4) (CURL *, |
||||
curl_infotype, const char *, size_t, const void *); |
||||
typedef int (*_curl_debug_callback5) (CURL *, |
||||
curl_infotype, unsigned char *, size_t, void *); |
||||
typedef int (*_curl_debug_callback6) (CURL *, |
||||
curl_infotype, unsigned char *, size_t, const void *); |
||||
typedef int (*_curl_debug_callback7) (CURL *, |
||||
curl_infotype, const unsigned char *, size_t, void *); |
||||
typedef int (*_curl_debug_callback8) (CURL *, |
||||
curl_infotype, const unsigned char *, size_t, const void *); |
||||
|
||||
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ |
||||
/* this is getting even messier... */ |
||||
#define _curl_is_ssl_ctx_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_ssl_ctx_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback8)) |
||||
typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *, |
||||
const void *); |
||||
#ifdef HEADER_SSL_H |
||||
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
|
||||
* this will of course break if we're included before OpenSSL headers... |
||||
*/ |
||||
typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *); |
||||
typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, |
||||
const void *); |
||||
#else |
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; |
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; |
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7; |
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8; |
||||
#endif |
||||
|
||||
/* evaluates to true if expr is of type curl_conv_callback or "similar" */ |
||||
#define _curl_is_conv_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_conv_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback4)) |
||||
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length); |
||||
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length); |
||||
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length); |
||||
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length); |
||||
|
||||
/* evaluates to true if expr is of type curl_seek_callback or "similar" */ |
||||
#define _curl_is_seek_cb(expr) \ |
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_seek_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback2)) |
||||
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int); |
||||
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int); |
||||
|
||||
|
||||
#endif /* __CURL_TYPECHECK_GCC_H */ |
||||
Binary file not shown.
Binary file not shown.
@ -1,513 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
||||
<DOCUMENT Type="Advanced Installer" CreateVersion="10.9" version="18.0" Modules="enterprise" RootPath="." Language="en" Id="{DC564647-6BF0-4550-87F4-89C938D0159C}"> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent"> |
||||
<ROW Property="AI_BITMAP_DISPLAY_MODE" Value="0"/> |
||||
<ROW Property="AI_EMBD_MSI_EXTR_PATH" Value="[TempFolder]" ValueLocId="-"/> |
||||
<ROW Property="AI_EXTERNALUIUNINSTALLERNAME" MultiBuildValue="DefaultBuild:aiui"/> |
||||
<ROW Property="AI_FINDEXE_TITLE" Value="Select the installation package for [|ProductName]" ValueLocId="AI.Property.FindExeTitle"/> |
||||
<ROW Property="AI_PREDEF_LCONDS_PROPS" Value="AI_DETECTED_DOTNET_VERSION"/> |
||||
<ROW Property="AI_PRODUCTNAME_ARP" Value="ZeroTier One"/> |
||||
<ROW Property="AI_REQUIRED_DOTNET_DISPLAY" MultiBuildValue="DefaultBuild:4.5" ValueLocId="-"/> |
||||
<ROW Property="AI_REQUIRED_DOTNET_VERSION" MultiBuildValue="DefaultBuild:4.5" ValueLocId="-"/> |
||||
<ROW Property="AI_UNINSTALLER" Value="msiexec.exe"/> |
||||
<ROW Property="ALLUSERS" Value="1"/> |
||||
<ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]."/> |
||||
<ROW Property="ARPCONTACT" Value="contact@zerotier.com"/> |
||||
<ROW Property="ARPHELPLINK" Value="https://www.zerotier.com/"/> |
||||
<ROW Property="ARPHELPTELEPHONE" Value="949-505-9993"/> |
||||
<ROW Property="ARPNOMODIFY" MultiBuildValue="DefaultBuild:1"/> |
||||
<ROW Property="ARPNOREPAIR" Value="1" MultiBuildValue="ExeBuild:1"/> |
||||
<ROW Property="ARPSYSTEMCOMPONENT" Value="1"/> |
||||
<ROW Property="ARPURLINFOABOUT" Value="https://www.zerotier.com/"/> |
||||
<ROW Property="ARPURLUPDATEINFO" Value="https://www.zerotier.com/"/> |
||||
<ROW Property="AiFeatIcoZeroTierOne" Value="ZeroTierIcon.exe" Type="8"/> |
||||
<ROW Property="CTRLS" Value="2"/> |
||||
<ROW Property="LIMITUI" MultiBuildValue="DefaultBuild:1"/> |
||||
<ROW Property="MSIFASTINSTALL" MultiBuildValue="DefaultBuild:2"/> |
||||
<ROW Property="Manufacturer" Value="ZeroTier, Inc."/> |
||||
<ROW Property="ProductCode" Value="1033:{EB928ABB-D74D-44AC-96BE-DABCBEAE9EB3} " Type="16"/> |
||||
<ROW Property="ProductLanguage" Value="1033"/> |
||||
<ROW Property="ProductName" Value="ZeroTier One"/> |
||||
<ROW Property="ProductVersion" Value="1.6.5" Type="32"/> |
||||
<ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/> |
||||
<ROW Property="RUNAPPLICATION" Value="1" Type="4"/> |
||||
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/> |
||||
<ROW Property="UpgradeCode" Value="{B0E2A5F3-88B6-4E77-B922-CB4739B4C4C8}"/> |
||||
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME#ExeBuild:Windows 9x/ME" ValueLocId="-"/> |
||||
<ROW Property="WindowsType9XDisplay" MultiBuildValue="DefaultBuild:Windows 9x/ME#ExeBuild:Windows 9x/ME" ValueLocId="-"/> |
||||
<ROW Property="WindowsTypeNT40" MultiBuildValue="DefaultBuild:Windows NT 4.0#ExeBuild:Windows NT 4.0" ValueLocId="-"/> |
||||
<ROW Property="WindowsTypeNT40Display" MultiBuildValue="DefaultBuild:Windows NT 4.0#ExeBuild:Windows NT 4.0" ValueLocId="-"/> |
||||
<ROW Property="WindowsTypeNT50" MultiBuildValue="DefaultBuild:Windows 2000#ExeBuild:Windows 2000" ValueLocId="-"/> |
||||
<ROW Property="WindowsTypeNT50Display" MultiBuildValue="DefaultBuild:Windows 2000#ExeBuild:Windows 2000" ValueLocId="-"/> |
||||
<ROW Property="WindowsTypeNT5X" MultiBuildValue="DefaultBuild:Windows XP/2003#ExeBuild:Windows XP/2003" ValueLocId="-"/> |
||||
<ROW Property="WindowsTypeNT5XDisplay" MultiBuildValue="DefaultBuild:Windows XP/2003#ExeBuild:Windows XP/2003" ValueLocId="-"/> |
||||
<ROW Property="ZTHEADLESS" Value="No"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiDirsComponent"> |
||||
<ROW Directory="APPDIR" Directory_Parent="TARGETDIR" DefaultDir="APPDIR:." IsPseudoRoot="1" DirectoryOptions="2"/> |
||||
<ROW Directory="CommonAppDataFolder" Directory_Parent="TARGETDIR" DefaultDir="COMMON~1|CommonAppDataFolder" IsPseudoRoot="1"/> |
||||
<ROW Directory="FontsFolder" Directory_Parent="TARGETDIR" DefaultDir="FONTSF~1|FontsFolder" IsPseudoRoot="1"/> |
||||
<ROW Directory="One_Dir" Directory_Parent="ZeroTier_Dir" DefaultDir="One"/> |
||||
<ROW Directory="ProgramFilesFolder" Directory_Parent="TARGETDIR" DefaultDir="PROGRA~1|ProgramFilesFolder" IsPseudoRoot="1"/> |
||||
<ROW Directory="ProgramMenuFolder" Directory_Parent="TARGETDIR" DefaultDir="PROGRA~2|ProgramMenuFolder" IsPseudoRoot="1"/> |
||||
<ROW Directory="TARGETDIR" DefaultDir="SourceDir"/> |
||||
<ROW Directory="ZeroTier_Dir" Directory_Parent="CommonAppDataFolder" DefaultDir="ZeroTier"/> |
||||
<ROW Directory="networks.d_Dir" Directory_Parent="One_Dir" DefaultDir="networks.d"/> |
||||
<ROW Directory="regid.201001.com.zerotier_Dir" Directory_Parent="CommonAppDataFolder" DefaultDir="REGID2~1.ZER|regid.2010-01.com.zerotier"/> |
||||
<ROW Directory="tapwindows_Dir" Directory_Parent="One_Dir" DefaultDir="TAP-WI~1|tap-windows"/> |
||||
<ROW Directory="x64_Dir" Directory_Parent="tapwindows_Dir" DefaultDir="x64"/> |
||||
<ROW Directory="x64_pre_win10_Dir" Directory_Parent="x64_Dir" DefaultDir=".:X64_PR~1|x64_pre_win10"/> |
||||
<ROW Directory="x86_Dir" Directory_Parent="tapwindows_Dir" DefaultDir="x86"/> |
||||
<ROW Directory="x86_pre_win10_Dir" Directory_Parent="x86_Dir" DefaultDir=".:X86_PR~1|x86_pre_win10"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent"> |
||||
<ROW Component="AI_CustomARPName" ComponentId="{3E28390A-EFBD-4C66-AC5B-0E8CC0503370}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/> |
||||
<ROW Component="AI_DisableModify" ComponentId="{46FFA8C5-A0CB-4E05-9AD3-911D543DE8CA}" Directory_="APPDIR" Attributes="4" KeyPath="NoModify" Options="1"/> |
||||
<ROW Component="AI_ExePath" ComponentId="{8E02B36C-7A19-429B-A93E-77A9261AC918}" Directory_="APPDIR" Attributes="4" KeyPath="AI_ExePath"/> |
||||
<ROW Component="APPDIR" ComponentId="{4DD7907D-D7FE-4CD6-B1A0-B5C1625F5133}" Directory_="APPDIR" Attributes="0"/> |
||||
<ROW Component="Hardcodet.Wpf.TaskbarNotification.dll" ComponentId="{BEA825AF-2555-44AF-BE40-47FFC16DCBA6}" Directory_="APPDIR" Attributes="0" Condition="ZTHEADLESS = "No"" KeyPath="Hardcodet.Wpf.TaskbarNotification.dll"/> |
||||
<ROW Component="Newtonsoft.Json.dll" ComponentId="{0B2F229D-5425-42FB-9E28-F6D25AB2B4B5}" Directory_="APPDIR" Attributes="0" Condition="ZTHEADLESS = "No"" KeyPath="Newtonsoft.Json.dll"/> |
||||
<ROW Component="ProductInformation" ComponentId="{DB078D04-EA8E-4A7C-9001-89BAD932F9D9}" Directory_="APPDIR" Attributes="4" KeyPath="Version"/> |
||||
<ROW Component="UI_fonts" ComponentId="{9F415308-A118-419F-AD8A-678DEA856B78}" Directory_="FontsFolder" Attributes="144" Condition="ZTHEADLESS = "No"" Type="0"/> |
||||
<ROW Component="ZeroTierOne.exe" ComponentId="{18B51525-77BF-4FD9-9C18-A10D4CFC25BA}" Directory_="APPDIR" Attributes="0" Condition="ZTHEADLESS = "No"" KeyPath="ZeroTierOne.exe"/> |
||||
<ROW Component="copyutil.exe" ComponentId="{9B9E89FB-81CB-4500-978B-11E2FA81B5B4}" Directory_="APPDIR" Attributes="0" Condition="ZTHEADLESS = "No"" KeyPath="copyutil.exe"/> |
||||
<ROW Component="networks.d" ComponentId="{EF54D0DF-889F-41DC-AF5C-4E7F96AB1C8B}" Directory_="networks.d_Dir" Attributes="0"/> |
||||
<ROW Component="regid.201001.com.zerotier" ComponentId="{A39C80FC-6A8F-454F-9052-10DAC3C3B139}" Directory_="regid.201001.com.zerotier_Dir" Attributes="0"/> |
||||
<ROW Component="zerotierone_x64.exe" ComponentId="{DFCFB72D-B055-4E60-B6D8-81FF585C2183}" Directory_="One_Dir" Attributes="256" Condition="VersionNT64" KeyPath="zerotierone_x64.exe"/> |
||||
<ROW Component="zerotierone_x86.exe" ComponentId="{5D2F3366-4FE1-40A4-A81A-66C49FA11F1C}" Directory_="One_Dir" Attributes="0" Condition="NOT VersionNT64" KeyPath="zerotierone_x86.exe"/> |
||||
<ROW Component="zttap300_x64_pre_win10" ComponentId="{B520DF93-641A-4450-8960-397880EF7432}" Directory_="x64_pre_win10_Dir" Attributes="256" Condition="VersionNT64 AND VersionNT < 1000" KeyPath="zttap300.cat"/> |
||||
<ROW Component="zttap300_x64_win10" ComponentId="{D4839F5E-FB94-41CB-9B1B-177A97ADC904}" Directory_="x64_Dir" Attributes="256" Condition="VersionNT64 AND VersionNT >= 1000" KeyPath="zttap300.inf"/> |
||||
<ROW Component="zttap300_x86_pre_win10" ComponentId="{144AC4E8-C08C-4132-A90E-234EEB3BC1DF}" Directory_="x86_pre_win10_Dir" Attributes="0" Condition="(NOT VersionNT64) And VersionNT < 1000" KeyPath="zttap300.cat_1" Type="0"/> |
||||
<ROW Component="zttap300_x86_win10" ComponentId="{9F913E48-095B-4EA3-98DA-EDAB1593F3E3}" Directory_="x86_Dir" Attributes="0" Condition="(NOT VersionNT64) And VersionNT >= 1000" KeyPath="zttap300.cat_3" Type="0"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent"> |
||||
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0"/> |
||||
<ROW Feature="ZeroTierOne" Title="MainFeature" Description="ZeroTier One" Display="1" Level="1" Directory_="APPDIR" Attributes="0"/> |
||||
<ATTRIBUTE name="CurrentFeature" value="ZeroTierOne"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent"> |
||||
<ROW File="zerotierone_x86.exe" Component_="zerotierone_x86.exe" FileName="ZEROTI~1.EXE|zerotier-one_x86.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\Build\Win32\Release\zerotier-one_x86.exe" SelfReg="false" DigSign="true"/> |
||||
<ROW File="zerotierone_x64.exe" Component_="zerotierone_x64.exe" FileName="ZEROTI~2.EXE|zerotier-one_x64.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\Build\x64\Release\zerotier-one_x64.exe" SelfReg="false" DigSign="true"/> |
||||
<ROW File="ZeroTierOne.exe" Component_="ZeroTierOne.exe" FileName="ZEROTI~1.EXE|ZeroTier One.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\WinUI\bin\Release\ZeroTier One.exe" SelfReg="false" DigSign="true"/> |
||||
<ROW File="zttap300.cat_2" Component_="zttap300_x64_win10" FileName="zttap300.cat" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64\zttap300.cat" SelfReg="false"/> |
||||
<ROW File="zttap300.sys_2" Component_="zttap300_x64_win10" FileName="zttap300.sys" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64\zttap300.sys" SelfReg="false"/> |
||||
<ROW File="zttap300.inf" Component_="zttap300_x64_win10" FileName="zttap300.inf" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64\zttap300.inf" SelfReg="false"/> |
||||
<ROW File="zttap300.cat_3" Component_="zttap300_x86_win10" FileName="zttap300.cat" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86\zttap300.cat" SelfReg="false"/> |
||||
<ROW File="zttap300.sys_3" Component_="zttap300_x86_win10" FileName="zttap300.sys" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86\zttap300.sys" SelfReg="false"/> |
||||
<ROW File="zttap300.inf_1" Component_="zttap300_x86_win10" FileName="zttap300.inf" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86\zttap300.inf" SelfReg="false"/> |
||||
<ROW File="Newtonsoft.Json.dll" Component_="Newtonsoft.Json.dll" FileName="NEWTON~1.DLL|Newtonsoft.Json.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\WinUI\bin\Release\Newtonsoft.Json.dll" SelfReg="false" DigSign="true"/> |
||||
<ROW File="copyutil.exe" Component_="copyutil.exe" FileName="copyutil.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\copyutil\bin\Release\copyutil.exe" SelfReg="false" DigSign="true"/> |
||||
<ROW File="Hardcodet.Wpf.TaskbarNotification.dll" Component_="Hardcodet.Wpf.TaskbarNotification.dll" FileName="HARDCO~1.DLL|Hardcodet.Wpf.TaskbarNotification.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\..\..\windows\WinUI\bin\Release\Hardcodet.Wpf.TaskbarNotification.dll" SelfReg="false" DigSign="true"/> |
||||
<ROW File="segoeui.ttf" Component_="UI_fonts" FileName="segoeui.ttf" Attributes="0" SourcePath="..\..\..\windows\WinUI\Fonts\segoeui.ttf" SelfReg="false"/> |
||||
<ROW File="segoeuib.ttf" Component_="UI_fonts" FileName="segoeuib.ttf" Attributes="0" SourcePath="..\..\..\windows\WinUI\Fonts\segoeuib.ttf" SelfReg="false"/> |
||||
<ROW File="segoeuii.ttf" Component_="UI_fonts" FileName="segoeuii.ttf" Attributes="0" SourcePath="..\..\..\windows\WinUI\Fonts\segoeuii.ttf" SelfReg="false"/> |
||||
<ROW File="segoeuiz.ttf" Component_="UI_fonts" FileName="segoeuiz.ttf" Attributes="0" SourcePath="..\..\..\windows\WinUI\Fonts\segoeuiz.ttf" SelfReg="false"/> |
||||
<ROW File="zttap300.cat" Component_="zttap300_x64_pre_win10" FileName="zttap300.cat" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64.old\zttap300.cat" SelfReg="false"/> |
||||
<ROW File="zttap300.inf_2" Component_="zttap300_x64_pre_win10" FileName="zttap300.inf" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64.old\zttap300.inf" SelfReg="false"/> |
||||
<ROW File="zttap300.sys" Component_="zttap300_x64_pre_win10" FileName="zttap300.sys" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x64.old\zttap300.sys" SelfReg="false"/> |
||||
<ROW File="zttap300.cat_1" Component_="zttap300_x86_pre_win10" FileName="zttap300.cat" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86.old\zttap300.cat" SelfReg="false"/> |
||||
<ROW File="zttap300.inf_3" Component_="zttap300_x86_pre_win10" FileName="zttap300.inf" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86.old\zttap300.inf" SelfReg="false"/> |
||||
<ROW File="zttap300.sys_1" Component_="zttap300_x86_pre_win10" FileName="zttap300.sys" Attributes="0" SourcePath="..\..\bin\tap-windows-ndis6\x86.old\zttap300.sys" SelfReg="false"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.custcomp.AiComponentAliasComponent"> |
||||
<ROW AliasRowId="AI_CustomARPName" AliasRowOperation="2" Condition="#DefaultBuild:ZTHEADLESS="No""/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.AiPersistentDataComponent"> |
||||
<ROW PersistentRow="segoeui.ttf" Type="0" Condition="1"/> |
||||
<ROW PersistentRow="segoeuib.ttf" Type="0" Condition="1"/> |
||||
<ROW PersistentRow="segoeuii.ttf" Type="0" Condition="1"/> |
||||
<ROW PersistentRow="segoeuiz.ttf" Type="0" Condition="1"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.BootstrOptComponent"> |
||||
<ROW BootstrOptKey="GlobalOptions" GeneralOptions="qh" DownloadFolder="[AppDataFolder][|Manufacturer]\[|ProductName]\prerequisites"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.BootstrapperUISequenceComponent"> |
||||
<ROW Action="AI_DetectSoftware" Sequence="101"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.BuildComponent"> |
||||
<ROW BuildKey="DefaultBuild" BuildName="MSI" BuildOrder="1" BuildType="1" PackageFolder="..\..\.." PackageFileName="ZeroTier One" Languages="en" InstallationType="4" ExtUI="true" UseLargeSchema="true"/> |
||||
<ROW BuildKey="ExeBuild" BuildName="update" BuildOrder="2" BuildType="1" PackageFolder="..\..\.." PackageFileName="ZeroTier One" Languages="en" InstallationType="2" CabsLocation="1" CompressCabs="false" UseLzma="true" LzmaMethod="2" LzmaCompressionLevel="4" PackageType="1" FilesInsideExe="true" ExeIconPath="..\..\..\artwork\ZeroTierIcon.ico" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" MsiCmdLine="/qn" ExtUI="true" UseLargeSchema="true" ExeName="zt1_update_2_1,2_[|ProductVersion]_0"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.CacheComponent"> |
||||
<ATTRIBUTE name="Enable" value="false"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.ChainedPackageComponent"> |
||||
<ROW ChainedPackage="ZeroTierOne_NDIS6_x64.msi" Order="1" Options="110" InstallCondition="VersionNT64 AND VersionNT >= 1000" MaintenanceCondition="FALSE" RemoveCondition="REMOVE="ALL" AND VersionNT64"/> |
||||
<ROW ChainedPackage="ZeroTierOne_NDIS6_x64.msi_1" Order="3" Options="110" InstallCondition="VersionNT64 AND VersionNT < 1000" MaintenanceCondition="FALSE" RemoveCondition="REMOVE="ALL" AND VersionNT64"/> |
||||
<ROW ChainedPackage="ZeroTierOne_NDIS6_x86.msi" Order="2" Options="110" InstallCondition="(NOT VersionNT64) And VersionNT >= 1000" MaintenanceCondition="FALSE" RemoveCondition="REMOVE="ALL" AND (NOT VersionNT64)"/> |
||||
<ROW ChainedPackage="ZeroTierOne_NDIS6_x86.msi_1" Order="4" Options="110" InstallCondition="(NOT VersionNT64) And VersionNT < 1000" MaintenanceCondition="FALSE" RemoveCondition="REMOVE="ALL" AND (NOT VersionNT64)"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.ChainedPackageFileComponent"> |
||||
<ROW FileId="ZeroTierOne_NDIS6_x64.msi" ChainedPackage="ZeroTierOne_NDIS6_x64.msi" Options="1" TargetPath="ZeroTierOne_NDIS6_x64.msi" Content="..\..\bin\tap-windows-ndis6\x64\ZeroTierOne_NDIS6_x64.msi"/> |
||||
<ROW FileId="ZeroTierOne_NDIS6_x64.msi_1" ChainedPackage="ZeroTierOne_NDIS6_x64.msi_1" Options="1" TargetPath="ZeroTierOne_NDIS6_x64.msi" Content="..\..\bin\tap-windows-ndis6\x64.old\ZeroTierOne_NDIS6_x64.msi"/> |
||||
<ROW FileId="ZeroTierOne_NDIS6_x86.msi" ChainedPackage="ZeroTierOne_NDIS6_x86.msi" Options="1" TargetPath="ZeroTierOne_NDIS6_x86.msi" Content="..\..\bin\tap-windows-ndis6\x86\ZeroTierOne_NDIS6_x86.msi"/> |
||||
<ROW FileId="ZeroTierOne_NDIS6_x86.msi_1" ChainedPackage="ZeroTierOne_NDIS6_x86.msi_1" Options="1" TargetPath="ZeroTierOne_NDIS6_x86.msi" Content="..\..\bin\tap-windows-ndis6\x86.old\ZeroTierOne_NDIS6_x86.msi"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent"> |
||||
<ROW Path="<AI_DICTS>ui.ail"/> |
||||
<ROW Path="<AI_DICTS>ui_en.ail"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.DigCertStoreComponent"> |
||||
<ROW TimeStampUrl="http://timestamp.digicert.com" SignerDescription="ZeroTier One" DescriptionUrl="https://www.zerotier.com/" SignOptions="7" SignTool="5" UseSha256="1" KVTenantId="5300bf3b-0eff-4a5f-a63f-821e22ed1730" KVAppId="5f94d77e-b795-41fd-afe7-ec913b03c1d3" KVName="ZeroTier-CS" KVCertName="ZT-EV-CS" KVCertVersion="442c2d6f77874ff99eed4b36f5cb401c"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.FirewallExceptionComponent"> |
||||
<ROW FirewallException="ZeroTierOneControl" Direction="1" DisplayName="ZeroTier One TCP/9993" GroupName="ZeroTierOne" Enabled="1" Scope="*" Condition="1" Profiles="7" Port="9993" Protocol="TCP"/> |
||||
<ROW FirewallException="ZeroTierOneUDP9993" Direction="1" DisplayName="ZeroTier One UDP/9993" GroupName="ZeroTierOne" Enabled="1" Scope="*" Condition="1" Profiles="7" Port="9993" Protocol="UDP"/> |
||||
<ROW FirewallException="ZeroTierOnex64Binary" Direction="1" DisplayName="ZeroTier One x64 Binary" Enabled="1" Scope="*" Condition="((?zerotierone_x64.exe=2) AND ($zerotierone_x64.exe=3))" Profiles="0" AppPath="[#zerotierone_x64.exe]" Port="*" Protocol="ANY"/> |
||||
<ROW FirewallException="ZeroTierOnex86Binary" Direction="1" DisplayName="ZeroTier One x86 Binary" Enabled="1" Scope="*" Condition="((?zerotierone_x86.exe=2) AND ($zerotierone_x86.exe=3))" Profiles="0" AppPath="[#zerotierone_x86.exe]" Port="*" Protocol="ANY"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.FragmentComponent"> |
||||
<ROW Fragment="CommonUI.aip" Path="<AI_FRAGS>CommonUI.aip"/> |
||||
<ROW Fragment="MaintenanceTypeDlg.aip" Path="<AI_THEMES>classic\fragments\MaintenanceTypeDlg.aip"/> |
||||
<ROW Fragment="MaintenanceWelcomeDlg.aip" Path="<AI_THEMES>classic\fragments\MaintenanceWelcomeDlg.aip"/> |
||||
<ROW Fragment="SequenceDialogs.aip" Path="<AI_THEMES>classic\fragments\SequenceDialogs.aip"/> |
||||
<ROW Fragment="Sequences.aip" Path="<AI_FRAGS>Sequences.aip"/> |
||||
<ROW Fragment="StaticUIStrings.aip" Path="<AI_FRAGS>StaticUIStrings.aip"/> |
||||
<ROW Fragment="UI.aip" Path="<AI_THEMES>classic\fragments\UI.aip"/> |
||||
<ROW Fragment="Validation.aip" Path="<AI_FRAGS>Validation.aip"/> |
||||
<ROW Fragment="VerifyRemoveDlg.aip" Path="<AI_THEMES>classic\fragments\VerifyRemoveDlg.aip"/> |
||||
<ROW Fragment="VerifyRepairDlg.aip" Path="<AI_THEMES>classic\fragments\VerifyRepairDlg.aip"/> |
||||
<ROW Fragment="WelcomeDlg.aip" Path="<AI_THEMES>classic\fragments\WelcomeDlg.aip"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiActionTextComponent"> |
||||
<ROW Action="AI_AiBackupImmediate" Description="Preparing backup operation" DescriptionLocId="ActionText.Description.AI_AiBackupImmediate" Template="Path: [1]" TemplateLocId="ActionText.Template.AI_AiBackupImmediate"/> |
||||
<ROW Action="AI_AiBackupRollback" Description="Rollback backup" DescriptionLocId="ActionText.Description.AI_AiBackupRollback" Template="Path: [1]" TemplateLocId="ActionText.Template.AI_AiBackupRollback"/> |
||||
<ROW Action="AI_AiRestoreDeferred" Description="Executing restore operation" DescriptionLocId="ActionText.Description.AI_AiRestoreDeferred" Template="Path: [1]" TemplateLocId="ActionText.Template.AI_AiRestoreDeferred"/> |
||||
<ROW Action="AI_AiRestoreDeferredImpersonate" Description="Executing restore operation" DescriptionLocId="ActionText.Description.AI_AiRestoreDeferred" Template="Path: [1]" TemplateLocId="ActionText.Template.AI_AiRestoreDeferred"/> |
||||
<ROW Action="AI_AiRestoreRollback" Description="Rollback restore" DescriptionLocId="ActionText.Description.AI_AiRestoreRollback" Template="Path: [1]" TemplateLocId="ActionText.Template.AI_AiRestoreRollback"/> |
||||
<ROW Action="AI_DeleteLzma" Description="Deleting files extracted from archive" DescriptionLocId="ActionText.Description.AI_DeleteLzma" TemplateLocId="-"/> |
||||
<ROW Action="AI_DeleteRLzma" Description="Deleting files extracted from archive" DescriptionLocId="ActionText.Description.AI_DeleteLzma" TemplateLocId="-"/> |
||||
<ROW Action="AI_ExtractFiles" Description="Extracting files from archive" DescriptionLocId="ActionText.Description.AI_ExtractLzma" TemplateLocId="-"/> |
||||
<ROW Action="AI_ExtractLzma" Description="Extracting files from archive" DescriptionLocId="ActionText.Description.AI_ExtractLzma" TemplateLocId="-"/> |
||||
<ROW Action="AI_FwConfig" Description="Executing Windows Firewall configurations" DescriptionLocId="ActionText.Description.AI_FwConfig" Template="Configuring Windows Firewall rule: "[1]"" TemplateLocId="ActionText.Template.AI_FwConfig"/> |
||||
<ROW Action="AI_FwInstall" Description="Generating actions to configure Windows Firewall" DescriptionLocId="ActionText.Description.AI_FwInstall"/> |
||||
<ROW Action="AI_FwRemove" Description="Executing Windows Firewall configurations" DescriptionLocId="ActionText.Description.AI_FwRemove" Template="Configuring Windows Firewall rule: "[1]"" TemplateLocId="ActionText.Template.AI_FwRemove"/> |
||||
<ROW Action="AI_FwRollback" Description="Rolling back Windows Firewall configurations." DescriptionLocId="ActionText.Description.AI_FwRollback" Template="Rolling back Windows Firewall configurations." TemplateLocId="ActionText.Template.AI_FwRollback"/> |
||||
<ROW Action="AI_FwUninstall" Description="Generating actions to configure Windows Firewall" DescriptionLocId="ActionText.Description.AI_FwUninstall"/> |
||||
<ROW Action="AI_TxtUpdaterCommit" Description="Commit text file changes. " DescriptionLocId="ActionText.Description.AI_TxtUpdaterCommit" Template="Commit text file changes." TemplateLocId="ActionText.Template.AI_TxtUpdaterCommit"/> |
||||
<ROW Action="AI_TxtUpdaterConfig" Description="Executing text file updates" DescriptionLocId="ActionText.Description.AI_TxtUpdaterConfig" Template="Updating text file: "[1]"" TemplateLocId="ActionText.Template.AI_TxtUpdaterConfig"/> |
||||
<ROW Action="AI_TxtUpdaterInstall" Description="Generating actions to configure text files updates" DescriptionLocId="ActionText.Description.AI_TxtUpdaterInstall"/> |
||||
<ROW Action="AI_TxtUpdaterRollback" Description="Rolling back text file changes. " DescriptionLocId="ActionText.Description.AI_TxtUpdaterRollback" Template="Rolling back text file changes." TemplateLocId="ActionText.Template.AI_TxtUpdaterRollback"/> |
||||
<ROW Action="AI_XmlCommit" Description="Committing XML file configurations." DescriptionLocId="ActionText.Description.AI_XmlCommit" Template="Committing XML file configurations." TemplateLocId="ActionText.Template.AI_XmlCommit"/> |
||||
<ROW Action="AI_XmlConfig" Description="Executing XML file configurations" DescriptionLocId="ActionText.Description.AI_XmlConfig" Template="Configuring XML file: "[1]"" TemplateLocId="ActionText.Template.AI_XmlConfig"/> |
||||
<ROW Action="AI_XmlInstall" Description="Generating actions to configure XML files" DescriptionLocId="ActionText.Description.AI_XmlInstall"/> |
||||
<ROW Action="AI_XmlRemove" Description="Executing XML file configurations" DescriptionLocId="ActionText.Description.AI_XmlRemove" Template="Configuring XML file: "[1]"" TemplateLocId="ActionText.Template.AI_XmlRemove"/> |
||||
<ROW Action="AI_XmlRollback" Description="Rolling back XML file configurations." DescriptionLocId="ActionText.Description.AI_XmlRollback" Template="Rolling back XML file configurations." TemplateLocId="ActionText.Template.AI_XmlRollback"/> |
||||
<ROW Action="AI_XmlUninstall" Description="Generating actions to configure XML files" DescriptionLocId="ActionText.Description.AI_XmlUninstall"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiAppSearchComponent"> |
||||
<ROW Property="AI_SETUPEXEPATH" Signature_="AI_EXE_PATH_CU" Builds="ExeBuild"/> |
||||
<ROW Property="AI_SETUPEXEPATH" Signature_="AI_EXE_PATH_LM" Builds="ExeBuild"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiBinaryComponent"> |
||||
<ROW Name="ExternalUICleaner.dll" SourcePath="<AI_CUSTACTS>ExternalUICleaner.dll"/> |
||||
<ROW Name="NetFirewall.dll" SourcePath="<AI_CUSTACTS>NetFirewall.dll"/> |
||||
<ROW Name="Prereq.dll" SourcePath="<AI_CUSTACTS>Prereq.dll"/> |
||||
<ROW Name="ResourceCleaner.dll" SourcePath="<AI_CUSTACTS>ResourceCleaner.dll"/> |
||||
<ROW Name="SoftwareDetector.dll" SourcePath="<AI_CUSTACTS>SoftwareDetector.dll"/> |
||||
<ROW Name="TxtUpdater.dll" SourcePath="<AI_CUSTACTS>TxtUpdater.dll"/> |
||||
<ROW Name="aicustact.dll" SourcePath="<AI_CUSTACTS>aicustact.dll"/> |
||||
<ROW Name="chainersupport.dll" SourcePath="<AI_CUSTACTS>chainersupport.dll"/> |
||||
<ROW Name="lzmaextractor.dll" SourcePath="<AI_CUSTACTS>lzmaextractor.dll"/> |
||||
<ROW Name="msichainer.exe" SourcePath="<AI_CUSTACTS>msichainer.exe"/> |
||||
<ROW Name="xmlCfg.dll" SourcePath="<AI_CUSTACTS>xmlCfg.dll"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiControlComponent"> |
||||
<ROW Dialog_="WelcomeDlg" Control="WelcomeDlgDialogInitializer" Type="DialogInitializer" X="0" Y="0" Width="0" Height="0" Attributes="0" Order="-1" TextLocId="-" HelpLocId="-" ExtDataLocId="-"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiControlEventComponent"> |
||||
<ROW Dialog_="WelcomeDlg" Control_="Next" Event="EndDialog" Argument="Return" Condition="AI_INSTALL" Ordering="1"/> |
||||
<ROW Dialog_="MaintenanceWelcomeDlg" Control_="Next" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT" Ordering="99"/> |
||||
<ROW Dialog_="CustomizeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_MAINT" Ordering="101"/> |
||||
<ROW Dialog_="CustomizeDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT" Ordering="1"/> |
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_MAINT" Ordering="198"/> |
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="CustomizeDlg" Condition="AI_MAINT" Ordering="202"/> |
||||
<ROW Dialog_="MaintenanceTypeDlg" Control_="ChangeButton" Event="NewDialog" Argument="CustomizeDlg" Condition="AI_MAINT" Ordering="501"/> |
||||
<ROW Dialog_="MaintenanceTypeDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceWelcomeDlg" Condition="AI_MAINT" Ordering="1"/> |
||||
<ROW Dialog_="MaintenanceTypeDlg" Control_="RemoveButton" Event="NewDialog" Argument="VerifyRemoveDlg" Condition="AI_MAINT AND InstallMode="Remove"" Ordering="601"/> |
||||
<ROW Dialog_="VerifyRemoveDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT AND InstallMode="Remove"" Ordering="1"/> |
||||
<ROW Dialog_="MaintenanceTypeDlg" Control_="RepairButton" Event="NewDialog" Argument="VerifyRepairDlg" Condition="AI_MAINT AND InstallMode="Repair"" Ordering="601"/> |
||||
<ROW Dialog_="VerifyRepairDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT AND InstallMode="Repair"" Ordering="1"/> |
||||
<ROW Dialog_="VerifyRepairDlg" Control_="Repair" Event="EndDialog" Argument="Return" Condition="AI_MAINT AND InstallMode="Repair"" Ordering="399" Options="1"/> |
||||
<ROW Dialog_="VerifyRemoveDlg" Control_="Remove" Event="EndDialog" Argument="Return" Condition="AI_MAINT AND InstallMode="Remove"" Ordering="299" Options="1"/> |
||||
<ROW Dialog_="PatchWelcomeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_PATCH" Ordering="201"/> |
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_PATCH" Ordering="199"/> |
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="PatchWelcomeDlg" Condition="AI_PATCH" Ordering="203"/> |
||||
<ROW Dialog_="ResumeDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_RESUME" Ordering="299"/> |
||||
<ROW Dialog_="WelcomeDlg" Control_="Next" Event="SpawnDialog" Argument="OutOfRbDiskDlg" Condition="AI_INSTALL AND OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)" Ordering="2" Options="2"/> |
||||
<ROW Dialog_="WelcomeDlg" Control_="Next" Event="EnableRollback" Argument="False" Condition="AI_INSTALL AND OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"" Ordering="3" Options="2"/> |
||||
<ROW Dialog_="WelcomeDlg" Control_="Next" Event="SpawnDialog" Argument="OutOfDiskDlg" Condition="AI_INSTALL AND ( (OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F") )" Ordering="4" Options="2"/> |
||||
<ROW Dialog_="WelcomeDlg" Control_="WelcomeDlgDialogInitializer" Event="[AI_ButtonText_Next_Orig]" Argument="[ButtonText_Next]" Condition="AI_INSTALL" Ordering="0" Options="2"/> |
||||
<ROW Dialog_="WelcomeDlg" Control_="WelcomeDlgDialogInitializer" Event="[ButtonText_Next]" Argument="[[AI_CommitButton]]" Condition="AI_INSTALL" Ordering="1" Options="2"/> |
||||
<ROW Dialog_="WelcomeDlg" Control_="WelcomeDlgDialogInitializer" Event="[AI_Text_Next_Orig]" Argument="[Text_Next]" Condition="AI_INSTALL" Ordering="2" Options="2"/> |
||||
<ROW Dialog_="WelcomeDlg" Control_="WelcomeDlgDialogInitializer" Event="[Text_Next]" Argument="[Text_Install]" Condition="AI_INSTALL" Ordering="3" Options="2"/> |
||||
<ROW Dialog_="WelcomeDlg" Control_="Back" Event="[ButtonText_Next]" Argument="[AI_ButtonText_Next_Orig]" Condition="AI_INSTALL" Ordering="0" Options="2"/> |
||||
<ROW Dialog_="WelcomeDlg" Control_="Back" Event="[Text_Next]" Argument="[AI_Text_Next_Orig]" Condition="AI_INSTALL" Ordering="1" Options="2"/> |
||||
<ROW Dialog_="FatalError" Control_="Finish" Event="DoAction" Argument="AI_AiBackupCleanup" Condition="1" Ordering="102"/> |
||||
<ROW Dialog_="UserExit" Control_="Finish" Event="DoAction" Argument="AI_AiBackupCleanup" Condition="1" Ordering="101"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiCreateFolderComponent"> |
||||
<ROW Directory_="networks.d_Dir" Component_="networks.d" ManualDelete="false"/> |
||||
<ROW Directory_="regid.201001.com.zerotier_Dir" Component_="regid.201001.com.zerotier" ManualDelete="false"/> |
||||
<ROW Directory_="APPDIR" Component_="APPDIR" ManualDelete="true"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiCustActComponent"> |
||||
<ROW Action="AI_AiBackupCleanup" Type="1" Source="ResourceCleaner.dll" Target="OnAiBackupCleanup" WithoutSeq="true"/> |
||||
<ROW Action="AI_AiBackupImmediate" Type="1" Source="ResourceCleaner.dll" Target="OnAiBackupImmediate"/> |
||||
<ROW Action="AI_AiBackupRollback" Type="11521" Source="ResourceCleaner.dll" Target="OnAiBackupRollback"/> |
||||
<ROW Action="AI_AiRestoreDeferred" Type="11265" Source="ResourceCleaner.dll" Target="OnAiRestoreDeferred"/> |
||||
<ROW Action="AI_AiRestoreDeferredImpersonate" Type="9217" Source="ResourceCleaner.dll" Target="OnAiRestoreDeferredImpersonate"/> |
||||
<ROW Action="AI_AiRestoreRollback" Type="11521" Source="ResourceCleaner.dll" Target="OnAiRestoreRollback" WithoutSeq="true"/> |
||||
<ROW Action="AI_AppSearchEx" Type="1" Source="Prereq.dll" Target="DoAppSearchEx"/> |
||||
<ROW Action="AI_BACKUP_AI_SETUPEXEPATH" Type="51" Source="AI_SETUPEXEPATH_ORIGINAL" Target="[AI_SETUPEXEPATH]"/> |
||||
<ROW Action="AI_CommitChainers" Type="11841" Source="chainersupport.dll" Target="CommitChainedPackages" WithoutSeq="true"/> |
||||
<ROW Action="AI_DATA_SETTER" Type="51" Source="CustomActionData" Target="[~]"/> |
||||
<ROW Action="AI_DATA_SETTER_1" Type="51" Source="CustomActionData" Target="[~]"/> |
||||
<ROW Action="AI_DATA_SETTER_2" Type="51" Source="CustomActionData" Target="[~]"/> |
||||
<ROW Action="AI_DATA_SETTER_3" Type="51" Source="CustomActionData" Target="[~]"/> |
||||
<ROW Action="AI_DATA_SETTER_4" Type="51" Source="CustomActionData" Target="[AI_SETUPEXEPATH]"/> |
||||
<ROW Action="AI_DATA_SETTER_6" Type="51" Source="CustomActionData" Target="ZeroTier One.exe"/> |
||||
<ROW Action="AI_DOWNGRADE" Type="19" Target="4010"/> |
||||
<ROW Action="AI_DeleteCadLzma" Type="51" Source="AI_DeleteLzma" Target="[AI_SETUPEXEPATH]"/> |
||||
<ROW Action="AI_DeleteLzma" Type="1025" Source="lzmaextractor.dll" Target="DeleteLZMAFiles"/> |
||||
<ROW Action="AI_DeleteRCadLzma" Type="51" Source="AI_DeleteRLzma" Target="[AI_SETUPEXEPATH]"/> |
||||
<ROW Action="AI_DeleteRLzma" Type="1281" Source="lzmaextractor.dll" Target="DeleteLZMAFiles"/> |
||||
<ROW Action="AI_DetectSoftware" Type="257" Source="SoftwareDetector.dll" Target="OnDetectSoftware"/> |
||||
<ROW Action="AI_DoRemoveExternalUIStub" Type="3585" Source="ExternalUICleaner.dll" Target="DoRemoveExternalUIStub" WithoutSeq="true"/> |
||||
<ROW Action="AI_DpiContentScale" Type="1" Source="aicustact.dll" Target="DpiContentScale"/> |
||||
<ROW Action="AI_EnableDebugLog" Type="321" Source="aicustact.dll" Target="EnableDebugLog"/> |
||||
<ROW Action="AI_ExtractCadLzma" Type="51" Source="AI_ExtractLzma" Target="[AI_SETUPEXEPATH]"/> |
||||
<ROW Action="AI_ExtractFiles" Type="1" Source="Prereq.dll" Target="ExtractSourceFiles" AdditionalSeq="AI_DATA_SETTER_4"/> |
||||
<ROW Action="AI_ExtractLzma" Type="1025" Source="lzmaextractor.dll" Target="ExtractLZMAFiles"/> |
||||
<ROW Action="AI_FindExeLzma" Type="1" Source="lzmaextractor.dll" Target="FindEXE"/> |
||||
<ROW Action="AI_FwConfig" Type="11265" Source="NetFirewall.dll" Target="OnFwConfig" WithoutSeq="true"/> |
||||
<ROW Action="AI_FwInstall" Type="1" Source="NetFirewall.dll" Target="OnFwInstall" AdditionalSeq="AI_DATA_SETTER_2"/> |
||||
<ROW Action="AI_FwRemove" Type="11265" Source="NetFirewall.dll" Target="OnFwRemove" WithoutSeq="true"/> |
||||
<ROW Action="AI_FwRollback" Type="11521" Source="NetFirewall.dll" Target="OnFwRollback" WithoutSeq="true"/> |
||||
<ROW Action="AI_FwUninstall" Type="1" Source="NetFirewall.dll" Target="OnFwUninstall" AdditionalSeq="AI_DATA_SETTER_3"/> |
||||
<ROW Action="AI_GetArpIconPath" Type="1" Source="aicustact.dll" Target="GetArpIconPath"/> |
||||
<ROW Action="AI_InstallModeCheck" Type="1" Source="aicustact.dll" Target="UpdateInstallMode" WithoutSeq="true"/> |
||||
<ROW Action="AI_LaunchApp" Type="1" Source="aicustact.dll" Target="[#ZeroTierOne.exe]"/> |
||||
<ROW Action="AI_PREPARE_UPGRADE" Type="65" Source="aicustact.dll" Target="PrepareUpgrade"/> |
||||
<ROW Action="AI_PrepareChainers" Type="1" Source="chainersupport.dll" Target="PrepareChainedPackages"/> |
||||
<ROW Action="AI_RESTORE_AI_SETUPEXEPATH" Type="51" Source="AI_SETUPEXEPATH" Target="[AI_SETUPEXEPATH_ORIGINAL]"/> |
||||
<ROW Action="AI_RESTORE_LOCATION" Type="65" Source="aicustact.dll" Target="RestoreLocation"/> |
||||
<ROW Action="AI_RemoveExternalUIStub" Type="1" Source="ExternalUICleaner.dll" Target="RemoveExternalUIStub"/> |
||||
<ROW Action="AI_ResolveKnownFolders" Type="1" Source="aicustact.dll" Target="AI_ResolveKnownFolders"/> |
||||
<ROW Action="AI_RollbackChainers" Type="11585" Source="chainersupport.dll" Target="RollbackChainedPackages" WithoutSeq="true"/> |
||||
<ROW Action="AI_SHOW_LOG" Type="65" Source="aicustact.dll" Target="LaunchLogFile" WithoutSeq="true"/> |
||||
<ROW Action="AI_STORE_LOCATION" Type="51" Source="ARPINSTALLLOCATION" Target="[APPDIR]"/> |
||||
<ROW Action="AI_TxtUpdaterCommit" Type="11777" Source="TxtUpdater.dll" Target="OnTxtUpdaterCommit" WithoutSeq="true"/> |
||||
<ROW Action="AI_TxtUpdaterConfig" Type="11265" Source="TxtUpdater.dll" Target="OnTxtUpdaterConfig" WithoutSeq="true"/> |
||||
<ROW Action="AI_TxtUpdaterInstall" Type="1" Source="TxtUpdater.dll" Target="OnTxtUpdaterInstall"/> |
||||
<ROW Action="AI_TxtUpdaterRollback" Type="11521" Source="TxtUpdater.dll" Target="OnTxtUpdaterRollback" WithoutSeq="true"/> |
||||
<ROW Action="AI_XmlCommit" Type="11777" Source="xmlCfg.dll" Target="OnXmlCommit" WithoutSeq="true"/> |
||||
<ROW Action="AI_XmlConfig" Type="11265" Source="xmlCfg.dll" Target="OnXmlConfig" WithoutSeq="true"/> |
||||
<ROW Action="AI_XmlInstall" Type="1" Source="xmlCfg.dll" Target="OnXmlInstall" AdditionalSeq="AI_DATA_SETTER"/> |
||||
<ROW Action="AI_XmlRemove" Type="11265" Source="xmlCfg.dll" Target="OnXmlRemove" WithoutSeq="true"/> |
||||
<ROW Action="AI_XmlRollback" Type="11521" Source="xmlCfg.dll" Target="OnXmlRollback" WithoutSeq="true"/> |
||||
<ROW Action="AI_XmlUninstall" Type="1" Source="xmlCfg.dll" Target="OnXmlUninstall" AdditionalSeq="AI_DATA_SETTER_1"/> |
||||
<ROW Action="SET_APPDIR" Type="307" Source="APPDIR" Target="[ProgramFilesFolder][Manufacturer]\[ProductName]" MultiBuildTarget="DefaultBuild:[ProgramFilesFolder]ZeroTier\One"/> |
||||
<ROW Action="SET_SHORTCUTDIR" Type="307" Source="SHORTCUTDIR" Target="[ProgramMenuFolder][ProductName]"/> |
||||
<ROW Action="SET_TARGETDIR_TO_APPDIR" Type="51" Source="TARGETDIR" Target="[APPDIR]"/> |
||||
<ROW Action="TapDeviceRemove32" Type="3154" Source="zerotierone_x86.exe" Target="-D"/> |
||||
<ROW Action="TapDeviceRemove64" Type="3154" Source="zerotierone_x64.exe" Target="-D"/> |
||||
<ROW Action="TerminateUI" Type="65" Source="aicustact.dll" Target="StopProcess" Options="1" AdditionalSeq="AI_DATA_SETTER_6"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiEmbeddedChainerComponent"> |
||||
<ROW MsiEmbeddedChainer="msichainer.exe" Condition="VersionMsi >= "4.05"" CommandLine="[AI_CHAINER_CMD_LINE]" Source="msichainer.exe" Type="2"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiEnvComponent"> |
||||
<ROW Environment="Path" Name="=-*Path" Value="[~];[APPDIR]" Component_="ZeroTierOne.exe"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatCompsComponent"> |
||||
<ROW Feature_="ZeroTierOne" Component_="Hardcodet.Wpf.TaskbarNotification.dll"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="Newtonsoft.Json.dll"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="ProductInformation"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="ZeroTierOne.exe"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="copyutil.exe"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="networks.d"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="regid.201001.com.zerotier"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="UI_fonts"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="zerotierone_x64.exe"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="zerotierone_x86.exe"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="zttap300_x86_win10"/> |
||||
<ROW Feature_="MainFeature" Component_="APPDIR"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="zttap300_x64_win10"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="zttap300_x64_pre_win10"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="zttap300_x86_pre_win10"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="AI_CustomARPName"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="AI_DisableModify"/> |
||||
<ROW Feature_="ZeroTierOne" Component_="AI_ExePath"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiFontsComponent"> |
||||
<ROW File_="segoeui.ttf"/> |
||||
<ROW File_="segoeuib.ttf"/> |
||||
<ROW File_="segoeuii.ttf"/> |
||||
<ROW File_="segoeuiz.ttf"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiIconsComponent"> |
||||
<ROW Name="ZeroTierIcon.exe" SourcePath="..\..\..\artwork\ZeroTierIcon.ico" Index="0"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstExSeqComponent"> |
||||
<ROW Action="AI_DOWNGRADE" Condition="AI_NEWERPRODUCTFOUND AND (UILevel <> 5)" Sequence="210"/> |
||||
<ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=""" Sequence="749"/> |
||||
<ROW Action="AI_STORE_LOCATION" Condition="(Not Installed) OR REINSTALL" Sequence="1503"/> |
||||
<ROW Action="AI_PREPARE_UPGRADE" Condition="AI_UPGRADE="No" AND (Not Installed)" Sequence="1397"/> |
||||
<ROW Action="AI_ResolveKnownFolders" Sequence="52"/> |
||||
<ROW Action="AI_XmlInstall" Condition="(REMOVE <> "ALL")" Sequence="5103"/> |
||||
<ROW Action="AI_DATA_SETTER" Condition="(REMOVE <> "ALL")" Sequence="5102"/> |
||||
<ROW Action="AI_XmlUninstall" Condition="(REMOVE)" Sequence="3102"/> |
||||
<ROW Action="AI_DATA_SETTER_1" Condition="(REMOVE)" Sequence="3101"/> |
||||
<ROW Action="InstallFinalize" Sequence="6600" SeqType="0" MsiKey="InstallFinalize"/> |
||||
<ROW Action="AI_RemoveExternalUIStub" Condition="(REMOVE="ALL") AND ((VersionNT > 500) OR((VersionNT = 500) AND (ServicePackLevel >= 4)))" Sequence="1502"/> |
||||
<ROW Action="TapDeviceRemove32" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE ) AND ( NOT VersionNT64 )" Sequence="1603"/> |
||||
<ROW Action="TapDeviceRemove64" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE ) AND ( VersionNT64 )" Sequence="1604"/> |
||||
<ROW Action="AI_FwInstall" Condition="(VersionNT >= 501) AND (REMOVE <> "ALL")" Sequence="5802"/> |
||||
<ROW Action="AI_DATA_SETTER_2" Condition="(VersionNT >= 501) AND (REMOVE <> "ALL")" Sequence="5801"/> |
||||
<ROW Action="AI_FwUninstall" Condition="(VersionNT >= 501) AND (REMOVE="ALL")" Sequence="1702"/> |
||||
<ROW Action="AI_DATA_SETTER_3" Condition="(VersionNT >= 501) AND (REMOVE="ALL")" Sequence="1701"/> |
||||
<ROW Action="AI_DetectSoftware" Sequence="103"/> |
||||
<ROW Action="AI_TxtUpdaterInstall" Sequence="5101"/> |
||||
<ROW Action="AI_BACKUP_AI_SETUPEXEPATH" Sequence="99" Builds="ExeBuild"/> |
||||
<ROW Action="AI_RESTORE_AI_SETUPEXEPATH" Condition="AI_SETUPEXEPATH_ORIGINAL" Sequence="102" Builds="ExeBuild"/> |
||||
<ROW Action="AI_DeleteCadLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="199" Builds="ExeBuild"/> |
||||
<ROW Action="AI_DeleteRCadLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="198" Builds="ExeBuild"/> |
||||
<ROW Action="AI_ExtractCadLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="197" Builds="ExeBuild"/> |
||||
<ROW Action="AI_FindExeLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="196" Builds="ExeBuild"/> |
||||
<ROW Action="AI_ExtractLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="1549" Builds="ExeBuild"/> |
||||
<ROW Action="AI_DeleteRLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="1548" Builds="ExeBuild"/> |
||||
<ROW Action="AI_DeleteLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="6594" Builds="ExeBuild"/> |
||||
<ROW Action="TerminateUI" Sequence="1602"/> |
||||
<ROW Action="AI_DATA_SETTER_6" Sequence="1601"/> |
||||
<ROW Action="AI_AiBackupImmediate" Sequence="1402"/> |
||||
<ROW Action="AI_AiBackupRollback" Sequence="1501"/> |
||||
<ROW Action="AI_AiRestoreDeferred" Sequence="6595"/> |
||||
<ROW Action="AI_EnableDebugLog" Sequence="51"/> |
||||
<ROW Action="AI_AiRestoreDeferredImpersonate" Sequence="6596"/> |
||||
<ROW Action="AI_AppSearchEx" Sequence="101"/> |
||||
<ROW Action="AI_PrepareChainers" Condition="VersionMsi >= "4.05"" Sequence="5851"/> |
||||
<ROW Action="AI_ExtractFiles" Sequence="1399" Builds="ExeBuild"/> |
||||
<ROW Action="AI_DATA_SETTER_4" Sequence="1398"/> |
||||
<ROW Action="AI_GetArpIconPath" Sequence="1401"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent"> |
||||
<ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=""" Sequence="749"/> |
||||
<ROW Action="AI_ResolveKnownFolders" Sequence="53"/> |
||||
<ROW Action="AI_DpiContentScale" Sequence="52"/> |
||||
<ROW Action="AI_BACKUP_AI_SETUPEXEPATH" Sequence="99"/> |
||||
<ROW Action="AI_RESTORE_AI_SETUPEXEPATH" Condition="AI_SETUPEXEPATH_ORIGINAL" Sequence="103"/> |
||||
<ROW Action="ExecuteAction" Sequence="1299" SeqType="0" MsiKey="ExecuteAction"/> |
||||
<ROW Action="AI_DetectSoftware" Sequence="102"/> |
||||
<ROW Action="AI_EnableDebugLog" Sequence="51"/> |
||||
<ROW Action="AI_AppSearchEx" Sequence="101"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiLaunchConditionsComponent"> |
||||
<ROW Condition="((VersionNT <> 501) AND (VersionNT <> 502))" Description="[ProductName] cannot be installed on [WindowsTypeNT5XDisplay]." DescriptionLocId="AI.LaunchCondition.NoNT5X" IsPredefined="true" Builds="DefaultBuild;ExeBuild"/> |
||||
<ROW Condition="(VersionNT <> 400)" Description="[ProductName] cannot be installed on [WindowsTypeNT40Display]." DescriptionLocId="AI.LaunchCondition.NoNT40" IsPredefined="true" Builds="DefaultBuild;ExeBuild"/> |
||||
<ROW Condition="(VersionNT <> 500)" Description="[ProductName] cannot be installed on [WindowsTypeNT50Display]." DescriptionLocId="AI.LaunchCondition.NoNT50" IsPredefined="true" Builds="DefaultBuild;ExeBuild"/> |
||||
<ROW Condition="AI_DETECTED_DOTNET_VERSION >= AI_REQUIRED_DOTNET_VERSION" Description="[ProductName] cannot be installed on systems with .NET Framework version lower than [AI_REQUIRED_DOTNET_DISPLAY]." DescriptionLocId="AI.LaunchCondition.DotNET" IsPredefined="true" Builds="DefaultBuild"/> |
||||
<ROW Condition="Privileged" Description="[ProductName] requires administrative privileges to install." DescriptionLocId="AI.LaunchCondition.Privileged" IsPredefined="true" Builds="DefaultBuild"/> |
||||
<ROW Condition="SETUPEXEDIR OR (REMOVE="ALL")" Description="This package can only be run from a bootstrapper." DescriptionLocId="AI.LaunchCondition.RequireBootstrapper" IsPredefined="true" Builds="ExeBuild"/> |
||||
<ROW Condition="VersionNT" Description="[ProductName] cannot be installed on [WindowsType9XDisplay]." DescriptionLocId="AI.LaunchCondition.No9X" IsPredefined="true" Builds="DefaultBuild;ExeBuild"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiRegLocatorComponent"> |
||||
<ROW Signature_="AI_EXE_PATH_CU" Root="1" Key="Software\Caphyon\Advanced Installer\LZMA\[ProductCode]\[ProductVersion]" Name="AI_ExePath" Type="2"/> |
||||
<ROW Signature_="AI_EXE_PATH_LM" Root="2" Key="Software\Caphyon\Advanced Installer\LZMA\[ProductCode]\[ProductVersion]" Name="AI_ExePath" Type="2"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiRegsComponent"> |
||||
<ROW Registry="AI_ExePath" Root="-1" Key="Software\Caphyon\Advanced Installer\LZMA\[ProductCode]\[ProductVersion]" Name="AI_ExePath" Value="[AI_SETUPEXEPATH]" Component_="AI_ExePath"/> |
||||
<ROW Registry="Comments" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="Comments" Value="[ARPCOMMENTS]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="Contact" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="Contact" Value="[ARPCONTACT]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="DisplayIcon" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="DisplayIcon" Value="[ARP_ICON_PATH]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="DisplayName" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="DisplayName" Value="[AI_PRODUCTNAME_ARP]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="DisplayVersion" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="DisplayVersion" Value="[ProductVersion]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="EstimatedSize" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="EstimatedSize" Value="#[AI_ARP_SIZE]" Component_="AI_CustomARPName" VirtualValue="#"/> |
||||
<ROW Registry="HelpLink" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="HelpLink" Value="[ARPHELPLINK]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="HelpTelephone" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="HelpTelephone" Value="[ARPHELPTELEPHONE]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="InstallLocation" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="InstallLocation" Value="[APPDIR]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="ModifyPath" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="ModifyPath" Value="[AI_UNINSTALLER] /i [ProductCode] AI_UNINSTALLER_CTP=1" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="NoModify" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="NoModify" Value="#1" Component_="AI_DisableModify" VirtualValue="#"/> |
||||
<ROW Registry="NoRepair" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="NoRepair" Value="#1" Component_="AI_CustomARPName" VirtualValue="#"/> |
||||
<ROW Registry="Path" Root="-1" Key="Software\[Manufacturer]\[ProductName]" Name="Path" Value="[APPDIR]" Component_="ProductInformation"/> |
||||
<ROW Registry="Publisher" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="Publisher" Value="[Manufacturer]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="Readme" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="Readme" Value="[ARPREADME]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="URLInfoAbout" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="URLInfoAbout" Value="[ARPURLINFOABOUT]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="URLUpdateInfo" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="URLUpdateInfo" Value="[ARPURLUPDATEINFO]" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="UninstallPath" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="UninstallPath" Value="[AI_UNINSTALLER] /x [ProductCode] AI_UNINSTALLER_CTP=1" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="UninstallString" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="UninstallString" Value="[AI_UNINSTALLER] /x [ProductCode] AI_UNINSTALLER_CTP=1" Component_="AI_CustomARPName"/> |
||||
<ROW Registry="Version" Root="-1" Key="Software\[Manufacturer]\[ProductName]" Name="Version" Value="[ProductVersion]" Component_="ProductInformation"/> |
||||
<ROW Registry="VersionMajor" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="VersionMajor" Value="#1" Component_="AI_CustomARPName" VirtualValue="#"/> |
||||
<ROW Registry="VersionMinor" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="VersionMinor" Value="#6" Component_="AI_CustomARPName" VirtualValue="#"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiServCtrlComponent"> |
||||
<ROW ServiceControl="zerotierone_x64.exe" Name="ZeroTierOneService" Event="163" Wait="1" Component_="zerotierone_x64.exe"/> |
||||
<ROW ServiceControl="zerotierone_x86.exe" Name="ZeroTierOneService" Event="163" Wait="1" Component_="zerotierone_x86.exe"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiServInstComponent"> |
||||
<ROW ServiceInstall="zerotierone_x64.exe" Name="ZeroTierOneService" DisplayName="ZeroTier One" ServiceType="16" StartType="2" ErrorControl="32769" Component_="zerotierone_x64.exe" Description="Ethernet Virtualization Service"/> |
||||
<ROW ServiceInstall="zerotierone_x86.exe" Name="ZeroTierOneService" DisplayName="ZeroTier One" ServiceType="16" StartType="2" ErrorControl="32769" Component_="zerotierone_x86.exe" Description="Ethernet Virtualization Service"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiShortsComponent"> |
||||
<ROW Shortcut="ZeroTierOne" Directory_="ProgramMenuFolder" Name="ZEROTI~1|ZeroTier One" Component_="ZeroTierOne.exe" Target="[#ZeroTierOne.exe]" Description="Ethernet Virtualization Control Panel" Hotkey="0" Icon_="ZeroTierIcon.exe" IconIndex="0" ShowCmd="1" WkDir="APPDIR"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiThemeComponent"> |
||||
<ATTRIBUTE name="UsedTheme" value="classic"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiUpgradeComponent"> |
||||
<ROW UpgradeCode="[|UpgradeCode]" VersionMin="0.0.1" VersionMax="[|ProductVersion]" Attributes="257" ActionProperty="OLDPRODUCTS"/> |
||||
<ROW UpgradeCode="[|UpgradeCode]" VersionMin="[|ProductVersion]" Attributes="2" ActionProperty="AI_NEWERPRODUCTFOUND"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.PreReqSearchComponent"> |
||||
<ROW SearchKey="UpgradeCode" SearchType="4" SearchString="{88AA80DE-14CA-4443-B024-6EC13F3EDDAD}" Order="2" Property="ZTTAP300_X86_INSTALLED"/> |
||||
<ROW SearchKey="_" SearchType="4" SearchString="{88AA80DE-14CA-4443-B024-6EC13F3EDDAD}" Order="1" Property="ZTTAP300_X64_INSTALLED"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.SoftwareIdentificationComponent"> |
||||
<ATTRIBUTE name="LocalFile" value="regid.199509.com.example_ProductName.swidtag"/> |
||||
<ATTRIBUTE name="SystemFile" value="regid.199509.com.example_ProductName.swidtag_1"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.TxtUpdateComponent"> |
||||
<ROW Name="Append/Create" TxtUpdateSet="zerotiercli.bat" FindPattern="@ECHO OFF if [\[][#zerotierone_x64.exe][\]] == [\[][\]] ( 	[#zerotierone_x86.exe] -q %* ) else ( 	[#zerotierone_x64.exe] -q %* ) " Options="160" Order="0" FileEncoding="0"/> |
||||
<ROW Name="Replace" TxtUpdateSet="zerotiercli.bat" FindPattern="YourFindText" ReplacePattern="YourReplaceText" Options="2" Order="1" FileEncoding="-1"/> |
||||
<ROW Name="Append/Create" TxtUpdateSet="zerotiercli1.bat" FindPattern="@ECHO OFF if [\[][#zerotierone_x64.exe][\]] == [\[][\]] ( 	[#zerotierone_x86.exe] -i %* ) else ( 	[#zerotierone_x64.exe] -i %* ) " Options="160" Order="0" FileEncoding="0"/> |
||||
<ROW Name="Replace" TxtUpdateSet="zerotiercli1.bat" FindPattern="YourFindText" ReplacePattern="YourReplaceText" Options="2" Order="1" FileEncoding="-1"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.TxtUpdateSetComponent"> |
||||
<ROW Key="zerotiercli.bat" Component="regid.201001.com.zerotier" FileName="zerotier-cli.bat" Directory="APPDIR" Options="17"/> |
||||
<ROW Key="zerotiercli1.bat" Component="regid.201001.com.zerotier" FileName="zerotier-idtool.bat" Directory="APPDIR" Options="17"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.XmlAttributeComponent"> |
||||
<ROW XmlAttribute="xmlnsds" XmlElement="swidsoftware_identification_tag" Name="xmlns:ds" Flags="14" Order="0" Value="http://www.w3.org/2000/09/xmldsig#"/> |
||||
<ROW XmlAttribute="xmlnsswid" XmlElement="swidsoftware_identification_tag" Name="xmlns:swid" Flags="14" Order="1" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd"/> |
||||
<ROW XmlAttribute="xmlnsxsi" XmlElement="swidsoftware_identification_tag" Name="xmlns:xsi" Flags="14" Order="2" Value="http://www.w3.org/2001/XMLSchema-instance"/> |
||||
<ROW XmlAttribute="xsischemaLocation" XmlElement="swidsoftware_identification_tag" Name="xsi:schemaLocation" Flags="14" Order="3" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.XmlElementComponent"> |
||||
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Condition="1" Order="2" Flags="14" Text="5" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidentitlement_required_indicator" ParentElement="swidsoftware_identification_tag" Name="swid:entitlement_required_indicator" Condition="1" Order="0" Flags="14" Text="false" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidmajor" ParentElement="swidnumeric" Name="swid:major" Condition="1" Order="0" Flags="14" Text="1" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidminor" ParentElement="swidnumeric" Name="swid:minor" Condition="1" Order="1" Flags="14" Text="6" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidname" ParentElement="swidproduct_version" Name="swid:name" Condition="1" Order="0" Flags="14" Text="[ProductVersion]" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidname_1" ParentElement="swidsoftware_creator" Name="swid:name" Condition="1" Order="0" Flags="14" Text="ZeroTier, Inc." UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidname_2" ParentElement="swidsoftware_licensor" Name="swid:name" Condition="1" Order="0" Flags="14" Text="ZeroTier, Inc." UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidname_3" ParentElement="swidtag_creator" Name="swid:name" Condition="1" Order="0" Flags="14" Text="ZeroTier, Inc." UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidnumeric" ParentElement="swidproduct_version" Name="swid:numeric" Condition="1" Order="1" Flags="14" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidproduct_title" ParentElement="swidsoftware_identification_tag" Name="swid:product_title" Condition="1" Order="1" Flags="14" Text="[ProductName]" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidproduct_version" ParentElement="swidsoftware_identification_tag" Name="swid:product_version" Condition="1" Order="2" Flags="14" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidregid" ParentElement="swidsoftware_creator" Name="swid:regid" Condition="1" Order="1" Flags="14" Text="regid.2010-01.com.zerotier" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidregid_1" ParentElement="swidsoftware_licensor" Name="swid:regid" Condition="1" Order="1" Flags="14" Text="regid.2010-01.com.zerotier" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidregid_2" ParentElement="swidtag_creator" Name="swid:regid" Condition="1" Order="1" Flags="14" Text="regid.2010-01.com.zerotier" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidreview" ParentElement="swidnumeric" Name="swid:review" Condition="1" Order="3" Flags="14" Text="0" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidsoftware_creator" ParentElement="swidsoftware_identification_tag" Name="swid:software_creator" Condition="1" Order="3" Flags="14" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidsoftware_id" ParentElement="swidsoftware_identification_tag" Name="swid:software_id" Condition="1" Order="5" Flags="14" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidsoftware_identification_tag" Name="swid:software_identification_tag" Condition="1" Order="0" Flags="14" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidsoftware_licensor" ParentElement="swidsoftware_identification_tag" Name="swid:software_licensor" Condition="1" Order="4" Flags="14" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidtag_creator" ParentElement="swidsoftware_identification_tag" Name="swid:tag_creator" Condition="1" Order="6" Flags="14" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidtag_creator_regid" ParentElement="swidsoftware_id" Name="swid:tag_creator_regid" Condition="1" Order="1" Flags="14" Text="regid.2010-01.com.zerotier" UpdateIndexInParent="0"/> |
||||
<ROW XmlElement="swidunique_id" ParentElement="swidsoftware_id" Name="swid:unique_id" Condition="1" Order="0" Flags="14" Text="ZeroTierOne" UpdateIndexInParent="0"/> |
||||
</COMPONENT> |
||||
<COMPONENT cid="caphyon.advinst.msicomp.XmlFileComponent"> |
||||
<ROW XmlFile="regid.199509.com.example_ProductName.swidtag" FileName="REGID2~1.SWI|regid.2010-01.com.zerotier_ZeroTierOne.swidtag" DirProperty="APPDIR" Component="ProductInformation" RootElement="swidsoftware_identification_tag" Flags="25" Version="1.0" Encoding="UTF-8" IndentUnits="2"/> |
||||
<ROW XmlFile="regid.199509.com.example_ProductName.swidtag_1" FileName="REGID2~1.SWI|regid.2010-01.com.zerotier_ZeroTierOne.swidtag" DirProperty="regid.201001.com.zerotier_Dir" Component="ProductInformation" RootElement="swidsoftware_identification_tag" Flags="25" Version="1.0" Encoding="UTF-8" IndentUnits="2"/> |
||||
</COMPONENT> |
||||
</DOCUMENT> |
||||
@ -1,247 +0,0 @@
|
||||
### Bonding (link aggregation) |
||||
|
||||
Link aggregation allows the simultaneous (or conditional) use of multiple physical links to enable increased throughput, load balancing, redundancy, and fault tolerance. There are a variety of standard policies available that can be used right out of the box with little to no configuration. These policies are directly inspired by [the policies offered by the Linux kernel](https://www.kernel.org/doc/Documentation/networking/bonding.txt) but are now offered in user-space and hence available on all platforms that ZeroTier supports. |
||||
|
||||
#### Standard policies |
||||
|
||||
| Policy name | Fault tolerance | Min. failover (sec.) | Default Failover (sec.)| Balancing | Aggregation efficiency | Redundancy | Sequence Reordering | |
||||
|--------------------|:---------------------:|---------------------:|-----------------------:|----------------------:|-----------------------:|-----------:|--------------------:| |
||||
| `none` | None | `60+` | `60+` | none | `none` |1 | No |
||||
| `active-backup` | Brief interruption | `0.25` | `10` | none | `low` |1 | Only during failover |
||||
| `broadcast` | Fully tolerant | `N/A` | `N/A` | none | `very low` |N | Often |
||||
| `balance-rr` | Self-healing | `0.25` | `10` | packet-based | `high` |1 | Often |
||||
| `balance-xor` | Self-healing | `0.25` | `10` | flow-based | `very high` |1 | Only during failover |
||||
| `balance-aware` | Self-healing | `0.25` | `10` | *adaptive* flow-based | `very high` |1 | Only during failover and re-balance |
||||
|
||||
A policy can be used easily without specifying any additional parameters: |
||||
|
||||
``` |
||||
{ |
||||
"settings": { |
||||
"defaultBondingPolicy": "active-backup" |
||||
} |
||||
} |
||||
``` |
||||
|
||||
#### Custom policies |
||||
|
||||
To customize a bonding policy for your use-case simply specify a `basePolicy` and override chosen parameters. For example, to create a more aggressive `active-backup` policy with low monitoring overhead that will failover `0.250` seconds after it detects a link failure, one could do the following: |
||||
|
||||
``` |
||||
{ |
||||
"settings": |
||||
{ |
||||
"defaultBondingPolicy": "aggressive-active-backup", |
||||
"policies": |
||||
{ |
||||
"aggressive-active-backup": |
||||
{ |
||||
"failoverInterval": 250, |
||||
"pathMonitorStrategy": "dynamic", |
||||
"basePolicy": "active-backup" |
||||
} |
||||
} |
||||
} |
||||
} |
||||
``` |
||||
|
||||
#### Specifying links |
||||
|
||||
Bonds are composed of multiple `links`. Different sets of links can be constructed for different bonding policies and used simultaneously. One can specify the links that ZeroTier should use in any given bonding policy simply by providing an array of links with names corresponding to interface names. If a user doesn't specify a set of interfaces to use, ZeroTier will assume every system interface is available for use. However, if the user **does** specify a set of interfaces, ZeroTier will only use what is specified. The same applies to failover rules, if none are specified, ZeroTier will failover to any operational link. On the other hand, if the user does specify failover rules and there is ever a situation where a link is available for usage but does not fit within the rules specified by the user, it will go unused. |
||||
|
||||
To specify that ZeroTier should only use `eth0` and `eth1` as primary links, and `eth2` as a backup spare and that it should prefer IPv4 over IPv6 except on `eth2` where only IPv6 is allowed: |
||||
|
||||
``` |
||||
{ |
||||
"settings": { |
||||
"defaultBondingPolicy": "aggressive-active-backup", |
||||
"policies": { |
||||
"aggressive-active-backup": { |
||||
"links": { |
||||
"eth0": { |
||||
"ipvPref": 46, |
||||
"failoverTo": "eth2", |
||||
"mode": "primary" |
||||
}, |
||||
"eth1": { |
||||
"ipvPref": 46, |
||||
"failoverTo": "eth2", |
||||
"mode": "primary" |
||||
}, |
||||
"eth2": { |
||||
"ipvPref": 6, |
||||
"mode": "spare" |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
``` |
||||
|
||||
Additional link-specific parameters: |
||||
|
||||
``` |
||||
"links": |
||||
{ |
||||
"interfaceName": /* System-name of the network interface. */ |
||||
{ |
||||
"failoverInterval": 0-65535, /* (optional) How quickly a path on this link should failover after a detected failure. */ |
||||
"ipvPref": [0,4,6,46,64], /* (optional) IP version preference for detected paths on a link. */ |
||||
"speed": 0-1000000, /* (optional) How fast this link is (in arbitrary units). This is a useful way to manually allocate a bond. */ |
||||
"alloc": 0-255, /* (optional) A relative value representing a desired allocation. */ |
||||
"upDelay": 0-65535, /* (optional) How long after a path becomes alive before it is added to the bond. */ |
||||
"downDelay": 0-65535, /* (optional) How long after a path fails before it is removed from the bond. */ |
||||
"failoverTo": "spareInterfaceName", /* (optional) Which link should be used next after a failure of this link. */ |
||||
"enabled": true|false, /* (optional) Whether any paths on this link are allowed to be used this bond. */ |
||||
"mode": "primary"|"spare" /* (optional) Whether this link is used by default or only after failover events. */ |
||||
} |
||||
} |
||||
``` |
||||
|
||||
#### Peer-specific bonds |
||||
|
||||
It is possible to direct ZeroTier to form a certain type of bond with specific peers of your choice. For instance, if one were to want `active-backup` by default but for certain peers to be bonded with a custom load-balanced bond such as `my-custom-balance-aware` one could do the following: |
||||
|
||||
``` |
||||
{ |
||||
"settings": |
||||
{ |
||||
"defaultBondingPolicy": "active-backup", |
||||
"policies": |
||||
{ |
||||
"my-custom-balance-aware": |
||||
{ |
||||
"failoverInterval": 2000, |
||||
"monitorStrategy": "dynamic", |
||||
"basePolicy": "balance-aware" |
||||
} |
||||
}, |
||||
"peerSpecificBonds": |
||||
{ |
||||
"f6203a2db3":"my-custom-balance-aware", |
||||
"45b0301da2":"my-custom-balance-aware", |
||||
"a92cb526fa":"my-custom-balance-aware" |
||||
} |
||||
} |
||||
} |
||||
``` |
||||
|
||||
#### Active backup (`active-backup`) |
||||
|
||||
Traffic is sent only on (one) path at any given time. A different path becomes active if the current path fails. This mode provides fault tolerance with a nearly immediate fail-over. This mode **does not** increase total throughput. |
||||
|
||||
- `mode`: `primary, spare` Link option which specifies which link is the primary device. The specified device is intended to always be the active link while it is available. There are exceptions to this behavior when using different `linkSelectMethod` modes. There can only be one `primary` link in this bonding policy. |
||||
|
||||
- `linkSelectMethod`: Specifies the selection policy for the active link during failure and/or recovery events. This is similar to the Linux Kernel's `primary_reselect` option but with a minor extension: |
||||
- `optimize`: **(default if user provides no failover guidance)** The primary link can change periodically if a superior path is detected. |
||||
- `always`: **(default when links are explicitly specified)**: Primary link regains status as active link whenever it comes back up. |
||||
- `better`: Primary link regains status as active link when it comes back up and (if) it is better than the currently-active link. |
||||
- `failure`: Primary link regains status as active link only if the currently-active link fails. |
||||
|
||||
``` |
||||
{ |
||||
"settings": |
||||
{ |
||||
"defaultBondingPolicy": "active-backup", |
||||
"active-backup": |
||||
{ |
||||
"linkSelectMethod": "always", |
||||
"links": |
||||
{ |
||||
"eth0": { "failoverTo": "eth1", "mode": "primary" }, |
||||
"eth1": { "mode": "spare" }, |
||||
"eth2": { "mode": "spare" }, |
||||
"eth3": { "mode": "spare" } |
||||
} |
||||
} |
||||
} |
||||
} |
||||
``` |
||||
|
||||
#### Broadcast (`broadcast`) |
||||
|
||||
Traffic is sent on (all) available paths simultaneously. This mode provides fault tolerance and effectively immediate failover due to transmission redundancy. This mode is a poor utilization of throughput resources and will **not** increase throughput but can prevent packet loss during a link failure. The only option available is `dedup` which will de-duplicate all packets on the receiving end if set to `true`. |
||||
|
||||
#### Balance round robin (`balance-rr`) |
||||
|
||||
Traffic is striped across multiple paths. Offers partial fault tolerance immediately, full fault tolerance eventually. This policy is unaware of protocols and is primarily intended for use with protocols that are not sensitive to reordering delays. The only option available for this policy is `packetsPerLink` which specifies the number of packets to transmit via a path before moving to the next in the RR sequence. When set to `0` a path is chosen at random for each outgoing packet. The default value is `8`, low values can begin to add overhead to packet processing. |
||||
|
||||
#### Balance XOR (`balance-xor`, similar to the Linux kernel's [balance-xor](https://www.kernel.org/doc/Documentation/networking/bonding.txt) with `xmit_hash_policy=layer3+4`) |
||||
|
||||
Traffic is categorized into *flows* based on *source port*, *destination port*, and *protocol type* these flows are then hashed onto available links. Each flow will persist on its assigned link interface for its entire life-cycle. Traffic that does not have an assigned port (such as ICMP pings) will be randomly distributed across links. The hash function is simply: `src_port ^ dst_port ^ proto`. |
||||
|
||||
#### Balance aware (`balance-aware`, similar to Linux kernel's [`balance-*lb`](https://www.kernel.org/doc/Documentation/networking/bonding.txt) modes) |
||||
|
||||
Traffic is dynamically allocated and balanced across multiple links simultaneously according to the target allocation. Options allow for *packet* or *flow-based* processing, and active-flow reassignment. Flows mediated over a recently failed links will be reassigned in a manner that respects the target allocation of the bond. An optional `balancePolicy` can be specified with the following effects: `flow-dynamic` (default) will hash flows onto links according to target allocation and may perform periodic re-assignments in order to preserve balance. `flow-static`, will hash flows onto links according to target allocation but will not re-assign flows unless a failure occurs or the link is no longer operating within acceptable parameters. And lastly `packet` which simply load balances packets across links according to target allocation but with no concern for sequence reordering. |
||||
|
||||
``` |
||||
{ |
||||
"settings": |
||||
{ |
||||
"defaultBondingPolicy": "balance-aware", |
||||
"balance-aware": { |
||||
"balancePolicy": "flow-dynamic"|"flow-static"|"packet" |
||||
} |
||||
} |
||||
} |
||||
``` |
||||
|
||||
#### Link quality |
||||
|
||||
ZeroTier measures various properties of a link (such as latency, throughput, jitter, packet loss ratio, etc) in order to arrive at a quality estimate. This estimate is used by bonding policies to make allocation and failover decisions: |
||||
|
||||
| Policy name | Role | |
||||
|:---------------|:-----| |
||||
|`active-backup` | Determines the order of the failover queue. And if `activeReselect=optimize` whether a new active link is selected. | |
||||
|`broadcast` | Does not use quality measurements. | |
||||
|`balance-rr` | May trigger removal of link from bond. | |
||||
|`balance-xor` | May trigger removal of link from bond. | |
||||
|`balance-aware` | Informs flow assignments and (re-)assignments. May trigger removal of link from bond. | |
||||
|
||||
A link's eligibility for being included in a bond is dependent on more than perceived quality. If a path on a link begins to exhibit disruptive behavior such as extremely high packet loss, corruption, or periodic inability to process traffic it will be removed from the bond, its traffic will be appropriately reallocated and it will be punished. Punishments gradually fade and a link can be readmitted to the bond over time. However, punishments increase exponentially if applied more than once within a given window of time. |
||||
|
||||
#### Asymmetric links |
||||
|
||||
In cases where it is necessary to bond physical links that vary radically in terms of cost, throughput, latency, and or reliability, there are a couple of ways to automatically (or manually) allocate traffic among them. Traffic distribution and balancing can be either `packet` or `flow` based. Where packet-based is suitable for protocols not susceptible to reordering penalties and flow-based is suitable for protocols such as TCP where it is desirable to keep a conversation on a single link unless we can't avoid having to re-assign it. Additionally, a *target allocation* of traffic used by the bonding policy can be derived/specified in the following ways: |
||||
|
||||
- **Automatically**: This is the easiest and requires no user configuration. The bonding layer measures and senses the link properties and determines a target allocation based on perceived quality and capacity. Weaker, less reliable links will have less traffic allocated to them and stronger, more reliable links will have more traffic allocated to them. Optionally, the user can specify a set of weights (totaling `1.0`) to inform the bonding layer how important certain link properties are. For instance, one may primarily be concerned with latency and jitter but not total throughput: |
||||
|
||||
``` |
||||
"balance-aware": { |
||||
"quality": { |
||||
"lat": 0.3, /* Moving average of latency in milliseconds */ |
||||
"ltm": 0.2, /* Maximum observed latency in milliseconds */ |
||||
"pdv": 0.3, /* Packet delay variance in milliseconds. Similar to jitter */ |
||||
"plr": 0.1, /* Packet loss ratio */ |
||||
"per": 0.1, /* Packet error ratio */ |
||||
"avl": 0.0, /* Availability */ |
||||
} |
||||
} |
||||
``` |
||||
In the absence of user guidance ZeroTier will attempt to form an understanding of each link's speed and capacity but this value can be inaccurate if the links are not routinely saturated. Therefore we provide a way to explicitly signal the capacity of each link in terms of arbitrary but relative values: |
||||
|
||||
``` |
||||
"links": { |
||||
"eth0": { "speed": 10000 }, |
||||
"eth1": { "speed": 1000 }, |
||||
"eth2": { "speed": 100 } |
||||
} |
||||
``` |
||||
|
||||
The user specifies allocation percentages (totaling `1.0`). In this case quality measurements will only be used to determine a link's eligibility to be a member of a bond, now how much traffic it will carry: |
||||
|
||||
``` |
||||
"links": { |
||||
"eth0": { "alloc": 0.50 }, |
||||
"eth1": { "alloc": 0.25 }, |
||||
"eth2": { "alloc": 0.25 } |
||||
} |
||||
``` |
||||
|
||||
#### Performance and overhead considerations |
||||
|
||||
- Only packets with internal IDs divisible by `16` are included in measurements, this amounts to about `6.25%` of all traffic. |
||||
- `failoverInterval` specifies how quickly failover should occur during a link failure. In order to accomplish this a combination of active and passive measurement techniques are employed which may result in `VERB_HELLO` probes being sent every `failoverInterval / 4` time units. As a mitigation `monitorStrategy` may be set to `dynamic` so that probe frequency directly correlates with native application traffic. |
||||
|
||||
|
||||
@ -0,0 +1,89 @@
|
||||
name: zerotier |
||||
summary: Securely connect any device, anywhere. |
||||
description: | |
||||
|
||||
ZeroTier is a software-based managed Ethernet switch for planet Earth. Use it to connect your |
||||
desktop clients, servers, phones, NAS, or even individual applications (using our SDK). |
||||
|
||||
This snap contains ZeroTier One, a service that provides ZeroTier network connectivity and |
||||
makes joining virtual networks as easy as joining IRC or Slack channels. Apps for Android |
||||
and iOS are available for free in the Google Play and Apple app stores. |
||||
|
||||
ZeroTier eliminates the LAN/WAN distinction and makes VPNs, tunnels, proxies, and other kludges |
||||
arising from the inflexible nature of physical networks obsolete. Everything is encrypted |
||||
end-to-end and traffic takes the most direct (peer to peer) path available. |
||||
|
||||
Install (be sure to use sudo) |
||||
|
||||
sudo snap install zerotier |
||||
|
||||
Join your network |
||||
|
||||
sudo zerotier join <nwid> |
||||
sudo zerotier status |
||||
|
||||
Approve your new node in ZeroTier Central (https://my.zerotier.com)! Welcome online! |
||||
|
||||
adopt-info: one |
||||
confinement: strict |
||||
grade: stable |
||||
base: core18 |
||||
|
||||
apps: |
||||
one: |
||||
# Add -U to prevent attempting to drop privileges since snaps have their |
||||
# own containment mechanism. Otherwise, if a user named "zerotier-one" |
||||
# exists on the system, the setgid or related calls will fail. |
||||
command: usr/sbin/zerotier-one -U |
||||
daemon: simple |
||||
plugs: |
||||
- network |
||||
- network-bind |
||||
- network-control |
||||
|
||||
# For backwards compatibility with old package (e.g. zerotier.cli) |
||||
# Should be removed someday |
||||
cli: |
||||
command: usr/sbin/zerotier-cli |
||||
plugs: |
||||
- network |
||||
|
||||
zerotier: |
||||
command: usr/sbin/zerotier-cli |
||||
plugs: |
||||
- network |
||||
|
||||
idtool: |
||||
command: usr/sbin/zerotier-idtool |
||||
plugs: |
||||
- network |
||||
|
||||
layout: |
||||
/var/lib/zerotier-one: |
||||
bind: $SNAP_COMMON |
||||
|
||||
parts: |
||||
one: |
||||
plugin: make |
||||
source: . |
||||
build-packages: |
||||
- build-essential |
||||
- libc++-dev |
||||
make-parameters: |
||||
- CXX=g++ |
||||
filesets: |
||||
binaries: |
||||
- usr/sbin/zerotier-one |
||||
- usr/sbin/zerotier-cli |
||||
- usr/sbin/zerotier-idtool |
||||
prime: |
||||
- $binaries |
||||
override-build: | |
||||
snapcraftctl build |
||||
# Grab the version string from the newly-compiled binary. |
||||
snapcraftctl set-version "$(./zerotier-one -v)" |
||||
slots: |
||||
zerotier-control: |
||||
interface: content |
||||
read: |
||||
- $SNAP_COMMON |
||||
@ -0,0 +1,5 @@
|
||||
[target.x86_64-apple-darwin] |
||||
rustflags=["-C", "link-arg=-mmacosx-version-min=10.13"] |
||||
|
||||
[target.aarch64-apple-darwin] |
||||
rustflags=["-C", "link-arg=-mmacosx-version-min=10.13"] |
||||
@ -0,0 +1,26 @@
|
||||
[package] |
||||
name = "zeroidc" |
||||
version = "0.1.0" |
||||
edition = "2018" |
||||
build = "build.rs" |
||||
publish = false |
||||
|
||||
[lib] |
||||
crate-type = ["staticlib","rlib"] |
||||
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html |
||||
|
||||
[dependencies] |
||||
openidconnect = "2.1" |
||||
base64 = "0.13" |
||||
url = "2.2" |
||||
reqwest = "0.11" |
||||
jsonwebtoken = "7.2" |
||||
serde = "1.0" |
||||
time = { version = "0.3", features = ["formatting"] } |
||||
bytes = "1.1" |
||||
thiserror = "1" |
||||
|
||||
[build-dependencies] |
||||
cbindgen = "0.20" |
||||
@ -0,0 +1,37 @@
|
||||
extern crate cbindgen; |
||||
|
||||
use std::env; |
||||
use std::path::PathBuf; |
||||
use cbindgen::{Config, Language}; |
||||
|
||||
fn main() { |
||||
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); |
||||
|
||||
let package_name = env::var("CARGO_PKG_NAME").unwrap(); |
||||
let output_file = target_dir() |
||||
.join(format!("{}.h", package_name)) |
||||
.display() |
||||
.to_string(); |
||||
|
||||
let config = Config { |
||||
language: Language::C, |
||||
cpp_compat: true, |
||||
namespace: Some(String::from("zeroidc")), |
||||
..Default::default() |
||||
}; |
||||
|
||||
cbindgen::generate_with_config(&crate_dir, config) |
||||
.unwrap() |
||||
.write_to_file(&output_file); |
||||
} |
||||
|
||||
/// Find the location of the `target/` directory. Note that this may be
|
||||
/// overridden by `cmake`, so we also need to check the `CARGO_TARGET_DIR`
|
||||
/// variable.
|
||||
fn target_dir() -> PathBuf { |
||||
if let Ok(target) = env::var("CARGO_TARGET_DIR") { |
||||
PathBuf::from(target) |
||||
} else { |
||||
PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()).join("target") |
||||
} |
||||
} |
||||
@ -0,0 +1,23 @@
|
||||
/* |
||||
* Copyright (c)2022 ZeroTier, Inc. |
||||
* |
||||
* Use of this software is governed by the Business Source License included |
||||
* in the LICENSE.TXT file in the project's root directory. |
||||
* |
||||
* Change Date: 2025-01-01 |
||||
* |
||||
* On the date above, in accordance with the Business Source License, use |
||||
* of this software will be governed by version 2.0 of the Apache License. |
||||
*/ |
||||
|
||||
use thiserror::Error; |
||||
|
||||
#[derive(Error, Debug)] |
||||
pub enum ZeroIDCError |
||||
{ |
||||
#[error(transparent)] |
||||
DiscoveryError(#[from] openidconnect::DiscoveryError<openidconnect::reqwest::Error<reqwest::Error>>), |
||||
|
||||
#[error(transparent)] |
||||
ParseError(#[from] url::ParseError), |
||||
} |
||||
@ -0,0 +1,220 @@
|
||||
/* |
||||
* Copyright (c)2021 ZeroTier, Inc. |
||||
* |
||||
* Use of this software is governed by the Business Source License included |
||||
* in the LICENSE.TXT file in the project's root directory. |
||||
* |
||||
* Change Date: 2025-01-01 |
||||
* |
||||
* On the date above, in accordance with the Business Source License, use |
||||
* of this software will be governed by version 2.0 of the Apache License. |
||||
*/ |
||||
|
||||
use std::ffi::{CStr, CString}; |
||||
use std::os::raw::c_char; |
||||
use url::{Url}; |
||||
|
||||
use crate::ZeroIDC; |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_new( |
||||
issuer: *const c_char, |
||||
client_id: *const c_char, |
||||
auth_endpoint: *const c_char, |
||||
web_listen_port: u16, |
||||
) -> *mut ZeroIDC { |
||||
if issuer.is_null() { |
||||
println!("issuer is null"); |
||||
return std::ptr::null_mut(); |
||||
} |
||||
|
||||
if client_id.is_null() { |
||||
println!("client_id is null"); |
||||
return std::ptr::null_mut(); |
||||
} |
||||
|
||||
if auth_endpoint.is_null() { |
||||
println!("auth_endpoint is null"); |
||||
return std::ptr::null_mut(); |
||||
} |
||||
|
||||
let issuer = unsafe { CStr::from_ptr(issuer) }; |
||||
let client_id = unsafe { CStr::from_ptr(client_id) }; |
||||
let auth_endpoint = unsafe { CStr::from_ptr(auth_endpoint) }; |
||||
match ZeroIDC::new( |
||||
issuer.to_str().unwrap(), |
||||
client_id.to_str().unwrap(), |
||||
auth_endpoint.to_str().unwrap(), |
||||
web_listen_port, |
||||
) { |
||||
Ok(idc) => { |
||||
return Box::into_raw(Box::new(idc)); |
||||
} |
||||
Err(s) => { |
||||
println!("Error creating ZeroIDC instance: {}", s); |
||||
return std::ptr::null_mut(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_delete(ptr: *mut ZeroIDC) { |
||||
if ptr.is_null() { |
||||
return; |
||||
} |
||||
unsafe { |
||||
Box::from_raw(ptr); |
||||
} |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_start(ptr: *mut ZeroIDC) { |
||||
let idc = unsafe { |
||||
assert!(!ptr.is_null()); |
||||
&mut *ptr |
||||
}; |
||||
idc.start(); |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_stop(ptr: *mut ZeroIDC) { |
||||
let idc = unsafe { |
||||
assert!(!ptr.is_null()); |
||||
&mut *ptr |
||||
}; |
||||
idc.stop(); |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_is_running(ptr: *mut ZeroIDC) -> bool { |
||||
let idc = unsafe { |
||||
assert!(!ptr.is_null()); |
||||
&mut *ptr |
||||
}; |
||||
|
||||
idc.is_running() |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_get_exp_time(ptr: *mut ZeroIDC) -> u64 { |
||||
let id = unsafe { |
||||
assert!(!ptr.is_null()); |
||||
&mut *ptr |
||||
}; |
||||
|
||||
id.get_exp_time() |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_set_nonce_and_csrf( |
||||
ptr: *mut ZeroIDC, |
||||
csrf_token: *const c_char, |
||||
nonce: *const c_char) { |
||||
let idc = unsafe { |
||||
assert!(!ptr.is_null()); |
||||
&mut *ptr |
||||
}; |
||||
|
||||
if csrf_token.is_null() { |
||||
println!("csrf_token is null"); |
||||
return; |
||||
} |
||||
|
||||
if nonce.is_null() { |
||||
println!("nonce is null"); |
||||
return; |
||||
} |
||||
|
||||
let csrf_token = unsafe { CStr::from_ptr(csrf_token) } |
||||
.to_str() |
||||
.unwrap() |
||||
.to_string(); |
||||
let nonce = unsafe { CStr::from_ptr(nonce) } |
||||
.to_str() |
||||
.unwrap() |
||||
.to_string(); |
||||
|
||||
idc.set_nonce_and_csrf(csrf_token, nonce); |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_get_auth_url(ptr: *mut ZeroIDC) -> *const c_char { |
||||
if ptr.is_null() { |
||||
println!("passed a null object"); |
||||
return std::ptr::null_mut(); |
||||
} |
||||
let idc = unsafe { |
||||
&mut *ptr |
||||
}; |
||||
|
||||
let s = CString::new(idc.auth_url()).unwrap(); |
||||
return s.into_raw(); |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_token_exchange(idc: *mut ZeroIDC, code: *const c_char ) -> *const c_char { |
||||
if idc.is_null() { |
||||
println!("idc is null"); |
||||
return std::ptr::null(); |
||||
} |
||||
|
||||
if code.is_null() { |
||||
println!("code is null"); |
||||
return std::ptr::null(); |
||||
} |
||||
let idc = unsafe { |
||||
&mut *idc |
||||
}; |
||||
|
||||
let code = unsafe{CStr::from_ptr(code)}.to_str().unwrap(); |
||||
|
||||
let ret = idc.do_token_exchange( code); |
||||
let ret = CString::new(ret).unwrap(); |
||||
return ret.into_raw(); |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_get_url_param_value(param: *const c_char, path: *const c_char) -> *const c_char { |
||||
if param.is_null() { |
||||
println!("param is null"); |
||||
return std::ptr::null(); |
||||
} |
||||
if path.is_null() { |
||||
println!("path is null"); |
||||
return std::ptr::null(); |
||||
} |
||||
let param = unsafe {CStr::from_ptr(param)}.to_str().unwrap(); |
||||
let path = unsafe {CStr::from_ptr(path)}.to_str().unwrap(); |
||||
|
||||
let url = "http://localhost:9993".to_string() + path; |
||||
let url = Url::parse(&url).unwrap(); |
||||
|
||||
let pairs = url.query_pairs();
|
||||
for p in pairs { |
||||
if p.0 == param { |
||||
let s = CString::new(p.1.into_owned()).unwrap(); |
||||
return s.into_raw() |
||||
} |
||||
} |
||||
|
||||
return std::ptr::null(); |
||||
} |
||||
|
||||
#[no_mangle] |
||||
pub extern "C" fn zeroidc_network_id_from_state(state: *const c_char) -> *const c_char { |
||||
if state.is_null() { |
||||
println!("state is null"); |
||||
return std::ptr::null(); |
||||
} |
||||
|
||||
let state = unsafe{CStr::from_ptr(state)}.to_str().unwrap(); |
||||
|
||||
let split = state.split("_"); |
||||
let split = split.collect::<Vec<&str>>(); |
||||
if split.len() != 2 { |
||||
return std::ptr::null(); |
||||
} |
||||
|
||||
let s = CString::new(split[1]).unwrap(); |
||||
return s.into_raw(); |
||||
} |
||||
@ -0,0 +1,582 @@
|
||||
/* |
||||
* Copyright (c)2021 ZeroTier, Inc. |
||||
* |
||||
* Use of this software is governed by the Business Source License included |
||||
* in the LICENSE.TXT file in the project's root directory. |
||||
* |
||||
* Change Date: 2025-01-01 |
||||
* |
||||
* On the date above, in accordance with the Business Source License, use |
||||
* of this software will be governed by version 2.0 of the Apache License. |
||||
*/ |
||||
|
||||
pub mod error; |
||||
pub mod ext; |
||||
|
||||
extern crate base64; |
||||
extern crate bytes; |
||||
extern crate openidconnect; |
||||
extern crate time; |
||||
extern crate url; |
||||
|
||||
use crate::error::ZeroIDCError; |
||||
|
||||
use bytes::Bytes; |
||||
use jsonwebtoken::{dangerous_insecure_decode}; |
||||
use openidconnect::core::{CoreClient, CoreProviderMetadata, CoreResponseType}; |
||||
use openidconnect::reqwest::http_client; |
||||
use openidconnect::{AccessToken, AccessTokenHash, AuthorizationCode, AuthenticationFlow, ClientId, CsrfToken, IssuerUrl, Nonce, OAuth2TokenResponse, PkceCodeChallenge, PkceCodeVerifier, RedirectUrl, RefreshToken, Scope, TokenResponse}; |
||||
use serde::{Deserialize, Serialize}; |
||||
use std::str::from_utf8; |
||||
use std::sync::{Arc, Mutex}; |
||||
use std::thread::{sleep, spawn, JoinHandle}; |
||||
use std::time::{SystemTime, UNIX_EPOCH, Duration}; |
||||
use time::{OffsetDateTime, format_description}; |
||||
|
||||
|
||||
use url::Url; |
||||
|
||||
pub struct ZeroIDC { |
||||
inner: Arc<Mutex<Inner>>, |
||||
} |
||||
|
||||
struct Inner { |
||||
running: bool, |
||||
auth_endpoint: String, |
||||
oidc_thread: Option<JoinHandle<()>>, |
||||
oidc_client: Option<openidconnect::core::CoreClient>, |
||||
access_token: Option<AccessToken>, |
||||
refresh_token: Option<RefreshToken>, |
||||
exp_time: u64, |
||||
|
||||
url: Option<Url>, |
||||
csrf_token: Option<CsrfToken>, |
||||
nonce: Option<Nonce>, |
||||
pkce_verifier: Option<PkceCodeVerifier>, |
||||
} |
||||
|
||||
impl Inner { |
||||
#[inline] |
||||
fn as_opt(&mut self) -> Option<&mut Inner> { |
||||
Some(self) |
||||
} |
||||
} |
||||
|
||||
#[derive(Debug, Serialize, Deserialize)] |
||||
struct Exp { |
||||
exp: u64 |
||||
} |
||||
|
||||
fn csrf_func(csrf_token: String) -> Box<dyn Fn() -> CsrfToken> { |
||||
return Box::new(move || CsrfToken::new(csrf_token.to_string())); |
||||
} |
||||
|
||||
fn nonce_func(nonce: String) -> Box<dyn Fn() -> Nonce> { |
||||
return Box::new(move || Nonce::new(nonce.to_string())); |
||||
} |
||||
|
||||
#[cfg(debug_assertions)] |
||||
fn systemtime_strftime<T>(dt: T, format: &str) -> String |
||||
where T: Into<OffsetDateTime> |
||||
{ |
||||
let f = format_description::parse(format); |
||||
match f { |
||||
Ok(f) => { |
||||
match dt.into().format(&f) { |
||||
Ok(s) => s, |
||||
Err(_e) => "".to_string(), |
||||
} |
||||
}, |
||||
Err(_e) => { |
||||
"".to_string() |
||||
}, |
||||
} |
||||
} |
||||
|
||||
impl ZeroIDC { |
||||
pub fn new( |
||||
issuer: &str, |
||||
client_id: &str, |
||||
auth_ep: &str, |
||||
local_web_port: u16, |
||||
) -> Result<ZeroIDC, ZeroIDCError> { |
||||
let idc = ZeroIDC { |
||||
inner: Arc::new(Mutex::new(Inner { |
||||
running: false, |
||||
auth_endpoint: auth_ep.to_string(), |
||||
oidc_thread: None, |
||||
oidc_client: None, |
||||
access_token: None, |
||||
refresh_token: None, |
||||
exp_time: 0, |
||||
|
||||
url: None, |
||||
csrf_token: None, |
||||
nonce: None, |
||||
pkce_verifier: None,
|
||||
})), |
||||
}; |
||||
|
||||
let iss = IssuerUrl::new(issuer.to_string())?; |
||||
|
||||
let provider_meta = CoreProviderMetadata::discover(&iss, http_client)?; |
||||
|
||||
let r = format!("http://localhost:{}/sso", local_web_port); |
||||
let redir_url = Url::parse(&r)?; |
||||
|
||||
let redirect = RedirectUrl::new(redir_url.to_string())?; |
||||
|
||||
(*idc.inner.lock().unwrap()).oidc_client = Some( |
||||
CoreClient::from_provider_metadata( |
||||
provider_meta, |
||||
ClientId::new(client_id.to_string()), |
||||
None, |
||||
) |
||||
.set_redirect_uri(redirect), |
||||
); |
||||
|
||||
Ok(idc) |
||||
} |
||||
|
||||
fn start(&mut self) { |
||||
let local = Arc::clone(&self.inner); |
||||
|
||||
if !(*local.lock().unwrap()).running { |
||||
let inner_local = Arc::clone(&self.inner); |
||||
(*local.lock().unwrap()).oidc_thread = Some(spawn(move || { |
||||
(*inner_local.lock().unwrap()).running = true; |
||||
let mut running = true; |
||||
|
||||
// Keep a copy of the initial nonce used to get the tokens
|
||||
// Will be needed later when verifying the responses from refresh tokens
|
||||
let nonce = (*inner_local.lock().unwrap()).nonce.clone(); |
||||
|
||||
while running { |
||||
let exp = UNIX_EPOCH + Duration::from_secs((*inner_local.lock().unwrap()).exp_time); |
||||
let now = SystemTime::now(); |
||||
|
||||
#[cfg(debug_assertions)] { |
||||
println!("refresh token thread tick, now: {}, exp: {}", systemtime_strftime(now, "[year]-[month]-[day] [hour]:[minute]:[second]"), systemtime_strftime(exp, "[year]-[month]-[day] [hour]:[minute]:[second]")); |
||||
} |
||||
let refresh_token = (*inner_local.lock().unwrap()).refresh_token.clone(); |
||||
if let Some(refresh_token) = refresh_token { |
||||
if now >= (exp - Duration::from_secs(30)) { |
||||
let token_response = (*inner_local.lock().unwrap()).oidc_client.as_ref().map(|c| { |
||||
let res = c.exchange_refresh_token(&refresh_token) |
||||
.request(http_client); |
||||
|
||||
res |
||||
}); |
||||
|
||||
if let Some(res) = token_response { |
||||
match res { |
||||
Ok(res) => { |
||||
|
||||
let n = match nonce.clone() { |
||||
Some(n) => n, |
||||
None => { |
||||
println!("err: no nonce"); |
||||
continue; |
||||
} |
||||
}; |
||||
|
||||
let id = match res.id_token() { |
||||
Some(t) => t, |
||||
None => { |
||||
println!("err: no id_token"); |
||||
continue; |
||||
} |
||||
}; |
||||
|
||||
// verify & validate claims
|
||||
let verified = (*inner_local.lock().unwrap()).oidc_client.as_ref().map(|c| { |
||||
let claims = match id.claims(&c.id_token_verifier(), &n) { |
||||
Ok(c) => c, |
||||
Err(e) => { |
||||
println!("claims err: {}", e); |
||||
return false; |
||||
} |
||||
}; |
||||
|
||||
let signing_algo = match id.signing_alg() { |
||||
Ok(s) => s, |
||||
Err(e) => { |
||||
println!("alg err: {}", e); |
||||
return false; |
||||
} |
||||
}; |
||||
|
||||
if let Some(expected_hash) = claims.access_token_hash() { |
||||
let actual_hash = match AccessTokenHash::from_token(res.access_token(), &signing_algo) { |
||||
Ok(h) => h, |
||||
Err(e) => { |
||||
println!("Error hashing access token: {}", e); |
||||
return false; |
||||
} |
||||
}; |
||||
|
||||
if actual_hash != *expected_hash { |
||||
println!("token hash error"); |
||||
return false; |
||||
} |
||||
} |
||||
return true; |
||||
}); |
||||
|
||||
let v = match verified { |
||||
Some(verified) => { |
||||
if !verified { |
||||
println!("not verified."); |
||||
(*inner_local.lock().unwrap()).running = false; |
||||
false |
||||
} else { |
||||
true |
||||
} |
||||
}, |
||||
None => { |
||||
println!("no verification performed?"); |
||||
(*inner_local.lock().unwrap()).running = false; |
||||
false |
||||
} |
||||
}; |
||||
|
||||
if v { |
||||
match res.id_token() { |
||||
Some(id_token) => { |
||||
let params = [("id_token", id_token.to_string()),("state", "refresh".to_string())]; |
||||
#[cfg(debug_assertions)] { |
||||
println!("New ID token: {}", id_token.to_string()); |
||||
} |
||||
let client = reqwest::blocking::Client::new(); |
||||
let r = client.post((*inner_local.lock().unwrap()).auth_endpoint.clone()) |
||||
.form(¶ms) |
||||
.send(); |
||||
|
||||
match r { |
||||
Ok(r) => { |
||||
if r.status().is_success() { |
||||
#[cfg(debug_assertions)] { |
||||
println!("hit url: {}", r.url().as_str()); |
||||
println!("status: {}", r.status()); |
||||
} |
||||
|
||||
let access_token = res.access_token(); |
||||
let at = access_token.secret(); |
||||
// yes this function is called `dangerous_insecure_decode`
|
||||
// and it doesn't validate the jwt token signature,
|
||||
// but if we've gotten this far, our claims have already
|
||||
// been validated up above
|
||||
let exp = dangerous_insecure_decode::<Exp>(&at); |
||||
|
||||
if let Ok(e) = exp { |
||||
(*inner_local.lock().unwrap()).exp_time = e.claims.exp |
||||
} |
||||
|
||||
(*inner_local.lock().unwrap()).access_token = Some(access_token.clone()); |
||||
if let Some(t) = res.refresh_token() { |
||||
// println!("New Refresh Token: {}", t.secret());
|
||||
(*inner_local.lock().unwrap()).refresh_token = Some(t.clone()); |
||||
} |
||||
#[cfg(debug_assertions)] { |
||||
println!("Central post succeeded"); |
||||
} |
||||
} else { |
||||
println!("Central post failed: {}", r.status().to_string()); |
||||
println!("hit url: {}", r.url().as_str()); |
||||
println!("Status: {}", r.status()); |
||||
(*inner_local.lock().unwrap()).exp_time = 0; |
||||
(*inner_local.lock().unwrap()).running = false; |
||||
} |
||||
}, |
||||
Err(e) => { |
||||
|
||||
println!("Central post failed: {}", e.to_string()); |
||||
println!("hit url: {}", e.url().unwrap().as_str()); |
||||
println!("Status: {}", e.status().unwrap()); |
||||
(*inner_local.lock().unwrap()).exp_time = 0; |
||||
(*inner_local.lock().unwrap()).running = false; |
||||
} |
||||
} |
||||
}, |
||||
None => { |
||||
println!("no id token?!?"); |
||||
} |
||||
} |
||||
} else { |
||||
println!("claims not verified"); |
||||
} |
||||
}, |
||||
Err(e) => { |
||||
println!("token error: {}", e); |
||||
} |
||||
} |
||||
} else { |
||||
println!("token response??"); |
||||
} |
||||
} else { |
||||
#[cfg(debug_assertions)] |
||||
println!("waiting to refresh"); |
||||
} |
||||
} else { |
||||
println!("no refresh token?"); |
||||
} |
||||
|
||||
sleep(Duration::from_secs(1)); |
||||
running = (*inner_local.lock().unwrap()).running; |
||||
} |
||||
|
||||
println!("thread done!") |
||||
})); |
||||
} |
||||
} |
||||
|
||||
pub fn stop(&mut self) { |
||||
let local = self.inner.clone(); |
||||
if (*local.lock().unwrap()).running { |
||||
if let Some(u) = (*local.lock().unwrap()).oidc_thread.take() { |
||||
u.join().expect("join failed"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
pub fn is_running(&mut self) -> bool { |
||||
let local = Arc::clone(&self.inner); |
||||
|
||||
if (*local.lock().unwrap()).running { |
||||
true |
||||
} else { |
||||
false |
||||
} |
||||
} |
||||
|
||||
pub fn get_exp_time(&mut self) -> u64 { |
||||
return (*self.inner.lock().unwrap()).exp_time; |
||||
} |
||||
|
||||
pub fn set_nonce_and_csrf(&mut self, csrf_token: String, nonce: String) { |
||||
let local = Arc::clone(&self.inner); |
||||
(*local.lock().expect("can't lock inner")).as_opt().map(|i| { |
||||
let need_verifier = match i.pkce_verifier { |
||||
None => true, |
||||
_ => false, |
||||
}; |
||||
|
||||
let csrf_diff = if let Some(csrf) = i.csrf_token.clone() { |
||||
if *csrf.secret() != csrf_token { |
||||
true
|
||||
} else { |
||||
false |
||||
} |
||||
} else { |
||||
false |
||||
}; |
||||
|
||||
let nonce_diff = if let Some(n) = i.nonce.clone() { |
||||
if *n.secret() != nonce { |
||||
true |
||||
} else { |
||||
false |
||||
} |
||||
} else { |
||||
false |
||||
}; |
||||
|
||||
if need_verifier || csrf_diff || nonce_diff { |
||||
let (pkce_challenge, pkce_verifier) = PkceCodeChallenge::new_random_sha256(); |
||||
let r = i.oidc_client.as_ref().map(|c| { |
||||
let (auth_url, csrf_token, nonce) = c |
||||
.authorize_url( |
||||
AuthenticationFlow::<CoreResponseType>::AuthorizationCode, |
||||
csrf_func(csrf_token), |
||||
nonce_func(nonce), |
||||
) |
||||
.add_scope(Scope::new("profile".to_string())) |
||||
.add_scope(Scope::new("email".to_string())) |
||||
.add_scope(Scope::new("offline_access".to_string())) |
||||
.add_scope(Scope::new("openid".to_string())) |
||||
.set_pkce_challenge(pkce_challenge) |
||||
.url(); |
||||
|
||||
(auth_url, csrf_token, nonce) |
||||
}); |
||||
|
||||
if let Some(r) = r { |
||||
i.url = Some(r.0); |
||||
i.csrf_token = Some(r.1); |
||||
i.nonce = Some(r.2); |
||||
i.pkce_verifier = Some(pkce_verifier); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
pub fn auth_url(&self) -> String { |
||||
let url = (*self.inner.lock().expect("can't lock inner")).as_opt().map(|i| { |
||||
match i.url.clone() { |
||||
Some(u) => u.to_string(), |
||||
_ => "".to_string(), |
||||
} |
||||
}); |
||||
|
||||
match url { |
||||
Some(url) => url.to_string(), |
||||
None => "".to_string(), |
||||
} |
||||
} |
||||
|
||||
pub fn do_token_exchange(&mut self, code: &str) -> String { |
||||
let local = Arc::clone(&self.inner); |
||||
let mut should_start = false; |
||||
let res = (*local.lock().unwrap()).as_opt().map(|i| { |
||||
if let Some(verifier) = i.pkce_verifier.take() { |
||||
let token_response = i.oidc_client.as_ref().map(|c| { |
||||
let r = c.exchange_code(AuthorizationCode::new(code.to_string())) |
||||
.set_pkce_verifier(verifier) |
||||
.request(http_client); |
||||
|
||||
// validate the token hashes
|
||||
match r { |
||||
Ok(res) =>{ |
||||
let n = match i.nonce.clone() { |
||||
Some(n) => n, |
||||
None => { |
||||
return None; |
||||
} |
||||
}; |
||||
|
||||
let id = match res.id_token() { |
||||
Some(t) => t, |
||||
None => { |
||||
return None; |
||||
} |
||||
}; |
||||
|
||||
let claims = match id.claims(&c.id_token_verifier(), &n) { |
||||
Ok(c) => c, |
||||
Err(_e) => { |
||||
return None; |
||||
} |
||||
}; |
||||
|
||||
let signing_algo = match id.signing_alg() { |
||||
Ok(s) => s, |
||||
Err(_) => { |
||||
return None; |
||||
} |
||||
}; |
||||
|
||||
if let Some(expected_hash) = claims.access_token_hash() { |
||||
let actual_hash = match AccessTokenHash::from_token(res.access_token(), &signing_algo) { |
||||
Ok(h) => h, |
||||
Err(e) => { |
||||
println!("Error hashing access token: {}", e); |
||||
return None; |
||||
} |
||||
}; |
||||
|
||||
if actual_hash != *expected_hash { |
||||
println!("token hash error"); |
||||
return None; |
||||
} |
||||
} |
||||
Some(res) |
||||
}, |
||||
Err(_e) => { |
||||
#[cfg(debug_assertions)] { |
||||
println!("token response error: {}", _e.to_string()); |
||||
} |
||||
|
||||
return None; |
||||
}, |
||||
} |
||||
}); |
||||
|
||||
if let Some(Some(tok)) = token_response { |
||||
let id_token = tok.id_token().unwrap(); |
||||
#[cfg(debug_assertions)] { |
||||
println!("ID token: {}", id_token.to_string()); |
||||
} |
||||
|
||||
let mut split = "".to_string(); |
||||
match i.csrf_token.clone() { |
||||
Some(csrf_token) => { |
||||
split = csrf_token.secret().to_owned(); |
||||
}, |
||||
_ => (), |
||||
} |
||||
|
||||
let split = split.split("_").collect::<Vec<&str>>(); |
||||
|
||||
if split.len() == 2 { |
||||
let params = [("id_token", id_token.to_string()),("state", split[0].to_string())]; |
||||
let client = reqwest::blocking::Client::new(); |
||||
let res = client.post(i.auth_endpoint.clone()) |
||||
.form(¶ms) |
||||
.send(); |
||||
|
||||
match res { |
||||
Ok(res) => { |
||||
#[cfg(debug_assertions)] { |
||||
println!("hit url: {}", res.url().as_str()); |
||||
println!("Status: {}", res.status()); |
||||
} |
||||
|
||||
let at = tok.access_token().secret(); |
||||
|
||||
// see previous note about this function's use
|
||||
let exp = dangerous_insecure_decode::<Exp>(&at); |
||||
if let Ok(e) = exp { |
||||
i.exp_time = e.claims.exp |
||||
} |
||||
|
||||
i.access_token = Some(tok.access_token().clone()); |
||||
if let Some(t) = tok.refresh_token() { |
||||
i.refresh_token = Some(t.clone()); |
||||
should_start = true; |
||||
} |
||||
#[cfg(debug_assertions)] { |
||||
let access_token = tok.access_token(); |
||||
println!("Access Token: {}", access_token.secret()); |
||||
|
||||
let refresh_token = tok.refresh_token(); |
||||
println!("Refresh Token: {}", refresh_token.unwrap().secret()); |
||||
} |
||||
|
||||
let bytes = match res.bytes() { |
||||
Ok(bytes) => bytes, |
||||
Err(_) => Bytes::from(""), |
||||
}; |
||||
|
||||
let bytes = match from_utf8(bytes.as_ref()) { |
||||
Ok(bytes) => bytes.to_string(), |
||||
Err(_) => "".to_string(), |
||||
}; |
||||
|
||||
return bytes; |
||||
}, |
||||
Err(res) => { |
||||
println!("hit url: {}", res.url().unwrap().as_str()); |
||||
println!("Status: {}", res.status().unwrap()); |
||||
println!("Post error: {}", res.to_string()); |
||||
i.exp_time = 0; |
||||
} |
||||
} |
||||
|
||||
|
||||
} else { |
||||
println!("invalid split length?!?"); |
||||
} |
||||
} |
||||
} |
||||
"".to_string() |
||||
}); |
||||
if should_start { |
||||
self.start(); |
||||
} |
||||
return match res { |
||||
Some(res) => res, |
||||
_ => "".to_string(), |
||||
}; |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup Label="ProjectConfigurations"> |
||||
<ProjectConfiguration Include="Debug|Win32"> |
||||
<Configuration>Debug</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Release|Win32"> |
||||
<Configuration>Release</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Debug|x64"> |
||||
<Configuration>Debug</Configuration> |
||||
<Platform>x64</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Release|x64"> |
||||
<Configuration>Release</Configuration> |
||||
<Platform>x64</Platform> |
||||
</ProjectConfiguration> |
||||
</ItemGroup> |
||||
<PropertyGroup Label="Globals"> |
||||
<VCProjectVersion>16.0</VCProjectVersion> |
||||
<ProjectGuid>{175C340F-F5BA-4CB1-88AD-533B102E3799}</ProjectGuid> |
||||
<Keyword>Win32Proj</Keyword> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
||||
<ConfigurationType>Makefile</ConfigurationType> |
||||
<UseDebugLibraries>true</UseDebugLibraries> |
||||
<PlatformToolset>v142</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
||||
<ConfigurationType>Makefile</ConfigurationType> |
||||
<UseDebugLibraries>false</UseDebugLibraries> |
||||
<PlatformToolset>v142</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
||||
<ConfigurationType>Makefile</ConfigurationType> |
||||
<UseDebugLibraries>true</UseDebugLibraries> |
||||
<PlatformToolset>v142</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
||||
<ConfigurationType>Makefile</ConfigurationType> |
||||
<UseDebugLibraries>false</UseDebugLibraries> |
||||
<PlatformToolset>v142</PlatformToolset> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
||||
<ImportGroup Label="ExtensionSettings"> |
||||
</ImportGroup> |
||||
<ImportGroup Label="Shared"> |
||||
</ImportGroup> |
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
||||
</ImportGroup> |
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
||||
</ImportGroup> |
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
||||
</ImportGroup> |
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
||||
</ImportGroup> |
||||
<PropertyGroup Label="UserMacros" /> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
||||
<NMakeBuildCommandLine>cargo build --release --target=x86_64-pc-windows-msvc</NMakeBuildCommandLine> |
||||
<NMakeOutput> |
||||
</NMakeOutput> |
||||
<NMakeCleanCommandLine>cargo clean</NMakeCleanCommandLine> |
||||
<NMakeReBuildCommandLine>cargo clean & cargo build --release --target=x86_64-pc-windows-msvc</NMakeReBuildCommandLine> |
||||
<NMakePreprocessorDefinitions>NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
||||
<NMakeBuildCommandLine>cargo build --target=i686-pc-windows-msvc</NMakeBuildCommandLine> |
||||
<NMakeOutput> |
||||
</NMakeOutput> |
||||
<NMakeCleanCommandLine>cargo clean</NMakeCleanCommandLine> |
||||
<NMakeReBuildCommandLine>cargo clean & cargo build --target=i686-pc-windows-msvc</NMakeReBuildCommandLine> |
||||
<NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
||||
<NMakeBuildCommandLine>cargo build --target=x86_64-pc-windows-msvc</NMakeBuildCommandLine> |
||||
<NMakeOutput> |
||||
</NMakeOutput> |
||||
<NMakeCleanCommandLine>cargo clean</NMakeCleanCommandLine> |
||||
<NMakeReBuildCommandLine>cargo clean & cargo build --target=x86_64-pc-windows-msvc</NMakeReBuildCommandLine> |
||||
<NMakePreprocessorDefinitions>_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
||||
<NMakeBuildCommandLine>cargo build --release --target=i686-pc-windows-msvc</NMakeBuildCommandLine> |
||||
<NMakeOutput> |
||||
</NMakeOutput> |
||||
<NMakeCleanCommandLine>cargo clean</NMakeCleanCommandLine> |
||||
<NMakeReBuildCommandLine>cargo clean & cargo build --release --target=i686-pc-windows-msvc</NMakeReBuildCommandLine> |
||||
<NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> |
||||
</PropertyGroup> |
||||
<ItemDefinitionGroup> |
||||
</ItemDefinitionGroup> |
||||
<ItemGroup> |
||||
<None Include="src\ext.rs" /> |
||||
<None Include="src\lib.rs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClInclude Include="target\zeroidc.h" /> |
||||
</ItemGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
||||
<ImportGroup Label="ExtensionTargets"> |
||||
</ImportGroup> |
||||
</Project> |
||||
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
||||
<Filter Include="Source Files"> |
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> |
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> |
||||
</Filter> |
||||
<Filter Include="Header Files"> |
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> |
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> |
||||
</Filter> |
||||
<Filter Include="Resource Files"> |
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> |
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> |
||||
</Filter> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="src\ext.rs"> |
||||
<Filter>Source Files</Filter> |
||||
</None> |
||||
<None Include="src\lib.rs"> |
||||
<Filter>Source Files</Filter> |
||||
</None> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClInclude Include="target\zeroidc.h"> |
||||
<Filter>Header Files</Filter> |
||||
</ClInclude> |
||||
</ItemGroup> |
||||
</Project> |
||||
Loading…
Reference in new issue