Ulfius: Constants

Ulfius HTTP Framework for REST Applications in C

Loading...
Searching...
No Matches
Macros | Enumerations
Constants

## Macros
#define | ULFIUS_STREAM_BLOCK_SIZE_DEFAULT 1024
#define | U_STREAM_END MHD_CONTENT_READER_END_OF_STREAM
#define | U_STREAM_ERROR MHD_CONTENT_READER_END_WITH_ERROR
#define | U_STREAM_SIZE_UNKNOWN MHD_SIZE_UNKNOWN
#define | U_STREAM_SIZE_UNKOWN U_STREAM_SIZE_UNKNOWN
#define | U_OK 0
| No error.
#define | U_ERROR 1
| Error.
#define | U_ERROR_MEMORY 2
| Error in memory allocation.
#define | U_ERROR_PARAMS 3
| Error in input parameters.
#define | U_ERROR_LIBMHD 4
| Error in libmicrohttpd execution.
#define | U_ERROR_LIBCURL 5
| Error in libcurl execution.
#define | U_ERROR_NOT_FOUND 6
| Something was not found.
#define | U_ERROR_DISCONNECTED 7
| Connection closed.
#define | U_CALLBACK_CONTINUE 0
| Callback exited with success, continue to next callback.
#define | U_CALLBACK_IGNORE 1
| Callback decided to be ignored, request.callback_position will not be incremented, continue to next callback.
#define | U_CALLBACK_COMPLETE 2
| Callback exited with success, exit callback list.
#define | U_CALLBACK_UNAUTHORIZED 3
| Request is unauthorized, exit callback list and return status 401.
#define | U_CALLBACK_ERROR 4
| Error during request process, exit callback list and return status 500.
#define | U_COOKIE_SAME_SITE_EMPTY 0
| Set same_site cookie property not set.
#define | U_COOKIE_SAME_SITE_STRICT 1
| Set same_site cookie property to strict.
#define | U_COOKIE_SAME_SITE_LAX 2
| Set same_site cookie property to lax.
#define | U_COOKIE_SAME_SITE_NONE 3
| Set same_site cookie property to none.
#define | U_USE_IPV4 0x0001
| Use instance in IPV4 mode only.
#define | U_USE_IPV6 0x0010
| Use instance in IPV6 mode only.
#define | U_USE_ALL (U_USE_IPV4|U_USE_IPV6)
| Use instance in both IPV4 and IPV6 mode.
#define | U_SSL_VERIFY_PEER 0x0001
| Verify TLS session with peers.
#define | U_SSL_VERIFY_HOSTNAME 0x0010
| Verify TLS session with hostname.
#define | U_POST_PROCESS_NONE 0x0000
#define | U_POST_PROCESS_URL_ENCODED 0x0001
#define | U_POST_PROCESS_MULTIPART_FORMDATA 0x0010

## Enumerations
enum | u_option { U_OPT_NONE = 0 , U_OPT_HTTP_VERB = 1 , U_OPT_HTTP_URL = 2 , U_OPT_HTTP_PROXY = 3 , U_OPT_CHECK_SERVER_CERTIFICATE = 5 , U_OPT_CHECK_SERVER_CERTIFICATE_FLAG = 6 , U_OPT_CHECK_PROXY_CERTIFICATE = 7 , U_OPT_CHECK_PROXY_CERTIFICATE_FLAG = 8 , U_OPT_FOLLOW_REDIRECT = 9 , U_OPT_CA_PATH = 10 , U_OPT_TIMEOUT = 11 , U_OPT_AUTH_BASIC_USER = 12 , U_OPT_AUTH_BASIC_PASSWORD = 13 , U_OPT_AUTH_BASIC = 14 , U_OPT_URL_PARAMETER = 15 , U_OPT_HEADER_PARAMETER = 16 , U_OPT_COOKIE_PARAMETER = 17 , U_OPT_POST_BODY_PARAMETER = 18 , U_OPT_URL_PARAMETER_REMOVE = 19 , U_OPT_HEADER_PARAMETER_REMOVE = 20 , U_OPT_COOKIE_PARAMETER_REMOVE = 21 , U_OPT_POST_BODY_PARAMETER_REMOVE = 22 , U_OPT_BINARY_BODY = 23 , U_OPT_STRING_BODY = 24 , U_OPT_JSON_BODY = 25 , U_OPT_CLIENT_CERT_FILE = 26 , U_OPT_CLIENT_KEY_FILE = 27 , U_OPT_CLIENT_KEY_PASSWORD = 28 , U_OPT_STATUS = 29 , U_OPT_AUTH_REALM = 30 , U_OPT_SHARED_DATA = 31 , U_OPT_HTTP_URL_APPEND = 32 }

