Demo entry 6625427

test

   

Submitted by anonymous on Jun 21, 2017 at 04:29
Language: C. Code size: 1.1 kB.

enum {
	SRC_FIELD_IPV4 = 0,
	NUM_FIELDS_IPV4
};

enum {
	RTE_ACL_IPV4SRC = 0,
	RTE_ACL_IPV4_NUM
};

struct pal_sg_rule {
	uint32_t ip;
};

struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
	{
		.type = RTE_ACL_FIELD_TYPE_MASK,
		.size = sizeof(uint8_t),
		.field_index = SRC_FIELD_IPV4,
		.input_index = RTE_ACL_IPV4_SRC,
		.offset = 0,
	},
};

RTE_ACL_RULE_DEF(acl4_rule, RTE_DIM(ipv4_defs));
 
struct pal_sg_ctx {
	struct rte_acl_ctx ctx;
};

struct usg_rule_table {
	struct pal_list_head node;		/* list in svc_usg */
	struct pal_sg_ctx *sg_ctx;		/* ctx of security group */
	uint8_t	action;					/* SG_ALLOW | SG_DROP */
}

/* security group */
struct svc_usg {
	struct pal_hlist_node 	node;			/* list in percpu_ctx */

	char 		usgid[SVC_USG_NAMELEN];		/* security group id */
	uint32_t	refcnt;						/* refcnt used by svc */
	struct pal_list_head *sg_rule_table;	/* rule table list */
};

/* security group descriptor */
struct svc_usg_descriptor {
	uint32_t count;							/* cur count in usg list */
	struct svc_usg *usg_list[SVC_USG_MAX];	/* usg list in svc */
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).