ZOO-Project
|
#include "service.h"
#include <openssl/sha.h>
#include <openssl/md5.h>
#include <openssl/hmac.h>
#include <openssl/evp.h>
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
Go to the source code of this file.
Macros | |
#define | IMPORTSERVICE "include" |
Functions | |
int | conf_read (const char *, maps *) |
Parse the main.cfg file and fill the maps structure. More... | |
char * | get_uuid () |
Generate a UUID. More... | |
char * | base64 (const char *, int) |
Base64 encoding of a char*. More... | |
char * | base64d (const char *, int, int *) |
Base64 decoding of a char*. More... | |
void | readBase64 (map **) |
Read Base64 value and split it value by lines of 64 char. More... | |
char * | url_decode (char *) |
Decode an URLEncoded url. More... | |
int | getVersionId (const char *) |
Detect WPS version used (1.0.0 or 2.0.0). More... | |
void | readGeneratedFile (maps *, map *, char *) |
Read a file generated by a service. More... | |
int | getServiceFromYAML (maps *, char *, service **, char *name) |
Read and parse a ZCFG file in YAML format. More... | |
char * | addDefaultValues (maps **, elements *, maps *, int, map **) |
Add the default values defined in the zcfg to a maps. More... | |
char * | getEncoding (maps *) |
Access the value of the encoding key in a maps. More... | |
void | parseIdentifier (maps *, char *, char *, char *) |
Extract the service identifier from the full service identifier ie: More... | |
void | dumpMapsValuesToFiles (maps **, maps **) |
Dump all values in a maps as files. More... | |
void | runDismiss (maps *, char *) |
Run Dismiss requests. More... | |
int | isRunning (maps *, char *) |
Check if a service is running. More... | |
void | runGetStatus (maps *, char *, char *) |
Run GetStatus requests. More... | |
void | readFinalRes (maps *, char *, map *) |
Read the Result file (.res). More... | |
int | isValidLang (maps *, const char *) |
Verify if a given language is listed in the lang list defined in the [main] section of the main.cfg file. More... | |
char * | getLastErrorMessage () |
Access the last error message returned by the OS when trying to dynamically load a shared library. More... | |
int | readServiceFile (maps *, char *, service **, char *) |
Parse the service file using getServiceFromFile or use getServiceFromYAML if YAML support was activated. More... | |
int | createRegistry (maps *, registry **, char *) |
Create the profile registry. More... | |
char * | produceErrorMessage (maps *) |
Create a string containing the basic error message. More... | |
int | zoo_path_compare (char *path1, char *path2) |
#define IMPORTSERVICE "include" |
Add the default values defined in the zcfg to a maps.
out | the maps containing the inputs or outputs given in the initial HTTP request |
in | the description of all inputs or outputs available for a service |
m | the maps containing the settings of the main.cfg file |
type | 0 for inputs and 1 for outputs |
err | the map to store potential missing mandatory input parameters or wrong output names depending on the type. |
In case of an Input maps, then add the minOccurs and maxOccurs to the content map.
Parsing BoundingBoxData, fill the following map and then add it to the content map of the Input maps: lowerCorner, upperCorner, srs and dimensions cf. parseBoundingBox
char* base64 | ( | const char * | input, |
int | length | ||
) |
Base64 encoding of a char*.
input | the value to encode |
length | the value length |
char* base64d | ( | const char * | input, |
int | length, | ||
int * | red | ||
) |
Base64 decoding of a char*.
input | the value to decode |
length | the value length |
red | the value length |
int conf_read | ( | const char * | file, |
maps * | my_map | ||
) |
Parse the main.cfg file and fill the maps structure.
file | the filename to parse |
my_map | the maps structure to fill |
Create the profile registry.
The profile registry is optional (created only if the registry key is available in the [main] section of the main.cfg file) and can be used to store the profiles hierarchy. The registry is a directory which should contain the following sub-directories:
m | the conf maps containing the main.cfg settings |
r | the registry to update |
reg_dir | the resgitry |
Dump all values in a maps as files.
main_conf | the maps containing the settings of the main.cfg file |
in | the maps containing values to dump as files |
char* get_uuid | ( | ) |
Generate a UUID.
ref: https://www.ietf.org/rfc/rfc4122.txt / 4.2
char* getEncoding | ( | maps * | m | ) |
Access the value of the encoding key in a maps.
m | the maps to search for the encoding key |
char* getLastErrorMessage | ( | ) |
Access the last error message returned by the OS when trying to dynamically load a shared library.
Read and parse a ZCFG file in YAML format.
conf | the conf maps containing the main.cfg settings |
file | the file name to read |
service | the service structure to fill |
name | the service name |
int getVersionId | ( | const char * | version | ) |
Detect WPS version used (1.0.0 or 2.0.0).
version | number as char* (1.0.0 or 2.0.0) |
int isRunning | ( | maps * | conf, |
char * | pid | ||
) |
Check if a service is running.
conf | the maps containing the setting of the main.cfg file |
pid | the unique service identifier (usid from the lenv section) |
int isValidLang | ( | maps * | conf, |
const char * | str | ||
) |
Verify if a given language is listed in the lang list defined in the [main] section of the main.cfg file.
conf | the map containing the settings from the main.cfg file |
str | the specific language |
void parseIdentifier | ( | maps * | conf, |
char * | conf_dir, | ||
char * | identifier, | ||
char * | buffer | ||
) |
Extract the service identifier from the full service identifier ie:
conf | the maps containing the settings of the main.cfg file |
conf_dir | the full path to the ZOO-Kernel directory |
identifier | the full service name (potentialy including a prefix, ie: Prefix.MyService) |
buffer | the resulting service identifier (without any prefix) |
char* produceErrorMessage | ( | maps * | pmConf | ) |
Create a string containing the basic error message.
pmConf | the main configuration maps pointer |
void readBase64 | ( | map ** | in | ) |
Read Base64 value and split it value by lines of 64 char.
in | the map containing the value to split |
Read the Result file (.res).
conf | the maps containing the setting of the main.cfg file |
pid | the service identifier (usid key from the [lenv] section) |
Read a file generated by a service.
m | the conf maps |
content | the output item |
filename | the file to read |
Parse the service file using getServiceFromFile or use getServiceFromYAML if YAML support was activated.
conf | the conf maps containing the main.cfg settings |
file | the file name to parse |
service | the service to update witht the file content |
name | the service name |
void runDismiss | ( | maps * | conf, |
char * | pid | ||
) |
Run Dismiss requests.
conf | the maps containing the setting of the main.cfg file |
pid | the service identifier (usid key from the [lenv] section) |
void runGetStatus | ( | maps * | conf, |
char * | pid, | ||
char * | req | ||
) |
Run GetStatus requests.
conf | the maps containing the setting of the main.cfg file |
pid | the service identifier (usid key from the [lenv] section) |
req | the request (GetStatus / GetResult) |
char* url_decode | ( | char * | str | ) |
Decode an URLEncoded url.
str | the URLEncoded url to decode |
int zoo_path_compare | ( | char * | path1, |
char * | path2 | ||
) |