## Detailed Description

Angharad libraries To disable all yder log messages, this flag must be enabled

## Macro Definition Documentation

## ◆ U_CALLBACK_COMPLETE

#define U_CALLBACK_COMPLETE 2

Callback exited with success, exit callback list.

## ◆ U_CALLBACK_CONTINUE

#define U_CALLBACK_CONTINUE 0

Callback exited with success, continue to next callback.

## ◆ U_CALLBACK_ERROR

#define U_CALLBACK_ERROR 4

Error during request process, exit callback list and return status 500.

## ◆ U_CALLBACK_IGNORE

#define U_CALLBACK_IGNORE 1

Callback decided to be ignored, request.callback_position will not be incremented, continue to next callback.

## ◆ U_CALLBACK_UNAUTHORIZED

#define U_CALLBACK_UNAUTHORIZED 3

Request is unauthorized, exit callback list and return status 401.

## ◆ U_COOKIE_SAME_SITE_EMPTY

#define U_COOKIE_SAME_SITE_EMPTY 0

Set same_site cookie property not set.

## ◆ U_COOKIE_SAME_SITE_LAX

#define U_COOKIE_SAME_SITE_LAX 2

Set same_site cookie property to lax.

## ◆ U_COOKIE_SAME_SITE_NONE

#define U_COOKIE_SAME_SITE_NONE 3

Set same_site cookie property to none.

## ◆ U_COOKIE_SAME_SITE_STRICT

#define U_COOKIE_SAME_SITE_STRICT 1

Set same_site cookie property to strict.

## ◆ U_ERROR

#define U_ERROR 1

Error.

## ◆ U_ERROR_DISCONNECTED

#define U_ERROR_DISCONNECTED 7

Connection closed.

## ◆ U_ERROR_LIBCURL

#define U_ERROR_LIBCURL 5

Error in libcurl execution.

## ◆ U_ERROR_LIBMHD

#define U_ERROR_LIBMHD 4

Error in libmicrohttpd execution.

## ◆ U_ERROR_MEMORY

#define U_ERROR_MEMORY 2

Error in memory allocation.

## ◆ U_ERROR_NOT_FOUND

#define U_ERROR_NOT_FOUND 6

Something was not found.

## ◆ U_ERROR_PARAMS

#define U_ERROR_PARAMS 3

Error in input parameters.

## ◆ U_OK

#define U_OK 0

No error.

## ◆ U_POST_PROCESS_MULTIPART_FORMDATA

#define U_POST_PROCESS_MULTIPART_FORMDATA 0x0010

## ◆ U_POST_PROCESS_NONE

#define U_POST_PROCESS_NONE 0x0000

## ◆ U_POST_PROCESS_URL_ENCODED

#define U_POST_PROCESS_URL_ENCODED 0x0001

## ◆ U_SSL_VERIFY_HOSTNAME

#define U_SSL_VERIFY_HOSTNAME 0x0010

Verify TLS session with hostname.

## ◆ U_SSL_VERIFY_PEER

#define U_SSL_VERIFY_PEER 0x0001

Verify TLS session with peers.

## ◆ U_STREAM_END

#define U_STREAM_END MHD_CONTENT_READER_END_OF_STREAM

## ◆ U_STREAM_ERROR

#define U_STREAM_ERROR MHD_CONTENT_READER_END_WITH_ERROR

## ◆ U_STREAM_SIZE_UNKNOWN

#define U_STREAM_SIZE_UNKNOWN MHD_SIZE_UNKNOWN

## ◆ U_STREAM_SIZE_UNKOWN

#define U_STREAM_SIZE_UNKOWN U_STREAM_SIZE_UNKNOWN

## ◆ U_USE_ALL

#define U_USE_ALL (U_USE_IPV4|U_USE_IPV6)

Use instance in both IPV4 and IPV6 mode.

## ◆ U_USE_IPV4

#define U_USE_IPV4 0x0001

Use instance in IPV4 mode only.

## ◆ U_USE_IPV6

#define U_USE_IPV6 0x0010

Use instance in IPV6 mode only.

## ◆ ULFIUS_STREAM_BLOCK_SIZE_DEFAULT

#define ULFIUS_STREAM_BLOCK_SIZE_DEFAULT 1024

## Enumeration Type Documentation

## ◆ u_option

enum u_option

Options available to set or get properties using ulfius_set_request_properties or ulfius_set_request_properties

