/*
- * This module implements decoding of AHCP (Ad Hoc Configuration Protocol) based
- * on draft-chroboczek-ahcp-00 and source code of ahcpd-0.53.
- *
- *
* Copyright (c) 2013 The TCPDUMP project
* All rights reserved.
*
* POSSIBILITY OF SUCH DAMAGE.
*/
+/* \summary: Ad Hoc Configuration Protocol (AHCP) printer */
+
+/* Based on draft-chroboczek-ahcp-00 and source code of ahcpd-0.53 */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
#include "netdissect.h"
#include "extract.h"
#include "addrtoname.h"
static const char tstr[] = " [|ahcp]";
-static const char cstr[] = "(invalid)";
#define AHCP_MAGIC_NUMBER 43
#define AHCP_VERSION_1 1
return 0;
invalid:
- ND_PRINT((ndo, ": %s", cstr));
+ ND_PRINT((ndo, "%s", istr));
ND_TCHECK2(*cp, ep - cp);
return 0;
trunc:
return 0;
invalid:
- ND_PRINT((ndo, ": %s", cstr));
+ ND_PRINT((ndo, "%s", istr));
ND_TCHECK2(*cp, ep - cp);
return 0;
trunc:
if (cp + 16 > ep)
goto invalid;
ND_TCHECK2(*cp, 16);
-#ifdef INET6
ND_PRINT((ndo, "%s%s", sep, ip6addr_string(ndo, cp)));
-#else
- ND_PRINT((ndo, "%s(compiled w/o IPv6)", sep));
-#endif /* INET6 */
cp += 16;
sep = ", ";
}
return 0;
invalid:
- ND_PRINT((ndo, ": %s", cstr));
+ ND_PRINT((ndo, "%s", istr));
ND_TCHECK2(*cp, ep - cp);
return 0;
trunc:
return 0;
invalid:
- ND_PRINT((ndo, ": %s", cstr));
+ ND_PRINT((ndo, "%s", istr));
ND_TCHECK2(*cp, ep - cp);
return 0;
trunc:
if (cp + 17 > ep)
goto invalid;
ND_TCHECK2(*cp, 17);
-#ifdef INET6
ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(ndo, cp), *(cp + 16)));
-#else
- ND_PRINT((ndo, "%s(compiled w/o IPv6)/%u", sep, *(cp + 16)));
-#endif /* INET6 */
cp += 17;
sep = ", ";
}
return 0;
invalid:
- ND_PRINT((ndo, ": %s", cstr));
+ ND_PRINT((ndo, "%s", istr));
ND_TCHECK2(*cp, ep - cp);
return 0;
trunc:
return 0;
invalid:
- ND_PRINT((ndo, ": %s", cstr));
+ ND_PRINT((ndo, "%s", istr));
ND_TCHECK2(*cp, ep - cp);
return 0;
trunc:
return;
invalid:
- ND_PRINT((ndo, " %s", cstr));
+ ND_PRINT((ndo, "%s", istr));
ND_TCHECK2(*cp, ep - cp);
return;
trunc:
return;
invalid:
- ND_PRINT((ndo, " %s", cstr));
+ ND_PRINT((ndo, "%s", istr));
ND_TCHECK2(*cp, ep - cp);
return;
trunc:
return;
invalid:
- ND_PRINT((ndo, " %s", cstr));
+ ND_PRINT((ndo, "%s", istr));
ND_TCHECK2(*cp, ep - cp);
return;
trunc: