RDK Documentation (Open Sourced RDK Components)
librmh_api_wrap_generic_only.c
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 #include <sys/ioctl.h>
21 #include <sys/sysinfo.h>
22 #include <net/if.h>
23 #include <ctype.h>
24 #include <string.h>
25 #include "librmh.h"
26 #include "rdk_moca_hal.h"
27 #include "rfcapi.h"
28 
29 #define RDK_FILE_PATH_VERSION "/version.txt"
30 #define RDK_FILE_PATH_DEBUG_ENABLE "/opt/rmh_start_enable_debug"
31 #define RDK_FILE_PATH_DEBUG_FOREVER_ENABLE "/opt/rmh_start_enable_debug_forever"
32 #define RDK_RFC_FILE "/etc/rfc.properties"
33 
34 #define LOCAL_MODULATION_PRINT_LINE_SIZE 256
35 
36 static
37 RMH_Result pRMH_IOCTL_Get(const RMH_Handle handle, const char* name, struct ifreq *ifrq) {
38  int fd = -1, rc = 0;
39  RMH_Result ret=RMH_SUCCESS;
40 
41  BRMH_RETURN_IF(!name, RMH_INVALID_PARAM)
42  BRMH_RETURN_IF((fd = socket(PF_INET6, SOCK_DGRAM, 0)) < 0, RMH_FAILURE);
43 
44  strncpy(ifrq->ifr_name, name, sizeof(ifrq->ifr_name));
45  ifrq->ifr_name[ sizeof(ifrq->ifr_name)-1 ] = 0;
46  rc = ioctl(fd, SIOCGIFFLAGS, ifrq);
47  if (rc < 0) {
48  RMH_PrintErr("ioctl SIOCGIFFLAGS returned %d!", rc);
49  return RMH_FAILURE;
50  }
51 
52  close(fd);
53  return ret;
54 }
55 
56 static
57 RMH_Result pRMH_IOCTL_Set(const RMH_Handle handle, struct ifreq *ifrq) {
58  int fd = -1, rc = 0;
59  RMH_Result ret=RMH_SUCCESS;
60 
61  BRMH_RETURN_IF((fd = socket(PF_INET6, SOCK_DGRAM, 0)) < 0, RMH_FAILURE);
62  rc = ioctl(fd, SIOCSIFFLAGS, ifrq);
63  if (rc < 0) {
64  RMH_PrintErr("ioctl SIOCSIFFLAGS returned %d!", rc);
65  return RMH_FAILURE;
66  }
67 
68  close(fd);
69  return ret;
70 }
71 
72 static
73 RMH_Result pRMH_FindTagList(const RMH_Handle handle, const char * tag, RMH_APIList **apiList) {
74  int i;
75 
76  /*Skip whitespace */
77  while( tag[0] != '\0' && tag[0] == ' ' ) tag++;
78 
79  if (strlen(tag) > 0) {
80  for(i=0; i != hRMHGeneric_APITags.tagListSize; i++) {
81  if (strcasecmp(tag, hRMHGeneric_APITags.tagList[i].apiListName) == 0) {
82  *apiList=&hRMHGeneric_APITags.tagList[i];
83  return RMH_SUCCESS;
84  }
85  }
86  if (hRMHGeneric_APITags.tagListSize < RMH_MAX_NUM_TAGS) {
87  *apiList=&hRMHGeneric_APITags.tagList[hRMHGeneric_APITags.tagListSize++];
88  (*apiList)->apiListSize=0;
89  strncpy((*apiList)->apiListName, tag, sizeof((*apiList)->apiListName));
90  (*apiList)->apiListName[0]=toupper((*apiList)->apiListName[0]);
91  RMH_PrintDbg("New tag '%s' add. Total tags:%d\n", (*apiList)->apiListName, hRMHGeneric_APITags.tagListSize);
92  return RMH_SUCCESS;
93  }
94  RMH_PrintWrn("Unable to find an existing tag '%s' and no more new tags are available. This will be dropped.\n", tag);
95  }
96  return RMH_FAILURE;
97 }
98 
99 static
100 int pRMH_TagCompare(const void* a, const void* b) {
101  const RMH_APIList _a=* (RMH_APIList const *)a;
102  const RMH_APIList _b=* (RMH_APIList const *)b;
103  return strcasecmp(_a.apiListName, _b.apiListName);
104 }
105 
106 RMH_Result pRMH_RFC_GetBool(const RMH_Handle handle, const char*name, bool *value) {
107  RFC_ParamData_t rfcParam;
108  WDMP_STATUS wdmpStatus;
109 
110  wdmpStatus = getRFCParameter("RMH", name, &rfcParam);
111  if (wdmpStatus != WDMP_SUCCESS) {
112  if (wdmpStatus != WDMP_ERR_VALUE_IS_EMPTY) {
113  RMH_PrintErr("Failed reading from RFC -- %s -- Returned error '%s' (%u)\n", rfcParam.name, getRFCErrorString(wdmpStatus), wdmpStatus);
114  }
115  return RMH_FAILURE;
116  }
117 
118  /* There are cases where RFC type might not be set correctly. To be sure of our value We'll explictly test both values. */
119  if (0 == strcasecmp(rfcParam.value, "TRUE")) {
120  *value=true;
121  }
122  else if (0 == strcasecmp(rfcParam.value, "FALSE")) {
123  *value=false;
124  }
125  else {
126  RMH_PrintErr("Unexpected value reading from RFC -- %s -- Returned '%s' which is type %u. Expecting type WDMP_BOOLEAN(%u)\n", rfcParam.name, rfcParam.value, getRFCErrorString(wdmpStatus), rfcParam.type, WDMP_BOOLEAN);
127  return RMH_FAILURE;
128  }
129 
130  return RMH_SUCCESS;
131 }
132 
133 RMH_Result GENERIC_IMPL__RMH_Self_RestoreRDKDefaultSettings(const RMH_Handle handle) {
134  bool started;
135  bool rfcBool;
136  int nodeId;
137 
138  BRMH_RETURN_IF_FAILED(RMH_Self_GetEnabled(handle, &started));
139  if (started) {
140  RMH_PrintErr("MoCA must be stopped before setting RDK defaults\n");
141  return RMH_INVALID_INTERNAL_STATE;
142  }
143 
144  /* Return MoCA default settings */
145  BRMH_RETURN_IF_FAILED(RMH_Self_RestoreDefaultSettings(handle));
146 
147  /***** Setup debug ***********************/
148  if (RMH_Log_SetDriverLevel(handle, RMH_LOG_DEFAULT) != RMH_SUCCESS) {
149  RMH_PrintWrn("Unable to set default log level!\n");
150  }
151 
152  if (access(RDK_FILE_PATH_DEBUG_FOREVER_ENABLE, F_OK ) != -1) {
153  char logFileName[1024];
154  if (RMH_Log_CreateDriverFile(handle, logFileName, sizeof(logFileName)) != RMH_SUCCESS) {
155  RMH_PrintWrn("Unable to create dedicated log file!\n");
156  }
157  else if (RMH_Log_SetDriverFilename(handle, logFileName) != RMH_SUCCESS) {
158  RMH_PrintWrn("Unable to start logging in %s!\n", logFileName);
159  }
160  else if (RMH_Log_SetDriverLevel(handle, RMH_LOG_DEFAULT | RMH_LOG_DEBUG) != RMH_SUCCESS) {
161  RMH_PrintWrn("Failed to enable RMH_LOG_DEBUG!\n");
162  }
163  else {
164  RMH_PrintMsg("Setting debug logging enabled to file %s\n", logFileName);
165  }
166  }
167  else if (access(RDK_FILE_PATH_DEBUG_ENABLE, F_OK ) != -1) {
168  if (RMH_Log_SetDriverLevel(handle, RMH_LOG_DEFAULT | RMH_LOG_DEBUG) != RMH_SUCCESS) {
169  RMH_PrintWrn("Unable to enable debug!\n");
170  }
171  else {
172  RMH_PrintMsg("Setting debug logging enabled\n");
173  }
174  }
175 
176  /***** Setup device configuration ***********************/
177 #ifdef RMH_START_DEFAULT_SINGLE_CHANEL
178  RMH_PrintMsg("Setting RMH_Self_SetLOF: %d\n", RMH_START_DEFAULT_SINGLE_CHANEL);
179  BRMH_RETURN_IF_FAILED(RMH_Self_SetScanLOFOnly(handle, true));
180  BRMH_RETURN_IF_FAILED(RMH_Self_SetLOF(handle, RMH_START_DEFAULT_SINGLE_CHANEL));
181 #endif
182 
183 #ifdef RMH_START_DEFAULT_POWER_REDUCTION
184  RMH_PrintMsg("Setting RMH_Power_SetTxBeaconPowerReduction: %d\n", RMH_START_DEFAULT_POWER_REDUCTION);
185  BRMH_RETURN_IF_FAILED(RMH_Power_SetTxBeaconPowerReductionEnabled(handle, true));
186  BRMH_RETURN_IF_FAILED(RMH_Power_SetTxBeaconPowerReduction(handle, RMH_START_DEFAULT_POWER_REDUCTION));
187 #endif
188 
189 #if defined RMH_START_DEFAULT_TABOO_START_CHANNEL && defined RMH_START_DEFAULT_TABOO_MASK
190  RMH_PrintMsg("Setting RMH_Self_SetTabooChannels: Start:%d Channel Mask:0x%08x\n", RMH_START_DEFAULT_TABOO_START_CHANNEL, RMH_START_DEFAULT_TABOO_MASK);
191  BRMH_RETURN_IF_FAILED(RMH_Self_SetTabooChannels(handle, RMH_START_DEFAULT_TABOO_START_CHANNEL, RMH_START_DEFAULT_TABOO_MASK));
192 #endif
193 
194  if (RMH_SUCCESS == pRMH_RFC_GetBool(handle, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.PNC.Enable", &rfcBool)) {
195  /* RFC has an override for this value */
196  RMH_PrintMsg("[**RFC OVERRIDE**] Setting RMH_Self_SetPreferredNCEnabled: %s\n", rfcBool ? "TRUE" : "FALSE");
197  BRMH_RETURN_IF_FAILED(RMH_Self_SetPreferredNCEnabled(handle, rfcBool));
198  }
199  else {
200  /* Set the value based on compiled defaults. */
201 #ifdef RMH_START_DEFAULT_PREFERRED_NC
202  RMH_PrintMsg("Setting RMH_Self_SetPreferredNCEnabled: %s\n", RMH_START_DEFAULT_PREFERRED_NC ? "TRUE" : "FALSE");
203  BRMH_RETURN_IF_FAILED(RMH_Self_SetPreferredNCEnabled(handle, RMH_START_DEFAULT_PREFERRED_NC));
204 #endif
205  }
206 
207 #if RMH_START_SET_MAC_FROM_PROC
208  if (RMH_START_SET_MAC_FROM_PROC) {
209  char ethName[18];
210  unsigned char mac[6];
211  char ifacePath[128];
212  char macString[32];
213  uint32_t macValsRead;
214  FILE *file;
215  BRMH_RETURN_IF_FAILED(RMH_Interface_GetName(handle, ethName, sizeof(ethName)));
216  sprintf(ifacePath, "/sys/class/net/%s/address", ethName);
217  file = fopen( ifacePath, "r");
218  BRMH_RETURN_IF(file == NULL, RMH_FAILURE);
219  macValsRead=fscanf(file, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]);
220  BRMH_RETURN_IF(macValsRead != 6, RMH_FAILURE);
221  fclose(file);
222  RMH_PrintMsg("Setting RMH_Interface_SetMac[%s]: %s\n", ethName, RMH_MacToString(mac, macString, sizeof(macString)));
223  BRMH_RETURN_IF_FAILED(RMH_Interface_SetMac(handle, mac));
224  }
225 #endif
226 
227  /* BCOM-2548: Force MoCA to remain active when the box goes to standby. This will cost some power savings but is needed
228  to work around an interop issue on the Cisco Xb3. When that device is the NC of a mixed mode network it
229  seems to have issues with a node going to standby */
230  RMH_Power_SetStandbyMode(handle, RMH_POWER_MODE_M0_ACTIVE);
231 
232  /* BCOM-5271: In an effort to keep the MoCA like from going down under high interference conditions, we're limiting the
233  GCD bits from 10 to 6. The goal here is not to fix the issue but just to help keep the link stable */
234  for(nodeId=0; nodeId != RMH_MAX_MOCA_NODES; nodeId++) {
235  RMH_RemoteNode_SetMaxConstellation_GCD100(handle, nodeId, 6);
236  }
237 
238  return RMH_SUCCESS;
239 }
240 
241 RMH_Result GENERIC_IMPL__RMH_Log_CreateDriverFile(const RMH_Handle handle, char* responseBuf, const size_t responseBufSize) {
242  uint8_t mac[6];
243  char line[1024];
244  int i;
245  struct tm* tm_info;
246  struct timeval tv;
247  FILE *logFile;
248  FILE *verFile;
249  int filenameLength;
250 
251  gettimeofday(&tv, NULL);
252  tm_info = localtime(&tv.tv_sec);
253 
254  if (RMH_Interface_GetMac(handle, &mac) != RMH_SUCCESS) {
255  memset(mac, 0, sizeof(mac));
256  }
257 
258  filenameLength=snprintf(responseBuf, responseBufSize, "/opt/rmh_moca_log_%s_MAC_%02X-%02X-%02X-%02X-%02X-%02X_TIME_%02d.%02d.%02d_%02d-%02d-%02d.log",
259 #ifdef MACHINE_NAME
260  MACHINE_NAME,
261 #else
262  "unknown",
263 #endif
264  mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
265  tm_info->tm_year + 1900, tm_info->tm_mon + 1, tm_info->tm_mday, tm_info->tm_hour, tm_info->tm_min, tm_info->tm_sec);
266 
267  BRMH_RETURN_IF(filenameLength<0, RMH_FAILURE);
268  BRMH_RETURN_IF(filenameLength>=responseBufSize, RMH_INSUFFICIENT_SPACE);
269 
270  logFile=fopen(responseBuf, "w");
271  if (logFile == NULL) {
272  RMH_PrintErr("Unable to open %s for writing!\n", responseBuf);
273  return RMH_FAILURE;
274  }
275  verFile=fopen(RDK_FILE_PATH_VERSION, "r");
276  if (verFile == NULL) {
277  RMH_PrintWrn("Unable to open %s for reading!. Cannot add version information\n", RDK_FILE_PATH_VERSION);
278  }
279  else {
280  fprintf(logFile, "= Device Version information =================================================================================\n");
281  for(i=0; i<10; i++) {
282  if (fgets(line, sizeof(line), verFile) == NULL)
283  break;
284  fputs(line, logFile);
285  }
286  fprintf(logFile, "\n\n");
287  fclose(verFile);
288  }
289  fclose(logFile);
290 
291  if (RMH_Log_PrintStatus(handle, responseBuf) != RMH_SUCCESS) {
292  RMH_PrintWrn("Failed to dump the status summary in file -- %s\n", responseBuf);
293  }
294 
295  return RMH_SUCCESS;
296 }
297 
298 /* Return the maximum egress bandwith from all nodes on the network */
299 RMH_Result GENERIC_IMPL__RMH_PQoS_GetMaxEgressBandwidth(const RMH_Handle handle, uint32_t* response) {
300  RMH_NodeList_Uint32_t remoteNodes;
301  uint32_t nodeResponse;
302  uint32_t nodeId;
303  RMH_Result ret = RMH_FAILURE;
304 
305  *response=0;
306  BRMH_RETURN_IF_FAILED(RMH_Network_GetRemoteNodeIds(handle, &remoteNodes));
307  for (nodeId = 0; nodeId < RMH_MAX_MOCA_NODES; nodeId++) {
308  if (remoteNodes.nodePresent[nodeId]) {
309  if (RMH_PQoS_GetEgressBandwidth(handle, nodeId, &nodeResponse) == RMH_SUCCESS) {
310  if (nodeResponse > *response) {
311  *response = nodeResponse;
312  ret=RMH_SUCCESS;
313  }
314  }
315  else {
316  RMH_PrintWrn("Failed to get info for node Id %u!", nodeId);
317  }
318  }
319  }
320 
321  return ret;
322 }
323 
324 /* Return the minumum egress bandwith from all nodes on the network */
325 RMH_Result GENERIC_IMPL__RMH_PQoS_GetMinEgressBandwidth(const RMH_Handle handle, uint32_t* response) {
326  RMH_NodeList_Uint32_t remoteNodes;
327  uint32_t nodeResponse;
328  uint32_t nodeId;
329  RMH_Result ret = RMH_FAILURE;
330 
331  *response=0xFFFFFFFF;
332  BRMH_RETURN_IF_FAILED(RMH_Network_GetRemoteNodeIds(handle, &remoteNodes));
333  for (nodeId = 0; nodeId < RMH_MAX_MOCA_NODES; nodeId++) {
334  if (remoteNodes.nodePresent[nodeId]) {
335  if (RMH_PQoS_GetEgressBandwidth(handle, nodeId, &nodeResponse) == RMH_SUCCESS) {
336  if (nodeResponse < *response) {
337  *response = nodeResponse;
338  ret=RMH_SUCCESS;
339  }
340  }
341  else {
342  RMH_PrintWrn("Failed to get info for node Id %u!\n", nodeId);
343  }
344  }
345  }
346 
347  return ret;
348 }
349 
350 RMH_Result GENERIC_IMPL__RMH_Interface_GetEnabled(const RMH_Handle handle, bool *response) {
351  char ethName[18];
352  struct ifreq ifrq;
353 
354  BRMH_RETURN_IF(handle==NULL, RMH_INVALID_PARAM);
355  BRMH_RETURN_IF(response==NULL, RMH_INVALID_PARAM);
356  BRMH_RETURN_IF_FAILED(RMH_Interface_GetName(handle, ethName, sizeof(ethName)));
357  BRMH_RETURN_IF(pRMH_IOCTL_Get(handle, ethName, &ifrq) != RMH_SUCCESS, RMH_FAILURE);
358  if ((ifrq.ifr_flags & IFF_UP) &&
359  (ifrq.ifr_flags & IFF_RUNNING)) {
360  *response = true;
361  }
362  else {
363  *response = false;
364  }
365  return RMH_SUCCESS;
366 }
367 
368 RMH_Result GENERIC_IMPL__RMH_Interface_SetEnabled(const RMH_Handle handle, const bool value) {
369  char ethName[18];
370  struct ifreq ifrq;
371  bool selectedValue;
372 
373  BRMH_RETURN_IF(handle==NULL, RMH_INVALID_PARAM);
374  BRMH_RETURN_IF_FAILED(RMH_Interface_GetName(handle, ethName, sizeof(ethName)));
375  BRMH_RETURN_IF(pRMH_IOCTL_Get(handle, ethName, &ifrq) != RMH_SUCCESS, RMH_FAILURE);
376  if (value)
377  ifrq.ifr_flags |= IFF_UP|IFF_RUNNING;
378  else
379  ifrq.ifr_flags &= ~(IFF_UP|IFF_RUNNING);
380 
381  BRMH_RETURN_IF(pRMH_IOCTL_Set(handle, &ifrq) != RMH_SUCCESS, RMH_FAILURE);
382 
383  RMH_Interface_GetEnabled(handle, &selectedValue);
384  return (selectedValue==value) ? RMH_SUCCESS : RMH_FAILURE;
385 }
386 
387 RMH_Result GENERIC_IMPL__RMH_Self_GetLinkStatus(const RMH_Handle handle, RMH_LinkStatus* response) {
388  bool linkUp;
389  bool selfEnabled;
390  bool ifEnabled;
391 
392  BRMH_RETURN_IF(handle==NULL, RMH_INVALID_PARAM);
393  BRMH_RETURN_IF(response==NULL, RMH_INVALID_PARAM);
394 
395  BRMH_RETURN_IF_FAILED(RMH_Self_GetEnabled(handle, &selfEnabled));
396  if (!selfEnabled) {
397  *response=RMH_LINK_STATUS_DISABLED;
398  return RMH_SUCCESS;
399  }
400 
401  BRMH_RETURN_IF_FAILED(RMH_Self_GetMoCALinkUp(handle, &linkUp));
402  if (!linkUp) {
403  *response=RMH_LINK_STATUS_NO_LINK;
404  return RMH_SUCCESS;
405  }
406 
407  BRMH_RETURN_IF_FAILED(RMH_Interface_GetEnabled(handle, &ifEnabled));
408  if (!ifEnabled) {
409  *response=RMH_LINK_STATUS_INTERFACE_DOWN;
410  return RMH_SUCCESS;
411  }
412 
413  *response=RMH_LINK_STATUS_UP;
414  return RMH_SUCCESS;
415 }
416 
417 static inline
418 uint32_t PrintModulationToString(char *outBuf, uint32_t outBufSize, const bool firstPrint, const RMH_SubcarrierProfile* array, const size_t arraySize, const uint32_t end, int32_t *start, bool *done) {
419  int32_t j;
420  int32_t pos=*start;
421  int32_t offset = pos < end ? 1 : -1;
422  int32_t outBufRemaining=outBufSize;
423  bool disablePrint=false;
424  int charsToBeWritten;
425 
426  if (firstPrint) {
427  charsToBeWritten = snprintf(outBuf, outBufRemaining, " | [%3u-%3u] | ", pos, pos+(31*offset));
428  /* Update the remaining space in the buffer */
429  if (charsToBeWritten < 0 || charsToBeWritten >= outBufRemaining) charsToBeWritten=outBufRemaining;
430  outBuf += charsToBeWritten;
431  outBufRemaining -= charsToBeWritten;
432  }
433 
434  for (j=0; j<32; j++) {
435  /* If the index is out of bounds or we've reached the end, stop printing */
436  if (*done || pos >= arraySize || pos < 0) disablePrint=true;
437 
438  /* If printing is disabled still print a space to keep columns in order */
439  charsToBeWritten = disablePrint ? snprintf(outBuf, outBufRemaining, " ") :
440  snprintf(outBuf, outBufRemaining, "%X", array[pos]);
441 
442  /* Update the remaining space in the buffer */
443  if (charsToBeWritten < 0 || charsToBeWritten >= outBufRemaining) charsToBeWritten=outBufRemaining;
444  outBuf += charsToBeWritten;
445  outBufRemaining -= charsToBeWritten;
446 
447  /* Check if we've reached the 'end'. This variable is enclusive so check after the print. */
448  if (pos == end) *done=true;
449  if (!*done) pos+=offset;
450  }
451 
452  charsToBeWritten = snprintf(outBuf, outBufRemaining, " | ");
453  /* Update the remaining space in the buffer */
454  if (charsToBeWritten < 0 || charsToBeWritten >= outBufRemaining) charsToBeWritten=outBufRemaining;
455  outBuf += charsToBeWritten;
456  outBufRemaining -= charsToBeWritten;
457 
458  *start=pos;
459  return outBufSize - outBufRemaining;
460 }
461 
462 static
463 RMH_Result RMH_Print_MODULATION(const RMH_Handle handle, const uint32_t start, const uint32_t end,
464  const char*h0, const RMH_SubcarrierProfile* p0, const size_t p0Size,
465  const char*h1, const RMH_SubcarrierProfile* p1, const size_t p1Size,
466  const char*h2, const RMH_SubcarrierProfile* p2, const size_t p2Size,
467  const char*h3, const RMH_SubcarrierProfile* p3, const size_t p3Size) {
468  char line[LOCAL_MODULATION_PRINT_LINE_SIZE];
469  const char *lineEnd=line + LOCAL_MODULATION_PRINT_LINE_SIZE;
470 
471  #define MAX_COLS 4
472  int32_t i[MAX_COLS];
473  bool done[MAX_COLS];
474  bool valid[MAX_COLS];
475  const char* printHeader[MAX_COLS];
476  uint32_t printHeaderLen[MAX_COLS];
477  bool complete=false;
478  uint32_t headerLength = 0;
479  int j;
480 
481  valid[0] = (p0 != NULL && p0Size >0);
482  valid[1] = (p1 != NULL && p1Size >0);
483  valid[2] = (p2 != NULL && p2Size >0);
484  valid[3] = (p3 != NULL && p3Size >0);
485  printHeader[0] = (h0 != NULL && valid[0]) ? h0 : "";
486  printHeader[1] = (h1 != NULL && valid[1]) ? h1 : "";
487  printHeader[2] = (h2 != NULL && valid[2]) ? h2 : "";
488  printHeader[3] = (h3 != NULL && valid[3]) ? h3 : "";
489  printHeaderLen[0] = strlen(printHeader[0]);
490  printHeaderLen[1] = strlen(printHeader[1]);
491  printHeaderLen[2] = strlen(printHeader[2]);
492  printHeaderLen[3] = strlen(printHeader[3]);
493 
494  for(j=0; j != MAX_COLS; j++) {
495  i[j]=start;
496  done[j]=false;
497  headerLength += printHeaderLen[j];
498  }
499 
500  if (headerLength > 0) {
501  RMH_PrintMsg(" | Subcarrier | ");
502  for(j=0; j != MAX_COLS; j++) {
503  if (printHeaderLen[j] > 0) {
504  RMH_PrintMsg("%-34s | ", printHeader[j]);
505  }
506  }
507 
508  RMH_PrintMsg("\n -------------|%s%s%s%s\n",
509  (printHeaderLen[0] > 0) ? "------------------------------------|" : "",
510  (printHeaderLen[1] > 0) ? "------------------------------------|" : "",
511  (printHeaderLen[2] > 0) ? "------------------------------------|" : "",
512  (printHeaderLen[3] > 0) ? "------------------------------------|" : "");
513  }
514 
515  while(!complete) {
516  char *linePos=line;
517  uint32_t lineRemaining=LOCAL_MODULATION_PRINT_LINE_SIZE-1; /* -1 for NULL terminator */
518  complete=true;
519 
520  if (valid[0]) {
521  linePos+=PrintModulationToString(linePos, lineRemaining, true, p0, p0Size, end, &i[0], &done[0]);
522  lineRemaining=linePos>lineEnd ? 0 : lineEnd-linePos;
523  complete&=done[0];
524  }
525 
526  if (valid[1]) {
527  linePos+=PrintModulationToString(linePos, lineRemaining, false, p1, p1Size, end, &i[1], &done[1]);
528  lineRemaining=linePos>lineEnd ? 0 : lineEnd-linePos;
529  complete&=done[1];
530  }
531 
532  if (valid[2]) {
533  linePos+=PrintModulationToString(linePos, lineRemaining, false, p2, p2Size, end, &i[2], &done[2]);
534  lineRemaining=linePos>lineEnd ? 0 : lineEnd-linePos;
535  complete&=done[2];
536  }
537 
538  if (valid[3]) {
539  linePos+=PrintModulationToString(linePos, lineRemaining, false, p3, p3Size, end, &i[3], &done[3]);
540  lineRemaining=linePos>lineEnd ? 0 : lineEnd-linePos;
541  complete&=done[3];
542  }
543 
544  RMH_PrintMsg("%s\n", line);
545  }
546  return RMH_SUCCESS;
547 }
548 
549 static
550 RMH_Result RMHApp__OUT_UINT32_NODELIST(const RMH_Handle handle, RMH_Result (*api)(const RMH_Handle handle, RMH_NodeList_Uint32_t* response)) {
551  RMH_NodeList_Uint32_t response;
552 
553  RMH_Result ret = api(handle, &response);
554  if (ret == RMH_SUCCESS) {
555  int i;
556  for (i = 0; i < RMH_MAX_MOCA_NODES; i++) {
557  if (response.nodePresent[i]) {
558  RMH_PrintMsg(" Node %02u: %u\n", i, response.nodeValue[i]);
559  }
560  }
561  }
562  return ret;
563 }
564 
565 static
566 RMH_Result RMH_Print_UINT32_NODEMESH(const RMH_Handle handle, RMH_Result (*api)(const RMH_Handle handle, RMH_NodeMesh_Uint32_t* response)) {
567  RMH_NodeMesh_Uint32_t response;
568  int i,j;
569 
570  RMH_Result ret = api(handle, &response);
571  if (ret == RMH_SUCCESS) {
572  char strBegin[256];
573  char *strEnd=strBegin+sizeof(strBegin);
574  char *str=strBegin;
575 
576  str+=snprintf(str, strEnd-str, " ");
577  for (i = 0; i < RMH_MAX_MOCA_NODES; i++) {
578  if (response.nodePresent[i]) {
579  str+=snprintf(str, strEnd-str, " %02u ", i);
580  }
581  }
582  RMH_PrintMsg("%s\n", strBegin);
583 
584  for (i = 0; i < RMH_MAX_MOCA_NODES; i++) {
585  if (response.nodePresent[i]) {
586  char *str=strBegin;
587  RMH_NodeList_Uint32_t *nl = &response.nodeValue[i];
588  str+=snprintf(str, strEnd-str, "%02u: ", i);
589  for (j = 0; j < RMH_MAX_MOCA_NODES; j++) {
590  if (i == j) {
591  str+=snprintf(str, strEnd-str, " -- ");
592  } else if (response.nodePresent[j]) {
593  str+=snprintf(str, strEnd-str, "%04u ", nl->nodeValue[j]);
594  }
595  }
596  RMH_PrintMsg("%s\n", strBegin);
597  }
598  }
599  }
600  else {
601  RMH_PrintMsg("%s\n", RMH_ResultToString(ret));
602  }
603 
604  return ret;
605 }
606 
607 #define PRINT_STATUS_MACRO(api, type, apiFunc, fmt, ...) { \
608  type; \
609  ret = apiFunc; \
610  if (ret == RMH_SUCCESS) { RMH_PrintMsg("%-50s: " fmt "\n", #api, ##__VA_ARGS__); } \
611  else { RMH_PrintMsg("%-50s: %s\n", #api, RMH_ResultToString(ret)); } \
612 }
613 #define PRINT_STATUS_BOOL(api) PRINT_STATUS_MACRO(api, bool response, api(handle, &response), "%s", response ? "TRUE" : "FALSE");
614 #define PRINT_STATUS_BOOL_RN(api, i) PRINT_STATUS_MACRO(api, bool response, api(handle, i, &response), "%s", response ? "TRUE" : "FALSE");
615 #define PRINT_STATUS_UINT32(api) PRINT_STATUS_MACRO(api, uint32_t response, api(handle, &response), "%u", response);
616 #define PRINT_STATUS_UINT32_RN(api, i) PRINT_STATUS_MACRO(api, uint32_t response, api(handle, i, &response), "%u", response);
617 #define PRINT_STATUS_UINT32_HEX(api) PRINT_STATUS_MACRO(api, uint32_t response, api(handle, &response), "0x%08x", response);
618 #define PRINT_STATUS_TABOO(api) PRINT_STATUS_MACRO(api, uint32_t start;uint32_t mask, api(handle, &start, &mask), "Start:%u Channel Mask:0x%08x", start, mask);
619 #define PRINT_STATUS_UINT32_HEX_RN(api, i) PRINT_STATUS_MACRO(api, uint32_t response, api(handle, i, &response), "0x%08x", response);
620 #define PRINT_STATUS_UPTIME(api) PRINT_STATUS_MACRO(api, uint32_t response, api(handle, &response), "%02uh:%02um:%02us", response/3600, (response%3600)/60, response%60);
621 #define PRINT_STATUS_STRING(api) PRINT_STATUS_MACRO(api, char response[256], api(handle, response, sizeof(response)), "%s", response);
622 #define PRINT_STATUS_STRING_RN(api, i) PRINT_STATUS_MACRO(api, char response[256], api(handle, i, response, sizeof(response)), "%s", response);
623 #define PRINT_STATUS_MAC(api) PRINT_STATUS_MACRO(api, RMH_MacAddress_t response;char macStr[24], api(handle, &response), "%s", RMH_MacToString(response, macStr, sizeof(macStr)));
624 #define PRINT_STATUS_MAC_RN(api, i) PRINT_STATUS_MACRO(api, RMH_MacAddress_t response;char macStr[24], api(handle, i, &response), "%s", RMH_MacToString(response, macStr, sizeof(macStr)));
625 #define PRINT_STATUS_MoCAVersion(api) PRINT_STATUS_MACRO(api, RMH_MoCAVersion response, api(handle, &response), "%s", RMH_MoCAVersionToString(response));
626 #define PRINT_STATUS_MoCAVersion_RN(api, i) PRINT_STATUS_MACRO(api, RMH_MoCAVersion response, api(handle, i, &response), "%s", RMH_MoCAVersionToString(response));
627 #define PRINT_STATUS_PowerMode(api) PRINT_STATUS_MACRO(api, RMH_PowerMode response;char outStr[128], api(handle, &response), "%s", RMH_PowerModeToString(response, outStr, sizeof(outStr)));
628 #define PRINT_STATUS_PowerMode_RN(api, i) PRINT_STATUS_MACRO(api, RMH_PowerMode response;char outStr[128], api(handle, i, &response), "%s", RMH_PowerModeToString(response, outStr, sizeof(outStr)));
629 #define PRINT_STATUS_LinkStatus(api) PRINT_STATUS_MACRO(api, RMH_LinkStatus response, api(handle, &response), "%s", RMH_LinkStatusToString(response));
630 #define PRINT_STATUS_FLOAT(api) PRINT_STATUS_MACRO(api, float response, api(handle, &response), "%.02f", response);
631 #define PRINT_STATUS_FLOAT_RN(api, i) PRINT_STATUS_MACRO(api, float response, api(handle,i, &response), "%.02f", response);
632 #define PRINT_STATUS_LOG_LEVEL(api) PRINT_STATUS_MACRO(api, uint32_t response;char outStr[128], api(handle, &response), "%s", RMH_LogLevelToString(response, outStr, sizeof(outStr)));
633 #define PRINT_STATUS_MAC_FLOW(api, mac) PRINT_STATUS_MACRO(api, RMH_MacAddress_t response;char macStr[24], api(handle, mac, &response), "%s", RMH_MacToString(response, macStr, sizeof(macStr)));
634 #define PRINT_STATUS_UINT32_FLOW(api, mac) PRINT_STATUS_MACRO(api, uint32_t response, api(handle, mac, &response), "%u", response);
635 
636 RMH_Result GENERIC_IMPL__RMH_Log_PrintStatus(const RMH_Handle handle, const char* filename) {
637  RMH_Result ret;
638  bool enabled;
639  int i;
640 
641  if (filename) {
642  handle->localLogToFile=fopen(filename, "a");
643  if (handle->localLogToFile == NULL) {
644  RMH_PrintErr("Failed to open '%s' for writing!\n", filename);
645  return RMH_FAILURE;
646  }
647  }
648 
649  ret=RMH_Self_GetEnabled(handle, &enabled);
650  if (ret != RMH_SUCCESS) {
651  RMH_PrintErr("Failed calling RMH_Self_GetEnabled! Ensure the MoCA driver is properly loaded\n");
652  return ret;
653  }
654 
655  RMH_PrintMsg("= RMH Local Device Status ======\n");
656  PRINT_STATUS_BOOL(RMH_Self_GetEnabled);
657  PRINT_STATUS_STRING(RMH_Interface_GetName);
658  PRINT_STATUS_MAC(RMH_Interface_GetMac);
659  PRINT_STATUS_BOOL(RMH_Interface_GetEnabled);
660  PRINT_STATUS_STRING(RMH_Self_GetSoftwareVersion);
661  PRINT_STATUS_MoCAVersion(RMH_Self_GetHighestSupportedMoCAVersion);
662  PRINT_STATUS_BOOL(RMH_Self_GetPreferredNCEnabled);
663  PRINT_STATUS_UINT32(RMH_Self_GetLOF);
664  PRINT_STATUS_BOOL(RMH_Power_GetTxPowerControlEnabled);
666  PRINT_STATUS_UINT32(RMH_Power_GetTxBeaconPowerReduction);
667  PRINT_STATUS_TABOO(RMH_Self_GetTabooChannels);
668  PRINT_STATUS_UINT32_HEX(RMH_Self_GetFrequencyMask);
669  PRINT_STATUS_BOOL(RMH_Self_GetQAM256Enabled);
670  PRINT_STATUS_BOOL(RMH_Self_GetTurboEnabled);
671  PRINT_STATUS_BOOL(RMH_Self_GetBondingEnabled);
672  PRINT_STATUS_BOOL(RMH_Self_GetPrivacyEnabled);
673  PRINT_STATUS_STRING(RMH_Self_GetPrivacyMACManagementKey);
674  PRINT_STATUS_LOG_LEVEL(RMH_Log_GetDriverLevel);
675  PRINT_STATUS_STRING(RMH_Log_GetDriverFilename);
676  PRINT_STATUS_PowerMode(RMH_Power_GetMode);
677 
678  if (enabled) {
679  RMH_LinkStatus linkStatus;
680  RMH_NodeList_Uint32_t nodes;
681 
682  ret=RMH_Self_GetLinkStatus(handle, &linkStatus);
683  if (ret == RMH_SUCCESS && linkStatus == RMH_LINK_STATUS_UP) {
684  RMH_PrintMsg("\n= Network Status ======\n");
685  PRINT_STATUS_LinkStatus(RMH_Self_GetLinkStatus);
686  PRINT_STATUS_UINT32(RMH_Network_GetNumNodes);
687  PRINT_STATUS_UINT32(RMH_Network_GetNodeId);
688  PRINT_STATUS_UINT32(RMH_Network_GetNCNodeId);
689  PRINT_STATUS_MAC(RMH_Network_GetNCMac);
690  PRINT_STATUS_UINT32(RMH_Network_GetBackupNCNodeId);
691  PRINT_STATUS_UPTIME(RMH_Network_GetLinkUptime);
692  PRINT_STATUS_MoCAVersion(RMH_Network_GetMoCAVersion);
693  PRINT_STATUS_BOOL(RMH_Network_GetMixedMode);
694  PRINT_STATUS_UINT32(RMH_Network_GetRFChannelFreq);
695  PRINT_STATUS_UINT32(RMH_Stats_GetTxTotalPackets);
696  PRINT_STATUS_UINT32(RMH_Stats_GetRxTotalPackets);
697  PRINT_STATUS_UINT32(RMH_Stats_GetTxTotalErrors);
698  PRINT_STATUS_UINT32(RMH_Stats_GetRxTotalErrors);
699  PRINT_STATUS_UINT32(RMH_Stats_GetTxDroppedPackets);
700  PRINT_STATUS_UINT32(RMH_Stats_GetRxDroppedPackets);
701  ret=RMH_Network_GetRemoteNodeIds(handle, &nodes);
702  if (ret == RMH_SUCCESS) {
703  for (i = 0; i < RMH_MAX_MOCA_NODES; i++) {
704  if (nodes.nodePresent[i]) {
705  RMH_PrintMsg("\n= Remote Node ID %02u =======\n", i);
706  PRINT_STATUS_MAC_RN(RMH_RemoteNode_GetMac, i);
707  PRINT_STATUS_MoCAVersion_RN(RMH_RemoteNode_GetHighestSupportedMoCAVersion, i);
708  PRINT_STATUS_BOOL_RN(RMH_RemoteNode_GetPreferredNC, i);
709  PRINT_STATUS_UINT32_RN(RMH_RemoteNode_GetRxPackets, i);
710  PRINT_STATUS_UINT32_RN(RMH_RemoteNode_GetTxPackets, i);
711  PRINT_STATUS_UINT32_RN(RMH_RemoteNode_GetTxUnicastPhyRate, i);
712  PRINT_STATUS_UINT32_RN(RMH_RemoteNode_GetTxPowerReduction, i);
713  PRINT_STATUS_FLOAT_RN(RMH_RemoteNode_GetTxUnicastPower, i);
714  PRINT_STATUS_UINT32_RN(RMH_RemoteNode_GetRxTotalErrors, i);
715  PRINT_STATUS_FLOAT_RN(RMH_RemoteNode_GetRxUnicastPower, i);
716  PRINT_STATUS_FLOAT_RN(RMH_RemoteNode_GetRxSNR, i);
717  }
718  }
719  }
720 
721  RMH_PrintMsg("\n= PHY Rates =========\n");
722  RMH_Print_UINT32_NODEMESH(handle, RMH_Network_GetTxUnicastPhyRate);
723  }
724  else {
725  RMH_PrintMsg("*** MoCA link is down! ***\n");
726  }
727  }
728  else {
729  RMH_PrintMsg("*** MoCA not enabled! You may need to run 'rmh start' ***\n");
730  }
731 
732  if (handle->localLogToFile) {
733  fclose(handle->localLogToFile);
734  handle->localLogToFile=NULL;
735  }
736  return RMH_SUCCESS;
737 }
738 
739 
740 RMH_Result GENERIC_IMPL__RMH_Log_PrintStats(const RMH_Handle handle, const char* filename) {
741  RMH_Result ret;
742  RMH_LinkStatus linkStatus;
743 
744  if (filename) {
745  handle->localLogToFile=fopen(filename, "a");
746  if (handle->localLogToFile == NULL) {
747  RMH_PrintErr("Failed to open '%s' for writing!\n", filename);
748  return RMH_FAILURE;
749  }
750  }
751 
752  ret=RMH_Self_GetLinkStatus(handle, &linkStatus);
753  if (ret == RMH_SUCCESS && linkStatus == RMH_LINK_STATUS_UP) {
754  RMH_PrintMsg("= Tx Stats ======\n");
755  PRINT_STATUS_UINT32(RMH_Stats_GetTxTotalPackets);
756  PRINT_STATUS_UINT32(RMH_Stats_GetTxUnicastPackets);
757  PRINT_STATUS_UINT32(RMH_Stats_GetTxBroadcastPackets);
758  PRINT_STATUS_UINT32(RMH_Stats_GetTxMulticastPackets);
759  PRINT_STATUS_UINT32(RMH_Stats_GetTxReservationRequestPackets);
760  PRINT_STATUS_UINT32(RMH_Stats_GetTxMapPackets);
761  PRINT_STATUS_UINT32(RMH_Stats_GetTxLinkControlPackets);
762  PRINT_STATUS_UINT32(RMH_Stats_GetTxBeacons);
763  PRINT_STATUS_UINT32(RMH_Stats_GetTxDroppedPackets);
764  PRINT_STATUS_UINT32(RMH_Stats_GetTxTotalErrors);
765  PRINT_STATUS_UINT32(RMH_Stats_GetTxTotalAggregatedPackets);
766  PRINT_STATUS_UINT32(RMH_Stats_GetTxTotalBytes);
767 
768  RMH_PrintMsg("\n= Rx ======\n");
769  PRINT_STATUS_UINT32(RMH_Stats_GetRxTotalBytes);
770  PRINT_STATUS_UINT32(RMH_Stats_GetRxTotalPackets);
771  PRINT_STATUS_UINT32(RMH_Stats_GetRxUnicastPackets);
772  PRINT_STATUS_UINT32(RMH_Stats_GetRxBroadcastPackets);
773  PRINT_STATUS_UINT32(RMH_Stats_GetRxMulticastPackets);
774  PRINT_STATUS_UINT32(RMH_Stats_GetRxReservationRequestPackets);
775  PRINT_STATUS_UINT32(RMH_Stats_GetRxMapPackets);
776  PRINT_STATUS_UINT32(RMH_Stats_GetRxLinkControlPackets);
777  PRINT_STATUS_UINT32(RMH_Stats_GetRxBeacons);
778  PRINT_STATUS_UINT32(RMH_Stats_GetRxUnknownProtocolPackets);
779  PRINT_STATUS_UINT32(RMH_Stats_GetRxDroppedPackets);
780  PRINT_STATUS_UINT32(RMH_Stats_GetRxTotalErrors);
781  PRINT_STATUS_UINT32(RMH_Stats_GetRxCRCErrors);
782  PRINT_STATUS_UINT32(RMH_Stats_GetRxTimeoutErrors);
783  PRINT_STATUS_UINT32(RMH_Stats_GetRxTotalAggregatedPackets);
784  RMH_PrintMsg("RMH_Stats_GetRxCorrectedErrors:\n");
785  RMHApp__OUT_UINT32_NODELIST(handle, RMH_Stats_GetRxCorrectedErrors);
786  RMH_PrintMsg("RMH_Stats_GetRxUncorrectedErrors:\n");
787  RMHApp__OUT_UINT32_NODELIST(handle,RMH_Stats_GetRxUncorrectedErrors);
788 
789  RMH_PrintMsg("\n= Admission ======\n");
790  PRINT_STATUS_UINT32(RMH_Stats_GetAdmissionAttempts);
791  PRINT_STATUS_UINT32(RMH_Stats_GetAdmissionSucceeded);
792  PRINT_STATUS_UINT32(RMH_Stats_GetAdmissionFailures);
793  PRINT_STATUS_UINT32(RMH_Stats_GetAdmissionsDeniedAsNC);
794  PRINT_STATUS_UINT32(RMH_Stats_GetAdmissionsFailedNoResponse);
795  PRINT_STATUS_UINT32(RMH_Stats_GetAdmissionsFailedChannelUnusable);
796  PRINT_STATUS_UINT32(RMH_Stats_GetAdmissionsFailedT2Timeout);
797  PRINT_STATUS_UINT32(RMH_Stats_GetAdmissionsFailedResyncLoss);
798  PRINT_STATUS_UINT32(RMH_Stats_GetAdmissionsFailedPrivacyFullBlacklist);
799  }
800  else {
801  RMH_PrintMsg("*** Stats not available while MoCA link is down ***\n");
802  }
803 
804 /*RMH_Stats_GetRxPacketAggregation (const RMH_Handle handle, uint32_t* responseArray, const size_t responseArraySize, size_t* responseArrayUsed);
805 RMH_Stats_GetTxPacketAggregation (const RMH_Handle handle, uint32_t* responseArray, const size_t responseArraySize, size_t* responseArrayUsed);
806 RMH_Stats_GetRxCorrectedErrors (const RMH_Handle handle, RMH_NodeList_Uint32_t* response);
807 RMH_Stats_GetRxUncorrectedErrors (const RMH_Handle handle, RMH_NodeList_Uint32_t* response);*/
808 
809  if (handle->localLogToFile) {
810  fclose(handle->localLogToFile);
811  handle->localLogToFile=NULL;
812  }
813  return RMH_SUCCESS;
814 }
815 
816 
817 RMH_Result GENERIC_IMPL__RMH_Log_PrintFlows(const RMH_Handle handle, const char* filename) {
818  RMH_Result ret;
819  RMH_MacAddress_t flowIds[64];
820  size_t numFlowIds;
821  uint32_t numIngressFlows;
822  char macStr[24];
823  uint32_t leaseTime;
824  RMH_LinkStatus linkStatus;
825  int i;
826 
827  if (filename) {
828  handle->localLogToFile=fopen(filename, "a");
829  if (handle->localLogToFile == NULL) {
830  RMH_PrintErr("Failed to open '%s' for writing!\n", filename);
831  return RMH_FAILURE;
832  }
833  }
834 
835  ret=RMH_Self_GetLinkStatus(handle, &linkStatus);
836  if (ret == RMH_SUCCESS && linkStatus == RMH_LINK_STATUS_UP) {
837  RMH_PrintMsg("= Local Flows ======\n");
838  PRINT_STATUS_UINT32(RMH_PQoS_GetNumEgressFlows);
839  ret = RMH_PQoS_GetNumIngressFlows(handle, &numIngressFlows);
840  if (ret == RMH_SUCCESS) {
841  RMH_PrintMsg("%-50s: %u\n", "RMH_PQoS_GetNumIngressFlows", numIngressFlows);
842  }
843  else {
844  RMH_PrintMsg("%-50s: %s\n", "RMH_PQoS_GetNumIngressFlows", RMH_ResultToString(ret));
845  }
846 
847  if (numIngressFlows) {
848  ret = RMH_PQoS_GetIngressFlowIds(handle, flowIds, sizeof(flowIds)/sizeof(flowIds[0]), &numFlowIds);
849  if ((ret == RMH_SUCCESS) && (numFlowIds != 0)) {
850  for (i=0; i < numFlowIds; i++) {
851  RMH_PrintMsg("= Flow %u =======\n", i);
852  RMH_PrintMsg("%-50s: %s\n", "Flow Id", RMH_MacToString(flowIds[i], macStr, sizeof(macStr)/sizeof(macStr[0])));
853  PRINT_STATUS_MAC_FLOW(RMH_PQoSFlow_GetIngressMac, flowIds[i]);
854  PRINT_STATUS_MAC_FLOW(RMH_PQoSFlow_GetEgressMac, flowIds[i]);
855  PRINT_STATUS_MAC_FLOW(RMH_PQoSFlow_GetDestination, flowIds[i]);
856  ret = RMH_PQoSFlow_GetLeaseTime(handle, flowIds[i], &leaseTime);
857  if (ret != RMH_SUCCESS) {
858  RMH_PrintWrn("%-50s: %s\n", "RMH_PQoSFlow_GetLeaseTime", RMH_ResultToString(ret));
859  }
860  else {
861  if (leaseTime) {
862  RMH_PrintMsg("%-50s: %u\n", "RMH_PQoSFlow_GetLeaseTime", leaseTime);
863  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetLeaseTimeRemaining, flowIds[i]);
864  }
865  else {
866  RMH_PrintMsg("%-50s: %s\n", "RMH_PQoSFlow_GetLeaseTime", "INFINITE");
867  }
868  }
869 
870  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetPeakDataRate, flowIds[i]);
871  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetBurstSize, flowIds[i]);
872  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetFlowTag, flowIds[i]);
873  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetPacketSize, flowIds[i]);
874  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetMaxLatency, flowIds[i]);
875  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetShortTermAvgRatio, flowIds[i]);
876  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetMaxRetry, flowIds[i]);
877  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetFlowPer, flowIds[i]);
878  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetIngressClassificationRule, flowIds[i]);
879  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetVLANTag, flowIds[i]);
880  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetTotalTxPackets, flowIds[i]);
881  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetDSCPMoCA, flowIds[i]);
882  PRINT_STATUS_UINT32_FLOW(RMH_PQoSFlow_GetDFID, flowIds[i]);
883  }
884  }
885  }
886  }
887  else {
888  RMH_PrintMsg("*** Flow information not available while MoCA link is down ***\n");
889  }
890 
891  if (handle->localLogToFile) {
892  fclose(handle->localLogToFile);
893  handle->localLogToFile=NULL;
894  }
895  return RMH_SUCCESS;
896 }
897 
898 RMH_Result GENERIC_IMPL__RMH_Log_PrintModulation(const RMH_Handle handle, const char* filename) {
899  uint32_t selfNodeId;
900  uint32_t nodeId;
901  RMH_MoCAVersion selfMoCAVersion;
902  RMH_MoCAVersion remoteMoCAVersion;
903  RMH_Result ret;
904  RMH_NodeList_Uint32_t nodes;
905  RMH_SubcarrierProfile p[4][512];
906  uint32_t pUsed[4];
907  RMH_LinkStatus linkStatus;
908 
909  ret=RMH_Self_GetLinkStatus(handle, &linkStatus);
910  if (ret != RMH_SUCCESS || linkStatus != RMH_LINK_STATUS_UP) {
911  RMH_PrintMsg("*** Modulation information not available while MoCA link is down ***\n");
912  return ret;
913  }
914 
915  ret = RMH_Network_GetNodeId(handle, &selfNodeId);
916  if (ret != RMH_SUCCESS) {
917  return ret;
918  }
919 
920  ret = RMH_RemoteNode_GetActiveMoCAVersion(handle, selfNodeId, &selfMoCAVersion);
921  if (ret != RMH_SUCCESS) {
922  return ret;
923  }
924 
925  ret = RMH_Network_GetRemoteNodeIds(handle, &nodes);
926  if (ret != RMH_SUCCESS) {
927  return ret;
928  }
929 
930  RMH_PrintMsg("Subcarrier Modulation To/From The Self Node %d [MoCA %s]\n", selfNodeId, RMH_MoCAVersionToString(selfMoCAVersion));
931  for (nodeId = 0; nodeId < RMH_MAX_MOCA_NODES; nodeId++) {
932  if (nodes.nodePresent[nodeId]) {
933  ret = RMH_RemoteNode_GetActiveMoCAVersion(handle, nodeId, &remoteMoCAVersion);
934  if (ret != RMH_SUCCESS) {
935  return ret;
936  }
937 
938  RMH_PrintMsg("= Node ID %02u [MoCA %s] =======\n", nodeId, RMH_MoCAVersionToString(remoteMoCAVersion));
939  if (selfMoCAVersion == RMH_MOCA_VERSION_20 && remoteMoCAVersion == RMH_MOCA_VERSION_20) {
940  memset(pUsed, 0, sizeof(pUsed));
941  ret = RMH_RemoteNode_GetRxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_NOMINAL, p[0], sizeof(p[0])/sizeof(p[0][0]), &pUsed[0]);
942  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
943  RMH_PrintWrn("RMH_RemoteNode_GetRxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
944  }
945 
946  ret = RMH_RemoteNode_GetTxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_NOMINAL, p[1], sizeof(p[1])/sizeof(p[1][0]), &pUsed[1]);
947  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
948  RMH_PrintWrn("RMH_RemoteNode_GetTxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
949  }
950 
951  ret = RMH_RemoteNode_GetRxBroadcastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_NOMINAL, p[2], sizeof(p[2])/sizeof(p[2][0]), &pUsed[2]);
952  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
953  RMH_PrintWrn("RMH_RemoteNode_GetRxBroadcastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
954  }
955 
956  ret = RMH_RemoteNode_GetTxBroadcastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_NOMINAL, p[3], sizeof(p[3])/sizeof(p[3][0]), &pUsed[3]);
957  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
958  RMH_PrintWrn("RMH_RemoteNode_GetTxBroadcastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
959  }
960 
961  RMH_PrintMsg(" Nominal Packet Error Rate [RMH_PER_MODE_NOMINAL]:\n");
962  RMH_Print_MODULATION(handle, 256, 511,
963  "Primary Unicast Rx (NPER)", p[0], pUsed[0],
964  "Primary Unicast Tx (NPER)", p[1], pUsed[1],
965  "Broadcast Rx (NPER)", p[2], pUsed[2],
966  "Broadcast Tx (NPER)", p[3], pUsed[3]);
967 
968  RMH_Print_MODULATION(handle, 0, 255,
969  NULL, p[0], pUsed[0],
970  NULL, p[1], pUsed[1],
971  NULL, p[2], pUsed[2],
972  NULL, p[3], pUsed[3]);
973 
974  memset(pUsed, 0, sizeof(pUsed));
975  ret = RMH_RemoteNode_GetRxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_VERY_LOW, p[0], sizeof(p[0])/sizeof(p[0][0]), &pUsed[0]);
976  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
977  RMH_PrintWrn("RMH_RemoteNode_GetRxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
978  }
979 
980  ret = RMH_RemoteNode_GetTxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_VERY_LOW, p[1], sizeof(p[1])/sizeof(p[1][0]), &pUsed[1]);
981  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
982  RMH_PrintWrn("RMH_RemoteNode_GetTxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
983  }
984 
985  ret = RMH_RemoteNode_GetRxBroadcastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_VERY_LOW, p[2], sizeof(p[2])/sizeof(p[2][0]), &pUsed[2]);
986  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
987  RMH_PrintWrn("RMH_RemoteNode_GetRxBroadcastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
988  }
989 
990  ret = RMH_RemoteNode_GetTxBroadcastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_VERY_LOW, p[3], sizeof(p[3])/sizeof(p[3][0]), &pUsed[3]);
991  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
992  RMH_PrintWrn("RMH_RemoteNode_GetTxBroadcastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
993  }
994 
995  RMH_PrintMsg("\n Nominal Packet Error Rate [RMH_PER_MODE_VERY_LOW]:\n");
996  RMH_Print_MODULATION(handle, 256, 511,
997  "Primary Unicast Rx (VLPER)", p[0], pUsed[0],
998  "Primary Unicast Tx (VLPER)", p[1], pUsed[1],
999  "Broadcast Rx (VLPER)", p[2], pUsed[2],
1000  "Broadcast Tx (VLPER)", p[3], pUsed[3]);
1001 
1002  RMH_Print_MODULATION(handle, 0, 255,
1003  NULL, p[0], pUsed[0],
1004  NULL, p[1], pUsed[1],
1005  NULL, p[2], pUsed[2],
1006  NULL, p[3], pUsed[3]);
1007 
1008 
1009 
1010  memset(pUsed, 0, sizeof(pUsed));
1011  ret = RMH_RemoteNode_GetSecondaryRxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_NOMINAL, p[0], sizeof(p[0])/sizeof(p[0][0]), &pUsed[0]);
1012  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
1013  RMH_PrintWrn("RMH_RemoteNode_GetSecondaryRxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
1014  }
1015 
1016  ret = RMH_RemoteNode_GetSecondaryRxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_VERY_LOW, p[1], sizeof(p[1])/sizeof(p[1][0]), &pUsed[1]);
1017  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
1018  RMH_PrintWrn("RMH_RemoteNode_GetSecondaryRxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
1019  }
1020 
1021  ret = RMH_RemoteNode_GetSecondaryTxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_NOMINAL, p[2], sizeof(p[2])/sizeof(p[2][0]), &pUsed[2]);
1022  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
1023  RMH_PrintWrn("RMH_RemoteNode_GetSecondaryTxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
1024  }
1025 
1026  ret = RMH_RemoteNode_GetSecondaryTxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_VERY_LOW, p[3], sizeof(p[3])/sizeof(p[3][0]), &pUsed[3]);
1027  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
1028  RMH_PrintWrn("RMH_RemoteNode_GetSecondaryTxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
1029  }
1030 
1031  RMH_PrintMsg("\n Secondary Packet Error Rate:\n");
1032  RMH_Print_MODULATION(handle, 256, 511,
1033  "Secondary Unicast Rx (NPER)", p[0], pUsed[0],
1034  "Secondary Unicast Rx (VLPER)", p[1], pUsed[1],
1035  "Secondary Unicast Tx (NPER)", p[2], pUsed[2],
1036  "Secondary Unicast Tx (VLPER)", p[3], pUsed[3]);
1037 
1038 
1039  RMH_Print_MODULATION(handle, 0, 255,
1040  NULL, p[0], pUsed[0],
1041  NULL, p[1], pUsed[1],
1042  NULL, p[2], pUsed[2],
1043  NULL, p[3], pUsed[3]);
1044 
1045  }
1046  else {
1047  memset(pUsed, 0, sizeof(pUsed));
1048  ret = RMH_RemoteNode_GetRxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_LEGACY, p[0], sizeof(p[0])/sizeof(p[0][0]), &pUsed[0]);
1049  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
1050  RMH_PrintWrn("RMH_RemoteNode_GetRxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
1051  }
1052 
1053  ret = RMH_RemoteNode_GetTxUnicastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_LEGACY, p[1], sizeof(p[1])/sizeof(p[1][0]), &pUsed[1]);
1054  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
1055  RMH_PrintWrn("RMH_RemoteNode_GetTxUnicastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
1056  }
1057 
1058  ret = RMH_RemoteNode_GetRxBroadcastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_LEGACY, p[2], sizeof(p[2])/sizeof(p[2][0]), &pUsed[2]);
1059  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
1060  RMH_PrintWrn("RMH_RemoteNode_GetRxBroadcastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
1061  }
1062 
1063  ret = RMH_RemoteNode_GetTxBroadcastSubcarrierModulation(handle, nodeId, RMH_PER_MODE_LEGACY, p[3], sizeof(p[3])/sizeof(p[3][0]), &pUsed[3]);
1064  if (ret != RMH_SUCCESS && ret != RMH_UNIMPLEMENTED && ret != RMH_UNIMPLEMENTED) {
1065  RMH_PrintWrn("RMH_RemoteNode_GetTxBroadcastSubcarrierModulation: %s\n", RMH_ResultToString(ret));
1066  }
1067 
1068  RMH_PrintMsg(" Packet Error Rate [RMH_PER_MODE_LEGACY]:\n");
1069  RMH_Print_MODULATION(handle, 127, 0,
1070  "Unicast Rx", p[0], pUsed[0],
1071  "Unicast Tx", p[1], pUsed[1],
1072  "Broadcast Rx", p[2], pUsed[2],
1073  "Broadcast Tx", p[3], pUsed[3]);
1074 
1075  RMH_Print_MODULATION(handle, 255, 128,
1076  NULL, p[0], pUsed[0],
1077  NULL, p[1], pUsed[1],
1078  NULL, p[2], pUsed[2],
1079  NULL, p[3], pUsed[3]);
1080 
1081  }
1082  RMH_PrintMsg("\n\n");
1083  }
1084  }
1085  return RMH_SUCCESS;
1086 }
1087 
1088 RMH_Result GENERIC_IMPL__RMH_GetAllAPIs(const RMH_Handle handle, RMH_APIList** apiList) {
1089  *apiList=&hRMHGeneric_APIList;
1090  return RMH_SUCCESS;
1091 }
1092 
1093 RMH_Result GENERIC_IMPL__RMH_GetUnimplementedAPIs(const RMH_Handle handle, RMH_APIList** apiList) {
1094  if (hRMHGeneric_SoCUnimplementedAPIList.apiListSize == 0) {
1095  int i;
1096  void* soclib = dlopen("librdkmocahalsoc.so.0", RTLD_LAZY);
1097  for(i=0; i != hRMHGeneric_APIList.apiListSize; i++) {
1098  RMH_API* api=hRMHGeneric_APIList.apiList[i];
1099  if (api->socApiExpected) {
1100  if (!soclib || !dlsym(soclib, api->socApiName)) {
1101  hRMHGeneric_SoCUnimplementedAPIList.apiList[hRMHGeneric_SoCUnimplementedAPIList.apiListSize++]=api;
1102  }
1103  }
1104  }
1105  if (soclib) {
1106  dlclose(soclib);
1107  }
1108  }
1109  *apiList=&hRMHGeneric_SoCUnimplementedAPIList;
1110  return RMH_SUCCESS;
1111 }
1112 
1113 RMH_Result GENERIC_IMPL__RMH_GetAPITags(const RMH_Handle handle, RMH_APITagList** apiTagList) {
1114  /* If the tag list isn't initialized, do it now */
1115  if (hRMHGeneric_APITags.tagListSize == 0) {
1116  int i;
1117  RMH_APIList* tagList;
1118  char* token;
1119 
1120  for(i=0; i != hRMHGeneric_APIList.apiListSize; i++) {
1121  RMH_API* api=hRMHGeneric_APIList.apiList[i];
1122  char* tags=strdup(api->tags);
1123  if (!tags) {
1124  RMH_PrintWrn("Unable to copy tag string for '%s'. Skipping\n", api->apiName);
1125  continue;
1126  }
1127  token = strtok(tags, ",");
1128  while(token) {
1129  if ((pRMH_FindTagList(handle, token, &tagList) == RMH_SUCCESS) && tagList) {
1130  tagList->apiList[tagList->apiListSize++] = api;
1131  RMH_PrintDbg("Added API '%s' to tag '%s'. Total APIs in this tags:%d\n", api->apiName, tagList->apiListName, tagList->apiListSize);
1132  }
1133  token = strtok(NULL, ",");
1134  }
1135  free(tags);
1136  }
1137  qsort(hRMHGeneric_APITags.tagList, hRMHGeneric_APITags.tagListSize, sizeof(RMH_APIList), pRMH_TagCompare);
1138  }
1139  *apiTagList=&hRMHGeneric_APITags;
1140  return RMH_SUCCESS;
1141 }
1142 
1143 
1144 RMH_Result GENERIC_IMPL__RMH_RemoteNode_GetNodeIdFromAssociatedId(RMH_Handle handle, const uint32_t associatedId, uint32_t* nodeId) {
1145  uint32_t associatedCounter=0;
1146  uint32_t nodeCounter;
1147  RMH_NodeList_Uint32_t remoteNodes;
1148 
1149  BRMH_RETURN_IF(handle==NULL, RMH_INVALID_PARAM);
1150  BRMH_RETURN_IF(nodeId==NULL, RMH_INVALID_PARAM);
1151  BRMH_RETURN_IF(associatedId>RMH_MAX_MOCA_NODES, RMH_INVALID_PARAM);
1152  BRMH_RETURN_IF_FAILED(RMH_Network_GetRemoteNodeIds(handle, &remoteNodes));
1153 
1154  for (nodeCounter = 0; nodeCounter < RMH_MAX_MOCA_NODES; nodeCounter++) {
1155  if (remoteNodes.nodePresent[nodeCounter]) {
1156  associatedCounter++;
1157  if (associatedCounter==associatedId) {
1158  *nodeId=nodeCounter;
1159  return RMH_SUCCESS;
1160  }
1161  }
1162  }
1163  return RMH_INVALID_ID;
1164 }
1165 
1166 RMH_Result GENERIC_IMPL__RMH_RemoteNode_GetAssociatedIdFromNodeId(RMH_Handle handle, const uint32_t nodeId, uint32_t* associatedId) {
1167  uint32_t associatedCounter=0;
1168  uint32_t nodeCounter;
1169  RMH_NodeList_Uint32_t remoteNodes;
1170 
1171  BRMH_RETURN_IF(handle==NULL, RMH_INVALID_PARAM);
1172  BRMH_RETURN_IF(associatedId==NULL, RMH_INVALID_PARAM);
1173  BRMH_RETURN_IF(nodeId>RMH_MAX_MOCA_NODES, RMH_INVALID_PARAM);
1174  BRMH_RETURN_IF_FAILED(RMH_Network_GetRemoteNodeIds(handle, &remoteNodes));
1175 
1176  for (nodeCounter = 0; nodeCounter < RMH_MAX_MOCA_NODES; nodeCounter++) {
1177  if (remoteNodes.nodePresent[nodeCounter]) {
1178  associatedCounter++;
1179  if (nodeCounter==nodeId) {
1180  *associatedId=associatedCounter;
1181  return RMH_SUCCESS;
1182  }
1183  }
1184  }
1185  return RMH_INVALID_ID;
1186 }
1187 
1188 RMH_Result GENERIC_IMPL__RMH_Network_GetAssociatedIds(RMH_Handle handle, RMH_NodeList_Uint32_t* response) {
1189  uint32_t associatedCounter=0;
1190  uint32_t nodeId;
1191  RMH_NodeList_Uint32_t remoteNodes;
1192 
1193  BRMH_RETURN_IF(handle==NULL, RMH_INVALID_PARAM);
1194  BRMH_RETURN_IF(response==NULL, RMH_INVALID_PARAM);
1195  BRMH_RETURN_IF_FAILED(RMH_Network_GetRemoteNodeIds(handle, &remoteNodes));
1196 
1197  memset(response, 0, sizeof(*response));
1198  for (nodeId = 0; nodeId < RMH_MAX_MOCA_NODES; nodeId++) {
1199  if (remoteNodes.nodePresent[nodeId]) {
1200  response->nodeValue[nodeId]=++associatedCounter;
1201  response->nodePresent[nodeId]=true;
1202  }
1203  }
1204 
1205  return RMH_SUCCESS;
1206 }
RMH_Network_GetNCMac
RMH_Result RMH_Network_GetNCMac(const RMH_Handle handle, RMH_MacAddress_t *response)
Return the MAC address of the network coordinator.
RMH_Stats_GetAdmissionFailures
RMH_Result RMH_Stats_GetAdmissionFailures(const RMH_Handle handle, uint32_t *response)
Return the number of admission failures for this node.
RMH_Log_GetDriverLevel
RMH_Result RMH_Log_GetDriverLevel(const RMH_Handle handle, RMH_LogLevel *response)
Return a bitmask of RMH_LogLevel which indicates the currently enabled RMH log types in the MoCA driv...
RMH_Power_GetMode
RMH_Result RMH_Power_GetMode(const RMH_Handle handle, RMH_PowerMode *response)
Return the current MoCA power state of this device.
RMH_Stats_GetRxMulticastPackets
RMH_Result RMH_Stats_GetRxMulticastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of multicast packets received by this node.
RMH_Self_GetPreferredNCEnabled
RMH_Result RMH_Self_GetPreferredNCEnabled(const RMH_Handle handle, bool *response)
Return if this device is a preferred NC.
RMH_Stats_GetRxTotalAggregatedPackets
RMH_Result RMH_Stats_GetRxTotalAggregatedPackets(const RMH_Handle handle, uint32_t *response)
Return the total number of received aggregated packets.
RMH_Stats_GetTxBroadcastPackets
RMH_Result RMH_Stats_GetTxBroadcastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of broadcast packets transmitted by this node.
RMH_Log_GetDriverFilename
RMH_Result RMH_Log_GetDriverFilename(const RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Get the file name where MoCA driver logs are currently being captured.
RMH_Stats_GetRxCRCErrors
RMH_Result RMH_Stats_GetRxCRCErrors(const RMH_Handle handle, uint32_t *response)
Return the total number of packets this node has received with CRC errors.
RMH_Stats_GetTxTotalErrors
RMH_Result RMH_Stats_GetTxTotalErrors(const RMH_Handle handle, uint32_t *response)
Return the total number of transmit errors by this node.
RMH_Stats_GetTxMulticastPackets
RMH_Result RMH_Stats_GetTxMulticastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of multicast packets transmitted by this node.
RMH_Self_GetLinkStatus
RMH_Result RMH_Self_GetLinkStatus(const RMH_Handle handle, RMH_LinkStatus *status)
Current operational status of the MoCA interface [mocaIfStatus].
RMH_RemoteNode_GetMac
RMH_Result RMH_RemoteNode_GetMac(const RMH_Handle handle, const uint32_t nodeId, RMH_MacAddress_t *response)
Return the MAC address of the remote node specified by nodeId.
RMH_Network_GetLinkUptime
RMH_Result RMH_Network_GetLinkUptime(const RMH_Handle handle, uint32_t *response)
Returns the amount of time this node has been part of the MoCA network [mocaIfLinkUpTime].
RMH_Log_SetDriverLevel
RMH_Result RMH_Log_SetDriverLevel(const RMH_Handle handle, const RMH_LogLevel value)
Set the log level of the MoCA driver.
RMH_Stats_GetAdmissionAttempts
RMH_Result RMH_Stats_GetAdmissionAttempts(const RMH_Handle handle, uint32_t *response)
Return the number of admission attempts this node has made.
RMH_Stats_GetAdmissionSucceeded
RMH_Result RMH_Stats_GetAdmissionSucceeded(const RMH_Handle handle, uint32_t *response)
Return the number of successful admissions for this node.
RMH_Network_GetBackupNCNodeId
RMH_Result RMH_Network_GetBackupNCNodeId(const RMH_Handle handle, uint32_t *response)
Return the node ID of the backup network coordinator [mocaIfBackupNC].
RMH_PQoS_GetNumIngressFlows
RMH_Result RMH_PQoS_GetNumIngressFlows(const RMH_Handle handle, uint32_t *response)
Return the number of ingress flows.
RMH_Log_CreateDriverFile
RMH_Result RMH_Log_CreateDriverFile(const RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Create a new log file in standard RDK format.
RMH_RemoteNode_GetPreferredNC
RMH_Result RMH_RemoteNode_GetPreferredNC(const RMH_Handle handle, const uint32_t nodeId, bool *response)
Return if the node indicated by nodeId is a preferred NC or not.
RMH_Stats_GetAdmissionsDeniedAsNC
RMH_Result RMH_Stats_GetAdmissionsDeniedAsNC(const RMH_Handle handle, uint32_t *response)
Return the number of admissions this node has denied when it was the NC.
RMH_Power_SetTxBeaconPowerReductionEnabled
RMH_Result RMH_Power_SetTxBeaconPowerReductionEnabled(const RMH_Handle handle, const bool value)
Enable or disable if beacon power reduction on this device.
RMH_PQoSFlow_GetVLANTag
RMH_Result RMH_PQoSFlow_GetVLANTag(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the VLAN priority for the flow specified by flowId.
RMH_Power_GetTxBeaconPowerReductionEnabled
RMH_Result RMH_Power_GetTxBeaconPowerReductionEnabled(const RMH_Handle handle, bool *response)
Return if beacon power reduction is enabled on this device.
RMH_PQoSFlow_GetDestination
RMH_Result RMH_PQoSFlow_GetDestination(const RMH_Handle handle, const RMH_MacAddress_t flowId, RMH_MacAddress_t *response)
Return the destination flow ID of the flow specified by flowId.
RMH_Stats_GetTxMapPackets
RMH_Result RMH_Stats_GetTxMapPackets(const RMH_Handle handle, uint32_t *response)
Return the number of MAP transmitted by this node.
RMH_PQoSFlow_GetFlowPer
RMH_Result RMH_PQoSFlow_GetFlowPer(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the flow packet error ratio profile for the flow specified by flowId.
RMH_Stats_GetTxTotalAggregatedPackets
RMH_Result RMH_Stats_GetTxTotalAggregatedPackets(const RMH_Handle handle, uint32_t *response)
Return the total number of transmitted aggregated packets.
RMH_RemoteNode_GetTxUnicastPower
RMH_Result RMH_RemoteNode_GetTxUnicastPower(const RMH_Handle handle, const uint32_t nodeId, float *response)
Return the power level rate at which unicast packets are transmitted from nodeId to the self node.
RMH_NodeList_Uint32_t
Definition: rmh_type.h:195
RMH_PQoSFlow_GetBurstSize
RMH_Result RMH_PQoSFlow_GetBurstSize(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the number of packets per burst for the flow specified by flowId.
RMH_MoCAVersionToString
const char *const RMH_MoCAVersionToString(const RMH_MoCAVersion value)
Convert RMH_MoCAVersion to a string.
Definition: librmh_api_no_wrap.c:122
RMH_RemoteNode_GetSecondaryRxUnicastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetSecondaryRxUnicastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the unicast recieve subcarrier modulation profiles for the secondary MoCA channel.
RMH_Power_GetTxPowerControlEnabled
RMH_Result RMH_Power_GetTxPowerControlEnabled(const RMH_Handle handle, bool *response)
Return if transmit power control is enabled or disabled for this device.
RMH_Network_GetNodeId
RMH_Result RMH_Network_GetNodeId(const RMH_Handle handle, uint32_t *response)
Return the node ID of this device.
RMH_Stats_GetTxReservationRequestPackets
RMH_Result RMH_Stats_GetTxReservationRequestPackets(const RMH_Handle handle, uint32_t *response)
Return the number of reservation request packets transmitted by this node.
RMH_Log_SetDriverFilename
RMH_Result RMH_Log_SetDriverFilename(const RMH_Handle handle, const char *value)
Set the file name where MoCA driver logs should be captured to.
RMH_RemoteNode_GetHighestSupportedMoCAVersion
RMH_Result RMH_RemoteNode_GetHighestSupportedMoCAVersion(const RMH_Handle handle, const uint32_t nodeId, RMH_MoCAVersion *response)
Return the highest supported version of MoCA by the remote node specified by nodeId.
RMH_PQoSFlow_GetMaxRetry
RMH_Result RMH_PQoSFlow_GetMaxRetry(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the maximum number of retransmission attempts for each MSDU of the flow specified by flowId.
RMH_Self_GetHighestSupportedMoCAVersion
RMH_Result RMH_Self_GetHighestSupportedMoCAVersion(const RMH_Handle handle, RMH_MoCAVersion *response)
Return the highest version of MoCA supported by the MoCA driver on this device. [mocaIfMocaVersion].
RMH_APITagList
Definition: rmh_type.h:240
RMH_Network_GetNumNodes
RMH_Result RMH_Network_GetNumNodes(const RMH_Handle handle, uint32_t *response)
Return the number of MoCA nodes in the network. [mocaIfNumNodes].
RMH_PQoSFlow_GetIngressClassificationRule
RMH_Result RMH_PQoSFlow_GetIngressClassificationRule(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the ingress classification rule for assigning MSDUs to the flow specified by flowId.
RMH_RemoteNode_GetRxBroadcastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetRxBroadcastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the receive broadcast subcarrier modulation profiles for the channel.
RMH_PQoS_GetNumEgressFlows
RMH_Result RMH_PQoS_GetNumEgressFlows(const RMH_Handle handle, uint32_t *response)
Return the number of egress flows.
RMH_Self_SetPreferredNCEnabled
RMH_Result RMH_Self_SetPreferredNCEnabled(const RMH_Handle handle, const bool value)
Enable or disable preferred NC on this device.
RMH_Self_GetTurboEnabled
RMH_Result RMH_Self_GetTurboEnabled(const RMH_Handle handle, bool *response)
Return if turbo mode is enabled on this device.
RMH_Network_GetRFChannelFreq
RMH_Result RMH_Network_GetRFChannelFreq(const RMH_Handle handle, uint32_t *response)
Return the frequency which the MoCA network is operating on. [mocaIfRFChannel].
RMH_RemoteNode_GetTxBroadcastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetTxBroadcastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the transmission broadcast subcarrier modulation profiles for the channel.
RMH_Network_GetMixedMode
RMH_Result RMH_Network_GetMixedMode(const RMH_Handle handle, bool *response)
Check if the MoCA network contains both 1.1 and 2.0 nodes.
RMH_Power_GetTxBeaconPowerReduction
RMH_Result RMH_Power_GetTxBeaconPowerReduction(const RMH_Handle handle, uint32_t *response)
Return the power control back-off used by this node for transmitting beacons.
RMH_Stats_GetRxTotalErrors
RMH_Result RMH_Stats_GetRxTotalErrors(const RMH_Handle handle, uint32_t *response)
Return the total number of received errors by this node.
RMH_RemoteNode_GetRxPackets
RMH_Result RMH_RemoteNode_GetRxPackets(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the number of packets nodeId has received.
RMH_Self_GetBondingEnabled
RMH_Result RMH_Self_GetBondingEnabled(const RMH_Handle handle, bool *response)
Return if bonding mode is enabled on this device.
RMH_PQoSFlow_GetMaxLatency
RMH_Result RMH_PQoSFlow_GetMaxLatency(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the maximum latency of the flow specified by flowId.
RMH
Definition: librmh.h:57
RMH_PQoSFlow_GetShortTermAvgRatio
RMH_Result RMH_PQoSFlow_GetShortTermAvgRatio(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the short term average ratio for the flow specified by flowId.
RMH_Power_SetTxBeaconPowerReduction
RMH_Result RMH_Power_SetTxBeaconPowerReduction(const RMH_Handle handle, const uint32_t value)
Set the power control back-off used by this node for transmitting beacons.
RMH_Stats_GetTxDroppedPackets
RMH_Result RMH_Stats_GetTxDroppedPackets(const RMH_Handle handle, uint32_t *response)
Return the number of packets this node has dropped before transmitting.
RMH_PQoS_GetIngressFlowIds
RMH_Result RMH_PQoS_GetIngressFlowIds(const RMH_Handle handle, RMH_MacAddress_t *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return a list of the unique Id for each existing ingress flows.
RMH_RemoteNode_GetRxUnicastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetRxUnicastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the unicast recieve subcarrier modulation profiles for the primary MoCA channel.
RMH_RemoteNode_GetRxTotalErrors
RMH_Result RMH_RemoteNode_GetRxTotalErrors(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the total number of packets with errors nodeId has received.
RMH_Stats_GetRxBeacons
RMH_Result RMH_Stats_GetRxBeacons(const RMH_Handle handle, uint32_t *response)
Return the number of beacons received by this node.
RMH_Stats_GetTxUnicastPackets
RMH_Result RMH_Stats_GetTxUnicastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of unicast packets transmitted by this node.
RMH_Stats_GetRxUncorrectedErrors
RMH_Result RMH_Stats_GetRxUncorrectedErrors(const RMH_Handle handle, RMH_NodeList_Uint32_t *response)
Return the number of received packets from every node with errors which were not corrected.
RMH_Stats_GetTxTotalBytes
RMH_Result RMH_Stats_GetTxTotalBytes(const RMH_Handle handle, uint32_t *response)
Return the total number of bytes transmitted by this node.
RMH_Interface_GetEnabled
RMH_Result RMH_Interface_GetEnabled(const RMH_Handle handle, bool *response)
Check if the MoCA interface is enabled at the kernel level.
RMH_Self_SetScanLOFOnly
RMH_Result RMH_Self_SetScanLOFOnly(const RMH_Handle handle, const bool value)
Indicate if the device should join networks only on the last operating frequency.
RMH_Self_SetLOF
RMH_Result RMH_Self_SetLOF(const RMH_Handle handle, const uint32_t value)
Manually set the last operating frequency of the device.
RMH_PQoSFlow_GetTotalTxPackets
RMH_Result RMH_PQoSFlow_GetTotalTxPackets(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the total number of packets transmitted on the flow specified by flowId.
RMH_Self_GetSoftwareVersion
RMH_Result RMH_Self_GetSoftwareVersion(const RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Return the version of software being used by the MoCA driver on this device. [mocaIfSoftwareVersion].
RMH_Network_GetTxUnicastPhyRate
RMH_Result RMH_Network_GetTxUnicastPhyRate(const RMH_Handle handle, RMH_NodeMesh_Uint32_t *response)
Return the unicast transmit PHY rates between all nodes on the network.
RMH_Stats_GetRxTotalBytes
RMH_Result RMH_Stats_GetRxTotalBytes(const RMH_Handle handle, uint32_t *response)
Return the total number of bytes received by this node.
RMH_MacToString
const char *const RMH_MacToString(const RMH_MacAddress_t value, char *responseBuf, const size_t responseBufSize)
Returns the provided MAC address in value as a string.
Definition: librmh_api_no_wrap.c:174
RMH_Self_SetTabooChannels
RMH_Result RMH_Self_SetTabooChannels(const RMH_Handle handle, const uint32_t channelMaskStart, const uint32_t channelMask)
Set which channels will be taboo on this device.
RMH_APIList
Definition: rmh_type.h:234
RMH_Stats_GetRxDroppedPackets
RMH_Result RMH_Stats_GetRxDroppedPackets(const RMH_Handle handle, uint32_t *response)
Return the number of packets this node has dropped after receiving.
RMH_NodeMesh_Uint32_t
Definition: rmh_type.h:205
RMH_Stats_GetTxBeacons
RMH_Result RMH_Stats_GetTxBeacons(const RMH_Handle handle, uint32_t *response)
Return the number of link control received by this node.
RMH_Stats_GetTxTotalPackets
RMH_Result RMH_Stats_GetTxTotalPackets(const RMH_Handle handle, uint32_t *response)
Return the total number of packets transmitted by this node.
RMH_Interface_GetMac
RMH_Result RMH_Interface_GetMac(const RMH_Handle handle, RMH_MacAddress_t *response)
Return the MAC address associated with this MoCA device. [mocaIfMacAddress].
RMH_Stats_GetRxMapPackets
RMH_Result RMH_Stats_GetRxMapPackets(const RMH_Handle handle, uint32_t *response)
Return the number of MAP received by this node.
RMH_API
Definition: rmh_type.h:222
RMH_Network_GetNCNodeId
RMH_Result RMH_Network_GetNCNodeId(const RMH_Handle handle, uint32_t *response)
Return the node ID of the network coordinator. [mocaIfNC].
RMH_Interface_SetMac
RMH_Result RMH_Interface_SetMac(const RMH_Handle handle, const RMH_MacAddress_t value)
Set the MAC address associated with this MoCA device.
RMH_RemoteNode_GetTxUnicastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetTxUnicastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the unicast transmit subcarrier modulation profiles for the primary MoCA channel.
RMH_Stats_GetRxBroadcastPackets
RMH_Result RMH_Stats_GetRxBroadcastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of broadcast packets received by this node.
RMH_ResultToString
const char *const RMH_ResultToString(const RMH_Result value)
Convert RMH_Result to a string.
Definition: librmh_api_no_wrap.c:84
RMH_Stats_GetRxTotalPackets
RMH_Result RMH_Stats_GetRxTotalPackets(const RMH_Handle handle, uint32_t *response)
Return the total number of packets received by this node.
RMH_Self_GetPrivacyEnabled
RMH_Result RMH_Self_GetPrivacyEnabled(const RMH_Handle handle, bool *response)
Return if MoCA privacy is enabled on this device.
RMH_Self_GetMoCALinkUp
RMH_Result RMH_Self_GetMoCALinkUp(const RMH_Handle handle, bool *response)
Check if this device is actively connected to a MoCA network. If so, RMH_Network and RMH_Remote APIs ...
RMH_RemoteNode_GetTxPowerReduction
RMH_Result RMH_RemoteNode_GetTxPowerReduction(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
The transmit power control back-off used for transmissions from the specified nodeId.
RMH_Self_GetTabooChannels
RMH_Result RMH_Self_GetTabooChannels(const RMH_Handle handle, uint32_t *channelMaskStart, uint32_t *channelMask)
Return which channels will be taboo on this device.
RMH_RemoteNode_GetTxUnicastPhyRate
RMH_Result RMH_RemoteNode_GetTxUnicastPhyRate(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the PHY rate at which unicast packets are transmitted from nodeId to the self node.
RMH_Self_RestoreDefaultSettings
RMH_Result RMH_Self_RestoreDefaultSettings(const RMH_Handle handle)
Return this device to its default configuration.
RMH_RemoteNode_GetTxPackets
RMH_Result RMH_RemoteNode_GetTxPackets(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the total number of packets nodeId has transmitted.
RMH_Stats_GetRxLinkControlPackets
RMH_Result RMH_Stats_GetRxLinkControlPackets(const RMH_Handle handle, uint32_t *response)
Return the number of link control received by this node.
RMH_PQoSFlow_GetLeaseTime
RMH_Result RMH_PQoSFlow_GetLeaseTime(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the lease time in seconds for the flow specified by flowId.
RMH_Self_GetFrequencyMask
RMH_Result RMH_Self_GetFrequencyMask(const RMH_Handle handle, uint32_t *response)
Gets the bit mask of frequencies the device used during the listening phase of network search.
RMH_PQoSFlow_GetPeakDataRate
RMH_Result RMH_PQoSFlow_GetPeakDataRate(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the peak data rate in Kbps for the flow specified by flowId.
RMH_PQoSFlow_GetDFID
RMH_Result RMH_PQoSFlow_GetDFID(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the destination flow ID of the flow specified by flowId.
RMH_Stats_GetRxUnknownProtocolPackets
RMH_Result RMH_Stats_GetRxUnknownProtocolPackets(const RMH_Handle handle, uint32_t *response)
Return the number of unknown packets received by this node.
RMH_PQoSFlow_GetIngressMac
RMH_Result RMH_PQoSFlow_GetIngressMac(const RMH_Handle handle, const RMH_MacAddress_t flowId, RMH_MacAddress_t *response)
Return the ingress MAC address of the flow specified by flowId.
RMH_PQoSFlow_GetFlowTag
RMH_Result RMH_PQoSFlow_GetFlowTag(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the tag for the flow specified by flowId. This is optional for application use.
RMH_Stats_GetRxTimeoutErrors
RMH_Result RMH_Stats_GetRxTimeoutErrors(const RMH_Handle handle, uint32_t *response)
Return the total number of packets this node has received with timeout errors.
RMH_PQoS_GetEgressBandwidth
RMH_Result RMH_PQoS_GetEgressBandwidth(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the amount of egress bandwidth available on a particular node.
RMH_Self_GetEnabled
RMH_Result RMH_Self_GetEnabled(const RMH_Handle handle, bool *response)
Return if the MoCA driver is actively connected to or attempting to connect to a MoCA network.
RMH_Log_PrintStatus
RMH_Result RMH_Log_PrintStatus(const RMH_Handle handle, const char *filename)
Print a generic status summary of the MoCA device and network.
RMH_Stats_GetRxCorrectedErrors
RMH_Result RMH_Stats_GetRxCorrectedErrors(const RMH_Handle handle, RMH_NodeList_Uint32_t *response)
Return the number of received packets from every node with errors which were corrected.
RMH_Stats_GetRxReservationRequestPackets
RMH_Result RMH_Stats_GetRxReservationRequestPackets(const RMH_Handle handle, uint32_t *response)
Return the number of reservation request packets received by this node.
RMH_PQoSFlow_GetEgressMac
RMH_Result RMH_PQoSFlow_GetEgressMac(const RMH_Handle handle, const RMH_MacAddress_t flowId, RMH_MacAddress_t *response)
Return the egress MAC address of the flow specified by flowId.
RMH_Stats_GetRxUnicastPackets
RMH_Result RMH_Stats_GetRxUnicastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of unicast packets received by this node.
RMH_PQoSFlow_GetPacketSize
RMH_Result RMH_PQoSFlow_GetPacketSize(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the packet size in bytes of the flow specified by flowId.
RMH_Interface_GetName
RMH_Result RMH_Interface_GetName(const RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Return the Linux interface name associated with the MoCA device. [mocaIfName].
RMH_Self_GetLOF
RMH_Result RMH_Self_GetLOF(const RMH_Handle handle, uint32_t *response)
The last frequency on which this device operated.
RMH_RemoteNode_GetRxSNR
RMH_Result RMH_RemoteNode_GetRxSNR(const RMH_Handle handle, const uint32_t nodeId, float *response)
The signal to noise ratio of nodeId based on the Type 1 probe from per node.
RMH_Network_GetRemoteNodeIds
RMH_Result RMH_Network_GetRemoteNodeIds(const RMH_Handle handle, RMH_NodeList_Uint32_t *response)
Return a list of every node ID on the network.
RMH_Network_GetMoCAVersion
RMH_Result RMH_Network_GetMoCAVersion(const RMH_Handle handle, RMH_MoCAVersion *response)
Return the version of MoCA under which the network is operating. [mocaIfNetworkVersion].
RMH_RemoteNode_GetRxUnicastPower
RMH_Result RMH_RemoteNode_GetRxUnicastPower(const RMH_Handle handle, const uint32_t nodeId, float *response)
Return the power level at which unicast packets are received from nodeId from the self node.
RMH_PQoSFlow_GetLeaseTimeRemaining
RMH_Result RMH_PQoSFlow_GetLeaseTimeRemaining(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the lease time remaining in seconds for the flow specified by flowId.
RMH_PQoSFlow_GetDSCPMoCA
RMH_Result RMH_PQoSFlow_GetDSCPMoCA(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the DSCP MoCA value for the flow specified by flowId.
RMH_RemoteNode_GetSecondaryTxUnicastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetSecondaryTxUnicastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the unicast transmit subcarrier modulation profiles for the secondary MoCA channel.
RMH_Stats_GetTxLinkControlPackets
RMH_Result RMH_Stats_GetTxLinkControlPackets(const RMH_Handle handle, uint32_t *response)
Return the number of link control transmitted by this node.
RMH_RemoteNode_GetActiveMoCAVersion
RMH_Result RMH_RemoteNode_GetActiveMoCAVersion(const RMH_Handle handle, const uint32_t nodeId, RMH_MoCAVersion *response)
Return the active supported version of MoCA by the remote node specificed by nodeId.
RMH_Self_GetPrivacyMACManagementKey
RMH_Result RMH_Self_GetPrivacyMACManagementKey(RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Get the SHA1 hash of the MoCA password as an ASCII string. [mocaIfPasswordHash].
RMH_Self_GetQAM256Enabled
RMH_Result RMH_Self_GetQAM256Enabled(const RMH_Handle handle, bool *response)
Return if this device is set as QAM256 capable in admission negotiations.