Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- ng_netflow.h.orig 2012-08-03 15:32:09.000000000 +0300
- +++ ng_netflow.h 2012-10-10 15:37:29.000000000 +0300
- @@ -34,6 +34,7 @@
- #define NG_NETFLOW_NODE_TYPE "netflow"
- #define NGM_NETFLOW_COOKIE 1309868867
- +#define NGM_NETFLOW_V9_COOKIE 1349865386
- #define NG_NETFLOW_MAXIFACES USHRT_MAX
- @@ -58,6 +59,7 @@
- NGM_NETFLOW_SETCONFIG = 7, /* set flow generation options */
- NGM_NETFLOW_SETTEMPLATE = 8, /* set v9 flow template periodic */
- NGM_NETFLOW_SETMTU = 9, /* set outgoing interface MTU */
- + NGM_NETFLOW_V9INFO = 10|NGM_READONLY|NGM_HASREPLY, /* get v9 info */
- };
- /* This structure is returned by the NGM_NETFLOW_INFO message */
- @@ -147,6 +149,13 @@
- uint32_t nentries; /* number of records in response */
- };
- +/* This structure is used in NGM_NETFLOW_V9INFO message */
- +struct ng_netflow_v9info {
- + uint16_t templ_packets; /* v9 template packets */
- + uint16_t templ_time; /* v9 template time */
- + uint16_t mtu; /* v9 MTU */
- +};
- +
- /* XXXGL
- * Somewhere flow_rec6 is casted to flow_rec, and flow6_entry_data is
- * casted to flow_entry_data. After casting, fle->r.fib is accessed.
- @@ -347,6 +356,14 @@
- { NULL } \
- }
- +/* Parse the v9info structure */
- +#define NG_NETFLOW_V9INFO_TYPE { \
- + { "v9 template packets", &ng_parse_uint16_type },\
- + { "v9 template time", &ng_parse_uint16_type },\
- + { "v9 MTU", &ng_parse_uint16_type },\
- + { NULL } \
- +}
- +
- /* Private hook data */
- struct ng_netflow_iface {
- hook_p hook; /* NULL when disconnected */
- @@ -388,6 +405,7 @@
- hook_p export9; /* Netflow V9 export data goes there */
- struct ng_netflow_info info;
- + struct ng_netflow_v9info v9info;
- struct callout exp_callout; /* expiry periodic job */
- /*
- @@ -472,6 +490,7 @@
- void ng_netflow_cache_flush(priv_p);
- int ng_netflow_fib_init(priv_p priv, int fib);
- void ng_netflow_copyinfo(priv_p, struct ng_netflow_info *);
- +void ng_netflow_copyv9info(priv_p, struct ng_netflow_v9info *);
- timeout_t ng_netflow_expire;
- int ng_netflow_flow_add(priv_p, fib_export_p, struct ip *, caddr_t, uint8_t, uint8_t, unsigned int);
- int ng_netflow_flow6_add(priv_p, fib_export_p, struct ip6_hdr *, caddr_t , uint8_t, uint8_t, unsigned int);
- --- ng_netflow.c.orig 2012-08-03 15:32:09.000000000 +0300
- +++ ng_netflow.c 2012-10-10 13:19:26.000000000 +0300
- @@ -238,6 +238,13 @@
- priv->info.nfinfo_inact_t = INACTIVE_TIMEOUT;
- priv->info.nfinfo_act_t = ACTIVE_TIMEOUT;
- + /* Initialize v9 template */
- + priv->info.nfinfo_templ_packets = NETFLOW_V9_MAX_PACKETS_TEMPL;
- + priv->info.nfinfo_templ_time = NETFLOW_V9_MAX_TIME_TEMPL;
- +
- + /* Initialize v9 MTU */
- + priv->info.nfinfo_mtu = BASE_MTU;
- +
- /* Set default config */
- for (i = 0; i < NG_NETFLOW_MAXIFACES; i++)
- priv->ifaces[i].info.conf = NG_NETFLOW_CONF_INGRESS;
- @@ -490,6 +497,9 @@
- priv->templ_packets = set->packets;
- priv->templ_time = set->time;
- + priv->info.nfinfo_templ_packets = set->packets;
- + priv->info.nfinfo_templ_time = set->time;
- +
- break;
- }
- case NGM_NETFLOW_SETMTU:
- @@ -505,6 +515,8 @@
- priv->mtu = set->mtu;
- + priv->info.nfinfo_mtu = set->mtu;
- +
- break;
- }
- case NGM_NETFLOW_SHOW:
Add Comment
Please, Sign In to add comment