Lines Matching refs:req
219 } req; in iprule_modify() local
222 memset(&req, 0, sizeof(req)); in iprule_modify()
224 req.n.nlmsg_type = cmd; in iprule_modify()
225 req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); in iprule_modify()
226 req.n.nlmsg_flags = NLM_F_REQUEST; in iprule_modify()
227 req.r.rtm_family = preferred_family; in iprule_modify()
228 req.r.rtm_protocol = RTPROT_BOOT; in iprule_modify()
230 req.r.rtm_scope = RT_SCOPE_UNIVERSE; in iprule_modify()
233 req.r.rtm_type = RTN_UNSPEC; in iprule_modify()
236 req.n.nlmsg_flags |= NLM_F_CREATE|NLM_F_EXCL; in iprule_modify()
237 req.r.rtm_type = RTN_UNICAST; in iprule_modify()
247 get_prefix(&dst, *argv, req.r.rtm_family); in iprule_modify()
248 req.r.rtm_src_len = dst.bitlen; in iprule_modify()
249 addattr_l(&req.n, sizeof(req), RTA_SRC, &dst.data, dst.bytelen); in iprule_modify()
253 get_prefix(&dst, *argv, req.r.rtm_family); in iprule_modify()
254 req.r.rtm_dst_len = dst.bitlen; in iprule_modify()
255 addattr_l(&req.n, sizeof(req), RTA_DST, &dst.data, dst.bytelen); in iprule_modify()
263 addattr32(&req.n, sizeof(req), RTA_PRIORITY, pref); in iprule_modify()
269 req.r.rtm_tos = tos; in iprule_modify()
278 addattr32(&req.n, sizeof(req), FRA_FWMARK, fwmark); in iprule_modify()
281 addattr32(&req.n, sizeof(req), FRA_FWMASK, fwmask); in iprule_modify()
288 addattr32(&req.n, sizeof(req), RTA_FLOW, realm); in iprule_modify()
299 req.r.rtm_table = RT_TABLE_UNSPEC; in iprule_modify()
300 addattr32(&req.n, sizeof(req), RTA_TABLE, tid); in iprule_modify()
303 req.r.rtm_table = tid; in iprule_modify()
310 addattr32(&req.n, sizeof(req), FRA_SUPPRESS_PREFIXLEN, prefix_length); in iprule_modify()
315 addattr32(&req.n, sizeof(req), FRA_SUPPRESS_IFGROUP, grp); in iprule_modify()
320 addattr_l(&req.n, sizeof(req), RTA_IIF, *argv, strlen(*argv)+1); in iprule_modify()
325 addattr32(&req.n, sizeof(req), RTA_GATEWAY, get_addr32(*argv)); in iprule_modify()
326 req.r.rtm_type = RTN_NAT; in iprule_modify()
337 req.r.rtm_type = type; in iprule_modify()
342 if (req.r.rtm_family == AF_UNSPEC) in iprule_modify()
343 req.r.rtm_family = AF_INET; in iprule_modify()
346 req.r.rtm_table = RT_TABLE_MAIN; in iprule_modify()
350 if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) in iprule_modify()