rndis_debug.c
Go to the documentation of this file.
1 /**
2  * @file rndis_debug.c
3  * @brief RNDIS (Remote Network Driver Interface Specification)
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Pro.
10  *
11  * This software is provided under a commercial license. You may
12  * use this software under the conditions stated in the license
13  * terms. This source code cannot be redistributed.
14  *
15  * @author Oryx Embedded SARL (www.oryx-embedded.com)
16  * @version 1.9.0
17  **/
18 
19 //Switch to the appropriate trace level
20 #define TRACE_LEVEL TRACE_LEVEL_INFO
21 
22 //Dependencies
23 #include "os_port.h"
24 #include "rndis_debug.h"
25 #include "debug.h"
26 
27 //Debug macros
28 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
29  #undef TRACE_DEBUG
30  #define TRACE_DEBUG(...) fprintf(stderr, __VA_ARGS__)
31  #undef TRACE_DEBUG_ARRAY
32  #define TRACE_DEBUG_ARRAY(p, a, n) debugDisplayArray(stderr, p, a, n)
33 #endif
34 
35 //RNDIS messages
37 {
38  {0x00000001, "REMOTE_NDIS_PACKET_MSG"},
39  {0x00000002, "REMOTE_NDIS_INITIALIZE_MSG"},
40  {0x80000002, "REMOTE_NDIS_INITIALIZE_CMPLT"},
41  {0x00000003, "REMOTE_NDIS_HALT_MSG"},
42  {0x00000004, "REMOTE_NDIS_QUERY_MSG"},
43  {0x80000004, "REMOTE_NDIS_QUERY_CMPLT"},
44  {0x00000005, "REMOTE_NDIS_SET_MSG"},
45  {0x80000005, "REMOTE_NDIS_SET_CMPLT"},
46  {0x00000006, "REMOTE_NDIS_RESET_MSG"},
47  {0x80000006, "REMOTE_NDIS_RESET_CMPLT"},
48  {0x00000007, "REMOTE_NDIS_INDICATE_STATUS_MSG"},
49  {0x00000008, "REMOTE_NDIS_KEEPALIVE_CMPLT"},
50  {0x80000008, "REMOTE_NDIS_KEEPALIVE_CMPLT"}
51 };
52 
53 //Status codes
55 {
56  {0x00000000, "RNDIS_STATUS_SUCCESS"},
57  {0xC0000001, "RNDIS_STATUS_FAILURE"},
58  {0xC0010015, "RNDIS_STATUS_INVALID_DATA"},
59  {0xC00000BB, "RNDIS_STATUS_NOT_SUPPORTED"},
60  {0x4001000B, "RNDIS_STATUS_MEDIA_CONNECT"},
61  {0x4001000C, "RNDIS_STATUS_MEDIA_DISCONNECT"}
62 };
63 
64 //Object identifiers
66 {
67  //General objects
68  {0x00010101, "OID_GEN_SUPPORTED_LIST"},
69  {0x00010102, "OID_GEN_HARDWARE_STATUS"},
70  {0x00010103, "OID_GEN_MEDIA_SUPPORTED"},
71  {0x00010104, "OID_GEN_MEDIA_IN_USE"},
72  {0x00010105, "OID_GEN_MAXIMUM_LOOKAHEAD"},
73  {0x00010106, "OID_GEN_MAXIMUM_FRAME_SIZE"},
74  {0x00010107, "OID_GEN_LINK_SPEED"},
75  {0x00010108, "OID_GEN_TRANSMIT_BUFFER_SPACE"},
76  {0x00010109, "OID_GEN_RECEIVE_BUFFER_SPACE"},
77  {0x0001010A, "OID_GEN_TRANSMIT_BLOCK_SIZE"},
78  {0x0001010B, "OID_GEN_RECEIVE_BLOCK_SIZE"},
79  {0x0001010C, "OID_GEN_VENDOR_ID"},
80  {0x0001010D, "OID_GEN_VENDOR_DESCRIPTION"},
81  {0x0001010E, "OID_GEN_CURRENT_PACKET_FILTER"},
82  {0x0001010F, "OID_GEN_CURRENT_LOOKAHEAD"},
83  {0x00010110, "OID_GEN_DRIVER_VERSION"},
84  {0x00010111, "OID_GEN_MAXIMUM_TOTAL_SIZE"},
85  {0x00010112, "OID_GEN_PROTOCOL_OPTIONS"},
86  {0x00010113, "OID_GEN_MAC_OPTIONS"},
87  {0x00010114, "OID_GEN_MEDIA_CONNECT_STATUS"},
88  {0x00010115, "OID_GEN_MAXIMUM_SEND_PACKETS"},
89  {0x00010116, "OID_GEN_VENDOR_DRIVER_VERSION"},
90  {0x00010117, "OID_GEN_SUPPORTED_GUIDS"},
91  {0x00010118, "OID_GEN_NETWORK_LAYER_ADDRESSES"},
92  {0x00010119, "OID_GEN_TRANSPORT_HEADER_OFFSET"},
93  {0x0001021A, "OID_GEN_MACHINE_NAME"},
94  {0x0001021B, "OID_GEN_RNDIS_CONFIG_PARAMETER"},
95  {0x0001021C, "OID_GEN_VLAN_ID"},
96  //Ethernet objects
97  {0x01010101, "OID_802_3_PERMANENT_ADDRESS"},
98  {0x01010102, "OID_802_3_CURRENT_ADDRESS"},
99  {0x01010103, "OID_802_3_MULTICAST_LIST"},
100  {0x01010104, "OID_802_3_MAXIMUM_LIST_SIZE"},
101  {0x01010105, "OID_802_3_MAC_OPTIONS"},
102 };
103 
104 
105 /**
106  * @brief Dump RNDIS message for debugging purpose
107  * @param[in] message Pointer to the RNDIS message
108  * @param[in] length Length of the message, in bytes
109  * @return Error code
110  **/
111 
113 {
114 //Check current trace level
115 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
116  error_t error;
117  const char_t *label;
118 
119  //Check the length of the message
120  if(length < sizeof(RndisMsg))
121  return ERROR_INVALID_LENGTH;
122 
123  //Retrieve the name of the RNDIS message
124  label = rndisFindName(message->messageType,
126 
127  //Dump RNDIS message
128  TRACE_DEBUG(" MessageType = 0x%08" PRIX32 " (%s)\r\n", message->messageType, label);
129  TRACE_DEBUG(" MessageLength = %" PRIu32 "\r\n", message->messageLength);
130 
131  //Check message type
132  switch(message->messageType)
133  {
134  //RNDIS Packet message?
135  case RNDIS_PACKET_MSG:
137  break;
138  //RNDIS Initialize message?
141  break;
142  //RNDIS Halt message?
143  case RNDIS_HALT_MSG:
145  break;
146  //RNDIS Query message?
147  case RNDIS_QUERY_MSG:
149  break;
150  //RNDIS Set message?
151  case RNDIS_SET_MSG:
153  break;
154  //RNDIS Reset message?
155  case RNDIS_RESET_MSG:
157  break;
158  //RNDIS Indicate Status message?
161  break;
162  //RNDIS Keep-Alive message?
163  case RNDIS_KEEPALIVE_MSG:
165  break;
166  //RNDIS Initialize Cmplt message?
169  break;
170  //RNDIS Query Cmplt message?
171  case RNDIS_QUERY_CMPLT:
173  break;
174  //RNDIS Set Cmplt message?
175  case RNDIS_SET_CMPLT:
177  break;
178  //RNDIS Reset Cmplt message?
179  case RNDIS_RESET_CMPLT:
181  break;
182  //RNDIS Keep-Alive Cmplt message?
185  break;
186  //Unknown message type?
187  default:
188  error = ERROR_INVALID_TYPE;
189  break;
190  }
191 
192  //Return status code
193  return error;
194 #else
195  //Successful processing
196  return NO_ERROR;
197 #endif
198 }
199 
200 
201 /**
202  * @brief Dump REMOTE_NDIS_PACKET_MSG message
203  * @param[in] message Pointer to the RNDIS message
204  * @param[in] length Length of the message, in bytes
205  * @return Error code
206  **/
207 
209 {
210  //Check the length of the message
211  if(length < sizeof(RndisPacketMsg))
212  return ERROR_INVALID_LENGTH;
213 
214  //Dump RNDIS message
215  TRACE_DEBUG(" DataOffset = 0x%08" PRIX32 "\r\n", message->dataOffset);
216  TRACE_DEBUG(" DataLength = %" PRIu32 "\r\n", message->dataLength);
217  TRACE_DEBUG(" OOBDataOffset = %" PRIu32 "\r\n", message->oobDataOffset);
218  TRACE_DEBUG(" OOBDataLength = %" PRIu32 "\r\n", message->oobDataLength);
219  TRACE_DEBUG(" NumOOBDataElements = %" PRIu32 "\r\n", message->numOobDataElements);
220  TRACE_DEBUG(" PerPacketInfoOffset = 0x%08" PRIX32 "\r\n", message->perPacketInfoOffset);
221  TRACE_DEBUG(" PerPacketInfoLength = %" PRIu32 "\r\n", message->perPacketInfoLength);
222  TRACE_DEBUG(" VcHandle = 0x%08" PRIX32 "\r\n", message->vcHandle);
223  TRACE_DEBUG(" Reserved = 0x%08" PRIX32 "\r\n", message->reserved);
224 
225  //Successful processing
226  return NO_ERROR;
227 }
228 
229 
230 /**
231  * @brief Dump REMOTE_NDIS_INITIALIZE_MSG message
232  * @param[in] message Pointer to the RNDIS message
233  * @param[in] length Length of the message, in bytes
234  * @return Error code
235  **/
236 
238 {
239  //Check the length of the message
240  if(length < sizeof(RndisInitializeMsg))
241  return ERROR_INVALID_LENGTH;
242 
243  //Dump RNDIS message
244  TRACE_DEBUG(" RequestID = 0x%08" PRIX32 "\r\n", message->requestId);
245  TRACE_DEBUG(" MajorVersion = %" PRIu32 "\r\n", message->majorVersion);
246  TRACE_DEBUG(" MinorVersion = %" PRIu32 "\r\n", message->minorVersion);
247  TRACE_DEBUG(" MaxTransferSize = %" PRIu32 "\r\n", message->maxTransferSize);
248 
249  //Successful processing
250  return NO_ERROR;
251 }
252 
253 
254 /**
255  * @brief Dump REMOTE_NDIS_HALT_MSG message
256  * @param[in] message Pointer to the RNDIS message
257  * @param[in] length Length of the message, in bytes
258  * @return Error code
259  **/
260 
262 {
263  //Check the length of the message
264  if(length < sizeof(RndisHaltMsg))
265  return ERROR_INVALID_LENGTH;
266 
267  //Dump RNDIS message
268  TRACE_DEBUG(" RequestID = 0x%08" PRIX32 "\r\n", message->requestId);
269 
270  //Successful processing
271  return NO_ERROR;
272 }
273 
274 
275 /**
276  * @brief Dump REMOTE_NDIS_QUERY_MSG message
277  * @param[in] message Pointer to the RNDIS message
278  * @param[in] length Length of the message, in bytes
279  * @return Error code
280  **/
281 
283 {
284 //Check current trace level
285 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
286  const char_t *label;
287 
288  //Check the length of the message
289  if(length < sizeof(RndisQueryMsg))
290  return ERROR_INVALID_LENGTH;
291 
292  //Retrieve the corresponding OID
293  label = rndisFindName(message->oid,
295 
296  //Dump RNDIS message
297  TRACE_DEBUG(" RequestID = 0x%08" PRIX32 "\r\n", message->requestId);
298  TRACE_DEBUG(" OID = 0x%08" PRIX32 " (%s)\r\n", message->oid, label);
299  TRACE_DEBUG(" InformationBufferLength = %" PRIu32 "\r\n", message->infoBufferLength);
300  TRACE_DEBUG(" InformationBufferOffset = %" PRIu32 "\r\n", message->infoBufferOffset);
301  TRACE_DEBUG(" Reserved = %" PRIu32 "\r\n", message->reserved);
302 
303  //Retrieve the length of the OID input buffer
304  length -= sizeof(RndisQueryMsg);
305 
306  //Any data to dump?
307  if(length > 0)
308  {
309  //Dump the content of the OID input buffer
310  TRACE_DEBUG(" OIDInputBuffer (%" PRIuSIZE " bytes)\r\n", length);
311  TRACE_DEBUG_ARRAY(" ", message->oidInputBuffer, length);
312  }
313 #endif
314 
315  //Successful processing
316  return NO_ERROR;
317 }
318 
319 
320 /**
321  * @brief Dump REMOTE_NDIS_SET_MSG message
322  * @param[in] message Pointer to the RNDIS message
323  * @param[in] length Length of the message, in bytes
324  * @return Error code
325  **/
326 
328 {
329 //Check current trace level
330 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
331  const char_t *label;
332 
333  //Check the length of the message
334  if(length < sizeof(RndisSetMsg))
335  return ERROR_INVALID_LENGTH;
336 
337  //Retrieve the corresponding OID
338  label = rndisFindName(message->oid,
340 
341  //Dump RNDIS message
342  TRACE_DEBUG(" RequestID = 0x%08" PRIX32 "\r\n", message->requestId);
343  TRACE_DEBUG(" OID = 0x%08" PRIX32 " (%s)\r\n", message->oid, label);
344  TRACE_DEBUG(" InformationBufferLength = %" PRIu32 "\r\n", message->infoBufferLength);
345  TRACE_DEBUG(" InformationBufferOffset = %" PRIu32 "\r\n", message->infoBufferOffset);
346  TRACE_DEBUG(" Reserved = %" PRIu32 "\r\n", message->reserved);
347 
348  //Retrieve the length of the OID input buffer
349  length -= sizeof(RndisSetMsg);
350 
351  //Any data to dump?
352  if(length > 0)
353  {
354  //Dump the content of the OID input buffer
355  TRACE_DEBUG(" OIDInputBuffer (%" PRIuSIZE " bytes)\r\n", length);
356  TRACE_DEBUG_ARRAY(" ", message->oidInputBuffer, length);
357  }
358 #endif
359 
360  //Successful processing
361  return NO_ERROR;
362 }
363 
364 
365 /**
366  * @brief Dump REMOTE_NDIS_RESET_MSG message
367  * @param[in] message Pointer to the RNDIS message
368  * @param[in] length Length of the message, in bytes
369  * @return Error code
370  **/
371 
373 {
374  //Check the length of the message
375  if(length < sizeof(RndisResetMsg))
376  return ERROR_INVALID_LENGTH;
377 
378  //Dump RNDIS message
379  TRACE_DEBUG(" Reserved = 0x%08" PRIX32 "\r\n", message->reserved);
380 
381  //Successful processing
382  return NO_ERROR;
383 }
384 
385 
386 /**
387  * @brief Dump REMOTE_NDIS_INDICATE_STATUS_MSG message
388  * @param[in] message Pointer to the RNDIS message
389  * @param[in] length Length of the message, in bytes
390  * @return Error code
391  **/
392 
394 {
395 //Check current trace level
396 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
397  size_t n;
398  const char_t *label;
399 
400  //Check the length of the message
401  if(length < sizeof(RndisIndicateStatusMsg))
402  return ERROR_INVALID_LENGTH;
403 
404  //Retrieve the corresponding status string
405  label = rndisFindName(message->status,
407 
408  //Dump RNDIS message
409  TRACE_DEBUG(" Status = 0x%08" PRIX32 " (%s)\r\n", message->status, label);
410  TRACE_DEBUG(" StatusBufferLength = %" PRIu32 "\r\n", message->statusBufferLength);
411  TRACE_DEBUG(" StatusBufferOffset = %" PRIu32 "\r\n", message->statusBufferOffset);
412 
413  //Calculate the length of the diagnostic information buffer
414  n = length - message->statusBufferLength;
415 
416  //Any data to dump?
417  if(n > 0)
418  {
419  //Dump the content of the diagnostic information buffer
420  TRACE_DEBUG(" DiagnosticInfoBuffer (%" PRIuSIZE " bytes)\r\n", n);
421  //TRACE_DEBUG_ARRAY(" ", message->diagnosticInfoBuffer, n);
422  }
423 
424  //Calculate the length of the status buffer
425  n = message->statusBufferLength;
426 
427  //Any data to dump?
428  if(n > 0)
429  {
430  //Dump the content of the status buffer
431  TRACE_DEBUG(" DiagnosticInfoBuffer (%" PRIuSIZE " bytes)\r\n", n);
432  //TRACE_DEBUG_ARRAY(" ", message->diagnosticInfoBuffer, n);
433  }
434 #endif
435 
436  //Successful processing
437  return NO_ERROR;
438 }
439 
440 
441 /**
442  * @brief Dump REMOTE_NDIS_KEEPALIVE_MSG message
443  * @param[in] message Pointer to the RNDIS message
444  * @param[in] length Length of the message, in bytes
445  * @return Error code
446  **/
447 
449 {
450  //Check the length of the message
451  if(length < sizeof(RndisKeepAliveMsg))
452  return ERROR_INVALID_LENGTH;
453 
454  //Dump RNDIS message
455  TRACE_DEBUG(" RequestID = 0x%08" PRIX32 "\r\n", message->requestId);
456 
457  //Successful processing
458  return NO_ERROR;
459 }
460 
461 
462 /**
463  * @brief Dump REMOTE_NDIS_INITIALIZE_CMPLT message
464  * @param[in] message Pointer to the RNDIS message
465  * @param[in] length Length of the message, in bytes
466  * @return Error code
467  **/
468 
470 {
471 //Check current trace level
472 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
473  const char_t *label;
474 
475  //Check the length of the message
476  if(length < sizeof(RndisInitializeCmplt))
477  return ERROR_INVALID_LENGTH;
478 
479  //Retrieve the corresponding status string
480  label = rndisFindName(message->status,
482 
483  //Dump RNDIS message
484  TRACE_DEBUG(" RequestID = 0x%08" PRIX32 "\r\n", message->requestId);
485  TRACE_DEBUG(" Status = 0x%08" PRIX32 " (%s)\r\n", message->status, label);
486  TRACE_DEBUG(" MajorVersion = %" PRIu32 "\r\n", message->majorVersion);
487  TRACE_DEBUG(" MinorVersion = %" PRIu32 "\r\n", message->minorVersion);
488  TRACE_DEBUG(" DeviceFlags = 0x%08" PRIX32 "\r\n", message->deviceFlags);
489  TRACE_DEBUG(" Medium = 0x%08" PRIX32 "\r\n", message->medium);
490  TRACE_DEBUG(" MaxPacketsPerTransfer = %" PRIu32 "\r\n", message->maxPacketsPerTransfer);
491  TRACE_DEBUG(" MaxTransferSize = %" PRIu32 "\r\n", message->maxTransferSize);
492  TRACE_DEBUG(" PacketAlignmentFactor = %" PRIu32 "\r\n", message->packetAlignmentFactor);
493  TRACE_DEBUG(" AFListOffset = %" PRIu32 "\r\n", message->afListOffset);
494  TRACE_DEBUG(" AFListSize = %" PRIu32 "\r\n", message->afListSize);
495 #endif
496 
497  //Successful processing
498  return NO_ERROR;
499 }
500 
501 
502 /**
503  * @brief Dump REMOTE_NDIS_QUERY_CMPLT message
504  * @param[in] message Pointer to the RNDIS message
505  * @param[in] length Length of the message, in bytes
506  * @return Error code
507  **/
508 
510 {
511 //Check current trace level
512 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
513  const char_t *label;
514 
515  //Check the length of the message
516  if(length < sizeof(RndisQueryCmplt))
517  return ERROR_INVALID_LENGTH;
518 
519  //Retrieve the corresponding status string
520  label = rndisFindName(message->status,
522 
523  //Dump RNDIS message
524  TRACE_DEBUG(" RequestID = 0x%08" PRIX32 "\r\n", message->requestId);
525  TRACE_DEBUG(" Status = 0x%08" PRIX32 " (%s)\r\n", message->status, label);
526  TRACE_DEBUG(" InformationBufferLength = %" PRIu32 "\r\n", message->infoBufferLength);
527  TRACE_DEBUG(" InformationBufferOffset = %" PRIu32 "\r\n", message->infoBufferOffset);
528 
529  //Retrieve the length of the OID input buffer
530  length -= sizeof(RndisQueryCmplt);
531 
532  //Any data to dump?
533  if(length > 0)
534  {
535  //Dump the content of the OID input buffer
536  TRACE_DEBUG(" OIDInputBuffer (%" PRIuSIZE " bytes)\r\n", length);
537  TRACE_DEBUG_ARRAY(" ", message->oidInputBuffer, length);
538  }
539 #endif
540 
541  //Successful processing
542  return NO_ERROR;
543 }
544 
545 
546 /**
547  * @brief Dump REMOTE_NDIS_SET_CMPLT message
548  * @param[in] message Pointer to the RNDIS message
549  * @param[in] length Length of the message, in bytes
550  * @return Error code
551  **/
552 
554 {
555 //Check current trace level
556 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
557  const char_t *label;
558 
559  //Check the length of the message
560  if(length < sizeof(RndisSetCmplt))
561  return ERROR_INVALID_LENGTH;
562 
563  //Retrieve the corresponding status string
564  label = rndisFindName(message->status,
566 
567  //Dump RNDIS message
568  TRACE_DEBUG(" RequestID = 0x%08" PRIX32 "\r\n", message->requestId);
569  TRACE_DEBUG(" Status = 0x%08" PRIX32 " (%s)\r\n", message->status, label);
570 #endif
571 
572  //Successful processing
573  return NO_ERROR;
574 }
575 
576 
577 /**
578  * @brief Dump REMOTE_NDIS_RESET_CMPLT message
579  * @param[in] message Pointer to the RNDIS message
580  * @param[in] length Length of the message, in bytes
581  * @return Error code
582  **/
583 
585 {
586 //Check current trace level
587 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
588  const char_t *label;
589 
590  //Check the length of the message
591  if(length < sizeof(RndisResetCmplt))
592  return ERROR_INVALID_LENGTH;
593 
594  //Retrieve the corresponding status string
595  label = rndisFindName(message->status,
597 
598  //Dump RNDIS message
599  TRACE_DEBUG(" Status = 0x%08" PRIX32 " (%s)\r\n", message->status, label);
600  TRACE_DEBUG(" AddressingReset = 0x%08" PRIX32 "\r\n", message->addressingReset);
601 #endif
602 
603  //Successful processing
604  return NO_ERROR;
605 }
606 
607 
608 /**
609  * @brief Dump REMOTE_NDIS_KEEPALIVE_CMPLT message
610  * @param[in] message Pointer to the RNDIS message
611  * @param[in] length Length of the message, in bytes
612  * @return Error code
613  **/
614 
616 {
617 //Check current trace level
618 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
619  const char_t *label;
620 
621  //Check the length of the message
622  if(length < sizeof(RndisKeepAliveCmplt))
623  return ERROR_INVALID_LENGTH;
624 
625  //Retrieve the corresponding status string
626  label = rndisFindName(message->status,
628 
629  //Dump RNDIS message
630  TRACE_DEBUG(" RequestID = 0x%08" PRIX32 "\r\n", message->requestId);
631  TRACE_DEBUG(" Status = 0x%08" PRIX32 " (%s)\r\n", message->status, label);
632 #endif
633 
634  //Successful processing
635  return NO_ERROR;
636 }
637 
638 
639 /**
640  * @brief Helper function
641  * @param[in] value 32-bit value
642  * @param[in] table Look-up table
643  * @param[in] size Number of entries in the look-up table
644  * @return Pointer to the matching name, if any
645  **/
646 
647 const char_t *rndisFindName(uint32_t value, const RndisValueName *table, size_t size)
648 {
649  //Local variables
650  size_t i;
651 
652  //Default name
653  static const char_t defaultName[] = "Unknown";
654 
655  //Loop through the look-up table
656  for(i = 0; i < size; i++)
657  {
658  //Compare values
659  if(table[i].value == value)
660  {
661  //Return a pointer to the corresponding name
662  return table[i].name;
663  }
664  }
665 
666  //No matching entry...
667  return defaultName;
668 }
error_t rndisDumpPacketMsg(const RndisPacketMsg *message, size_t length)
Dump REMOTE_NDIS_PACKET_MSG message.
Definition: rndis_debug.c:208
RNDIS (Remote Network Driver Interface Specification)
error_t rndisDumpResetMsg(const RndisResetMsg *message, size_t length)
Dump REMOTE_NDIS_RESET_MSG message.
Definition: rndis_debug.c:372
error_t rndisDumpKeepAliveCmplt(const RndisKeepAliveCmplt *message, size_t length)
Dump REMOTE_NDIS_KEEPALIVE_CMPLT message.
Definition: rndis_debug.c:615
RNDIS Query message.
Definition: rndis.h:234
RNDIS Indicate Status message.
Definition: rndis.h:280
char char_t
Definition: compiler_port.h:41
#define RNDIS_INDICATE_STATUS_MSG
Definition: rndis.h:54
error_t rndisDumpSetCmplt(const RndisSetCmplt *message, size_t length)
Dump REMOTE_NDIS_SET_CMPLT message.
Definition: rndis_debug.c:553
Generic RNDIS message.
Definition: rndis.h:196
Response to a RNDIS Initialize message.
Definition: rndis.h:318
Debugging facilities.
error_t rndisDumpInitializeCmplt(const RndisInitializeCmplt *message, size_t length)
Dump REMOTE_NDIS_INITIALIZE_CMPLT message.
Definition: rndis_debug.c:469
const RndisValueName rndisOidLabel[]
Definition: rndis_debug.c:65
RNDIS Packet message.
Definition: rndis.h:395
uint8_t message[]
Definition: chap.h:150
error_t rndisDumpQueryCmplt(const RndisQueryCmplt *message, size_t length)
Dump REMOTE_NDIS_QUERY_CMPLT message.
Definition: rndis_debug.c:509
Response to a RNDIS Query message.
Definition: rndis.h:340
#define RNDIS_KEEPALIVE_MSG
Definition: rndis.h:55
RNDIS Keep-Alive message.
Definition: rndis.h:306
#define RNDIS_QUERY_CMPLT
Definition: rndis.h:49
error_t rndisDumpHaltMsg(const RndisHaltMsg *message, size_t length)
Dump REMOTE_NDIS_HALT_MSG message.
Definition: rndis_debug.c:261
RNDIS Initialize message.
Definition: rndis.h:207
error_t rndisDumpSetMsg(const RndisSetMsg *message, size_t length)
Dump REMOTE_NDIS_SET_MSG message.
Definition: rndis_debug.c:327
#define arraysize(a)
Definition: os_port.h:68
#define RNDIS_RESET_MSG
Definition: rndis.h:52
error_t rndisDumpKeepAliveMsg(const RndisKeepAliveMsg *message, size_t length)
Dump REMOTE_NDIS_KEEPALIVE_MSG message.
Definition: rndis_debug.c:448
Value/name pair.
Definition: rndis_debug.h:30
#define RNDIS_RESET_CMPLT
Definition: rndis.h:53
error_t rndisDumpQueryMsg(const RndisQueryMsg *message, size_t length)
Dump REMOTE_NDIS_QUERY_MSG message.
Definition: rndis_debug.c:282
#define RNDIS_SET_CMPLT
Definition: rndis.h:51
const char_t * rndisFindName(uint32_t value, const RndisValueName *table, size_t size)
Helper function.
Definition: rndis_debug.c:647
#define RNDIS_INITIALIZE_MSG
Definition: rndis.h:45
RNDIS Reset message.
Definition: rndis.h:268
RTOS abstraction layer.
const char_t * name
Definition: rndis_debug.h:33
#define RNDIS_QUERY_MSG
Definition: rndis.h:48
RNDIS Set message.
Definition: rndis.h:251
Response to a RNDIS Keep-Alive message.
Definition: rndis.h:382
const RndisValueName rndisMsgLabel[]
Definition: rndis_debug.c:36
error_t rndisDumpInitializeMsg(const RndisInitializeMsg *message, size_t length)
Dump REMOTE_NDIS_INITIALIZE_MSG message.
Definition: rndis_debug.c:237
#define RNDIS_KEEPALIVE_CMPLT
Definition: rndis.h:56
#define TRACE_DEBUG_ARRAY(p, a, n)
Definition: rndis_debug.c:32
Success.
Definition: error.h:42
error_t rndisDumpResetCmplt(const RndisResetCmplt *message, size_t length)
Dump REMOTE_NDIS_RESET_CMPLT message.
Definition: rndis_debug.c:584
error_t
Error codes.
Definition: error.h:40
#define RNDIS_SET_MSG
Definition: rndis.h:50
#define PRIuSIZE
Definition: compiler_port.h:72
#define RNDIS_INITIALIZE_CMPLT
Definition: rndis.h:46
error_t rndisDumpMsg(const RndisMsg *message, size_t length)
Dump RNDIS message for debugging purpose.
Definition: rndis_debug.c:112
Response to a RNDIS Reset message.
Definition: rndis.h:369
Response to a RNDIS Set message.
Definition: rndis.h:356
uint8_t value[]
Definition: dtls_misc.h:141
RNDIS Halt message.
Definition: rndis.h:222
#define RNDIS_PACKET_MSG
Definition: rndis.h:44
error_t rndisDumpIndicateStatusMsg(const RndisIndicateStatusMsg *message, size_t length)
Dump REMOTE_NDIS_INDICATE_STATUS_MSG message.
Definition: rndis_debug.c:393
const RndisValueName rndisStatusLabel[]
Definition: rndis_debug.c:54
uint8_t length
Definition: dtls_misc.h:140
uint8_t n
#define TRACE_DEBUG(...)
Definition: rndis_debug.c:30
#define RNDIS_HALT_MSG
Definition: rndis.h:47