* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/* \summary: Cisco NetFlow protocol printer */
+
/*
* Cisco NetFlow protocol
*
{
register const struct nfhdr_v1 *nh;
register const struct nfrec_v1 *nr;
- struct protoent *pent;
+ const char *p_name;
int nrecs, ver;
#if 0
time_t t;
ND_PRINT((ndo, ">> %s\n ", intoa(nr->nhop_ina.s_addr)));
- pent = getprotobynumber(nr->proto);
- if (!pent || ndo->ndo_nflag)
- ND_PRINT((ndo, "%u ", nr->proto));
+ if (!ndo->ndo_nflag && (p_name = netdb_protoname(nr->proto)) != NULL)
+ ND_PRINT((ndo, "%s ", p_name));
else
- ND_PRINT((ndo, "%s ", pent->p_name));
+ ND_PRINT((ndo, "%u ", nr->proto));
/* tcp flags for tcp only */
- if (pent && pent->p_proto == IPPROTO_TCP) {
+ if (nr->proto == IPPROTO_TCP) {
int flags;
flags = nr->tcp_flags;
ND_PRINT((ndo, "%s%s%s%s%s%s%s",
{
register const struct nfhdr_v5 *nh;
register const struct nfrec_v5 *nr;
- struct protoent *pent;
+ const char *p_name;
int nrecs, ver;
#if 0
time_t t;
ND_PRINT((ndo, ">> %s\n ", intoa(nr->nhop_ina.s_addr)));
- pent = getprotobynumber(nr->proto);
- if (!pent || ndo->ndo_nflag)
- ND_PRINT((ndo, "%u ", nr->proto));
+ if (!ndo->ndo_nflag && (p_name = netdb_protoname(nr->proto)) != NULL)
+ ND_PRINT((ndo, "%s ", p_name));
else
- ND_PRINT((ndo, "%s ", pent->p_name));
+ ND_PRINT((ndo, "%u ", nr->proto));
/* tcp flags for tcp only */
- if (pent && pent->p_proto == IPPROTO_TCP) {
+ if (nr->proto == IPPROTO_TCP) {
int flags;
flags = nr->tcp_flags;
ND_PRINT((ndo, "%s%s%s%s%s%s%s",
{
register const struct nfhdr_v6 *nh;
register const struct nfrec_v6 *nr;
- struct protoent *pent;
+ const char *p_name;
int nrecs, ver;
#if 0
time_t t;
ND_PRINT((ndo, ">> %s\n ", intoa(nr->nhop_ina.s_addr)));
- pent = getprotobynumber(nr->proto);
- if (!pent || ndo->ndo_nflag)
- ND_PRINT((ndo, "%u ", nr->proto));
+ if (!ndo->ndo_nflag && (p_name = netdb_protoname(nr->proto)) != NULL)
+ ND_PRINT((ndo, "%s ", p_name));
else
- ND_PRINT((ndo, "%s ", pent->p_name));
+ ND_PRINT((ndo, "%u ", nr->proto));
/* tcp flags for tcp only */
- if (pent && pent->p_proto == IPPROTO_TCP) {
+ if (nr->proto == IPPROTO_TCP) {
int flags;
flags = nr->tcp_flags;
ND_PRINT((ndo, "%s%s%s%s%s%s%s",