Guest User

Untitled

a guest
Jan 12th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.15 KB | None | 0 0
  1. --- ng_netflow.h.orig   2012-08-03 15:32:09.000000000 +0300
  2. +++ ng_netflow.h    2012-10-10 15:37:29.000000000 +0300
  3. @@ -34,6 +34,7 @@
  4.  
  5.  #define NG_NETFLOW_NODE_TYPE   "netflow"
  6.  #define NGM_NETFLOW_COOKIE 1309868867
  7. +#define NGM_NETFLOW_V9_COOKIE  1349865386
  8.  
  9.  #define    NG_NETFLOW_MAXIFACES    USHRT_MAX
  10.  
  11. @@ -58,6 +59,7 @@
  12.      NGM_NETFLOW_SETCONFIG  = 7,    /* set flow generation options */
  13.      NGM_NETFLOW_SETTEMPLATE    = 8,    /* set v9 flow template periodic */
  14.      NGM_NETFLOW_SETMTU     = 9,    /* set outgoing interface MTU */
  15. +    NGM_NETFLOW_V9INFO = 10|NGM_READONLY|NGM_HASREPLY,     /* get v9 info */
  16.  };
  17.  
  18.  /* This structure is returned by the NGM_NETFLOW_INFO message */
  19. @@ -147,6 +149,13 @@
  20.     uint32_t    nentries;   /* number of records in response */
  21.  };
  22.  
  23. +/* This structure is used in NGM_NETFLOW_V9INFO message */
  24. +struct ng_netflow_v9info {
  25. +   uint16_t    templ_packets;  /* v9 template packets */
  26. +   uint16_t    templ_time; /* v9 template time */
  27. +   uint16_t    mtu;        /* v9 MTU */
  28. +};
  29. +
  30.  /* XXXGL
  31.   * Somewhere flow_rec6 is casted to flow_rec, and flow6_entry_data is
  32.   * casted to flow_entry_data. After casting, fle->r.fib is accessed.
  33. @@ -347,6 +356,14 @@
  34.     { NULL }                    \
  35.  }
  36.  
  37. +/* Parse the v9info structure */
  38. +#define    NG_NETFLOW_V9INFO_TYPE {            \
  39. +   { "v9 template packets",    &ng_parse_uint16_type },\
  40. +   { "v9 template time",   &ng_parse_uint16_type },\
  41. +   { "v9 MTU",     &ng_parse_uint16_type },\
  42. +   { NULL }                    \
  43. +}
  44. +
  45.  /* Private hook data */
  46.  struct ng_netflow_iface {
  47.     hook_p      hook;       /* NULL when disconnected */
  48. @@ -388,6 +405,7 @@
  49.     hook_p          export9;    /* Netflow V9 export data goes there */
  50.  
  51.     struct ng_netflow_info  info;
  52. +   struct ng_netflow_v9info    v9info;
  53.     struct callout      exp_callout;    /* expiry periodic job */
  54.  
  55.     /*
  56. @@ -472,6 +490,7 @@
  57.  void   ng_netflow_cache_flush(priv_p);
  58.  int    ng_netflow_fib_init(priv_p priv, int fib);
  59.  void   ng_netflow_copyinfo(priv_p, struct ng_netflow_info *);
  60. +void   ng_netflow_copyv9info(priv_p, struct ng_netflow_v9info *);
  61.  timeout_t ng_netflow_expire;
  62.  int    ng_netflow_flow_add(priv_p, fib_export_p, struct ip *, caddr_t, uint8_t, uint8_t, unsigned int);
  63.  int    ng_netflow_flow6_add(priv_p, fib_export_p, struct ip6_hdr *, caddr_t , uint8_t, uint8_t, unsigned int);
  64. --- ng_netflow.c.orig   2012-08-03 15:32:09.000000000 +0300
  65. +++ ng_netflow.c    2012-10-10 13:19:26.000000000 +0300
  66. @@ -238,6 +238,13 @@
  67.     priv->info.nfinfo_inact_t = INACTIVE_TIMEOUT;
  68.     priv->info.nfinfo_act_t = ACTIVE_TIMEOUT;
  69.  
  70. +   /* Initialize v9 template */
  71. +   priv->info.nfinfo_templ_packets = NETFLOW_V9_MAX_PACKETS_TEMPL;
  72. +   priv->info.nfinfo_templ_time = NETFLOW_V9_MAX_TIME_TEMPL;
  73. +
  74. +   /* Initialize v9 MTU */
  75. +   priv->info.nfinfo_mtu = BASE_MTU;
  76. +
  77.     /* Set default config */
  78.     for (i = 0; i < NG_NETFLOW_MAXIFACES; i++)
  79.         priv->ifaces[i].info.conf = NG_NETFLOW_CONF_INGRESS;
  80. @@ -490,6 +497,9 @@
  81.             priv->templ_packets = set->packets;
  82.             priv->templ_time = set->time;
  83.  
  84. +           priv->info.nfinfo_templ_packets = set->packets;
  85. +           priv->info.nfinfo_templ_time = set->time;
  86. +
  87.             break;
  88.         }
  89.         case NGM_NETFLOW_SETMTU:
  90. @@ -505,6 +515,8 @@
  91.  
  92.             priv->mtu = set->mtu;
  93.  
  94. +           priv->info.nfinfo_mtu = set->mtu;
  95. +
  96.             break;
  97.         }
  98.         case NGM_NETFLOW_SHOW:
Add Comment
Please, Sign In to add comment