Shadow Network Framework
0.0.1-alpha
C Server Library for Shadow Network Framework
|
This file Defines everything related to Opcodes ( Short for OP**eartion**Codes ) More...
Go to the source code of this file.
Data Structures | |
union | SNF_opcode_t |
Structure for the opcode. More... | |
struct | SNF_opcode_t::SNF_opcode_struct |
SNF_opcode's Structure if you wanna access it using a structure. More... | |
struct | SNF_opcode_LL_item_t |
Structure used to save registred opcode members. More... | |
Macros | |
#define | SNF_opcode_mmbr_t uint8_t |
Defines SNF_opcode_mmbr_t 's size. | |
#define | SNF_opcode_mmbr_MAX UINT8_MAX |
Defines SNF_opcode_mmbr_t 's maximum possible Value. | |
#define | SNF_OPCODE_BASE_CAT (SNF_opcode_mmbr_t)0x00 |
Base Category for SNF. | |
#define | SNF_OPCODE_BASE_SUBCAT (SNF_opcode_mmbr_t)0x00 |
Base Sub-Category for SNF. | |
#define | SNF_OPCODE_BASE_DET_UNDETAILED (SNF_opcode_mmbr_t)0x00 |
Default Detail. | |
#define | SNF_OPCODE_BASE_CMD_CONNECT (SNF_opcode_mmbr_t)0x00 |
When client attemps to connect. | |
#define | SNF_OPCODE_BASE_CMD_RECONNECT (SNF_opcode_mmbr_t)0x01 |
When client attemps to reconnect - or forced to. | |
#define | SNF_OPCODE_BASE_CMD_DISCONNECT (SNF_opcode_mmbr_t)0x02 |
When client attemps to disconnect. | |
#define | SNF_OPCODE_BASE_CMD_SNF_VER (SNF_opcode_mmbr_t)0x03 |
When client requests SNF version of the Server. | |
#define | SNF_OPCODE_BASE_CMD_KICK (SNF_opcode_mmbr_t)0x04 |
When client was forced to disconnect ( Kicked ). | |
#define | SNF_OPCODE_BASE_CMD_CONFIRM (SNF_opcode_mmbr_t)0x05 |
When client's reuqest was confirmed. | |
#define | SNF_OPCODE_BASE_CMD_REJECT (SNF_opcode_mmbr_t)0x06 |
When client's request was rejected. | |
#define | SNF_OPCODE_BASE_CMD_INVALID (SNF_opcode_mmbr_t)0xFF |
When client's request was invalid either, wrong version or incomplete request. | |
#define | SNF_OPCODE_BASE_DET_INVALID_UNREGISTRED_OPCODE (SNF_opcode_mmbr_t)0x01 |
Received opcode was not registred. | |
#define | SNF_OPCODE_BASE_DET_INVALID_ERROR_PROTOCOL (SNF_opcode_mmbr_t)0x02 |
Protocol used is invalid. | |
Typedefs | |
typedef union SNF_opcode_t | SNF_opcode |
Shortened definiton of struct SNF_opcode_t . | |
typedef struct SNF_opcode_LL_item_t | SNF_opcode_LL_item |
Shortened definiton of struct SNF_opcode_LL_item_t . | |
Functions | |
int | snf_opcode_init () |
Initializes the SNF's opcodes. | |
int | snf_opcode_define_category (SNF_opcode_mmbr_t Code, const char *Definition) |
Defines an opcode Category. | |
int | snf_opcode_define_sub_category (SNF_opcode_mmbr_t Category, SNF_opcode_mmbr_t Code, const char *Definition) |
Defines an opcode Sub-Category. | |
int | snf_opcode_define_command (SNF_opcode_mmbr_t Category, SNF_opcode_mmbr_t SubCategory, SNF_opcode_mmbr_t Code, const char *Definition) |
Defines an opcode Command. | |
int | snf_opcode_define_detail (SNF_opcode_mmbr_t Category, SNF_opcode_mmbr_t SubCategory, SNF_opcode_mmbr_t Command, SNF_opcode_mmbr_t Code, const char *Definition) |
Defines an opcode Detail. | |
SNF_opcode_LL_item * | snf_opcode_get_category (SNF_opcode_mmbr_t Category) |
Fetches the opcode Category from the opcode's data structure. | |
SNF_opcode_LL_item * | snf_opcode_get_sub_category (SNF_opcode_mmbr_t Category, SNF_opcode_mmbr_t SubCategory) |
Fetches the opcode Sub-Category from the opcode's data structure. | |
SNF_opcode_LL_item * | snf_opcode_get_command (SNF_opcode_mmbr_t Category, SNF_opcode_mmbr_t SubCategory, SNF_opcode_mmbr_t Command) |
Fetches the opcode Command from the opcode's data structure. | |
SNF_opcode_LL_item * | snf_opcode_get_detail (SNF_opcode_mmbr_t Category, SNF_opcode_mmbr_t SubCategory, SNF_opcode_mmbr_t Command, SNF_opcode_mmbr_t Detail) |
SNF_opcode * | snf_opcode_get (SNF_opcode_mmbr_t Category, SNF_opcode_mmbr_t SubCategory, SNF_opcode_mmbr_t Command, SNF_opcode_mmbr_t Detail) |
Fetches a fully structured OPcode. | |
SNF_opcode * | snf_opcode_getu (SNF_opcode_mmbr_t Category, SNF_opcode_mmbr_t SubCategory, SNF_opcode_mmbr_t Command) |
Fetches a fully structured OPcode using the default Detail. | |
int | snf_opcode_compare (SNF_opcode *op1, SNF_opcode *op2) |
Compares between two opcodes. | |
SNF_opcode_LL_item * | snf_opcode_get_base_category () |
Fetches the base opcode Category from the opcode's data structure. | |
SNF_opcode_LL_item * | snf_opcode_get_base_sub_category () |
Fetches the base opcode Sub-Category from the opcode's data structure. | |
SNF_opcode_LL_item * | snf_opcode_get_base_command (SNF_opcode_mmbr_t Command) |
Fetches a base opcode Command from the opcode's data structure. | |
SNF_opcode_LL_item * | snf_opcode_get_base_detail (SNF_opcode_mmbr_t Command, SNF_opcode_mmbr_t Detail) |
Fetches a base opcode Command from the opcode's data structure. | |
SNF_opcode * | snf_opcode_get_base (SNF_opcode_mmbr_t Command, SNF_opcode_mmbr_t Detail) |
Fetches a fully structured OPcode with a base "Command". | |
SNF_opcode * | snf_opcode_getu_base (SNF_opcode_mmbr_t Command) |
Fetches a fully structured OPcode witha base "Command" using the default Detail. | |
Variables | |
SNF_opcode_LL_item * | SNF_opcode_LL |
Data structure where opcodes will be saved. | |
int | SNF_opcode_base_isinit |
used to check if SNF's base opcodes are initialized | |
This file Defines everything related to Opcodes ( Short for OP**eartion**Codes )
#define SNF_opcode_mmbr_t uint8_t |
Defines SNF_opcode_mmbr_t 's size.
#define SNF_opcode_mmbr_MAX UINT8_MAX |
Defines SNF_opcode_mmbr_t 's maximum possible Value.
#define SNF_OPCODE_BASE_CAT (SNF_opcode_mmbr_t)0x00 |
Base Category for SNF.
#define SNF_OPCODE_BASE_SUBCAT (SNF_opcode_mmbr_t)0x00 |
Base Sub-Category for SNF.
#define SNF_OPCODE_BASE_DET_UNDETAILED (SNF_opcode_mmbr_t)0x00 |
Default Detail.
#define SNF_OPCODE_BASE_CMD_CONNECT (SNF_opcode_mmbr_t)0x00 |
When client attemps to connect.
#define SNF_OPCODE_BASE_CMD_RECONNECT (SNF_opcode_mmbr_t)0x01 |
When client attemps to reconnect - or forced to.
#define SNF_OPCODE_BASE_CMD_DISCONNECT (SNF_opcode_mmbr_t)0x02 |
When client attemps to disconnect.
#define SNF_OPCODE_BASE_CMD_SNF_VER (SNF_opcode_mmbr_t)0x03 |
When client requests SNF version of the Server.
#define SNF_OPCODE_BASE_CMD_KICK (SNF_opcode_mmbr_t)0x04 |
When client was forced to disconnect ( Kicked ).
#define SNF_OPCODE_BASE_CMD_CONFIRM (SNF_opcode_mmbr_t)0x05 |
When client's reuqest was confirmed.
#define SNF_OPCODE_BASE_CMD_REJECT (SNF_opcode_mmbr_t)0x06 |
When client's request was rejected.
#define SNF_OPCODE_BASE_CMD_INVALID (SNF_opcode_mmbr_t)0xFF |
When client's request was invalid either, wrong version or incomplete request.
#define SNF_OPCODE_BASE_DET_INVALID_UNREGISTRED_OPCODE (SNF_opcode_mmbr_t)0x01 |
Received opcode was not registred.
#define SNF_OPCODE_BASE_DET_INVALID_ERROR_PROTOCOL (SNF_opcode_mmbr_t)0x02 |
Protocol used is invalid.
typedef union SNF_opcode_t SNF_opcode |
Shortened definiton of struct SNF_opcode_t .
typedef struct SNF_opcode_LL_item_t SNF_opcode_LL_item |
Shortened definiton of struct SNF_opcode_LL_item_t .
|
extern |
Initializes the SNF's opcodes.
|
extern |
Defines an opcode Category.
Code | OPcode category's value |
Definition | String Definition for The category |
|
extern |
Defines an opcode Sub-Category.
Category | OPcode's Category |
Code | OPcode subcategory's value |
Definition | String Definition for The sub-category |
|
extern |
Defines an opcode Command.
Category | OPcode's Category |
SubCategory | OPcode's Sub-Category |
Code | Opcode command's value |
Definition | String Definition for The command/// |
|
extern |
Defines an opcode Detail.
Category | OPcode's Category |
SubCategory | OPcode's Sub-Category |
Command | Opcode's Command |
Code | Opcode detail's value |
Definition | String Definition for The detail |
|
extern |
Fetches the opcode Category from the opcode's data structure.
Category | Category to be fetched. |
|
extern |
Fetches the opcode Sub-Category from the opcode's data structure.
Category | Parent Category |
SubCategory | Sub-Category to be fetched. |
|
extern |
Fetches the opcode Command from the opcode's data structure.
Category | Parent Category |
SubCategory | Parent Sub-Category |
Command | Command to be fetched. |
|
extern |
Category | Parent Category |
SubCategory | Parent Sub-Category |
Command | Parent Command |
Detail | Detail to be fetched. |
|
extern |
Fetches a fully structured OPcode.
Category | Parent Category. |
SubCategory | Parent Sub-Category |
Command | Executing Command |
Detail | Given Detail. |
|
extern |
Fetches a fully structured OPcode using the default Detail.
Category | Parent Category. |
SubCategory | Parent Sub-Category |
Command | Executing Command |
|
extern |
Compares between two opcodes.
op1 | OPCode 1 |
op2 | OPCode 2 |
|
extern |
Fetches the base opcode Category from the opcode's data structure.
|
extern |
Fetches the base opcode Sub-Category from the opcode's data structure.
|
extern |
Fetches a base opcode Command from the opcode's data structure.
Command | requested Command |
|
extern |
Fetches a base opcode Command from the opcode's data structure.
Command | Parent Command |
Detail | Command's Detail |
|
extern |
Fetches a fully structured OPcode with a base "Command".
Command | Base Command's Value |
Detail | Base Command Detail's Value |
|
extern |
Fetches a fully structured OPcode witha base "Command" using the default Detail.
Command | Base Command's Value |
|
extern |
Data structure where opcodes will be saved.
|
extern |
used to check if SNF's base opcodes are initialized