Lines Matching refs:msg
31 void idiagnl_msg_get(struct idiagnl_msg *msg) in idiagnl_msg_get() argument
33 nl_object_get((struct nl_object *) msg); in idiagnl_msg_get()
36 void idiagnl_msg_put(struct idiagnl_msg *msg) in idiagnl_msg_put() argument
38 nl_object_put((struct nl_object *) msg); in idiagnl_msg_put()
46 struct idiagnl_msg *msg = NULL; in idiagnl_msg_parser() local
49 if ((err = idiagnl_msg_parse(nlh, &msg)) < 0) in idiagnl_msg_parser()
52 err = pp->pp_cb((struct nl_object *) msg, pp); in idiagnl_msg_parser()
53 idiagnl_msg_put(msg); in idiagnl_msg_parser()
134 uint8_t idiagnl_msg_get_family(const struct idiagnl_msg *msg) in idiagnl_msg_get_family() argument
136 return msg->idiag_family; in idiagnl_msg_get_family()
139 void idiagnl_msg_set_family(struct idiagnl_msg *msg, uint8_t family) in idiagnl_msg_set_family() argument
141 msg->idiag_family = family; in idiagnl_msg_set_family()
144 uint8_t idiagnl_msg_get_state(const struct idiagnl_msg *msg) in idiagnl_msg_get_state() argument
146 return msg->idiag_state; in idiagnl_msg_get_state()
149 void idiagnl_msg_set_state(struct idiagnl_msg *msg, uint8_t state) in idiagnl_msg_set_state() argument
151 msg->idiag_state = state; in idiagnl_msg_set_state()
154 uint8_t idiagnl_msg_get_timer(const struct idiagnl_msg *msg) in idiagnl_msg_get_timer() argument
156 return msg->idiag_timer; in idiagnl_msg_get_timer()
159 void idiagnl_msg_set_timer(struct idiagnl_msg *msg, uint8_t timer) in idiagnl_msg_set_timer() argument
161 msg->idiag_timer = timer; in idiagnl_msg_set_timer()
164 uint8_t idiagnl_msg_get_retrans(const struct idiagnl_msg *msg) in idiagnl_msg_get_retrans() argument
166 return msg->idiag_retrans; in idiagnl_msg_get_retrans()
169 void idiagnl_msg_set_retrans(struct idiagnl_msg *msg, uint8_t retrans) in idiagnl_msg_set_retrans() argument
171 msg->idiag_retrans = retrans; in idiagnl_msg_set_retrans()
174 uint16_t idiagnl_msg_get_sport(struct idiagnl_msg *msg) in idiagnl_msg_get_sport() argument
176 return msg->idiag_sport; in idiagnl_msg_get_sport()
179 void idiagnl_msg_set_sport(struct idiagnl_msg *msg, uint16_t port) in idiagnl_msg_set_sport() argument
181 msg->idiag_sport = port; in idiagnl_msg_set_sport()
184 uint16_t idiagnl_msg_get_dport(struct idiagnl_msg *msg) in idiagnl_msg_get_dport() argument
186 return msg->idiag_dport; in idiagnl_msg_get_dport()
189 void idiagnl_msg_set_dport(struct idiagnl_msg *msg, uint16_t port) in idiagnl_msg_set_dport() argument
191 msg->idiag_dport = port; in idiagnl_msg_set_dport()
194 struct nl_addr *idiagnl_msg_get_src(const struct idiagnl_msg *msg) in idiagnl_msg_get_src() argument
196 return msg->idiag_src; in idiagnl_msg_get_src()
199 int idiagnl_msg_set_src(struct idiagnl_msg *msg, struct nl_addr *addr) in idiagnl_msg_set_src() argument
201 if (msg->idiag_src) in idiagnl_msg_set_src()
202 nl_addr_put(msg->idiag_src); in idiagnl_msg_set_src()
205 msg->idiag_src = addr; in idiagnl_msg_set_src()
210 struct nl_addr *idiagnl_msg_get_dst(const struct idiagnl_msg *msg) in idiagnl_msg_get_dst() argument
212 return msg->idiag_dst; in idiagnl_msg_get_dst()
215 int idiagnl_msg_set_dst(struct idiagnl_msg *msg, struct nl_addr *addr) in idiagnl_msg_set_dst() argument
217 if (msg->idiag_dst) in idiagnl_msg_set_dst()
218 nl_addr_put(msg->idiag_dst); in idiagnl_msg_set_dst()
221 msg->idiag_dst = addr; in idiagnl_msg_set_dst()
226 uint32_t idiagnl_msg_get_ifindex(const struct idiagnl_msg *msg) in idiagnl_msg_get_ifindex() argument
228 return msg->idiag_ifindex; in idiagnl_msg_get_ifindex()
231 void idiagnl_msg_set_ifindex(struct idiagnl_msg *msg, uint32_t ifindex) in idiagnl_msg_set_ifindex() argument
233 msg->idiag_ifindex = ifindex; in idiagnl_msg_set_ifindex()
236 uint32_t idiagnl_msg_get_expires(const struct idiagnl_msg *msg) in idiagnl_msg_get_expires() argument
238 return msg->idiag_expires; in idiagnl_msg_get_expires()
241 void idiagnl_msg_set_expires(struct idiagnl_msg *msg, uint32_t expires) in idiagnl_msg_set_expires() argument
243 msg->idiag_expires = expires; in idiagnl_msg_set_expires()
246 uint32_t idiagnl_msg_get_rqueue(const struct idiagnl_msg *msg) in idiagnl_msg_get_rqueue() argument
248 return msg->idiag_rqueue; in idiagnl_msg_get_rqueue()
251 void idiagnl_msg_set_rqueue(struct idiagnl_msg *msg, uint32_t rqueue) in idiagnl_msg_set_rqueue() argument
253 msg->idiag_rqueue = rqueue; in idiagnl_msg_set_rqueue()
256 uint32_t idiagnl_msg_get_wqueue(const struct idiagnl_msg *msg) in idiagnl_msg_get_wqueue() argument
258 return msg->idiag_wqueue; in idiagnl_msg_get_wqueue()
261 void idiagnl_msg_set_wqueue(struct idiagnl_msg *msg, uint32_t wqueue) in idiagnl_msg_set_wqueue() argument
263 msg->idiag_wqueue = wqueue; in idiagnl_msg_set_wqueue()
266 uint32_t idiagnl_msg_get_uid(const struct idiagnl_msg *msg) in idiagnl_msg_get_uid() argument
268 return msg->idiag_uid; in idiagnl_msg_get_uid()
271 void idiagnl_msg_set_uid(struct idiagnl_msg *msg, uint32_t uid) in idiagnl_msg_set_uid() argument
273 msg->idiag_uid = uid; in idiagnl_msg_set_uid()
276 uint32_t idiagnl_msg_get_inode(const struct idiagnl_msg *msg) in idiagnl_msg_get_inode() argument
278 return msg->idiag_inode; in idiagnl_msg_get_inode()
281 void idiagnl_msg_set_inode(struct idiagnl_msg *msg, uint32_t inode) in idiagnl_msg_set_inode() argument
283 msg->idiag_inode = inode; in idiagnl_msg_set_inode()
286 uint8_t idiagnl_msg_get_tos(const struct idiagnl_msg *msg) in idiagnl_msg_get_tos() argument
288 return msg->idiag_tos; in idiagnl_msg_get_tos()
291 void idiagnl_msg_set_tos(struct idiagnl_msg *msg, uint8_t tos) in idiagnl_msg_set_tos() argument
293 msg->idiag_tos = tos; in idiagnl_msg_set_tos()
296 uint8_t idiagnl_msg_get_tclass(const struct idiagnl_msg *msg) in idiagnl_msg_get_tclass() argument
298 return msg->idiag_tclass; in idiagnl_msg_get_tclass()
301 void idiagnl_msg_set_tclass(struct idiagnl_msg *msg, uint8_t tclass) in idiagnl_msg_set_tclass() argument
303 msg->idiag_tclass = tclass; in idiagnl_msg_set_tclass()
306 uint8_t idiagnl_msg_get_shutdown(const struct idiagnl_msg *msg) in idiagnl_msg_get_shutdown() argument
308 return msg->idiag_shutdown; in idiagnl_msg_get_shutdown()
311 void idiagnl_msg_set_shutdown(struct idiagnl_msg *msg, uint8_t shutdown) in idiagnl_msg_set_shutdown() argument
313 msg->idiag_shutdown = shutdown; in idiagnl_msg_set_shutdown()
316 char *idiagnl_msg_get_cong(const struct idiagnl_msg *msg) in idiagnl_msg_get_cong() argument
318 return msg->idiag_cong; in idiagnl_msg_get_cong()
321 void idiagnl_msg_set_cong(struct idiagnl_msg *msg, char *cong) in idiagnl_msg_set_cong() argument
323 msg->idiag_cong = strdup(cong); in idiagnl_msg_set_cong()
326 struct idiagnl_meminfo *idiagnl_msg_get_meminfo(const struct idiagnl_msg *msg) in idiagnl_msg_get_meminfo() argument
328 return msg->idiag_meminfo; in idiagnl_msg_get_meminfo()
331 void idiagnl_msg_set_meminfo(struct idiagnl_msg *msg, struct idiagnl_meminfo in idiagnl_msg_set_meminfo() argument
334 if (msg->idiag_meminfo) in idiagnl_msg_set_meminfo()
335 idiagnl_meminfo_put(msg->idiag_meminfo); in idiagnl_msg_set_meminfo()
338 msg->idiag_meminfo = minfo; in idiagnl_msg_set_meminfo()
341 struct idiagnl_vegasinfo *idiagnl_msg_get_vegasinfo(const struct idiagnl_msg *msg) in idiagnl_msg_get_vegasinfo() argument
343 return msg->idiag_vegasinfo; in idiagnl_msg_get_vegasinfo()
346 void idiagnl_msg_set_vegasinfo(struct idiagnl_msg *msg, struct idiagnl_vegasinfo in idiagnl_msg_set_vegasinfo() argument
349 if (msg->idiag_vegasinfo) in idiagnl_msg_set_vegasinfo()
350 idiagnl_vegasinfo_put(msg->idiag_vegasinfo); in idiagnl_msg_set_vegasinfo()
353 msg->idiag_vegasinfo = vinfo; in idiagnl_msg_set_vegasinfo()
356 struct tcp_info idiagnl_msg_get_tcpinfo(const struct idiagnl_msg *msg) in idiagnl_msg_get_tcpinfo() argument
358 return msg->idiag_tcpinfo; in idiagnl_msg_get_tcpinfo()
361 void idiagnl_msg_set_tcpinfo(struct idiagnl_msg *msg, struct tcp_info *tinfo) in idiagnl_msg_set_tcpinfo() argument
363 memcpy(&msg->idiag_tcpinfo, tinfo, sizeof(struct tcp_info)); in idiagnl_msg_set_tcpinfo()
370 struct idiagnl_msg *msg = (struct idiagnl_msg *) a; in idiag_msg_dump_line() local
373 nl_dump_line(p, "family: %s ", nl_af2str(msg->idiag_family, buf, sizeof(buf))); in idiag_msg_dump_line()
374 nl_dump(p, "src: %s:%d ", nl_addr2str(msg->idiag_src, buf, sizeof(buf)), in idiag_msg_dump_line()
375 ntohs(msg->idiag_sport)); in idiag_msg_dump_line()
376 nl_dump(p, "dst: %s:%d ", nl_addr2str(msg->idiag_dst, buf, sizeof(buf)), in idiag_msg_dump_line()
377 ntohs(msg->idiag_dport)); in idiag_msg_dump_line()
378 nl_dump(p, "iif: %d ", msg->idiag_ifindex); in idiag_msg_dump_line()
384 struct idiagnl_msg *msg = (struct idiagnl_msg *) a; in idiag_msg_dump_details() local
387 nl_dump(p, "\nfamily: %s\n", nl_af2str(msg->idiag_family, buf, sizeof(buf))); in idiag_msg_dump_details()
389 idiagnl_state2str(msg->idiag_state, buf, sizeof(buf))); in idiag_msg_dump_details()
391 idiagnl_timer2str(msg->idiag_timer, buf, sizeof(buf)), in idiag_msg_dump_details()
392 nl_msec2str(msg->idiag_expires, buf2, sizeof(buf2)), in idiag_msg_dump_details()
393 msg->idiag_retrans); in idiag_msg_dump_details()
395 nl_dump(p, "source: %s:%d\n", nl_addr2str(msg->idiag_src, buf, sizeof(buf)), in idiag_msg_dump_details()
396 ntohs(msg->idiag_sport)); in idiag_msg_dump_details()
397 nl_dump(p, "destination: %s:%d\n", nl_addr2str(msg->idiag_dst, buf, sizeof(buf)), in idiag_msg_dump_details()
398 ntohs(msg->idiag_dport)); in idiag_msg_dump_details()
400 nl_dump(p, "ifindex: %d\n", msg->idiag_ifindex); in idiag_msg_dump_details()
401 nl_dump(p, "rqueue: %-6d wqueue: %-6d\n", msg->idiag_rqueue, msg->idiag_wqueue); in idiag_msg_dump_details()
402 nl_dump(p, "uid %d\n", msg->idiag_uid); in idiag_msg_dump_details()
403 nl_dump(p, "inode %d\n", msg->idiag_inode); in idiag_msg_dump_details()
404 if (msg->idiag_shutdown) { in idiag_msg_dump_details()
406 idiagnl_shutdown2str(msg->idiag_shutdown, in idiag_msg_dump_details()
410 nl_dump(p, "tos: 0x%x\n", msg->idiag_tos); in idiag_msg_dump_details()
411 nl_dump(p, "traffic class: %d\n", msg->idiag_tclass); in idiag_msg_dump_details()
412 nl_dump(p, "congestion algorithm: %s\n", msg->idiag_cong); in idiag_msg_dump_details()
417 struct idiagnl_msg *msg = (struct idiagnl_msg *) obj; in idiag_msg_dump_stats() local
424 idiagnl_state2str(msg->idiag_tcpinfo.tcpi_state, in idiag_msg_dump_stats()
427 idiagnl_tcpstate2str(msg->idiag_tcpinfo.tcpi_ca_state, in idiag_msg_dump_stats()
430 msg->idiag_tcpinfo.tcpi_retransmits); in idiag_msg_dump_stats()
432 msg->idiag_tcpinfo.tcpi_probes); in idiag_msg_dump_stats()
434 msg->idiag_tcpinfo.tcpi_backoff); in idiag_msg_dump_stats()
436 idiagnl_tcpopts2str(msg->idiag_tcpinfo.tcpi_options, in idiag_msg_dump_stats()
438 nl_dump(p, "\tsnd_wscale: %d\n", msg->idiag_tcpinfo.tcpi_snd_wscale); in idiag_msg_dump_stats()
439 nl_dump(p, "\trcv_wscale: %d\n", msg->idiag_tcpinfo.tcpi_rcv_wscale); in idiag_msg_dump_stats()
440 nl_dump(p, "\trto: %d\n", msg->idiag_tcpinfo.tcpi_rto); in idiag_msg_dump_stats()
441 nl_dump(p, "\tato: %d\n", msg->idiag_tcpinfo.tcpi_ato); in idiag_msg_dump_stats()
442 nl_dump(p, "\tsnd_mss: %s\n", nl_size2str(msg->idiag_tcpinfo.tcpi_snd_mss, in idiag_msg_dump_stats()
444 nl_dump(p, "\trcv_mss: %s\n", nl_size2str(msg->idiag_tcpinfo.tcpi_rcv_mss, in idiag_msg_dump_stats()
446 nl_dump(p, "\tunacked: %d\n", msg->idiag_tcpinfo.tcpi_unacked); in idiag_msg_dump_stats()
447 nl_dump(p, "\tsacked: %d\n", msg->idiag_tcpinfo.tcpi_sacked); in idiag_msg_dump_stats()
449 nl_dump(p, "\tlost: %d\n", msg->idiag_tcpinfo.tcpi_lost); in idiag_msg_dump_stats()
451 msg->idiag_tcpinfo.tcpi_retrans); in idiag_msg_dump_stats()
453 msg->idiag_tcpinfo.tcpi_fackets); in idiag_msg_dump_stats()
455 nl_msec2str(msg->idiag_tcpinfo.tcpi_last_data_sent, buf, in idiag_msg_dump_stats()
458 nl_msec2str(msg->idiag_tcpinfo.tcpi_last_ack_sent, buf, sizeof(buf))); in idiag_msg_dump_stats()
460 nl_msec2str(msg->idiag_tcpinfo.tcpi_last_data_recv, buf, in idiag_msg_dump_stats()
463 nl_msec2str(msg->idiag_tcpinfo.tcpi_last_ack_recv, buf, in idiag_msg_dump_stats()
466 nl_size2str(msg->idiag_tcpinfo.tcpi_pmtu, buf, in idiag_msg_dump_stats()
469 msg->idiag_tcpinfo.tcpi_rcv_ssthresh); in idiag_msg_dump_stats()
471 msg->idiag_tcpinfo.tcpi_rtt); in idiag_msg_dump_stats()
473 msg->idiag_tcpinfo.tcpi_rttvar); in idiag_msg_dump_stats()
475 nl_size2str(msg->idiag_tcpinfo.tcpi_snd_ssthresh, buf, in idiag_msg_dump_stats()
478 msg->idiag_tcpinfo.tcpi_snd_cwnd); in idiag_msg_dump_stats()
480 nl_size2str(msg->idiag_tcpinfo.tcpi_advmss, buf, in idiag_msg_dump_stats()
483 msg->idiag_tcpinfo.tcpi_reordering); in idiag_msg_dump_stats()
485 msg->idiag_tcpinfo.tcpi_rcv_rtt); in idiag_msg_dump_stats()
487 nl_size2str(msg->idiag_tcpinfo.tcpi_rcv_space, buf, in idiag_msg_dump_stats()
490 msg->idiag_tcpinfo.tcpi_total_retrans); in idiag_msg_dump_stats()
493 if (msg->idiag_meminfo) { in idiag_msg_dump_stats()
496 nl_size2str(msg->idiag_meminfo->idiag_rmem, in idiag_msg_dump_stats()
500 nl_size2str(msg->idiag_meminfo->idiag_wmem, in idiag_msg_dump_stats()
504 nl_size2str(msg->idiag_meminfo->idiag_fmem, in idiag_msg_dump_stats()
508 nl_size2str(msg->idiag_meminfo->idiag_tmem, in idiag_msg_dump_stats()
514 if (msg->idiag_vegasinfo) { in idiag_msg_dump_stats()
517 msg->idiag_vegasinfo->tcpv_enabled); in idiag_msg_dump_stats()
518 if (msg->idiag_vegasinfo->tcpv_enabled) { in idiag_msg_dump_stats()
520 msg->idiag_vegasinfo->tcpv_rttcnt); in idiag_msg_dump_stats()
522 msg->idiag_vegasinfo->tcpv_rtt); in idiag_msg_dump_stats()
524 msg->idiag_vegasinfo->tcpv_minrtt); in idiag_msg_dump_stats()
531 msg->idiag_skmeminfo[IDIAG_SK_MEMINFO_RMEM_ALLOC]); in idiag_msg_dump_stats()
533 nl_size2str(msg->idiag_skmeminfo[IDIAG_SK_MEMINFO_RCVBUF], in idiag_msg_dump_stats()
536 msg->idiag_skmeminfo[IDIAG_SK_MEMINFO_WMEM_ALLOC]); in idiag_msg_dump_stats()
538 nl_size2str(msg->idiag_skmeminfo[IDIAG_SK_MEMINFO_SNDBUF], in idiag_msg_dump_stats()
541 msg->idiag_skmeminfo[IDIAG_SK_MEMINFO_FWD_ALLOC]); in idiag_msg_dump_stats()
543 nl_size2str(msg->idiag_skmeminfo[IDIAG_SK_MEMINFO_WMEM_QUEUED], in idiag_msg_dump_stats()
546 msg->idiag_skmeminfo[IDIAG_SK_MEMINFO_OPTMEM]); in idiag_msg_dump_stats()
548 msg->idiag_skmeminfo[IDIAG_SK_MEMINFO_BACKLOG]); in idiag_msg_dump_stats()
554 struct idiagnl_msg *msg = (struct idiagnl_msg *) a; in idiagnl_msg_free() local
558 free(msg->idiag_cong); in idiagnl_msg_free()
559 nl_addr_put(msg->idiag_src); in idiagnl_msg_free()
560 nl_addr_put(msg->idiag_dst); in idiagnl_msg_free()
561 idiagnl_meminfo_put(msg->idiag_meminfo); in idiagnl_msg_free()
562 idiagnl_vegasinfo_put(msg->idiag_vegasinfo); in idiagnl_msg_free()
594 struct idiagnl_msg *msg = NULL; in idiagnl_msg_parse() local
600 msg = idiagnl_msg_alloc(); in idiagnl_msg_parse()
601 if (!msg) in idiagnl_msg_parse()
610 msg->idiag_family = raw_msg->idiag_family; in idiagnl_msg_parse()
611 msg->idiag_state = raw_msg->idiag_state; in idiagnl_msg_parse()
612 msg->idiag_timer = raw_msg->idiag_timer; in idiagnl_msg_parse()
613 msg->idiag_retrans = raw_msg->idiag_retrans; in idiagnl_msg_parse()
614 msg->idiag_expires = raw_msg->idiag_expires; in idiagnl_msg_parse()
615 msg->idiag_rqueue = raw_msg->idiag_rqueue; in idiagnl_msg_parse()
616 msg->idiag_wqueue = raw_msg->idiag_wqueue; in idiagnl_msg_parse()
617 msg->idiag_uid = raw_msg->idiag_uid; in idiagnl_msg_parse()
618 msg->idiag_inode = raw_msg->idiag_inode; in idiagnl_msg_parse()
619 msg->idiag_sport = raw_msg->id.idiag_sport; in idiagnl_msg_parse()
620 msg->idiag_dport = raw_msg->id.idiag_dport; in idiagnl_msg_parse()
621 msg->idiag_ifindex = raw_msg->id.idiag_if; in idiagnl_msg_parse()
628 err = idiagnl_msg_set_dst(msg, dst); in idiagnl_msg_parse()
639 err = idiagnl_msg_set_src(msg, src); in idiagnl_msg_parse()
646 msg->idiag_tos = nla_get_u8(tb[IDIAG_ATTR_TOS]); in idiagnl_msg_parse()
649 msg->idiag_tclass = nla_get_u8(tb[IDIAG_ATTR_TCLASS]); in idiagnl_msg_parse()
652 msg->idiag_shutdown = nla_get_u8(tb[IDIAG_ATTR_SHUTDOWN]); in idiagnl_msg_parse()
655 msg->idiag_cong = nla_strdup(tb[IDIAG_ATTR_CONG]); in idiagnl_msg_parse()
658 nla_memcpy(&msg->idiag_tcpinfo, tb[IDIAG_ATTR_INFO], in idiagnl_msg_parse()
659 sizeof(msg->idiag_tcpinfo)); in idiagnl_msg_parse()
676 msg->idiag_meminfo = minfo; in idiagnl_msg_parse()
694 msg->idiag_vegasinfo = vinfo; in idiagnl_msg_parse()
698 nla_memcpy(&msg->idiag_skmeminfo, tb[IDIAG_ATTR_SKMEMINFO], in idiagnl_msg_parse()
699 sizeof(msg->idiag_skmeminfo)); in idiagnl_msg_parse()
701 *result = msg; in idiagnl_msg_parse()
705 idiagnl_msg_put(msg); in idiagnl_msg_parse()