| 1755 | } |
| 1756 | |
| 1757 | static int |
| 1758 | action_handle_create(portid_t port_id, |
| 1759 | struct port_indirect_action *pia, |
| 1760 | const struct rte_flow_indir_action_conf *conf, |
| 1761 | const struct rte_flow_action *action, |
| 1762 | struct rte_flow_error *error) |
| 1763 | { |
| 1764 | if (action->type == RTE_FLOW_ACTION_TYPE_AGE) { |
| 1765 | struct rte_flow_action_age *age = |
| 1766 | (struct rte_flow_action_age *)(uintptr_t)(action->conf); |
| 1767 | |
| 1768 | pia->age_type = ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION; |
| 1769 | age->context = &pia->age_type; |
| 1770 | } else if (action->type == RTE_FLOW_ACTION_TYPE_CONNTRACK) { |
| 1771 | struct rte_flow_action_conntrack *ct = |
| 1772 | (struct rte_flow_action_conntrack *)(uintptr_t)(action->conf); |
| 1773 | |
| 1774 | memcpy(ct, &conntrack_context, sizeof(*ct)); |
| 1775 | } |
| 1776 | pia->type = action->type; |
| 1777 | pia->handle = rte_flow_action_handle_create(port_id, conf, action, |
| 1778 | error); |
| 1779 | return pia->handle ? 0 : -1; |
| 1780 | } |
| 1781 | |
| 1782 | static int |
| 1783 | action_list_handle_create(portid_t port_id, |
no test coverage detected