-/* $OpenBSD: if_pflow.c,v 1.45 2014/07/22 11:06:09 mpi Exp $ */
+/* $OpenBSD: if_pflow.c,v 1.46 2014/08/13 09:46:23 blambert Exp $ */
/*
* Copyright (c) 2011 Florian Obser <florian@narrans.de>
struct pflow_v10_header *h10;
struct pflow_set_header *set_hdr;
struct ifnet *ifp = &sc->sc_if;
+ u_int32_t count;
int set_length;
switch (af) {
if (m == NULL)
return (0);
sc->sc_mbuf = NULL;
+ count = sc->sc_count4;
set_length = sizeof(struct pflow_set_header)
+ sc->sc_count4 * sizeof(struct pflow_ipfix_flow4);
break;
if (m == NULL)
return (0);
sc->sc_mbuf6 = NULL;
+ count = sc->sc_count6;
set_length = sizeof(struct pflow_set_header)
+ sc->sc_count6 * sizeof(struct pflow_ipfix_flow6);
break;
h10->version = htons(PFLOW_PROTO_10);
h10->length = htons(PFLOW_IPFIX_HDRLEN + set_length);
h10->time_sec = htonl(time_second); /* XXX 2038 */
- h10->flow_sequence = htonl(sc->sc_gcounter);
+ h10->flow_sequence = htonl(sc->sc_sequence);
+ sc->sc_sequence += count;
h10->observation_dom = htonl(PFLOW_ENGINE_TYPE);
return (pflow_sendout_mbuf(sc, m));
}
h10->length = htons(PFLOW_IPFIX_HDRLEN + sizeof(struct
pflow_ipfix_tmpl));
h10->time_sec = htonl(time_second); /* XXX 2038 */
- h10->flow_sequence = htonl(sc->sc_gcounter);
+ h10->flow_sequence = htonl(sc->sc_sequence);
h10->observation_dom = htonl(PFLOW_ENGINE_TYPE);
timeout_add_sec(&sc->sc_tmo_tmpl, PFLOW_TMPL_TIMEOUT);
-/* $OpenBSD: if_pflow.h,v 1.11 2014/03/29 11:26:03 florian Exp $ */
+/* $OpenBSD: if_pflow.h,v 1.12 2014/08/13 09:46:23 blambert Exp $ */
/*
* Copyright (c) 2008 Henning Brauer <henning@openbsd.org>
unsigned int sc_maxcount4;
unsigned int sc_maxcount6;
u_int64_t sc_gcounter;
+ u_int32_t sc_sequence;
struct ip_moptions sc_imo;
struct timeout sc_tmo;
struct timeout sc_tmo6;