MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LocalRouteOrd.cpp
1 /*
2  Copyright 2009 Sun Microsystems, Inc.
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #include <signaldata/LocalRouteOrd.hpp>
20 #include <DebuggerNames.hpp>
21 #include <RefConvert.hpp>
22 
23 bool
24 printLOCAL_ROUTE_ORD(FILE* output,
25  const Uint32* theData, Uint32 len,
26  Uint16 rbn)
27 {
28  const LocalRouteOrd * sig = (const LocalRouteOrd*)theData;
29  Uint32 pathcnt = sig->cnt >> 16;
30  Uint32 dstcnt = sig->cnt & 0xFFFF;
31 
32  fprintf(output, " pathcnt: %u dstcnt: %u\n", pathcnt, dstcnt);
33  fprintf(output, " gsn: %u(%s) prio: %u\n",
34  sig->gsn, getSignalName(sig->gsn), sig->prio);
35 
36  const Uint32 * ptr = sig->path;
37  fprintf(output, " path:");
38  for (Uint32 i = 0; i<pathcnt; i++)
39  {
40  fprintf(output, " [ hop: 0x%x(%s) prio: %u ]",
41  ptr[0], getBlockName(refToMain(ptr[0])), ptr[1]);
42  ptr += 2;
43  }
44 
45  fprintf(output, "\n dst:");
46  for (Uint32 i = 0; i<dstcnt; i++)
47  {
48  fprintf(output, " [ 0x%x(%s) ]",
49  ptr[0], getBlockName(refToMain(ptr[0])));
50  }
51  fprintf(output, "\n");
52 
53  if (ptr < (theData + len))
54  {
55  fprintf(output, " data:");
56  while (ptr < (theData + len))
57  {
58  fprintf(output, " %.8x", * ptr++);
59  }
60  fprintf(output, "\n");
61  }
62  return true;
63 }