summaryrefslogtreecommitdiff
path: root/print-sunatm.c
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2014-03-20 14:39:44 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2014-03-20 15:17:35 +0400
commit90692fcf9745a67fff68350b88acd56e4ddcb23b (patch)
tree31430b376bc2d643da3c31733ca320040a9ab5f7 /print-sunatm.c
parent94b28f43b5c95af7591305e65b07471f230c9371 (diff)
downloadtcpdump-90692fcf9745a67fff68350b88acd56e4ddcb23b.tar.gz
NDOize ATM, MPTCP, NTP, VTP & Whiteboard decoders
Diffstat (limited to 'print-sunatm.c')
-rw-r--r--print-sunatm.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/print-sunatm.c b/print-sunatm.c
index ae86ccbf..fc03d42a 100644
--- a/print-sunatm.c
+++ b/print-sunatm.c
@@ -30,6 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -39,13 +40,10 @@
struct mbuf;
struct rtentry;
-#include <stdio.h>
-
#include "interface.h"
#include "extract.h"
#include "atm.h"
-#include "atmuni31.h"
/* SunATM header for ATM packet */
#define DIR_POS 0 /* Direction (0x80 = transmit, 0x00 = receive) */
@@ -64,7 +62,8 @@ struct rtentry;
* is the number of bytes actually captured.
*/
u_int
-sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p)
+sunatm_if_print(netdissect_options *ndo,
+ const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
@@ -73,15 +72,12 @@ sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p)
u_int traftype;
if (caplen < PKT_BEGIN_POS) {
- printf("[|atm]");
+ ND_PRINT((ndo, "[|atm]"));
return (caplen);
}
- if (eflag) {
- if (p[DIR_POS] & 0x80)
- printf("Tx: ");
- else
- printf("Rx: ");
+ if (ndo->ndo_eflag) {
+ ND_PRINT((ndo, p[DIR_POS] & 0x80 ? "Tx: " : "Rx: "));
}
switch (p[DIR_POS] & 0x0f) {
@@ -105,7 +101,7 @@ sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p)
p += PKT_BEGIN_POS;
caplen -= PKT_BEGIN_POS;
length -= PKT_BEGIN_POS;
- atm_print(vpi, vci, traftype, p, length, caplen);
+ atm_print(ndo, vpi, vci, traftype, p, length, caplen);
return (PKT_BEGIN_POS);
}