Lines Matching refs:action

278 {"action",		IPQOS_DATA_TYPE_ACTION},
437 * modify the kernel parameters of the action action_nm using the nvlist
453 IPQOSCDBG1(APPLY, "In modify_params: action: %s\n", action_name);
503 gettext("Invalid parameters for action %s.\n"),
510 "action %s.\n"), action_name);
514 ipqos_msg(MT_ERROR, gettext("Failed to modify action "
532 * add a class to the kernel action action_name called class_name with
533 * stats set according to stats_enable and the first action set to
548 IPQOSCDBG4(APPLY, "add_class: action: %s, class: %s, "
580 /* add next action */
613 gettext("Failed to create class %s in action "
629 * modify the class in the kernel action action_name called class_name with
630 * stats set according to stats_enable and the first action set to
646 IPQOSCDBG5(APPLY, "modify_class: action: %s, class: %s, first: %s, "
679 /* add next action */
703 gettext("Modifying class %s in action %s failed: %s.\n"),
716 * removes the class class_name from the kernel action action_name. The
718 * result in the action this class references being destroyed.
731 IPQOSCDBG3(APPLY, "remove_class: action: %s, class: %s, "
767 gettext("Removing class %s in action %s failed: %s.\n"),
780 * add the filter flt to the kernel action named action_name.
793 IPQOSCDBG4(APPLY, "add_filter: action: %s, filter: %s, "
879 "%s in action %s.\n"), flt->name, action_name);
886 "reached in action %s.\n"), IPGPC_NAME);
891 gettext("Failed to create filter %s in action "
904 * modify the filter flt in the kernel action named action_name.
917 IPQOSCDBG4(APPLY, "modify_filter: action: %s, filter: %s, "
1023 "parameter for filter %s in action %s.\n"),
1030 gettext("Failed to modify filter %s in action %s: "
1042 * kernel action action_name.
1055 IPQOSCDBG2(APPLY, "remove_filter: action: %s, filter: %s\n",
1099 gettext("Removing filter %s in action %s failed: %s.\n"),
1265 * mark all the filters and classes in parameter action either
1269 mark_classes_filters_del(ipqos_conf_action_t *action)
1275 IPQOSCDBG1(L1, "In mark_classes_filters_del: action: %s\n",
1276 action->name);
1279 for (flt = action->filters; flt; flt = flt->next) {
1294 for (cls = action->classes; cls; cls = cls->next) {
1313 mark_classes_filters_new(ipqos_conf_action_t *action)
1319 IPQOSCDBG1(L1, "In mark_classes_filters_new: action: %s\n",
1320 action->name);
1324 for (flt = action->filters; flt; flt = flt->next) {
1330 action->modified = B_TRUE;
1340 for (cls = action->classes; cls; cls = cls->next) {
1346 action->modified = B_TRUE;
1365 IPQOSCDBG1(DIFF, "Marking action %s as new\n", conf->name);
1394 /* if action not in old mark it and it's contents as new */
1404 /* if action in old diff old against new */
1431 * differences action old against action new, comparing its classes, filters
1432 * and parameters. If it is different the new action is marked as modified
1464 /* mark action as modified if params are */
1466 IPQOSCDBG1(DIFF, "Marking params for action %s modified\n",
1478 * in the old class appropriately. Also marks the action which has had an
1510 /* mark old action */
1514 * if permanent class and next action created by us
1515 * copy it, set it's next action to continue and
1516 * add it to new action. This will cause the class
1519 * case where the class is pointing at an action
1524 cls->alist->action && /* not virtual action */
1525 cls->alist->action->params->originator ==
1535 /* set next action to continue */
1560 new->modified = B_TRUE; /* mark new action */
1582 * in the old filter appropriately. Also marks the action which has had an
1621 new->modified = B_TRUE; /* mark new action */
1679 new->modified = B_TRUE; /* mark new action */
1681 /* mark old action */
1693 /* mark action if diff */
1718 old->modified = B_TRUE; /* mark old action */
1857 /* action name / string */
2147 * we need to create ipgpc action before any others as some actions
2163 * loop though action list and add any actions marked as
2164 * new/modified action and apply any additions there, then return.
2193 IPQOSCDBG2(L1, "In add_item: action: %s, rem_undo: %u\n",
2205 /* recurse to last action in tree */
2209 /* if not virtual action */
2211 if (cls->alist->action) {
2212 res = add_item(cls->alist->action, rem_undo);
2223 if (pact->action) {
2224 res = add_item(pact->action, rem_undo);
2232 /* if action marked as new and not ipgpc, create */
2260 * this action in the kernel.
2270 IPQOSCDBG2(APPLY, "add_action: action: %s, module: %s\n", act->name,
2294 /* add action stats */
2298 ipqos_msg(MT_ENOSTR, "nvlist_add_uint32: action stats");
2308 /* call into lib to create action */
2312 IPQOSCDBG2(APPLY, "Create action %s, module %s failed\n",
2319 gettext("Invalid Parameters for action %s.\n"),
2324 gettext("Missing required parameter for action "
2328 ipqos_msg(MT_ERROR, gettext("Failed to create action "
2335 /* mark action as created */
2344 * marked as deleted then add the filter to the kernel action named by action
2351 char *action,
2371 /* add filter to action */
2372 if (add_filter(action, flt, module_version) !=
2387 * marked as deleted then add the class to the kernel action named by action
2394 char *action,
2414 /* add class to action */
2415 res = add_class(action, cls->name, module_version,
2429 * For each of the actions in actions remove the action if marked as
2445 * loop through actions removing any actions, or action contents
2459 * Deletes this action if marked for deletion or any of it's contents marked
2460 * for deletion. If the action is marked for deletion any actions referencing
2461 * this action are destroyed first if marked or have their contents destroyed
2476 IPQOSCDBG3(L1, "In remove_item: action: %s, add_undo: %u, mod: %u\n",
2489 /* if this action is to be deleted */
2498 res = remove_item(dep->action, add_undo);
2504 /* delete this action */
2506 IPQOSCDBG1(APPLY, "deleting action %s\n", act->name);
2509 IPQOSCDBG1(APPLY, "failed to destroy action %s\n",
2518 /* if modified action */
2571 /* mark action as having been modified */
2581 * modified as a modification to the kernel action represented.
2650 /* mark action modified */
2686 * if the action was new then it will be removed and
2688 * will dissappear, so ignore action.
2706 /* for each filter in action if filter modified switch back */
2721 /* for each class in action if class modified switch back */
2742 * whose action was deleted.
3514 * action, else action_nm verbatim to fp parameter.
3557 /* print name, next action and stats enable */
3751 * print an action clause for action to fp. If the printall flag is set
3759 ipqos_conf_action_t *action,
3774 quote_ws_string(action->module));
3776 (void) fprintf(fp, "name %s\n", quote_ws_string(action->name));
3781 res = printparams(fp, action->module, action->params, printall,
3791 for (cls = action->classes; cls != NULL; cls = cls->next) {
3804 for (flt = action->filters; flt != NULL; flt = flt->next) {
3809 res = printfilter(fp, action->module, &flt, printall,
4035 * check whether name is a valid action/class/filter name.
6152 char *action;
6206 * read action type parameter - add it to list of action refs.
6208 * change the action name to their special ipp names in
6209 * the action ref list and the nvlist.
6216 (void) nvpair_value_string(nvp, &action);
6218 /* if virtual action names change to ipp name */
6220 if ((strcmp(action, IPQOS_CONF_CONT_STR) == 0) ||
6221 strcmp(action, IPQOS_CONF_DROP_STR) == 0) {
6232 /* modify nvlist entry and change action */
6234 if (strcmp(action, IPQOS_CONF_CONT_STR) == 0) {
6235 action = IPP_ANAME_CONT;
6237 nm, action);
6239 action = IPP_ANAME_DROP;
6241 nm, action);
6250 /* add action reference to params */
6252 res = add_aref(&params->actions, nm, action);
6300 /* copy first action reference */
6345 /* free its action refs if present */
6607 /* ************************* action manip fns ********************** */
6612 * create and zero action structure and a params structure hung off of it.
6613 * RETURNS: ptr to allocated action on success, else NULL.
6619 ipqos_conf_action_t *action;
6621 action = (ipqos_conf_action_t *)malloc(sizeof (ipqos_conf_action_t));
6622 if (action == NULL) {
6624 return (action);
6626 bzero(action, sizeof (ipqos_conf_action_t));
6628 action->params = (ipqos_conf_params_t *)
6630 if (action->params == NULL) {
6631 free(action);
6634 bzero(action->params, sizeof (ipqos_conf_params_t));
6635 action->params->stats_enable = B_FALSE;
6637 return (action);
6664 /* free action nvlist */
6709 * Checks whether there is an action called action_name in actions list.
6710 * RETURNS: ptr to first matched action, else if not matched NULL.
6735 * add an action reference element with parameter field and action
6748 IPQOSCDBG1(L1, "add_aref: action: %s.\n", action_name);
6764 /* copy action name */
6776 * free all the memory used by the action references in arefs.
6801 * checks whether aname is a valid action name.
6809 * dissallow the use of the name of a virtual action, either
6816 ipqos_msg(MT_ERROR, gettext("Invalid action name line %u.\n"),
6888 char *action;
6927 * catch name and action nv pairs and stats if present
6944 /* next action */
6949 (void) nvpair_value_string(nvp, &action);
6952 * if next action string continue string set action to
6955 if (strcmp(action, IPQOS_CONF_CONT_STR) == 0) {
6956 action = IPP_ANAME_CONT;
6957 } else if (strcmp(action, IPQOS_CONF_DROP_STR) == 0) {
6958 action = IPP_ANAME_DROP;
6961 /* add an action reference to action list */
6964 IPQOS_CONF_NEXT_ACTION_STR, action);
6992 gettext("Missing class name/next action before line %u.\n"),
7774 * read action clause and params/classes/filters clauses within and
7775 * store in and hang off an action structure, and point action at it.
7781 ipqos_conf_action_t **action)
7813 /* create action structure */
7815 *action = alloc_action();
7816 if (*action == NULL) {
7819 (*action)->params->originator = IPP_CONFIG_IPQOSCONF;
7823 (*action)->lineno = lineno;
7832 /* loop till read both action name and module */
7838 res = readnvpair(cfp, NULL, &(*action)->nvlist, &nvp, &type,
7848 gettext("Missing action name/ module "
7855 /* store name and module in action structure */
7859 /* read action name */
7874 (void) strcpy((*action)->name, strval);
7876 (void) nvlist_remove_all((*action)->nvlist,
7905 * move module name to action struct
7907 (void) strlcpy((*action)->module, strval,
7909 (void) nvlist_remove_all((*action)->nvlist,
7925 * check that if the ipgpc action it is named correctly
7927 if ((strcmp((*action)->module, IPGPC_NAME) == 0) &&
7928 (strcmp((*action)->name, IPGPC_CLASSIFY) != 0)) {
7930 gettext("%s action has incorrect name line %u.\n"),
7931 IPGPC_NAME, (*action)->lineno);
7937 res = read_perm_items(0, tfp, (*action)->module,
7938 &(*action)->perm_classes, &(*action)->num_perm_classes);
7945 res = read_perm_items(1, tfp, (*action)->module,
7955 (*action)->module)) == -1)
7960 "incompatible.\n"), (*action)->module);
7968 if (((*action)->module_version = read_tfile_ver(tfp, IPQOS_MOD_STR,
7969 (*action)->module)) == -1)
7984 /* read CURL_END - end of action definition */
8001 res = readfilter(cfp, tfp, (*action)->module, &filter,
8015 res = domultihome(filter, &(*action)->filters,
8042 &(*action)->retry_filters,
8061 ADD_TO_LIST(&(*action)->filters, filter);
8068 res = readclass(cfp, (*action)->module, &class,
8069 (*action)->perm_classes,
8070 (*action)->num_perm_classes);
8075 ADD_TO_LIST(&(*action)->classes, class);
8087 res = readparams(cfp, tfp, (*action)->module,
8088 (*action)->params);
8110 if (*action) {
8111 free_actions(*action);
8112 *action = NULL;
8119 * set *name to point at the name of the duplicate action.
8120 * RETURNS: IPQOS_CONF_ERR if a non-unique action, else IPQOS_CONF_SUCCESS.
8140 * checks whether the action parameter is involved in an action cycle.
8145 ipqos_conf_action_t *action)
8151 IPQOSCDBG1(L0, "in_cycle: visiting action %s\n", action->name);
8154 /* have we visited this action before? */
8156 if (action->visited == INCYCLE_VISITED) {
8157 action->visited = 0;
8160 action->visited = INCYCLE_VISITED;
8163 * recurse down the child actions of this action through the
8164 * classes next action and parameter actions.
8167 for (aref = action->params->actions; aref != NULL; aref = aref->next) {
8175 if (in_cycle(aref->action)) {
8176 action->visited = 0;
8181 for (c = action->classes; c != NULL; c = c->next) {
8188 if (in_cycle(aref->action)) {
8189 action->visited = 0;
8195 action->visited = 0;
8202 * their action, that classes referenced by filters exist and actions
8234 ipqos_msg(MT_ERROR, gettext("Duplicate named action %s.\n"),
8243 * check they are unique in this action and their class exists.
8254 "%s in action %s.\n"), flt->name,
8272 "action %s.\n"), flt->name,
8289 "action %s.\n"), cls->name, act->name);
8295 * action.
8302 * check existance of next action and create link to
8305 if ((cls->alist->action =
8308 gettext("Undefined action in class %s, "
8309 "action %s.\n"), cls->name, act->name);
8315 dact = cls->alist->action;
8320 dact->dependencies->action = act;
8324 /* check actions exist for action type parameters */
8336 * check existance of action in this ref
8339 aref->action = actionexist(aref->name, actions);
8340 if (aref->action == NULL) {
8342 gettext("Undefined action in parameter "
8343 "%s, action %s.\n"),
8350 dact = aref->action;
8356 dact->dependencies->action = act;
8378 /* check that this action has a parent (except ipgpc) */
8459 ipqos_conf_action_t *action;
8488 action = NULL;
8492 res = readaction(cfp, &action);
8503 ADD_TO_LIST(conf, action);
8505 /* check if we just read an ipgpc action */
8507 if (strcmp(action->name, IPGPC_CLASSIFY) == 0)
8514 ipqos_msg(MT_ERROR, gettext("No %s action defined.\n"),
8593 /* get action list for this module */
8601 /* read config of each action of this module */
8604 ai_prm.action = alloc_action();
8605 if (ai_prm.action == NULL) {
8609 /* copy action name into action struct */
8611 (void) strlcpy(ai_prm.action->name, actnames[y],
8614 /* copy module name into action struct */
8616 (void) strlcpy(ai_prm.action->module, modnames[x],
8619 /* get action info */
8633 ADD_TO_LIST(conf, ai_prm.action);
8651 * is called back one for each configuration element within the action
8653 * off of action, and action having its params set.
8666 ipqos_conf_action_t *action = ai_prm->action;
8669 IPQOSCDBG1(KRET, "In parse_kaction: action_name: %s\n", action->name);
8680 * and add result to action's filter list.
8695 ADD_TO_LIST(&action->filters, filter);
8702 * and add result to action's class list.
8717 ADD_TO_LIST(&action->classes, class);
8723 * as part of an action.
8728 ret = parse_kparams(action->module, action->params,
8795 /* get action stats and remove from nvlist */
8805 * action ref entrys for them.
8874 /* lookup next action */
8997 * determines whether action_name is a virtual action name.
8998 * RETURNS: if virtual action 1, else 0.
9060 IPQOSCDBG1(APPLY, "deleting action %s\n", actnames[y]);
9063 * if fails for reason other than action doesn't
9064 * exist or action has dependency.
9269 /* add the newly resolved filters to the kernel action */
9527 * action before we deleted the old one and because actions
9534 /* found action */
9541 "installed action, but is for a "