Lines Matching refs:cmsg

77 	} cmsg;  member
178 opt.cmsg.dontfrag.ena = true; in cs_parse_args()
179 opt.cmsg.dontfrag.val = atoi(optarg); in cs_parse_args()
185 opt.cmsg.tclass.ena = true; in cs_parse_args()
186 opt.cmsg.tclass.val = atoi(optarg); in cs_parse_args()
192 opt.cmsg.hlimit.ena = true; in cs_parse_args()
193 opt.cmsg.hlimit.val = atoi(optarg); in cs_parse_args()
199 opt.cmsg.exthdr.ena = true; in cs_parse_args()
202 opt.cmsg.exthdr.val = IPV6_HOPOPTS; in cs_parse_args()
205 opt.cmsg.exthdr.val = IPV6_DSTOPTS; in cs_parse_args()
208 opt.cmsg.exthdr.val = IPV6_RTHDRDSTOPTS; in cs_parse_args()
241 struct cmsghdr *cmsg; in ca_write_cmsg_u32() local
246 cmsg = (struct cmsghdr *)(cbuf + *cmsg_len); in ca_write_cmsg_u32()
251 cmsg->cmsg_level = level; in ca_write_cmsg_u32()
252 cmsg->cmsg_type = optname; in ca_write_cmsg_u32()
253 cmsg->cmsg_len = CMSG_LEN(sizeof(__u32)); in ca_write_cmsg_u32()
254 *(__u32 *)CMSG_DATA(cmsg) = uopt->val; in ca_write_cmsg_u32()
260 struct cmsghdr *cmsg; in cs_write_cmsg() local
273 SOL_IP, IP_TOS, &opt.cmsg.tclass); in cs_write_cmsg()
275 SOL_IP, IP_TTL, &opt.cmsg.hlimit); in cs_write_cmsg()
278 SOL_IPV6, IPV6_DONTFRAG, &opt.cmsg.dontfrag); in cs_write_cmsg()
280 SOL_IPV6, IPV6_TCLASS, &opt.cmsg.tclass); in cs_write_cmsg()
282 SOL_IPV6, IPV6_HOPLIMIT, &opt.cmsg.hlimit); in cs_write_cmsg()
292 cmsg = (struct cmsghdr *)(cbuf + cmsg_len); in cs_write_cmsg()
297 cmsg->cmsg_level = SOL_SOCKET; in cs_write_cmsg()
298 cmsg->cmsg_type = SCM_TXTIME; in cs_write_cmsg()
299 cmsg->cmsg_len = CMSG_LEN(sizeof(txtime)); in cs_write_cmsg()
300 memcpy(CMSG_DATA(cmsg), &txtime, sizeof(txtime)); in cs_write_cmsg()
303 cmsg = (struct cmsghdr *)(cbuf + cmsg_len); in cs_write_cmsg()
308 cmsg->cmsg_level = SOL_SOCKET; in cs_write_cmsg()
309 cmsg->cmsg_type = SO_TIMESTAMPING; in cs_write_cmsg()
310 cmsg->cmsg_len = CMSG_LEN(sizeof(__u32)); in cs_write_cmsg()
311 *(__u32 *)CMSG_DATA(cmsg) = SOF_TIMESTAMPING_TX_SCHED | in cs_write_cmsg()
314 if (opt.cmsg.exthdr.ena) { in cs_write_cmsg()
315 cmsg = (struct cmsghdr *)(cbuf + cmsg_len); in cs_write_cmsg()
320 cmsg->cmsg_level = SOL_IPV6; in cs_write_cmsg()
321 cmsg->cmsg_type = opt.cmsg.exthdr.val; in cs_write_cmsg()
322 cmsg->cmsg_len = CMSG_LEN(8); in cs_write_cmsg()
323 *(__u64 *)CMSG_DATA(cmsg) = 0; in cs_write_cmsg()
351 struct cmsghdr *cmsg; in cs_read_cmsg() local
371 for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; in cs_read_cmsg()
372 cmsg = CMSG_NXTHDR(msg, cmsg)) { in cs_read_cmsg()
373 if (cmsg->cmsg_level == SOL_SOCKET && in cs_read_cmsg()
374 cmsg->cmsg_type == SO_TIMESTAMPING_OLD) { in cs_read_cmsg()
375 if (cmsg->cmsg_len < sizeof(*ts)) in cs_read_cmsg()
378 ts = (void *)CMSG_DATA(cmsg); in cs_read_cmsg()
380 if ((cmsg->cmsg_level == SOL_IP && in cs_read_cmsg()
381 cmsg->cmsg_type == IP_RECVERR) || in cs_read_cmsg()
382 (cmsg->cmsg_level == SOL_IPV6 && in cs_read_cmsg()
383 cmsg->cmsg_type == IPV6_RECVERR)) { in cs_read_cmsg()
384 if (cmsg->cmsg_len < sizeof(*see)) in cs_read_cmsg()
387 see = (void *)CMSG_DATA(cmsg); in cs_read_cmsg()