* Initialize a netlink message with a TC header. * * @param[in, out] msg * The netlink message to fill. * @param[in] ifindex * The netdevice ifindex where the rule will be applied. * @param[in] type * The type of TC message to create (RTM_NEWTFILTER, RTM_NEWQDISC, etc.). * @param[in] flags * Overrides the default netlink flags for this msg with those specified. */
| 42 | * Overrides the default netlink flags for this msg with those specified. |
| 43 | */ |
| 44 | void |
| 45 | tc_init_msg(struct nlmsg *msg, unsigned int ifindex, uint16_t type, uint16_t flags) |
| 46 | { |
| 47 | struct nlmsghdr *n = &msg->nh; |
| 48 | |
| 49 | n->nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); |
| 50 | n->nlmsg_type = type; |
| 51 | if (flags) |
| 52 | n->nlmsg_flags = flags; |
| 53 | else |
| 54 | n->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; |
| 55 | msg->t.tcm_family = AF_UNSPEC; |
| 56 | msg->t.tcm_ifindex = ifindex; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Delete a specific QDISC identified by its iface, and it's handle and parent. |
no outgoing calls
no test coverage detected