• Home
  • Raw
  • Download

Lines Matching refs:ofd

755 static void prefix_line(FILE *ofd, int prefix)  in prefix_line()  argument
760 fprintf(ofd, " "); in prefix_line()
763 static inline void dump_hex(FILE *ofd, char *start, int len, int prefix) in dump_hex() argument
769 prefix_line(ofd, prefix); in dump_hex()
770 fprintf(ofd, " "); in dump_hex()
775 fprintf(ofd, "%02x ", v); in dump_hex()
779 fprintf(ofd, "%s\n", ascii); in dump_hex()
781 prefix_line(ofd, prefix); in dump_hex()
782 fprintf(ofd, " "); in dump_hex()
791 fprintf(ofd, " "); in dump_hex()
792 fprintf(ofd, "%s\n", ascii); in dump_hex()
796 static void print_hdr(FILE *ofd, struct nl_msg *msg) in print_hdr() argument
803 fprintf(ofd, " .nlmsg_len = %d\n", nlh->nlmsg_len); in print_hdr()
816 fprintf(ofd, " .type = %d <%s>\n", nlh->nlmsg_type, buf); in print_hdr()
817 fprintf(ofd, " .flags = %d <%s>\n", nlh->nlmsg_flags, in print_hdr()
819 fprintf(ofd, " .seq = %d\n", nlh->nlmsg_seq); in print_hdr()
820 fprintf(ofd, " .port = %d\n", nlh->nlmsg_pid); in print_hdr()
824 static void print_genl_hdr(FILE *ofd, void *start) in print_genl_hdr() argument
828 fprintf(ofd, " [GENERIC NETLINK HEADER] %zu octets\n", GENL_HDRLEN); in print_genl_hdr()
829 fprintf(ofd, " .cmd = %u\n", ghdr->cmd); in print_genl_hdr()
830 fprintf(ofd, " .version = %u\n", ghdr->version); in print_genl_hdr()
831 fprintf(ofd, " .unused = %#x\n", ghdr->reserved); in print_genl_hdr()
834 static void *print_genl_msg(struct nl_msg *msg, FILE *ofd, struct nlmsghdr *hdr, in print_genl_msg() argument
842 print_genl_hdr(ofd, data); in print_genl_msg()
854 fprintf(ofd, " [HEADER] %d octets\n", hdrsize); in print_genl_msg()
855 dump_hex(ofd, data, hdrsize, 0); in print_genl_msg()
865 static void dump_attr(FILE *ofd, struct nlattr *attr, int prefix) in dump_attr() argument
869 dump_hex(ofd, nla_data(attr), len, prefix); in dump_attr()
872 static void dump_attrs(FILE *ofd, struct nlattr *attrs, int attrlen, in dump_attrs() argument
881 prefix_line(ofd, prefix); in dump_attrs()
884 fprintf(ofd, " [ATTR PADDING] %d octets\n", alen); in dump_attrs()
886 fprintf(ofd, " [ATTR %02d%s] %d octets\n", nla_type(nla), in dump_attrs()
891 dump_attrs(ofd, nla_data(nla), alen, prefix+1); in dump_attrs()
893 dump_attr(ofd, nla, prefix); in dump_attrs()
897 prefix_line(ofd, prefix); in dump_attrs()
898 fprintf(ofd, " [PADDING] %d octets\n", in dump_attrs()
900 dump_hex(ofd, nla_data(nla) + alen, in dump_attrs()
906 prefix_line(ofd, prefix); in dump_attrs()
907 fprintf(ofd, " [LEFTOVER] %d octets\n", rem); in dump_attrs()
911 static void dump_error_msg(struct nl_msg *msg, FILE *ofd) in dump_error_msg() argument
916 fprintf(ofd, " [ERRORMSG] %zu octets\n", sizeof(*err)); in dump_error_msg()
922 fprintf(ofd, " .error = %d \"%s\"\n", err->error, in dump_error_msg()
924 fprintf(ofd, " [ORIGINAL MESSAGE] %zu octets\n", sizeof(*hdr)); in dump_error_msg()
927 print_hdr(ofd, errmsg); in dump_error_msg()
932 static void print_msg(struct nl_msg *msg, FILE *ofd, struct nlmsghdr *hdr) in print_msg() argument
948 data = print_genl_msg(msg, ofd, hdr, ops, &payloadlen); in print_msg()
951 fprintf(ofd, " [PAYLOAD] %d octets\n", payloadlen); in print_msg()
952 dump_hex(ofd, data, payloadlen, 0); in print_msg()
961 dump_attrs(ofd, attrs, attrlen, 0); in print_msg()
973 void nl_msg_dump(struct nl_msg *msg, FILE *ofd) in nl_msg_dump() argument
977 fprintf(ofd, in nl_msg_dump()
980 fprintf(ofd, " [NETLINK HEADER] %zu octets\n", sizeof(struct nlmsghdr)); in nl_msg_dump()
981 print_hdr(ofd, msg); in nl_msg_dump()
984 dump_error_msg(msg, ofd); in nl_msg_dump()
986 print_msg(msg, ofd, hdr); in nl_msg_dump()
988 fprintf(ofd, in nl_msg_dump()