Home | History | Annotate | Download | only in lib

Lines Matching refs:ofd

856 static void prefix_line(FILE *ofd, int prefix)
861 fprintf(ofd, " ");
864 static inline void dump_hex(FILE *ofd, char *start, int len, int prefix)
870 prefix_line(ofd, prefix);
871 fprintf(ofd, " ");
876 fprintf(ofd, "%02x ", v);
880 fprintf(ofd, "%s\n", ascii);
882 prefix_line(ofd, prefix);
883 fprintf(ofd, " ");
893 fprintf(ofd, " ");
894 fprintf(ofd, "%s\n", ascii);
898 static void print_hdr(FILE *ofd, struct nl_msg *msg)
905 fprintf(ofd, " .nlmsg_len = %d\n", nlh->nlmsg_len);
917 fprintf(ofd, " .nlmsg_type = %d <%s>\n", nlh->nlmsg_type, buf);
918 fprintf(ofd, " .nlmsg_flags = %d <%s>\n", nlh->nlmsg_flags,
920 fprintf(ofd, " .nlmsg_seq = %d\n", nlh->nlmsg_seq);
921 fprintf(ofd, " .nlmsg_pid = %d\n", nlh->nlmsg_pid);
925 static void dump_attrs(FILE *ofd, struct nlattr *attrs, int attrlen,
934 prefix_line(ofd, prefix);
935 fprintf(ofd, " [ATTR %02d%s] %d octets\n", nla_type(nla),
940 dump_attrs(ofd, nla_data(nla), alen, prefix+1);
942 dump_hex(ofd, nla_data(nla), alen, prefix);
946 prefix_line(ofd, prefix);
947 fprintf(ofd, " [PADDING] %d octets\n",
949 dump_hex(ofd, nla_data(nla) + alen,
955 prefix_line(ofd, prefix);
956 fprintf(ofd, " [LEFTOVER] %d octets\n", rem);
963 * @arg ofd File descriptor.
965 void nl_msg_dump(struct nl_msg *msg, FILE *ofd)
969 fprintf(ofd,
973 fprintf(ofd, " [HEADER] %Zu octets\n", sizeof(struct nlmsghdr));
974 print_hdr(ofd, msg);
981 fprintf(ofd, " [ERRORMSG] %Zu octets\n", sizeof(*err));
982 fprintf(ofd, " .error = %d \"%s\"\n", err->error,
984 fprintf(ofd, " [ORIGINAL MESSAGE] %Zu octets\n", sizeof(*hdr));
987 print_hdr(ofd, errmsg);
1001 fprintf(ofd, " [PAYLOAD] %d octets\n", payloadlen);
1002 dump_hex(ofd, nlmsg_data(hdr), payloadlen, 0);
1010 dump_attrs(ofd, attrs, attrlen, 0);
1014 fprintf(ofd,