Enumerator
U_OPT_NONE | Empty option to complete a ulfius_set_request_properties or ulfius_set_request_properties.
U_OPT_HTTP_VERB | http method (GET, POST, PUT, DELETE, etc.), expected option value type: const char *
U_OPT_HTTP_URL | full url used to call this callback function or full url to call when used in a ulfius_send_http_request, expected option value type: const char *
U_OPT_HTTP_PROXY | proxy address to use for outgoing connections, used by ulfius_send_http_request, expected option value type: const char *
U_OPT_CHECK_SERVER_CERTIFICATE | check server certificate and hostname, default true, used by ulfius_send_http_request, expected option value type: int
U_OPT_CHECK_SERVER_CERTIFICATE_FLAG | check certificate peer and or server hostname if check_server_certificate is enabled, values available are U_SSL_VERIFY_PEER, U_SSL_VERIFY_HOSTNAME or both, default value is both (U_SSL_VERIFY_PEER|U_SSL_VERIFY_HOSTNAME), used by ulfius_send_http_request, expected option value type: int
U_OPT_CHECK_PROXY_CERTIFICATE | check proxy certificate and hostname, default true, used by ulfius_send_http_request, requires libcurl >= 7.52, expected option value type: int
U_OPT_CHECK_PROXY_CERTIFICATE_FLAG | check certificate peer and or proxy hostname if check_proxy_certificate is enabled, values available are U_SSL_VERIFY_PEER, U_SSL_VERIFY_HOSTNAME or both, default value is both (U_SSL_VERIFY_PEER|U_SSL_VERIFY_HOSTNAME), used by ulfius_send_http_request, requires libcurl >= 7.52, expected option value type: int
U_OPT_FOLLOW_REDIRECT | follow url redirections, used by ulfius_send_http_request, expected option value type: int
U_OPT_CA_PATH | specify a path to CA certificates instead of system path, used by ulfius_send_http_request, expected option value type: const char *
U_OPT_TIMEOUT | connection timeout used by ulfius_send_http_request, default is 0 or Timeout in seconds to close the connection because of inactivity between the client and the server, expected option value type: unsigned long
U_OPT_AUTH_BASIC_USER | basic authentication username, expected option value type: const char *
U_OPT_AUTH_BASIC_PASSWORD | basic authentication password, expected option value type: const char *
U_OPT_AUTH_BASIC | basic authentication user, then password, expected option value type: const char *, const char *
U_OPT_URL_PARAMETER | Add to the map containing the url variables, both from the route and the ?key=value variables, expected option value type: const char *, const char *.
U_OPT_HEADER_PARAMETER | Add to the map containing the header variables, expected option value type: const char *, const char *.
U_OPT_COOKIE_PARAMETER | Add to the map containing the cookie variables, expected option value type: const char *, const char *.
U_OPT_POST_BODY_PARAMETER | Add to the map containing the post body variables (if available), expected option value type: const char *, const char *.
U_OPT_URL_PARAMETER_REMOVE | Remove from the map containing the url variables, both from the route and the ?key=value variables, expected option value type: const char *.
U_OPT_HEADER_PARAMETER_REMOVE | Remove from map containing the header variables, expected option value type: const char *.
U_OPT_COOKIE_PARAMETER_REMOVE | Remove from map containing the cookie variables, expected option value type: const char *.
U_OPT_POST_BODY_PARAMETER_REMOVE | Remove from map containing the post body variables (if available), expected option value type: const char *.
U_OPT_BINARY_BODY | Set a raw body to the request or the reponse, expected option value type: const char *, size_t.
U_OPT_STRING_BODY | Set a char * body to the request or the reponse, expected option value type: const char *.
U_OPT_JSON_BODY | Set a stringified json_t * body to the request or the reponse, expected option value type: json_t *.
U_OPT_CLIENT_CERT_FILE | path to client certificate file for sending http requests with certificate authentication, available only if GnuTLS support is enabled, expected option value type: const char *
U_OPT_CLIENT_KEY_FILE | path to client key file for sending http requests with certificate authentication, available only if GnuTLS support is enabled, expected option value type: const char *
U_OPT_CLIENT_KEY_PASSWORD | password to unlock client key file, available only if GnuTLS support is enabled, expected option value type: const char *
U_OPT_STATUS | HTTP response status code (200, 404, 500, etc), expected option value type: long.
U_OPT_AUTH_REALM | realm to send to the client response on authenticationb failed, expected option value type: const char *
U_OPT_SHARED_DATA | any data shared between callback functions, must be allocated and freed by the callback functions, expected option value type: void *
U_OPT_HTTP_URL_APPEND | append char * value to the current url, expected option value type: const char *