Diff for /embedaddon/mpd/src/ngfunc.c between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2013/07/22 08:44:29 version 1.1.1.3, 2016/11/01 09:56:12
Line 629  NgFuncWriteFrame(int dsock, const char *hookname, cons Line 629  NgFuncWriteFrame(int dsock, const char *hookname, cons
     /* ENOBUFS can be expected on some links, e.g., ng_pptpgre(4) */      /* ENOBUFS can be expected on some links, e.g., ng_pptpgre(4) */
     if (rtn < 0 && errno != ENOBUFS) {      if (rtn < 0 && errno != ENOBUFS) {
         Perror("[%s] error writing len %d frame to %s",          Perror("[%s] error writing len %d frame to %s",
            label, MBLEN(bp), hookname);            label, (int)MBLEN(bp), hookname);
     }      }
     mbfree(bp);      mbfree(bp);
     return (rtn);      return (rtn);
Line 765  NetflowSetCommand(Context ctx, int ac, char *av[], voi Line 765  NetflowSetCommand(Context ctx, int ac, char *av[], voi
             gNetflowExport = *sin;              gNetflowExport = *sin;
             break;              break;
         case SET_SELF:          case SET_SELF:
               if (ac != 1 && ac != 2)
                   return (-1);
             if ((sin = ParseAddrPort(ac, av, ALLOW_IPV4|ALLOW_IPV6)) == NULL)              if ((sin = ParseAddrPort(ac, av, ALLOW_IPV4|ALLOW_IPV6)) == NULL)
                 return (-1);                  return (-1);
             gNetflowSource = *sin;              gNetflowSource = *sin;
Line 817  NetflowSetCommand(Context ctx, int ac, char *av[], voi Line 819  NetflowSetCommand(Context ctx, int ac, char *av[], voi
         case SET_HOOK:          case SET_HOOK:
             if (ac != 1)              if (ac != 1)
                 return (-1);                  return (-1);
            if (atoi(av[0]) <= 0)            if (atoi(av[0]) <= 0 || atoi(av[0]) >= NG_NETFLOW_MAXIFACES)
                 Error("Bad netflow hook number \"%s\"", av[0]);                  Error("Bad netflow hook number \"%s\"", av[0]);
             gNetflowIface = atoi(av[0])-1;              gNetflowIface = atoi(av[0])-1;
             break;              break;
Line 875  ShowNetflow(Context ctx, int ac, char *av[], void *arg Line 877  ShowNetflow(Context ctx, int ac, char *av[], void *arg
     Printf("\tNode name      : %s\r\n", gNetflowNodeName);      Printf("\tNode name      : %s\r\n", gNetflowNodeName);
     Printf("\tInitial hook   : %d\r\n", gNetflowIface);      Printf("\tInitial hook   : %d\r\n", gNetflowIface);
     Printf("\tTimeouts, sec:\r\n");      Printf("\tTimeouts, sec:\r\n");
    Printf("\t  Active       : %d\r\n",    Printf("\t  Active       : %u\r\n",
         (gNetflowNodeID>0) ? ni->nfinfo_act_t :          (gNetflowNodeID>0) ? ni->nfinfo_act_t :
         (gNetflowActive ? gNetflowActive : ACTIVE_TIMEOUT));          (gNetflowActive ? gNetflowActive : ACTIVE_TIMEOUT));
    Printf("\t  Inactive     : %d\r\n",    Printf("\t  Inactive     : %u\r\n",
         (gNetflowNodeID>0) ? ni->nfinfo_inact_t :          (gNetflowNodeID>0) ? ni->nfinfo_inact_t :
         (gNetflowInactive ? gNetflowInactive : INACTIVE_TIMEOUT));          (gNetflowInactive ? gNetflowInactive : INACTIVE_TIMEOUT));
     sockaddrtou_addr(&gNetflowExport, &addr, &port);      sockaddrtou_addr(&gNetflowExport, &addr, &port);
Line 912  ShowNetflow(Context ctx, int ac, char *av[], void *arg Line 914  ShowNetflow(Context ctx, int ac, char *av[], void *arg
 #endif  #endif
     if (gNetflowNodeID>0) {      if (gNetflowNodeID>0) {
         Printf("Traffic stats:\r\n");          Printf("Traffic stats:\r\n");
   #if NGM_NETFLOW_COOKIE >= 1365756954
         Printf("\tAccounted IPv4 octets  : %llu\r\n", (unsigned long long)ni->nfinfo_bytes);          Printf("\tAccounted IPv4 octets  : %llu\r\n", (unsigned long long)ni->nfinfo_bytes);
        Printf("\tAccounted IPv4 packets : %d\r\n", ni->nfinfo_packets);        Printf("\tAccounted IPv4 packets : %llu\r\n", (unsigned long long)ni->nfinfo_packets);
         Printf("\tAccounted IPv6 octets  : %llu\r\n", (unsigned long long)ni->nfinfo_bytes6);
         Printf("\tAccounted IPv6 packets : %llu\r\n", (unsigned long long)ni->nfinfo_packets6);
         Printf("\tSkipped IPv4 octets    : %llu\r\n", (unsigned long long)ni->nfinfo_sbytes);
         Printf("\tSkipped IPv4 packets   : %llu\r\n", (unsigned long long)ni->nfinfo_spackets);
         Printf("\tSkipped IPv6 octets    : %llu\r\n", (unsigned long long)ni->nfinfo_sbytes6);
         Printf("\tSkipped IPv6 packets   : %llu\r\n", (unsigned long long)ni->nfinfo_spackets6);
         Printf("\tActive expiries        : %llu\r\n", (unsigned long long)ni->nfinfo_act_exp);
         Printf("\tInactive expiries      : %llu\r\n", (unsigned long long)ni->nfinfo_inact_exp);
         Printf("\tUsed IPv4 cache records: %u\r\n", ni->nfinfo_used);
         Printf("\tUsed IPv6 cache records: %u\r\n", ni->nfinfo_used6);
         Printf("\tFailed allocations     : %u\r\n", ni->nfinfo_alloc_failed);
         Printf("\tFailed v5 export       : %u\r\n", ni->nfinfo_export_failed);
         Printf("\tFailed v9 export       : %u\r\n", ni->nfinfo_export9_failed);
         Printf("\tRallocated mbufs       : %u\r\n", ni->nfinfo_realloc_mbuf);
         Printf("\tFibs allocated         : %u\r\n", ni->nfinfo_alloc_fibs);
 #else /* NGM_NETFLOW_COOKIE >= 1365756954 */
         Printf("\tAccounted IPv4 octets  : %llu\r\n", (unsigned long long)ni->nfinfo_bytes);
         Printf("\tAccounted IPv4 packets : %u\r\n", ni->nfinfo_packets);
 #if NGM_NETFLOW_COOKIE >= 1309868867  #if NGM_NETFLOW_COOKIE >= 1309868867
         Printf("\tAccounted IPv6 octets  : %llu\r\n", (unsigned long long)ni->nfinfo_bytes6);          Printf("\tAccounted IPv6 octets  : %llu\r\n", (unsigned long long)ni->nfinfo_bytes6);
        Printf("\tAccounted IPv6 packets : %d\r\n", ni->nfinfo_packets6);        Printf("\tAccounted IPv6 packets : %u\r\n", ni->nfinfo_packets6);
         Printf("\tSkipped IPv4 octets    : %llu\r\n", (unsigned long long)ni->nfinfo_sbytes);          Printf("\tSkipped IPv4 octets    : %llu\r\n", (unsigned long long)ni->nfinfo_sbytes);
        Printf("\tSkipped IPv4 packets   : %d\r\n", ni->nfinfo_spackets);        Printf("\tSkipped IPv4 packets   : %u\r\n", ni->nfinfo_spackets);
         Printf("\tSkipped IPv6 octets    : %llu\r\n", (unsigned long long)ni->nfinfo_sbytes6);          Printf("\tSkipped IPv6 octets    : %llu\r\n", (unsigned long long)ni->nfinfo_sbytes6);
        Printf("\tSkipped IPv6 packets   : %d\r\n", ni->nfinfo_spackets6);        Printf("\tSkipped IPv6 packets   : %u\r\n", ni->nfinfo_spackets6);
 #endif  #endif
        Printf("\tUsed IPv4 cache records: %d\r\n", ni->nfinfo_used);        Printf("\tUsed IPv4 cache records: %u\r\n", ni->nfinfo_used);
 #if NGM_NETFLOW_COOKIE >= 1309868867  #if NGM_NETFLOW_COOKIE >= 1309868867
        Printf("\tUsed IPv6 cache records: %d\r\n", ni->nfinfo_used6);        Printf("\tUsed IPv6 cache records: %u\r\n", ni->nfinfo_used6);
 #endif  #endif
        Printf("\tFailed allocations     : %d\r\n", ni->nfinfo_alloc_failed);        Printf("\tFailed allocations     : %u\r\n", ni->nfinfo_alloc_failed);
        Printf("\tFailed v5 export       : %d\r\n", ni->nfinfo_export_failed);        Printf("\tFailed v5 export       : %u\r\n", ni->nfinfo_export_failed);
 #if NGM_NETFLOW_COOKIE >= 1309868867  #if NGM_NETFLOW_COOKIE >= 1309868867
        Printf("\tFailed v9 export       : %d\r\n", ni->nfinfo_export9_failed);        Printf("\tFailed v9 export       : %u\r\n", ni->nfinfo_export9_failed);
        Printf("\tRallocated mbufs       : %d\r\n", ni->nfinfo_realloc_mbuf);        Printf("\tRallocated mbufs       : %u\r\n", ni->nfinfo_realloc_mbuf);
        Printf("\tFibs allocated         : %d\r\n", ni->nfinfo_alloc_fibs);        Printf("\tFibs allocated         : %u\r\n", ni->nfinfo_alloc_fibs);
 #endif  #endif
        Printf("\tActive expiries        : %d\r\n", ni->nfinfo_act_exp);        Printf("\tActive expiries        : %u\r\n", ni->nfinfo_act_exp);
        Printf("\tInactive expiries      : %d\r\n", ni->nfinfo_inact_exp);        Printf("\tInactive expiries      : %u\r\n", ni->nfinfo_inact_exp);
 #endif /* NGM_NETFLOW_COOKIE >= 1365756954 */
     }      }
     return(0);      return(0);
 }  }

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>