• Home
  • Raw
  • Download

Lines Matching refs:msg

68 	int (*format)(struct tipc_nl_compat_msg *msg, struct nlattr **attrs);
74 struct sk_buff *skb, struct tipc_nl_compat_msg *msg);
182 struct tipc_nl_compat_msg *msg, in __tipc_nl_compat_dumpit() argument
202 buf->sk = msg->dst_sk; in __tipc_nl_compat_dumpit()
203 if (__tipc_dump_start(&cb, msg->net)) { in __tipc_nl_compat_dumpit()
236 err = (*cmd->format)(msg, attrbuf); in __tipc_nl_compat_dumpit()
240 if (tipc_skb_tailroom(msg->rep) <= 1) { in __tipc_nl_compat_dumpit()
262 if ((TIPC_SKB_MAX - msg->rep->len) <= 1) { in __tipc_nl_compat_dumpit()
263 char *tail = skb_tail_pointer(msg->rep); in __tipc_nl_compat_dumpit()
277 struct tipc_nl_compat_msg *msg) in tipc_nl_compat_dumpit() argument
283 if (msg->req_type && (!msg->req_size || in tipc_nl_compat_dumpit()
284 !TLV_CHECK_TYPE(msg->req, msg->req_type))) in tipc_nl_compat_dumpit()
287 msg->rep = tipc_tlv_alloc(msg->rep_size); in tipc_nl_compat_dumpit()
288 if (!msg->rep) in tipc_nl_compat_dumpit()
291 if (msg->rep_type) in tipc_nl_compat_dumpit()
292 tipc_tlv_init(msg->rep, msg->rep_type); in tipc_nl_compat_dumpit()
295 err = (*cmd->header)(msg); in tipc_nl_compat_dumpit()
297 kfree_skb(msg->rep); in tipc_nl_compat_dumpit()
298 msg->rep = NULL; in tipc_nl_compat_dumpit()
305 kfree_skb(msg->rep); in tipc_nl_compat_dumpit()
306 msg->rep = NULL; in tipc_nl_compat_dumpit()
313 kfree_skb(msg->rep); in tipc_nl_compat_dumpit()
314 msg->rep = NULL; in tipc_nl_compat_dumpit()
319 err = __tipc_nl_compat_dumpit(cmd, msg, arg); in tipc_nl_compat_dumpit()
321 kfree_skb(msg->rep); in tipc_nl_compat_dumpit()
322 msg->rep = NULL; in tipc_nl_compat_dumpit()
330 struct tipc_nl_compat_msg *msg) in __tipc_nl_compat_doit() argument
360 err = (*cmd->transcode)(cmd, trans_buf, msg); in __tipc_nl_compat_doit()
370 doit_buf->sk = msg->dst_sk; in __tipc_nl_compat_doit()
386 struct tipc_nl_compat_msg *msg) in tipc_nl_compat_doit() argument
390 if (msg->req_type && (!msg->req_size || in tipc_nl_compat_doit()
391 !TLV_CHECK_TYPE(msg->req, msg->req_type))) in tipc_nl_compat_doit()
394 err = __tipc_nl_compat_doit(cmd, msg); in tipc_nl_compat_doit()
399 msg->rep = tipc_tlv_alloc(0); in tipc_nl_compat_doit()
400 if (!msg->rep) in tipc_nl_compat_doit()
406 static int tipc_nl_compat_bearer_dump(struct tipc_nl_compat_msg *msg, in tipc_nl_compat_bearer_dump() argument
420 return tipc_add_tlv(msg->rep, TIPC_TLV_BEARER_NAME, in tipc_nl_compat_bearer_dump()
427 struct tipc_nl_compat_msg *msg) in tipc_nl_compat_bearer_enable() argument
434 b = (struct tipc_bearer_config *)TLV_DATA(msg->req); in tipc_nl_compat_bearer_enable()
440 len = TLV_GET_DATA_LEN(msg->req); in tipc_nl_compat_bearer_enable()
470 struct tipc_nl_compat_msg *msg) in tipc_nl_compat_bearer_disable() argument
476 name = (char *)TLV_DATA(msg->req); in tipc_nl_compat_bearer_disable()
482 len = TLV_GET_DATA_LEN(msg->req); in tipc_nl_compat_bearer_disable()
503 static void __fill_bc_link_stat(struct tipc_nl_compat_msg *msg, in __fill_bc_link_stat() argument
506 tipc_tlv_sprintf(msg->rep, " Window:%u packets\n", in __fill_bc_link_stat()
509 tipc_tlv_sprintf(msg->rep, in __fill_bc_link_stat()
517 tipc_tlv_sprintf(msg->rep, in __fill_bc_link_stat()
525 tipc_tlv_sprintf(msg->rep, " RX naks:%u defs:%u dups:%u\n", in __fill_bc_link_stat()
530 tipc_tlv_sprintf(msg->rep, " TX naks:%u acks:%u dups:%u\n", in __fill_bc_link_stat()
535 tipc_tlv_sprintf(msg->rep, in __fill_bc_link_stat()
542 static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg, in tipc_nl_compat_link_stat_dump() argument
578 name = (char *)TLV_DATA(msg->req); in tipc_nl_compat_link_stat_dump()
580 len = TLV_GET_DATA_LEN(msg->req); in tipc_nl_compat_link_stat_dump()
591 tipc_tlv_sprintf(msg->rep, "\nLink <%s>\n", in tipc_nl_compat_link_stat_dump()
595 __fill_bc_link_stat(msg, prop, stats); in tipc_nl_compat_link_stat_dump()
600 tipc_tlv_sprintf(msg->rep, " ACTIVE"); in tipc_nl_compat_link_stat_dump()
602 tipc_tlv_sprintf(msg->rep, " STANDBY"); in tipc_nl_compat_link_stat_dump()
604 tipc_tlv_sprintf(msg->rep, " DEFUNCT"); in tipc_nl_compat_link_stat_dump()
606 tipc_tlv_sprintf(msg->rep, " MTU:%u Priority:%u", in tipc_nl_compat_link_stat_dump()
610 tipc_tlv_sprintf(msg->rep, " Tolerance:%u ms Window:%u packets\n", in tipc_nl_compat_link_stat_dump()
614 tipc_tlv_sprintf(msg->rep, in tipc_nl_compat_link_stat_dump()
623 tipc_tlv_sprintf(msg->rep, in tipc_nl_compat_link_stat_dump()
632 tipc_tlv_sprintf(msg->rep, in tipc_nl_compat_link_stat_dump()
638 tipc_tlv_sprintf(msg->rep, in tipc_nl_compat_link_stat_dump()
649 tipc_tlv_sprintf(msg->rep, "-16384:%u%% -32768:%u%% -66000:%u%%\n", in tipc_nl_compat_link_stat_dump()
657 tipc_tlv_sprintf(msg->rep, in tipc_nl_compat_link_stat_dump()
665 tipc_tlv_sprintf(msg->rep, in tipc_nl_compat_link_stat_dump()
673 tipc_tlv_sprintf(msg->rep, in tipc_nl_compat_link_stat_dump()
682 static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg, in tipc_nl_compat_link_dump() argument
702 return tipc_add_tlv(msg->rep, TIPC_TLV_LINK_INFO, in tipc_nl_compat_link_dump()
707 struct tipc_nl_compat_msg *msg, in __tipc_add_link_prop() argument
710 switch (msg->cmd) { in __tipc_add_link_prop()
723 struct tipc_nl_compat_msg *msg) in tipc_nl_compat_media_set() argument
729 lc = (struct tipc_link_config *)TLV_DATA(msg->req); in tipc_nl_compat_media_set()
742 __tipc_add_link_prop(skb, msg, lc); in tipc_nl_compat_media_set()
750 struct tipc_nl_compat_msg *msg) in tipc_nl_compat_bearer_set() argument
756 lc = (struct tipc_link_config *)TLV_DATA(msg->req); in tipc_nl_compat_bearer_set()
769 __tipc_add_link_prop(skb, msg, lc); in tipc_nl_compat_bearer_set()
777 struct tipc_nl_compat_msg *msg) in __tipc_nl_compat_link_set() argument
783 lc = (struct tipc_link_config *)TLV_DATA(msg->req); in __tipc_nl_compat_link_set()
796 __tipc_add_link_prop(skb, msg, lc); in __tipc_nl_compat_link_set()
805 struct tipc_nl_compat_msg *msg) in tipc_nl_compat_link_set() argument
812 lc = (struct tipc_link_config *)TLV_DATA(msg->req); in tipc_nl_compat_link_set()
814 len = TLV_GET_DATA_LEN(msg->req); in tipc_nl_compat_link_set()
826 return tipc_nl_compat_media_set(skb, msg); in tipc_nl_compat_link_set()
829 bearer = tipc_bearer_find(msg->net, lc->name); in tipc_nl_compat_link_set()
832 return tipc_nl_compat_bearer_set(skb, msg); in tipc_nl_compat_link_set()
835 return __tipc_nl_compat_link_set(skb, msg); in tipc_nl_compat_link_set()
840 struct tipc_nl_compat_msg *msg) in tipc_nl_compat_link_reset_stats() argument
846 name = (char *)TLV_DATA(msg->req); in tipc_nl_compat_link_reset_stats()
852 len = TLV_GET_DATA_LEN(msg->req); in tipc_nl_compat_link_reset_stats()
868 static int tipc_nl_compat_name_table_dump_header(struct tipc_nl_compat_msg *msg) in tipc_nl_compat_name_table_dump_header() argument
880 ntq = (struct tipc_name_table_query *)TLV_DATA(msg->req); in tipc_nl_compat_name_table_dump_header()
881 if (TLV_GET_DATA_LEN(msg->req) < (int)sizeof(struct tipc_name_table_query)) in tipc_nl_compat_name_table_dump_header()
889 tipc_tlv_sprintf(msg->rep, header[i]); in tipc_nl_compat_name_table_dump_header()
890 tipc_tlv_sprintf(msg->rep, "\n"); in tipc_nl_compat_name_table_dump_header()
895 static int tipc_nl_compat_name_table_dump(struct tipc_nl_compat_msg *msg, in tipc_nl_compat_name_table_dump() argument
925 ntq = (struct tipc_name_table_query *)TLV_DATA(msg->req); in tipc_nl_compat_name_table_dump()
940 tipc_tlv_sprintf(msg->rep, "%-10u ", in tipc_nl_compat_name_table_dump()
946 tipc_tlv_sprintf(msg->rep, "%-10u %-10u ", in tipc_nl_compat_name_table_dump()
956 tipc_tlv_sprintf(msg->rep, "%-26s ", port_str); in tipc_nl_compat_name_table_dump()
961 tipc_tlv_sprintf(msg->rep, "%-10u %s", in tipc_nl_compat_name_table_dump()
965 tipc_tlv_sprintf(msg->rep, "\n"); in tipc_nl_compat_name_table_dump()
970 static int __tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, in __tipc_nl_compat_publ_dump() argument
990 tipc_tlv_sprintf(msg->rep, " {%u,%u}", type, lower); in __tipc_nl_compat_publ_dump()
992 tipc_tlv_sprintf(msg->rep, " {%u,%u,%u}", type, lower, upper); in __tipc_nl_compat_publ_dump()
997 static int tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, u32 sock) in tipc_nl_compat_publ_dump() argument
1033 err = __tipc_nl_compat_dumpit(&dump, msg, args); in tipc_nl_compat_publ_dump()
1040 static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg, in tipc_nl_compat_sk_dump() argument
1056 tipc_tlv_sprintf(msg->rep, "%u:", sock_ref); in tipc_nl_compat_sk_dump()
1070 tipc_tlv_sprintf(msg->rep, " connected to <%u.%u.%u:%u>", in tipc_nl_compat_sk_dump()
1077 tipc_tlv_sprintf(msg->rep, " via {%u,%u}\n", in tipc_nl_compat_sk_dump()
1081 tipc_tlv_sprintf(msg->rep, "\n"); in tipc_nl_compat_sk_dump()
1083 tipc_tlv_sprintf(msg->rep, " bound to"); in tipc_nl_compat_sk_dump()
1085 err = tipc_nl_compat_publ_dump(msg, sock_ref); in tipc_nl_compat_sk_dump()
1089 tipc_tlv_sprintf(msg->rep, "\n"); in tipc_nl_compat_sk_dump()
1094 static int tipc_nl_compat_media_dump(struct tipc_nl_compat_msg *msg, in tipc_nl_compat_media_dump() argument
1108 return tipc_add_tlv(msg->rep, TIPC_TLV_MEDIA_NAME, in tipc_nl_compat_media_dump()
1113 static int tipc_nl_compat_node_dump(struct tipc_nl_compat_msg *msg, in tipc_nl_compat_node_dump() argument
1131 return tipc_add_tlv(msg->rep, TIPC_TLV_NODE_INFO, &node_info, in tipc_nl_compat_node_dump()
1137 struct tipc_nl_compat_msg *msg) in tipc_nl_compat_net_set() argument
1142 val = ntohl(*(__be32 *)TLV_DATA(msg->req)); in tipc_nl_compat_net_set()
1148 if (msg->cmd == TIPC_CMD_SET_NODE_ADDR) { in tipc_nl_compat_net_set()
1151 } else if (msg->cmd == TIPC_CMD_SET_NETID) { in tipc_nl_compat_net_set()
1160 static int tipc_nl_compat_net_dump(struct tipc_nl_compat_msg *msg, in tipc_nl_compat_net_dump() argument
1177 return tipc_add_tlv(msg->rep, TIPC_TLV_UNSIGNED, &id, sizeof(id)); in tipc_nl_compat_net_dump()
1180 static int tipc_cmd_show_stats_compat(struct tipc_nl_compat_msg *msg) in tipc_cmd_show_stats_compat() argument
1182 msg->rep = tipc_tlv_alloc(ULTRA_STRING_MAX_LEN); in tipc_cmd_show_stats_compat()
1183 if (!msg->rep) in tipc_cmd_show_stats_compat()
1186 tipc_tlv_init(msg->rep, TIPC_TLV_ULTRA_STRING); in tipc_cmd_show_stats_compat()
1187 tipc_tlv_sprintf(msg->rep, "TIPC version " TIPC_MOD_VER "\n"); in tipc_cmd_show_stats_compat()
1192 static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg) in tipc_nl_compat_handle() argument
1200 switch (msg->cmd) { in tipc_nl_compat_handle()
1202 msg->rep = tipc_tlv_alloc(0); in tipc_nl_compat_handle()
1203 if (!msg->rep) in tipc_nl_compat_handle()
1207 msg->rep_size = MAX_BEARERS * TLV_SPACE(TIPC_MAX_BEARER_NAME); in tipc_nl_compat_handle()
1210 return tipc_nl_compat_dumpit(&dump, msg); in tipc_nl_compat_handle()
1212 msg->req_type = TIPC_TLV_BEARER_CONFIG; in tipc_nl_compat_handle()
1215 return tipc_nl_compat_doit(&doit, msg); in tipc_nl_compat_handle()
1217 msg->req_type = TIPC_TLV_BEARER_NAME; in tipc_nl_compat_handle()
1220 return tipc_nl_compat_doit(&doit, msg); in tipc_nl_compat_handle()
1222 msg->req_type = TIPC_TLV_LINK_NAME; in tipc_nl_compat_handle()
1223 msg->rep_size = ULTRA_STRING_MAX_LEN; in tipc_nl_compat_handle()
1224 msg->rep_type = TIPC_TLV_ULTRA_STRING; in tipc_nl_compat_handle()
1227 return tipc_nl_compat_dumpit(&dump, msg); in tipc_nl_compat_handle()
1229 msg->req_type = TIPC_TLV_NET_ADDR; in tipc_nl_compat_handle()
1230 msg->rep_size = ULTRA_STRING_MAX_LEN; in tipc_nl_compat_handle()
1233 return tipc_nl_compat_dumpit(&dump, msg); in tipc_nl_compat_handle()
1237 msg->req_type = TIPC_TLV_LINK_CONFIG; in tipc_nl_compat_handle()
1240 return tipc_nl_compat_doit(&doit, msg); in tipc_nl_compat_handle()
1242 msg->req_type = TIPC_TLV_LINK_NAME; in tipc_nl_compat_handle()
1245 return tipc_nl_compat_doit(&doit, msg); in tipc_nl_compat_handle()
1247 msg->req_type = TIPC_TLV_NAME_TBL_QUERY; in tipc_nl_compat_handle()
1248 msg->rep_size = ULTRA_STRING_MAX_LEN; in tipc_nl_compat_handle()
1249 msg->rep_type = TIPC_TLV_ULTRA_STRING; in tipc_nl_compat_handle()
1253 return tipc_nl_compat_dumpit(&dump, msg); in tipc_nl_compat_handle()
1255 msg->rep_size = ULTRA_STRING_MAX_LEN; in tipc_nl_compat_handle()
1256 msg->rep_type = TIPC_TLV_ULTRA_STRING; in tipc_nl_compat_handle()
1259 return tipc_nl_compat_dumpit(&dump, msg); in tipc_nl_compat_handle()
1261 msg->rep_size = MAX_MEDIA * TLV_SPACE(TIPC_MAX_MEDIA_NAME); in tipc_nl_compat_handle()
1264 return tipc_nl_compat_dumpit(&dump, msg); in tipc_nl_compat_handle()
1266 msg->rep_size = ULTRA_STRING_MAX_LEN; in tipc_nl_compat_handle()
1269 return tipc_nl_compat_dumpit(&dump, msg); in tipc_nl_compat_handle()
1271 msg->req_type = TIPC_TLV_NET_ADDR; in tipc_nl_compat_handle()
1274 return tipc_nl_compat_doit(&doit, msg); in tipc_nl_compat_handle()
1276 msg->req_type = TIPC_TLV_UNSIGNED; in tipc_nl_compat_handle()
1279 return tipc_nl_compat_doit(&doit, msg); in tipc_nl_compat_handle()
1281 msg->rep_size = sizeof(u32); in tipc_nl_compat_handle()
1284 return tipc_nl_compat_dumpit(&dump, msg); in tipc_nl_compat_handle()
1286 return tipc_cmd_show_stats_compat(msg); in tipc_nl_compat_handle()
1296 struct tipc_nl_compat_msg msg; in tipc_nl_compat_recv() local
1301 memset(&msg, 0, sizeof(msg)); in tipc_nl_compat_recv()
1304 msg.req = nlmsg_data(req_nlh) + GENL_HDRLEN + TIPC_GENL_HDRLEN; in tipc_nl_compat_recv()
1305 msg.cmd = req_userhdr->cmd; in tipc_nl_compat_recv()
1306 msg.net = genl_info_net(info); in tipc_nl_compat_recv()
1307 msg.dst_sk = skb->sk; in tipc_nl_compat_recv()
1309 if ((msg.cmd & 0xC000) && (!netlink_net_capable(skb, CAP_NET_ADMIN))) { in tipc_nl_compat_recv()
1310 msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_NET_ADMIN); in tipc_nl_compat_recv()
1315 msg.req_size = nlmsg_attrlen(req_nlh, GENL_HDRLEN + TIPC_GENL_HDRLEN); in tipc_nl_compat_recv()
1316 if (msg.req_size && !TLV_OK(msg.req, msg.req_size)) { in tipc_nl_compat_recv()
1317 msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_SUPPORTED); in tipc_nl_compat_recv()
1322 err = tipc_nl_compat_handle(&msg); in tipc_nl_compat_recv()
1324 msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_SUPPORTED); in tipc_nl_compat_recv()
1326 msg.rep = tipc_get_err_tlv(TIPC_CFG_TLV_ERROR); in tipc_nl_compat_recv()
1328 if (!msg.rep) in tipc_nl_compat_recv()
1332 skb_push(msg.rep, len); in tipc_nl_compat_recv()
1333 rep_nlh = nlmsg_hdr(msg.rep); in tipc_nl_compat_recv()
1335 rep_nlh->nlmsg_len = msg.rep->len; in tipc_nl_compat_recv()
1336 genlmsg_unicast(msg.net, msg.rep, NETLINK_CB(skb).portid); in tipc_nl_compat_recv()