Shadow Network Framework
0.0.2-alpha
C Server Library for Shadow Network Framework
|
This file Defines everything related to handling Requests. More...
Go to the source code of this file.
Data Structures | |
struct | SNF_Request_t |
The Structure for saving Requests. More... | |
struct | SNF_Request_args_t |
Macros | |
#define | NULLREQUEST "000000000000000" |
Requests's Default Request ID. | |
#define | SNF_REQUEST_MAXSIZE 4096 |
Defines the Requests' maximum length. | |
Typedefs | |
typedef struct SNF_Request_t | SNF_RQST |
Shortened definition of struct SNF_Request_t . | |
typedef struct SNF_Request_args_t | SNF_RQST_ARG |
Shortened definition of struct SNF_Request_args_t . | |
Functions | |
void | snf_request_free (SNF_RQST *Request) |
Frees a SNF_RQST *. | |
SNF_RQST * | snf_request_gen () |
Generates a new empty request. | |
SNF_RQST * | snf_request_gen_wUID (const char UID[16]) |
Generates a new empty request that has an UID. | |
SNF_RQST * | snf_request_gen_response (SNF_RQST *Original, SNF_opcode *OPCODE, SNF_RQST_ARG *Args) |
Generates a new response request. | |
SNF_RQST * | snf_request_gen_server_OPCODE (SNF_opcode *OPCODE) |
Generates a server request. | |
SNF_RQST * | snf_request_gen_base (SNF_RQST *Original, SNF_opcode_mmbr_t Command, SNF_opcode_mmbr_t Detail) |
Generates a response request using base OPCode. | |
SNF_RQST * | snf_request_genu_base (SNF_RQST *Original, SNF_opcode_mmbr_t Command) |
Generates a response request using undetailed base OPCode. | |
int | snf_request_get_nargs (SNF_RQST *args) |
Gets the amount of arguments a request has. | |
SNF_RQST_ARG * | snf_request_arg_gen (const char *arg) |
Generates a new Argumment. | |
void | snf_request_arg_free (SNF_RQST_ARG *arg) |
Frees an instance of SNF_RQST_ARG. | |
void | snf_request_args_free (SNF_RQST_ARG *arg) |
Frees all instance of SNF_RQST_ARG that were linked together using SNF_RQST_ARG::next. | |
void | snf_request_arg_insert (SNF_RQST *Request, SNF_RQST_ARG *arg) |
Inserts an arguments to the end of Request's SNF_RQST_ARG List. | |
SNF_RQST * | snf_request_fetch (SNF_CLT *Client) |
Fetches the request from the incoming Client. | |
void | snf_request_send (SNF_CLT *Client, SNF_RQST *Request) |
Send a request to a Client. | |
void | snf_request_send_confirm (SNF_CLT *Client, SNF_RQST *Original) |
Sends a confirmation Response request to the client. | |
void | snf_request_send_reject (SNF_CLT *Client, SNF_RQST *Original) |
Sends a rejection Response request to the client. | |
void | snf_request_send_invalid (SNF_CLT *Client, SNF_RQST *Original) |
Sends a invalidation Response request to the client. | |
This file Defines everything related to handling Requests.
#define NULLREQUEST "000000000000000" |
Requests's Default Request ID.
#define SNF_REQUEST_MAXSIZE 4096 |
Defines the Requests' maximum length.
typedef struct SNF_Request_t SNF_RQST |
Shortened definition of struct SNF_Request_t .
typedef struct SNF_Request_args_t SNF_RQST_ARG |
Shortened definition of struct SNF_Request_args_t .
|
extern |
Frees a SNF_RQST *.
Request | Pointer to be free'd |
|
extern |
Generates a new empty request.
|
extern |
Generates a new empty request that has an UID.
UID | The new Request's UID |
|
extern |
Generates a new response request.
Original | The request to reply to |
OPCODE | Thre response's OPCODE |
Args | The response's arguments |
|
extern |
Generates a server request.
OPCODE | server request's OPCODE |
|
extern |
Generates a response request using base OPCode.
Original | The request to respond to |
Command | Base Command |
Detail | Base Command's Detail |
|
extern |
Generates a response request using undetailed base OPCode.
Original | The request to respond to |
Command | Base Command |
|
extern |
Gets the amount of arguments a request has.
args | The request to get it's arguments |
|
extern |
Generates a new Argumment.
arg | Argument's Content |
|
extern |
Frees an instance of SNF_RQST_ARG.
arg | Instance to be free'd |
|
extern |
Frees all instance of SNF_RQST_ARG that were linked together using SNF_RQST_ARG::next.
arg | arg Instances to be free'd |
|
extern |
Inserts an arguments to the end of Request's SNF_RQST_ARG List.
Request | Request to be operated on |
arg | Argument to be added |
Fetches the request from the incoming Client.
Client | Client to receive request from. |
Send a request to a Client.
Client | Receiving Client |
Request | Request to Send |
Sends a confirmation Response request to the client.
Client | Receiving Client |
Original | Client's Original Request |
Sends a rejection Response request to the client.
Client | Receiving Client |
Original | Client's Original Request |