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