/// <summary> /// Generate a sample rule action. /// </summary> /// <param name="actionType">The action Type</param> /// <param name="bytesCount">The length of the bytes count</param> /// <param name="actionDataBufferValue">The actionData buffer</param> /// <param name="actionFlavor">Action flavor value.</param> /// <param name="actionFlag">Action flag value.</param> /// <returns>An instance of the RuleAction</returns> private static RuleAction GenerateRuleAction(ActionTypes actionType, Count bytesCount, IActionData actionDataBufferValue, uint actionFlavor, uint actionFlag) { ActionBlock actionBlock = new ActionBlock(bytesCount) { ActionType = actionType, ActionFlags = actionFlag, ActionDataValue = actionDataBufferValue, ActionFlavor = actionFlavor }; actionBlock.ActionLength = (bytesCount == Count.TwoBytesCount) ? (actionBlock.Size() - 2) : (actionBlock.Size() - 4); RuleAction ruleAction = new RuleAction(bytesCount) { NoOfActions = 0x01, Actions = new ActionBlock[1] { actionBlock } }; // Only one rule action is generated. return(ruleAction); }
/// <summary> /// Generate a sample rule action. /// </summary> /// <param name="actionType">The action Type</param> /// <param name="bytesCount">The length of the bytes count</param> /// <param name="actionDataBufferValue">The actionData buffer</param> /// <param name="actionFlavor">Action flavor value.</param> /// <param name="actionFlag">Action flag value.</param> /// <returns>An instance of the RuleAction</returns> private static RuleAction GenerateRuleAction(ActionTypes actionType, Count bytesCount, IActionData actionDataBufferValue, uint actionFlavor, uint actionFlag) { ActionBlock actionBlock = new ActionBlock(bytesCount) { ActionType = actionType, ActionFlags = actionFlag, ActionDataValue = actionDataBufferValue, ActionFlavor = actionFlavor }; actionBlock.ActionLength = (bytesCount == Count.TwoBytesCount) ? (actionBlock.Size() - 2) : (actionBlock.Size() - 4); RuleAction ruleAction = new RuleAction(bytesCount) { NoOfActions = 0x01, Actions = new ActionBlock[1] { actionBlock } }; // Only one rule action is generated. return ruleAction; }