Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 1 | /* |
| 2 | * net/tipc/msg.c: TIPC message header routines |
YOSHIFUJI Hideaki | c430728 | 2007-02-09 23:25:21 +0900 | [diff] [blame] | 3 | * |
Per Liden | 593a5f2 | 2006-01-11 19:14:19 +0100 | [diff] [blame] | 4 | * Copyright (c) 2000-2006, Ericsson AB |
Allan Stephens | 741de3e | 2011-01-25 13:33:31 -0500 | [diff] [blame] | 5 | * Copyright (c) 2005, 2010-2011, Wind River Systems |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 6 | * All rights reserved. |
| 7 | * |
Per Liden | 9ea1fd3 | 2006-01-11 13:30:43 +0100 | [diff] [blame] | 8 | * Redistribution and use in source and binary forms, with or without |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 9 | * modification, are permitted provided that the following conditions are met: |
| 10 | * |
Per Liden | 9ea1fd3 | 2006-01-11 13:30:43 +0100 | [diff] [blame] | 11 | * 1. Redistributions of source code must retain the above copyright |
| 12 | * notice, this list of conditions and the following disclaimer. |
| 13 | * 2. Redistributions in binary form must reproduce the above copyright |
| 14 | * notice, this list of conditions and the following disclaimer in the |
| 15 | * documentation and/or other materials provided with the distribution. |
| 16 | * 3. Neither the names of the copyright holders nor the names of its |
| 17 | * contributors may be used to endorse or promote products derived from |
| 18 | * this software without specific prior written permission. |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 19 | * |
Per Liden | 9ea1fd3 | 2006-01-11 13:30:43 +0100 | [diff] [blame] | 20 | * Alternatively, this software may be distributed under the terms of the |
| 21 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 22 | * Software Foundation. |
| 23 | * |
| 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 34 | * POSSIBILITY OF SUCH DAMAGE. |
| 35 | */ |
| 36 | |
| 37 | #include "core.h" |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 38 | #include "msg.h" |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 39 | |
Allan Stephens | 23461e8 | 2010-05-11 14:30:18 +0000 | [diff] [blame] | 40 | u32 tipc_msg_tot_importance(struct tipc_msg *m) |
| 41 | { |
| 42 | if (likely(msg_isdata(m))) { |
| 43 | if (likely(msg_orignode(m) == tipc_own_addr)) |
| 44 | return msg_importance(m); |
| 45 | return msg_importance(m) + 4; |
| 46 | } |
| 47 | if ((msg_user(m) == MSG_FRAGMENTER) && |
| 48 | (msg_type(m) == FIRST_FRAGMENT)) |
| 49 | return msg_importance(msg_get_wrapped(m)); |
| 50 | return msg_importance(m); |
| 51 | } |
| 52 | |
| 53 | |
| 54 | void tipc_msg_init(struct tipc_msg *m, u32 user, u32 type, |
| 55 | u32 hsize, u32 destnode) |
| 56 | { |
| 57 | memset(m, 0, hsize); |
| 58 | msg_set_version(m); |
| 59 | msg_set_user(m, user); |
| 60 | msg_set_hdr_sz(m, hsize); |
| 61 | msg_set_size(m, hsize); |
| 62 | msg_set_prevnode(m, tipc_own_addr); |
| 63 | msg_set_type(m, type); |
Allan Stephens | 15f4e2b | 2011-05-31 14:35:18 -0400 | [diff] [blame] | 64 | msg_set_orignode(m, tipc_own_addr); |
| 65 | msg_set_destnode(m, destnode); |
Allan Stephens | 23461e8 | 2010-05-11 14:30:18 +0000 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | /** |
Allan Stephens | 23461e8 | 2010-05-11 14:30:18 +0000 | [diff] [blame] | 69 | * tipc_msg_build - create message using specified header and data |
| 70 | * |
| 71 | * Note: Caller must not hold any locks in case copy_from_user() is interrupted! |
| 72 | * |
| 73 | * Returns message data size or errno |
| 74 | */ |
Allan Stephens | 2689690 | 2011-04-21 10:42:07 -0500 | [diff] [blame] | 75 | int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect, |
| 76 | u32 num_sect, unsigned int total_len, |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 77 | int max_size, int usrmem, struct sk_buff **buf) |
Allan Stephens | 23461e8 | 2010-05-11 14:30:18 +0000 | [diff] [blame] | 78 | { |
| 79 | int dsz, sz, hsz, pos, res, cnt; |
| 80 | |
Allan Stephens | 2689690 | 2011-04-21 10:42:07 -0500 | [diff] [blame] | 81 | dsz = total_len; |
Allan Stephens | 23461e8 | 2010-05-11 14:30:18 +0000 | [diff] [blame] | 82 | pos = hsz = msg_hdr_sz(hdr); |
| 83 | sz = hsz + dsz; |
| 84 | msg_set_size(hdr, sz); |
| 85 | if (unlikely(sz > max_size)) { |
| 86 | *buf = NULL; |
| 87 | return dsz; |
| 88 | } |
| 89 | |
stephen hemminger | 31e3c3f | 2010-10-13 13:20:35 +0000 | [diff] [blame] | 90 | *buf = tipc_buf_acquire(sz); |
Allan Stephens | 23461e8 | 2010-05-11 14:30:18 +0000 | [diff] [blame] | 91 | if (!(*buf)) |
| 92 | return -ENOMEM; |
| 93 | skb_copy_to_linear_data(*buf, hdr, hsz); |
| 94 | for (res = 1, cnt = 0; res && (cnt < num_sect); cnt++) { |
| 95 | if (likely(usrmem)) |
| 96 | res = !copy_from_user((*buf)->data + pos, |
| 97 | msg_sect[cnt].iov_base, |
| 98 | msg_sect[cnt].iov_len); |
| 99 | else |
| 100 | skb_copy_to_linear_data_offset(*buf, pos, |
| 101 | msg_sect[cnt].iov_base, |
| 102 | msg_sect[cnt].iov_len); |
| 103 | pos += msg_sect[cnt].iov_len; |
| 104 | } |
| 105 | if (likely(res)) |
| 106 | return dsz; |
| 107 | |
Allan Stephens | 5f6d912 | 2011-11-04 13:24:29 -0400 | [diff] [blame] | 108 | kfree_skb(*buf); |
Allan Stephens | 23461e8 | 2010-05-11 14:30:18 +0000 | [diff] [blame] | 109 | *buf = NULL; |
| 110 | return -EFAULT; |
| 111 | } |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 112 | |
Allan Stephens | 48c9713 | 2008-05-05 01:24:06 -0700 | [diff] [blame] | 113 | #ifdef CONFIG_TIPC_DEBUG |
Allan Stephens | 48c9713 | 2008-05-05 01:24:06 -0700 | [diff] [blame] | 114 | void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str) |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 115 | { |
| 116 | u32 usr = msg_user(msg); |
Allan Stephens | 6e7e309 | 2010-12-31 18:59:28 +0000 | [diff] [blame] | 117 | tipc_printf(buf, KERN_DEBUG); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 118 | tipc_printf(buf, str); |
| 119 | |
| 120 | switch (usr) { |
| 121 | case MSG_BUNDLER: |
| 122 | tipc_printf(buf, "BNDL::"); |
| 123 | tipc_printf(buf, "MSGS(%u):", msg_msgcnt(msg)); |
| 124 | break; |
| 125 | case BCAST_PROTOCOL: |
| 126 | tipc_printf(buf, "BCASTP::"); |
| 127 | break; |
| 128 | case MSG_FRAGMENTER: |
| 129 | tipc_printf(buf, "FRAGM::"); |
| 130 | switch (msg_type(msg)) { |
| 131 | case FIRST_FRAGMENT: |
| 132 | tipc_printf(buf, "FIRST:"); |
| 133 | break; |
| 134 | case FRAGMENT: |
| 135 | tipc_printf(buf, "BODY:"); |
| 136 | break; |
| 137 | case LAST_FRAGMENT: |
| 138 | tipc_printf(buf, "LAST:"); |
| 139 | break; |
| 140 | default: |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 141 | tipc_printf(buf, "UNKNOWN:%x", msg_type(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 142 | |
| 143 | } |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 144 | tipc_printf(buf, "NO(%u/%u):", msg_long_msgno(msg), |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 145 | msg_fragm_no(msg)); |
| 146 | break; |
Allan Stephens | 06d82c9 | 2008-03-06 15:06:55 -0800 | [diff] [blame] | 147 | case TIPC_LOW_IMPORTANCE: |
| 148 | case TIPC_MEDIUM_IMPORTANCE: |
| 149 | case TIPC_HIGH_IMPORTANCE: |
| 150 | case TIPC_CRITICAL_IMPORTANCE: |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 151 | tipc_printf(buf, "DAT%u:", msg_user(msg)); |
| 152 | if (msg_short(msg)) { |
| 153 | tipc_printf(buf, "CON:"); |
| 154 | break; |
| 155 | } |
| 156 | switch (msg_type(msg)) { |
| 157 | case TIPC_CONN_MSG: |
| 158 | tipc_printf(buf, "CON:"); |
| 159 | break; |
| 160 | case TIPC_MCAST_MSG: |
| 161 | tipc_printf(buf, "MCST:"); |
| 162 | break; |
| 163 | case TIPC_NAMED_MSG: |
| 164 | tipc_printf(buf, "NAM:"); |
| 165 | break; |
| 166 | case TIPC_DIRECT_MSG: |
| 167 | tipc_printf(buf, "DIR:"); |
| 168 | break; |
| 169 | default: |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 170 | tipc_printf(buf, "UNKNOWN TYPE %u", msg_type(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 171 | } |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 172 | if (msg_reroute_cnt(msg)) |
| 173 | tipc_printf(buf, "REROUTED(%u):", |
| 174 | msg_reroute_cnt(msg)); |
| 175 | break; |
| 176 | case NAME_DISTRIBUTOR: |
| 177 | tipc_printf(buf, "NMD::"); |
| 178 | switch (msg_type(msg)) { |
| 179 | case PUBLICATION: |
| 180 | tipc_printf(buf, "PUBL(%u):", (msg_size(msg) - msg_hdr_sz(msg)) / 20); /* Items */ |
| 181 | break; |
| 182 | case WITHDRAWAL: |
| 183 | tipc_printf(buf, "WDRW:"); |
| 184 | break; |
| 185 | default: |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 186 | tipc_printf(buf, "UNKNOWN:%x", msg_type(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 187 | } |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 188 | if (msg_reroute_cnt(msg)) |
| 189 | tipc_printf(buf, "REROUTED(%u):", |
| 190 | msg_reroute_cnt(msg)); |
| 191 | break; |
| 192 | case CONN_MANAGER: |
| 193 | tipc_printf(buf, "CONN_MNG:"); |
| 194 | switch (msg_type(msg)) { |
| 195 | case CONN_PROBE: |
| 196 | tipc_printf(buf, "PROBE:"); |
| 197 | break; |
| 198 | case CONN_PROBE_REPLY: |
| 199 | tipc_printf(buf, "PROBE_REPLY:"); |
| 200 | break; |
| 201 | case CONN_ACK: |
| 202 | tipc_printf(buf, "CONN_ACK:"); |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 203 | tipc_printf(buf, "ACK(%u):", msg_msgcnt(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 204 | break; |
| 205 | default: |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 206 | tipc_printf(buf, "UNKNOWN TYPE:%x", msg_type(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 207 | } |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 208 | if (msg_reroute_cnt(msg)) |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 209 | tipc_printf(buf, "REROUTED(%u):", msg_reroute_cnt(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 210 | break; |
| 211 | case LINK_PROTOCOL: |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 212 | switch (msg_type(msg)) { |
| 213 | case STATE_MSG: |
| 214 | tipc_printf(buf, "STATE:"); |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 215 | tipc_printf(buf, "%s:", msg_probe(msg) ? "PRB" : ""); |
| 216 | tipc_printf(buf, "NXS(%u):", msg_next_sent(msg)); |
| 217 | tipc_printf(buf, "GAP(%u):", msg_seq_gap(msg)); |
| 218 | tipc_printf(buf, "LSTBC(%u):", msg_last_bcast(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 219 | break; |
| 220 | case RESET_MSG: |
| 221 | tipc_printf(buf, "RESET:"); |
| 222 | if (msg_size(msg) != msg_hdr_sz(msg)) |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 223 | tipc_printf(buf, "BEAR:%s:", msg_data(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 224 | break; |
| 225 | case ACTIVATE_MSG: |
| 226 | tipc_printf(buf, "ACTIVATE:"); |
| 227 | break; |
| 228 | default: |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 229 | tipc_printf(buf, "UNKNOWN TYPE:%x", msg_type(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 230 | } |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 231 | tipc_printf(buf, "PLANE(%c):", msg_net_plane(msg)); |
| 232 | tipc_printf(buf, "SESS(%u):", msg_session(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 233 | break; |
| 234 | case CHANGEOVER_PROTOCOL: |
| 235 | tipc_printf(buf, "TUNL:"); |
| 236 | switch (msg_type(msg)) { |
| 237 | case DUPLICATE_MSG: |
| 238 | tipc_printf(buf, "DUPL:"); |
| 239 | break; |
| 240 | case ORIGINAL_MSG: |
| 241 | tipc_printf(buf, "ORIG:"); |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 242 | tipc_printf(buf, "EXP(%u)", msg_msgcnt(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 243 | break; |
| 244 | default: |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 245 | tipc_printf(buf, "UNKNOWN TYPE:%x", msg_type(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 246 | } |
| 247 | break; |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 248 | case LINK_CONFIG: |
| 249 | tipc_printf(buf, "CFG:"); |
| 250 | switch (msg_type(msg)) { |
| 251 | case DSC_REQ_MSG: |
| 252 | tipc_printf(buf, "DSC_REQ:"); |
| 253 | break; |
| 254 | case DSC_RESP_MSG: |
| 255 | tipc_printf(buf, "DSC_RESP:"); |
| 256 | break; |
| 257 | default: |
Allan Stephens | 0e65967 | 2010-12-31 18:59:32 +0000 | [diff] [blame] | 258 | tipc_printf(buf, "UNKNOWN TYPE:%x:", msg_type(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 259 | break; |
| 260 | } |
| 261 | break; |
| 262 | default: |
| 263 | tipc_printf(buf, "UNKNOWN USER:"); |
| 264 | } |
| 265 | |
| 266 | switch (usr) { |
| 267 | case CONN_MANAGER: |
Allan Stephens | 06d82c9 | 2008-03-06 15:06:55 -0800 | [diff] [blame] | 268 | case TIPC_LOW_IMPORTANCE: |
| 269 | case TIPC_MEDIUM_IMPORTANCE: |
| 270 | case TIPC_HIGH_IMPORTANCE: |
| 271 | case TIPC_CRITICAL_IMPORTANCE: |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 272 | switch (msg_errcode(msg)) { |
| 273 | case TIPC_OK: |
| 274 | break; |
| 275 | case TIPC_ERR_NO_NAME: |
| 276 | tipc_printf(buf, "NO_NAME:"); |
| 277 | break; |
| 278 | case TIPC_ERR_NO_PORT: |
| 279 | tipc_printf(buf, "NO_PORT:"); |
| 280 | break; |
| 281 | case TIPC_ERR_NO_NODE: |
| 282 | tipc_printf(buf, "NO_PROC:"); |
| 283 | break; |
| 284 | case TIPC_ERR_OVERLOAD: |
| 285 | tipc_printf(buf, "OVERLOAD:"); |
| 286 | break; |
| 287 | case TIPC_CONN_SHUTDOWN: |
| 288 | tipc_printf(buf, "SHUTDOWN:"); |
| 289 | break; |
| 290 | default: |
| 291 | tipc_printf(buf, "UNKNOWN ERROR(%x):", |
| 292 | msg_errcode(msg)); |
| 293 | } |
Allan Stephens | a016892 | 2010-12-31 18:59:35 +0000 | [diff] [blame] | 294 | default: |
| 295 | break; |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 296 | } |
| 297 | |
| 298 | tipc_printf(buf, "HZ(%u):", msg_hdr_sz(msg)); |
| 299 | tipc_printf(buf, "SZ(%u):", msg_size(msg)); |
| 300 | tipc_printf(buf, "SQNO(%u):", msg_seqno(msg)); |
| 301 | |
| 302 | if (msg_non_seq(msg)) |
| 303 | tipc_printf(buf, "NOSEQ:"); |
Allan Stephens | a016892 | 2010-12-31 18:59:35 +0000 | [diff] [blame] | 304 | else |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 305 | tipc_printf(buf, "ACK(%u):", msg_ack(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 306 | tipc_printf(buf, "BACK(%u):", msg_bcast_ack(msg)); |
| 307 | tipc_printf(buf, "PRND(%x)", msg_prevnode(msg)); |
| 308 | |
| 309 | if (msg_isdata(msg)) { |
| 310 | if (msg_named(msg)) { |
| 311 | tipc_printf(buf, "NTYP(%u):", msg_nametype(msg)); |
| 312 | tipc_printf(buf, "NINST(%u)", msg_nameinst(msg)); |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | if ((usr != LINK_PROTOCOL) && (usr != LINK_CONFIG) && |
| 317 | (usr != MSG_BUNDLER)) { |
| 318 | if (!msg_short(msg)) { |
| 319 | tipc_printf(buf, ":ORIG(%x:%u):", |
| 320 | msg_orignode(msg), msg_origport(msg)); |
| 321 | tipc_printf(buf, ":DEST(%x:%u):", |
| 322 | msg_destnode(msg), msg_destport(msg)); |
| 323 | } else { |
| 324 | tipc_printf(buf, ":OPRT(%u):", msg_origport(msg)); |
| 325 | tipc_printf(buf, ":DPRT(%u):", msg_destport(msg)); |
| 326 | } |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 327 | } |
| 328 | if (msg_user(msg) == NAME_DISTRIBUTOR) { |
| 329 | tipc_printf(buf, ":ONOD(%x):", msg_orignode(msg)); |
| 330 | tipc_printf(buf, ":DNOD(%x):", msg_destnode(msg)); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 331 | } |
| 332 | |
| 333 | if (msg_user(msg) == LINK_CONFIG) { |
Allan Stephens | 3d749a6 | 2011-10-07 15:19:11 -0400 | [diff] [blame] | 334 | struct tipc_media_addr orig; |
| 335 | |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 336 | tipc_printf(buf, ":DDOM(%x):", msg_dest_domain(msg)); |
| 337 | tipc_printf(buf, ":NETID(%u):", msg_bc_netid(msg)); |
Allan Stephens | 3d749a6 | 2011-10-07 15:19:11 -0400 | [diff] [blame] | 338 | memcpy(orig.value, msg_media_addr(msg), sizeof(orig.value)); |
| 339 | orig.media_id = 0; |
| 340 | orig.broadcast = 0; |
| 341 | tipc_media_addr_printf(buf, &orig); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 342 | } |
| 343 | if (msg_user(msg) == BCAST_PROTOCOL) { |
| 344 | tipc_printf(buf, "BCNACK:AFTER(%u):", msg_bcgap_after(msg)); |
| 345 | tipc_printf(buf, "TO(%u):", msg_bcgap_to(msg)); |
| 346 | } |
| 347 | tipc_printf(buf, "\n"); |
Allan Stephens | a016892 | 2010-12-31 18:59:35 +0000 | [diff] [blame] | 348 | if ((usr == CHANGEOVER_PROTOCOL) && (msg_msgcnt(msg))) |
Allan Stephens | 48c9713 | 2008-05-05 01:24:06 -0700 | [diff] [blame] | 349 | tipc_msg_dbg(buf, msg_get_wrapped(msg), " /"); |
Allan Stephens | a016892 | 2010-12-31 18:59:35 +0000 | [diff] [blame] | 350 | if ((usr == MSG_FRAGMENTER) && (msg_type(msg) == FIRST_FRAGMENT)) |
Allan Stephens | 48c9713 | 2008-05-05 01:24:06 -0700 | [diff] [blame] | 351 | tipc_msg_dbg(buf, msg_get_wrapped(msg), " /"); |
Per Liden | b97bf3f | 2006-01-02 19:04:38 +0100 | [diff] [blame] | 352 | } |
Allan Stephens | 48c9713 | 2008-05-05 01:24:06 -0700 | [diff] [blame] | 353 | #endif |