aboutsummaryrefslogtreecommitdiffstats
path: root/src/framework/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/framework/include')
-rw-r--r--src/framework/include/nsfw_init.h8
-rw-r--r--src/framework/include/nsfw_maintain_api.h6
-rw-r--r--src/framework/include/nsfw_mem_api.h72
-rw-r--r--src/framework/include/nsfw_mgr_com_api.h6
-rw-r--r--src/framework/include/nsfw_recycle_api.h2
-rw-r--r--src/framework/include/nsfw_snapshot.h10
-rw-r--r--src/framework/include/nsfw_upgrade.h4
7 files changed, 54 insertions, 54 deletions
diff --git a/src/framework/include/nsfw_init.h b/src/framework/include/nsfw_init.h
index def97b2..0237060 100644
--- a/src/framework/include/nsfw_init.h
+++ b/src/framework/include/nsfw_init.h
@@ -33,7 +33,7 @@ extern "C"{
#define NSFW_SET_INSTANCE_VALUE(_attr, _inst, _value) \
nsfw_module_set_instance_##_attr(_inst, _value)
-#define NSFW_INIT_CRAETE_LOCAL_INSTANCE() \
+#define NSFW_INIT_CREATE_LOCAL_INSTANCE() \
if (!nsfwLocalInitInst) {\
nsfwLocalInitInst = nsfw_module_create_instance(); \
nsfw_module_add_instance(nsfwLocalInitInst);\
@@ -41,7 +41,7 @@ extern "C"{
#define _NSFW_MODULE_ATTRIBUTE_DEFINE_SURFIX(_attr, _value, _priority, _surfix) \
static __attribute__((__constructor__(_priority))) void nsfw_module_attribute_##_attr##_surfix(void){\
- NSFW_INIT_CRAETE_LOCAL_INSTANCE(); \
+ NSFW_INIT_CREATE_LOCAL_INSTANCE(); \
NSFW_SET_INSTANCE_VALUE(_attr, nsfwLocalInitInst, _value);\
} \
@@ -123,8 +123,8 @@ extern void nsfw_module_set_instance_depends (nsfw_module_instance_t * inst,
/**
* @Function nstack_framework_init
- * @Description This function will do framework initial work, it will involk all initial functions
- * registed using macro NSFW_MODULE_INIT before
+ * @Description This function will do framework initial work, it will invoke all initial functions
+ * registered using macro NSFW_MODULE_INIT before
* @param none
* @return 0 on success, -1 on error
*/
diff --git a/src/framework/include/nsfw_maintain_api.h b/src/framework/include/nsfw_maintain_api.h
index 74cedf6..bf0d45e 100644
--- a/src/framework/include/nsfw_maintain_api.h
+++ b/src/framework/include/nsfw_maintain_api.h
@@ -72,8 +72,8 @@ typedef int (*nsfw_res_free_fun) (void *pdata);
typedef struct _nsfw_res_scn_cfg
{
u8 type; /*nsfw_res_scan_type */
- u8 force_free_percent; /*if the resource free percent below this vlaue, begin to force free the element */
- u16 force_free_chk_num; /*if the check count beyone this vlaue, call free fun release this element */
+ u8 force_free_percent; /*if the resource free percent below this value, begin to force free the element */
+ u16 force_free_chk_num; /*if the check count beyone this value, call free fun release this element */
u16 alloc_speed_factor; /*alloc fast with higher value */
u32 num_per_cyc; /*define the element number in one scan cycle process and increase chk_count of every element */
@@ -174,7 +174,7 @@ typedef struct _nsfw_set_log_msg
#define SPL_DFX_RES_CONN "conn"
#define SPL_DFX_RES_L2TO4 "l2to4"
#define SPL_DFX_RES_UNMATCH "version"
-#define SPL_DFX_RES_SOCKT_CB "socketcb"
+#define SPL_DFX_RES_SOCKET_CB "socketcb"
#define SPL_DFX_RES_COMM_MEMPOOL "mbufpool"
#define SPL_DFX_RES_PCBLIST "pcblist"
#define SPL_DFX_RES_ARPLIST "arplist"
diff --git a/src/framework/include/nsfw_mem_api.h b/src/framework/include/nsfw_mem_api.h
index ec78692..68adbe1 100644
--- a/src/framework/include/nsfw_mem_api.h
+++ b/src/framework/include/nsfw_mem_api.h
@@ -28,8 +28,8 @@
/*
*the max len of memory name is 32bytes, but app just can use max 22bytes, left 10bytes to memory manager module
*/
-#define NSFW_MEM_NAME_LENTH (32)
-#define NSFW_MEM_APPNAME_LENTH (22)
+#define NSFW_MEM_NAME_LENGTH (32)
+#define NSFW_MEM_APPNAME_LENGTH (22)
#define NSFW_SOCKET_ANY (-1)
#define NSFW_MEM_OK (0)
@@ -50,9 +50,9 @@ typedef enum
/*type of ring operation*/
typedef enum
{
- NSFW_MRING_SPSC, /*sigle producer sigle consumer ring */
- NSFW_MRING_MPSC, /*multi producer sigle consumer ring */
- NSFW_MRING_SPMC, /*sigle producer multi consumer ring */
+ NSFW_MRING_SPSC, /*single producer single consumer ring */
+ NSFW_MRING_MPSC, /*multi producer single consumer ring */
+ NSFW_MRING_SPMC, /*single producer multi consumer ring */
NSFW_MRING_MPMC, /*multi producer multi consumer ring */
NSFW_MRING_SPSC_ST, /*single producer single consumer and belong to one thread ring */
NSFW_MPOOL_TYPEMAX,
@@ -83,13 +83,13 @@ typedef struct
* must add '_0' at the end of name, if the memory was created by app and the role of process is NSFW_PROC_MASTER, must add
* _(pid) at the end of name, nstack_123.
*/
- i8 aname[NSFW_MEM_NAME_LENTH]; /*the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. */
+ i8 aname[NSFW_MEM_NAME_LENGTH]; /*the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */
} nsfw_mem_name;
typedef struct
{
nsfw_mem_name stname;
- size_t lenth;
+ size_t length;
i32 isocket_id;
i32 ireserv;
} nsfw_mem_zone;
@@ -156,7 +156,7 @@ typedef enum
typedef struct __nsfw_shmem_msg_head
{
unsigned usmsg_type;
- unsigned uslenth;
+ unsigned uslength;
i32 aidata[0];
} nsfw_shmem_msg_head;
@@ -171,17 +171,17 @@ typedef struct __nsfw_shmem_ack
typedef struct __nsfw_shmem_reserv_req
{
- i8 aname[NSFW_MEM_NAME_LENTH];
+ i8 aname[NSFW_MEM_NAME_LENGTH];
u16 usseq;
u16 usreserv;
i32 isocket_id;
- size_t lenth;
+ size_t length;
i32 ireserv;
} nsfw_shmem_reserv_req;
typedef struct __nsfw_shmem_mbuf_req
{
- i8 aname[NSFW_MEM_NAME_LENTH];
+ i8 aname[NSFW_MEM_NAME_LENGTH];
u16 usseq;
u16 enmptype;
unsigned usnum;
@@ -194,7 +194,7 @@ typedef struct __nsfw_shmem_mbuf_req
typedef struct __nsfw_shmem_sppool_req
{
- i8 aname[NSFW_MEM_NAME_LENTH];
+ i8 aname[NSFW_MEM_NAME_LENGTH];
u16 usseq;
u16 enmptype;
u32 usnum;
@@ -205,7 +205,7 @@ typedef struct __nsfw_shmem_sppool_req
typedef struct __nsfw_shmem_ring_req
{
- i8 aname[NSFW_MEM_NAME_LENTH];
+ i8 aname[NSFW_MEM_NAME_LENGTH];
u16 usseq;
u16 enmptype;
u32 usnum;
@@ -215,7 +215,7 @@ typedef struct __nsfw_shmem_ring_req
typedef struct __nsfw_shmem_free_req
{
- i8 aname[NSFW_MEM_NAME_LENTH];
+ i8 aname[NSFW_MEM_NAME_LENGTH];
u16 usseq;
u16 ustype; /*structure of memory(memzone,mbuf,mpool,ring) */
i32 ireserv;
@@ -223,7 +223,7 @@ typedef struct __nsfw_shmem_free_req
typedef struct __nsfw_shmem_lookup_req
{
- i8 aname[NSFW_MEM_NAME_LENTH];
+ i8 aname[NSFW_MEM_NAME_LENGTH];
u16 usseq;
u16 ustype; /*structure of memory(memzone,mbuf,mpool,ring) */
i32 ireserv;
@@ -243,7 +243,7 @@ typedef struct
/*
* memory module init
- * para:point to nstak_fwmem_para
+ * para:point to nstack_fwmem_para
*/
i32 nsfw_mem_init (void *para);
@@ -251,20 +251,20 @@ i32 nsfw_mem_init (void *para);
* create a block memory with name
* nsfw_mem_zone::stname
* nsfw_mem_zone::isize
- * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
*/
mzone_handle nsfw_mem_zone_create (nsfw_mem_zone * pinfo);
/*
*create some memory blocks
- * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
*/
i32 nsfw_mem_zone_createv (nsfw_mem_zone * pmeminfo, i32 inum,
mzone_handle * paddr_array, i32 iarray_num);
/*
*look up a memory
- * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
* 2. if the memory is shared, pname->enowner indicate that who create this memory,
* note:
* 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain,
@@ -288,7 +288,7 @@ mpool_handle nsfw_mem_mbfmp_create (nsfw_mem_mbfpool * pbufinfo);
/*
*create some mbuf pools
- * note: 1. the name of lenth must be less than NSFW_MEM_APPNAME_LENTH.
+ * note: 1. the name of length must be less than NSFW_MEM_APPNAME_LENGTH.
*/
i32 nsfw_mem_mbfmp_createv (nsfw_mem_mbfpool * pmbfname, i32 inum,
mpool_handle * phandle_array, i32 iarray_num);
@@ -305,7 +305,7 @@ i32 nsfw_mem_mbf_free (mbuf_handle mhandle, nsfw_mem_type entype);
/*
*look up mbuf mpool
- * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
* 2. if the memory is shared, pname->enowner indicate that who create this memory.
* note:
* 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain,
@@ -321,39 +321,39 @@ mpool_handle nsfw_mem_mbfmp_lookup (nsfw_mem_name * pmbfname);
/*
*release mbuf pool
- * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
*/
i32 nsfw_mem_mbfmp_release (nsfw_mem_name * pname);
/*
*create a simple pool
- *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
*/
mring_handle nsfw_mem_sp_create (nsfw_mem_sppool * pmpinfo);
/*
*create some simple pools one time
- *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
*/
i32 nsfw_mem_sp_createv (nsfw_mem_sppool * pmpinfo, i32 inum,
mring_handle * pringhandle_array, i32 iarray_num);
/*
*create a simple pool with many rings
- *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
*/
i32 nsfw_mem_sp_ring_create (nsfw_mem_mring * prpoolinfo,
mring_handle * pringhandle_array, i32 iringnum);
/*
*release a simple mempool
- *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
*/
i32 nsfw_mem_sp_release (nsfw_mem_name * pname);
/*
*look up a simpile ring
- * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
* 2. if the memory is shared, pname->enowner indicate that who create this memory,
* note:
* 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain,
@@ -369,15 +369,15 @@ mring_handle nsfw_mem_sp_lookup (nsfw_mem_name * pname);
/*
*create a ring
- *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
- * 2. shared memory ring (NSFW_SHMEM) just can put a pointor into the queue, the queue also point to a shared block memory.
+ *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
+ * 2. shared memory ring (NSFW_SHMEM) just can put a pointer into the queue, the queue also point to a shared block memory.
* no shared memory ring(NSFW_NSHMEM) is other wise.
*/
mring_handle nsfw_mem_ring_create (nsfw_mem_mring * pringinfo);
/*
*look up a ring by name
- * note:1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ * note:1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
* 2. if the memory is shared, pname->enowner indicate that who create this memory,
* note:
* 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain,
@@ -402,7 +402,7 @@ extern nsfw_ring_ops g_ring_ops_arry[NSFW_MEM_TYPEMAX][NSFW_MPOOL_TYPEMAX];
/*****************************************************************************
* Prototype : nsfw_mem_ring_dequeue
* Description : get a member from a ring
-* note : if NSFW_SHMEM ring, pdata returned alread a local address
+* note : if NSFW_SHMEM ring, pdata returned already a local address
* Input : mring_handle mhandle
* void** pdata
* Output : None
@@ -429,7 +429,7 @@ nsfw_mem_ring_dequeue (mring_handle mhandle, void **pdata)
/*****************************************************************************
* Prototype : nsfw_mem_ring_dequeuev
* Description : get some members from a ring
-* note : if NSFW_SHMEM ring, pdata returned alread a local address
+* note : if NSFW_SHMEM ring, pdata returned already a local address
* Input : mring_handle mhandle
* void** pdata
* unsigned inum
@@ -501,14 +501,14 @@ u32 nsfw_mem_ring_size (mring_handle mhandle);
/*
*release a ring memory
- *note: the lenth of name must be less than NSFW_MEM_APPNAME_LENTH.
+ *note: the length of name must be less than NSFW_MEM_APPNAME_LENGTH.
*/
i32 nsfw_mem_ring_release (nsfw_mem_name * pname);
/*
*statics mbufpool, sppool, ring mem size
*return: <=0, err happen, >0 mem size
- * NSFW_MEM_MZONE: not surport because you already know the lenth when create
+ * NSFW_MEM_MZONE: not surport because you already know the length when create
*/
ssize_t nsfw_mem_get_len (void *handle, nsfw_mem_struct_type type);
@@ -530,14 +530,14 @@ i32 nsfw_mem_mbuf_iterator (mpool_handle handle, u32 start, u32 end,
* Description : print ring info
* Input : mring_handle mhandle
* char *pbuf
-* int lenth
+* int length
* Output : None
* Return Value : i32
* Calls :
* Called By :
*
*****************************************************************************/
-i32 nsfw_mem_dfx_ring_print (mring_handle mhandle, char *pbuf, int lenth);
+i32 nsfw_mem_dfx_ring_print (mring_handle mhandle, char *pbuf, int length);
#ifdef SYS_MEM_RES_STAT
u32 nsfw_mem_mbfpool_free_count (mpool_handle mhandle);
diff --git a/src/framework/include/nsfw_mgr_com_api.h b/src/framework/include/nsfw_mgr_com_api.h
index 099cdbc..094043e 100644
--- a/src/framework/include/nsfw_mgr_com_api.h
+++ b/src/framework/include/nsfw_mgr_com_api.h
@@ -46,7 +46,7 @@ typedef enum _mgr_msg_type
MGR_MSG_MEM_ALLOC_REQ = 64, /* memory msg type */
/*############################################# */
- MGR_MSG_DFX_QRY_REQ = 96, /* nStackCtrl maitain msg */
+ MGR_MSG_DFX_QRY_REQ = 96, /* nStackCtrl maintain msg */
MGR_MSG_SET_LOG_REQ,
/*############################################# */
@@ -59,7 +59,7 @@ typedef enum _mgr_msg_type
/*###query message with large rsp message begin## */
MGR_MSG_LARGE_QRY_REQ_BEGIN = 384,
MGR_MSG_LARGE_STA_QRY_REQ = MGR_MSG_LARGE_QRY_REQ_BEGIN,
- MGR_MSG_LARGE_MT_QRY_REQ, /* nStackCtrl maitain msg */
+ MGR_MSG_LARGE_MT_QRY_REQ, /* nStackCtrl maintain msg */
/*############################################# */
MGR_MSG_LARGE_ALARM_REQ = 500, /* alarm msg type */
@@ -112,7 +112,7 @@ typedef enum _fw_poc_type
typedef enum _nsfw_mgr_msg_rsp_code
{
- NSFW_MGR_SUCESS,
+ NSFW_MGR_SUCCESS,
NSFW_MGR_MSG_TYPE_ERROR,
} mgr_msg_rsp_code;
diff --git a/src/framework/include/nsfw_recycle_api.h b/src/framework/include/nsfw_recycle_api.h
index fd2bd8f..9d7f3bb 100644
--- a/src/framework/include/nsfw_recycle_api.h
+++ b/src/framework/include/nsfw_recycle_api.h
@@ -41,7 +41,7 @@ typedef enum _nsfw_recycle_priority
{
NSFW_REC_PRO_HIGHTEST = 0,
NSFW_REC_PRO_NORMAL = 1,
- NSFW_REC_PRO_DEFALUT = 2,
+ NSFW_REC_PRO_DEFAULT = 2,
NSFW_REC_PRO_LOWEST = 3,
NSFW_REC_PRO_MAX = 4
} nsfw_recycle_priority;
diff --git a/src/framework/include/nsfw_snapshot.h b/src/framework/include/nsfw_snapshot.h
index 8958c64..5ce64aa 100644
--- a/src/framework/include/nsfw_snapshot.h
+++ b/src/framework/include/nsfw_snapshot.h
@@ -63,7 +63,7 @@ typedef struct _nsfw_ss_objDesc
u16 objType; /* Type number of object */
u8 memNum; /* Nubmer of object members */
u32 objSize;
- nsfw_ss_objMemDesc_t *memDesc; /* Member descripe */
+ nsfw_ss_objMemDesc_t *memDesc; /* Member descript */
} nsfw_ss_objDesc_t;
#define NSFW_SS_MAX_OBJDESC_NUM 256
@@ -81,8 +81,8 @@ extern nsfw_ss_objDescManager_t g_nsfw_ss_objDescManager;
#define nsfw_ss_getObjDescManagerInst() (&g_nsfw_ss_objDescManager)
/**
- * @Function nsfw_ss_registe_ObjDesc
- * @Description Registe object description to snapshot
+ * @Function nsfw_ss_register_ObjDesc
+ * @Description Register object description to snapshot
* @param objDesc - description of object
* @return void
*/
@@ -92,7 +92,7 @@ extern void nsfw_ss_register_ObjDesc (nsfw_ss_objDesc_t * objDesc);
* @Function nsfw_ss_store
* @Description store object to memory
* @param (in) objType - type of object
- * @param (in) obj - adderss of object memory
+ * @param (in) obj - address of object memory
* @param (in) storeMem - address of memory to store object data
* @param (in) storeMemLen - maximal length of storage memory
* @return positive integer means length of memory cost on success. return -1 if error
@@ -130,7 +130,7 @@ extern int nsfw_ss_getObjStoreMemLen (int objType);
NSFW_SNAPSHOT_OBJDESC_REGISTER_SURFIX(_value, __LINE__)
/**
- * Using this marcro to register object description
+ * Using this macro to register object description
*/
#define NSFW_SS_REGSITER_OBJDESC(_value) \
NSFW_SNAPSHOT_OBJDESC_REGISTER_UNIQUE(_value)
diff --git a/src/framework/include/nsfw_upgrade.h b/src/framework/include/nsfw_upgrade.h
index a4e809c..d5cb5aa 100644
--- a/src/framework/include/nsfw_upgrade.h
+++ b/src/framework/include/nsfw_upgrade.h
@@ -32,9 +32,9 @@ extern "C" {
#define USE_MEM_BIT(mem_bit, struct, mem) (mem_bit |= ((i64)1 << struct ## _ ## mem))
-#define UPGRADE_MEM_VAL(mem_bit, struct, mem, obj, defalut) { \
+#define UPGRADE_MEM_VAL(mem_bit, struct, mem, obj, default) { \
if (!GET_MEM_BIT(mem_bit, struct, mem)){ \
- obj->mem = defalut; \
+ obj->mem = default; \
} \
}