]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-esp.c
Add program_name field in the netdissect_options structure
[tcpdump] / print-esp.c
index 3086928e57935459f7e7aec38bf7796e45045641..fe494a39e81ff6384acc71ea082b2343b90590f0 100644 (file)
 #include "ip6.h"
 #endif
 
-#include "interface.h"
+#include "netdissect.h"
 #include "extract.h"
 
+#include "ascii_strcasecmp.h"
+
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * All rights reserved.
@@ -331,8 +333,8 @@ espprint_decode_authalgo(netdissect_options *ndo,
        }
        *colon = '\0';
 
-       if(strcasecmp(colon,"sha1") == 0 ||
-          strcasecmp(colon,"md5") == 0) {
+       if(ascii_strcasecmp(colon,"sha1") == 0 ||
+          ascii_strcasecmp(colon,"md5") == 0) {
                sa->authlen = 12;
        }
        return 1;
@@ -426,11 +428,11 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
        } else
                decode = line;
 
-       if (spikey && strcasecmp(spikey, "file") == 0) {
+       if (spikey && ascii_strcasecmp(spikey, "file") == 0) {
                /* open file and read it */
                FILE *secretfile;
                char  fileline[1024];
-               int   lineno=0;
+               int   subfile_lineno=0;
                char  *nl;
                char *filename = line;
 
@@ -441,7 +443,7 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
                }
 
                while (fgets(fileline, sizeof(fileline)-1, secretfile) != NULL) {
-                       lineno++;
+                       subfile_lineno++;
                        /* remove newline from the line */
                        nl = strchr(fileline, '\n');
                        if (nl)
@@ -449,14 +451,14 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
                        if (fileline[0] == '#') continue;
                        if (fileline[0] == '\0') continue;
 
-                       esp_print_decode_onesecret(ndo, fileline, filename, lineno);
+                       esp_print_decode_onesecret(ndo, fileline, filename, subfile_lineno);
                }
                fclose(secretfile);
 
                return;
        }
 
-       if (spikey && strcasecmp(spikey, "ikev2") == 0) {
+       if (spikey && ascii_strcasecmp(spikey, "ikev2") == 0) {
                esp_print_decode_ikeline(ndo, line, file, lineno);
                return;
        }