search for: u32_sport

Displaying 1 result from an estimated 1 matches for "u32_sport".

2007 Sep 23
0
Add U32 Filter with libnl
...t_kind(pFilter, "u32"); rtnl_cls_set_prio(pFilter, 100); rtnl_cls_set_protocol(pFilter, ETH_P_IP); // setting parent class id rtnl_tc_str2handle("1:", &handle); rtnl_cls_set_parent(pFilter, handle); // source port filter rtnl_u32_add_key_uint16(pFilter, 22, 0xffff, U32_SPORT, 0); // setting flowid sprintf(pBuffer, "1:%i", parentId); /* flowid 1:20 */ rtnl_tc_str2handle(pBuffer, &handle); rtnl_u32_set_classid(pFilter, handle); // add filter if (rtnl_cls_add(m_pNetlinkHandle, pFilter, NLM_F_REPLACE) < 0) ... Thanks in advance...