From 1ea174de0a940a119c0af6e5a7bf42994f943422 Mon Sep 17 00:00:00 2001 From: Kohei TANUMA Date: Mon, 17 Aug 2009 14:06:13 +0900 Subject: [PATCH] Re-numbering log. --- logger/extract_log | 135 +++++++++++++++++++++++++++++++++ module/protocol/protomod_ip.c | 22 +++--- module/protocol/protomod_pfilter.c | 16 ++-- module/protocol/protomod_sessionless.c | 16 ++-- module/protocol/protomod_sslid.c | 48 ++++++------ module/protocol/protomod_url.c | 16 ++-- 6 files changed, 194 insertions(+), 59 deletions(-) create mode 100755 logger/extract_log diff --git a/logger/extract_log b/logger/extract_log new file mode 100755 index 0000000..32360eb --- /dev/null +++ b/logger/extract_log @@ -0,0 +1,135 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use Data::Dumper; + +@ARGV || do { + die "Usage: $0 SRCFILE ...\n" + . "Extract log message from specified source code,\n" + . "and output log lists in CSV format.\n" + . "\n" + . "Example:\n" + . " \$ $0 ../src/*.c ../module/*/*.c*\n"; +}; + +my %all_log; +$| = 1; + +# pick out all log message! +for my $src (@ARGV) { + print STDERR "reading $src ... "; + if (!-f $src) { + print STDERR "\n$src: No such file\nPush Enter key to continue.\n"; + ; + next; + } + my $fh; + if (!open $fh, "<", $src) { + print STDERR "\n$src: Cannot open file\nPush Enter key to continue.\n"; + ; + next; + } + my $all_line; + map { $all_line .= $_ } <$fh>; + close $fh; + + # remove all CRLF + $all_line =~ s/[\r\n]//g; + my $count = 0; + + # log function regex + while ($all_line =~ / + ( # capture start + (?: + LOGGER_PUT_LOG_([^\s(]+) \s* \( \s* # LOGGER_PUT_LOG_LEVEL start + | # or + PUT_LOG_([^\s(]+) \s* \( [^,]+, \s* # PUT_LOG_LEVEL start + ) + ([^\s,]+) \s* , \s* # log category + (\d+) \s* , \s* # log number + ( (?: (?: "[^"]*" \s* )+ | [^,)]+) ) # log message + .*? # any argument + \) \s* ; # log function end + ) # capture end + /xsg) { + my ($log, $category, $number, $message) = ($1, $4, $5, $6); + my $level = $2 || $3; + + # push to hash table (push for duplicate log) + push @{ $all_log{$category}{$level}{$number}{file } }, $src; + push @{ $all_log{$category}{$level}{$number}{log } }, $log; + push @{ $all_log{$category}{$level}{$number}{message } }, $message; + + $count++; + } + print STDERR "$count logs.\n"; +} + +#print Dumper \%all_log; +#exit; + +# output log list +my %summary; +my @duplicate_list; +for my $category (sort keys %all_log) { + print "===== $category =====\n"; + for my $level ( sort keys %{ $all_log{$category} } ) { + print "----- $level -----\n"; + for my $number ( sort { $a <=> $b } keys %{ $all_log{$category}{$level} } ) { + my $entry = $#{ $all_log{$category}{$level}{$number}{file} }; + for (0 .. $entry) { + my $file = $all_log{$category}{$level}{$number}{file }[$_]; + my $log = $all_log{$category}{$level}{$number}{log }[$_]; + my $message = $all_log{$category}{$level}{$number}{message}[$_]; + # CSV + print "$category,$level,$number,$file,$message,"; + if ($entry > 0) { + # duplicate tag + print "DUPLICATE"; + push @duplicate_list, "$file: $log\n"; + } + print "\n"; + $summary{$category}{all}++; + $summary{$category}{$level}++; + $summary{$category}{duplicate}{all} += $entry; + $summary{$category}{duplicate}{$level} += $entry; + } + } + } + print "\n"; +} + +# print all duplicate log +#print "===== DUPLICATE LOG =====\n"; +#for (@duplicate_list) { +# print; +#} +#print "\n"; + +# print summary +print "===== SUMMARY =====\n"; +for my $category (sort keys %summary) { + # category has duplicate log + if ( $summary{$category}{duplicate}{all} ) { + print "$category (duplicate)\n"; + printf "ALL: %d(%d), ", $summary{$category}{all} || 0, $summary{$category}{duplicate}{all} || 0; + printf "FATAL: %d(%d), ", $summary{$category}{FATAL} || 0, $summary{$category}{duplicate}{FATAL} || 0; + printf "ERROR: %d(%d), ", $summary{$category}{ERROR} || 0, $summary{$category}{duplicate}{ERROR} || 0; + printf "WARN: %d(%d), ", $summary{$category}{WARN} || 0, $summary{$category}{duplicate}{WARN} || 0; + printf "INFO: %d(%d), ", $summary{$category}{INFO} || 0, $summary{$category}{duplicate}{INFO} || 0; + printf "DEBUG: %d(%d)", $summary{$category}{DEBUG} || 0, $summary{$category}{duplicate}{DEBUG} || 0; + print "\n"; + } + # category has no duplicate log + else { + print "$category\n"; + printf "ALL: %d, ", $summary{$category}{all} || 0; + printf "FATAL: %d, ", $summary{$category}{FATAL} || 0; + printf "ERROR: %d, ", $summary{$category}{ERROR} || 0; + printf "WARN: %d, ", $summary{$category}{WARN} || 0; + printf "INFO: %d, ", $summary{$category}{INFO} || 0; + printf "DEBUG: %d ", $summary{$category}{DEBUG} || 0; + print "\n"; + } +} diff --git a/module/protocol/protomod_ip.c b/module/protocol/protomod_ip.c index b642a74..e897169 100644 --- a/module/protocol/protomod_ip.c +++ b/module/protocol/protomod_ip.c @@ -540,7 +540,7 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, else { strncpy(len_str, "NULL", DEBUG_STR_LEN); } - PUT_LOG_DEBUG(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,260, + PUT_LOG_DEBUG(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,331, "in_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len):srv=&(%s), conn=&(%s), request=\"%s\", len=&(%s)", srv_str, conn_str, request, len_str); @@ -549,22 +549,22 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, /* check null */ if (srv == NULL) { - PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,221, "Arg(srv) is NULL pointer."); + PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,324, "Arg(srv) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (srv->pm == NULL) { - PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,222, "Arg(srv->pm) is NULL pointer."); + PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,325, "Arg(srv->pm) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (request == NULL) { - PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,223, "Arg(request) is NULL pointer."); + PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,326, "Arg(request) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (len == NULL) { - PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,224, "Arg(len) is NULL pointer."); + PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,327, "Arg(len) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } @@ -577,13 +577,13 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, LOG_LV_DEBUG == ip_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { char ip_str[DEBUG_STR_LEN] = {0}; l7vs_ip_service_c_str(ip_str, ip_service); - PUT_LOG_DEBUG(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,261, "pointer assign: ip_service=&(%s)", + PUT_LOG_DEBUG(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,332, "pointer assign: ip_service=&(%s)", ip_str); } /*------ DEBUG LOG END ------*/ if (ip_service == NULL) { - PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,227, "Could not find such service handle's ip service."); + PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,328, "Could not find such service handle's ip service."); return_value = -1; goto analyze_cldata_out; } @@ -635,7 +635,7 @@ analyze_cldata_out: /*-------- DEBUG LOG --------*/ if (ip_protomod.get_log_level != NULL && LOG_LV_DEBUG == ip_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { - PUT_LOG_DEBUG(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,262, + PUT_LOG_DEBUG(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,333, "out_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len):return_value=%d", return_value); } @@ -1040,13 +1040,13 @@ parse(void *ip_arg, int argc, char *argv[]) /* --timeout / -T */ case 'T': if (sscanf(optarg, "%lu", &buffer) == 0) { - PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,107, + PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,316, "-T/--timeout option value '%s' is invalid.", optarg); return_value = -1; goto parse_out; } if (buffer > INT_MAX) { - PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,108, + PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,317, "-T/--timeout option value '%s' is too large.", optarg); return_value = -1; goto parse_out; @@ -1090,7 +1090,7 @@ parse(void *ip_arg, int argc, char *argv[]) } /* same option */ if (timeout_flag > 1) { - PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,113, + PUT_LOG_ERROR(ip_protomod, LOG_CAT_L7VSD_PROTOCOL,318, "Cannot set multiple option '--timeout/-T'."); return_value = -1; goto parse_out; diff --git a/module/protocol/protomod_pfilter.c b/module/protocol/protomod_pfilter.c index 1182f4b..0490f5f 100644 --- a/module/protocol/protomod_pfilter.c +++ b/module/protocol/protomod_pfilter.c @@ -594,7 +594,7 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, else { strncpy(len_str, "NULL", DEBUG_STR_LEN); } - PUT_LOG_DEBUG(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,296, + PUT_LOG_DEBUG(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,334, "in_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len):srv=&(%s), conn=&(%s), " "request=\"%s\", len=&(%s))", @@ -604,22 +604,22 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, /* check null */ if (srv == NULL) { - PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,253, "Arg(srv) is NULL pointer."); + PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,329, "Arg(srv) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (srv->pm == NULL) { - PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,254, "Arg(srv->pm) is NULL pointer."); + PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,330, "Arg(srv->pm) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (request == NULL) { - PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,255, "Arg(request) is NULL pointer."); + PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,331, "Arg(request) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (len == NULL) { - PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,256, "Arg(len) is NULL pointer."); + PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,332, "Arg(len) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } @@ -632,13 +632,13 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, LOG_LV_DEBUG == pfilter_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { char pfilter_str[DEBUG_STR_LEN] = {0}; l7vs_pfilter_service_c_str(pfilter_str, pfilter_service); - PUT_LOG_DEBUG(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,297, "pointer assign: pfilter_service=&(%s)", + PUT_LOG_DEBUG(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,335, "pointer assign: pfilter_service=&(%s)", pfilter_str); } /*------ DEBUG LOG END ------*/ if (pfilter_service == NULL) { - PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,259, "Could not find such service handle's pfilter service."); + PUT_LOG_ERROR(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,333, "Could not find such service handle's pfilter service."); return_value = -1; goto analyze_cldata_out; } @@ -671,7 +671,7 @@ analyze_cldata_out: /*-------- DEBUG LOG --------*/ if (pfilter_protomod.get_log_level != NULL && LOG_LV_DEBUG == pfilter_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { - PUT_LOG_DEBUG(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,298, + PUT_LOG_DEBUG(pfilter_protomod, LOG_CAT_L7VSD_PROTOCOL,336, "out_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len):return_value=%d", return_value); diff --git a/module/protocol/protomod_sessionless.c b/module/protocol/protomod_sessionless.c index f488de4..11c5ff3 100644 --- a/module/protocol/protomod_sessionless.c +++ b/module/protocol/protomod_sessionless.c @@ -525,7 +525,7 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, else { strncpy(len_str, "NULL", DEBUG_STR_LEN); } - PUT_LOG_DEBUG(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,70, + PUT_LOG_DEBUG(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,322, "in_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len):srv=&(%s), conn=&(%s), request=\"%s\", len=&(%s)", srv_str, conn_str, request, len_str); @@ -534,22 +534,22 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, /* check null */ if (srv == NULL) { - PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,55, "Arg(srv) is NULL pointer."); + PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,305, "Arg(srv) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (srv->pm == NULL) { - PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,56, "Arg(srv->pm) is NULL pointer."); + PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,306, "Arg(srv->pm) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (request == NULL) { - PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,57, "Arg(request) is NULL pointer."); + PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,307, "Arg(request) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (len == NULL) { - PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,58, "Arg(len) is NULL pointer."); + PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,308, "Arg(len) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } @@ -562,13 +562,13 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, LOG_LV_DEBUG == sessionless_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { char sessionless_str[DEBUG_STR_LEN] = {0}; l7vs_sessionless_service_c_str(sessionless_str, sessionless_service); - PUT_LOG_DEBUG(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,71, "pointer assign: sessionless_service=&(%s)", + PUT_LOG_DEBUG(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,323, "pointer assign: sessionless_service=&(%s)", sessionless_str); } /*------ DEBUG LOG END ------*/ if (sessionless_service == NULL) { - PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,61, "Could not find such service handle's sessionless service."); + PUT_LOG_ERROR(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,309, "Could not find such service handle's sessionless service."); return_value = -1; goto analyze_cldata_out; } @@ -620,7 +620,7 @@ analyze_cldata_out: /*-------- DEBUG LOG --------*/ if (sessionless_protomod.get_log_level != NULL && LOG_LV_DEBUG == sessionless_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { - PUT_LOG_DEBUG(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,72, + PUT_LOG_DEBUG(sessionless_protomod, LOG_CAT_L7VSD_PROTOCOL,324, "out_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len):return_value=%d", return_value); diff --git a/module/protocol/protomod_sslid.c b/module/protocol/protomod_sslid.c index 00f259c..d4b9d35 100644 --- a/module/protocol/protomod_sslid.c +++ b/module/protocol/protomod_sslid.c @@ -608,7 +608,7 @@ analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, else { strncpy(len_str, "NULL", DEBUG_STR_LEN); } - PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,103, + PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,325, "in_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len):srv=&(%s), conn=&(%s), " "request=\"%s\", len=&(%s)", @@ -618,22 +618,22 @@ analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, /* check null */ if (srv == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,83, "Arg(srv) is NULL pointer."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,310, "Arg(srv) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (srv->pm == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,84, "Arg(srv->pm) is NULL pointer."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,311, "Arg(srv->pm) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (request == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,85, "Arg(request) is NULL pointer."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,312, "Arg(request) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (len == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,86, "Arg(len) is NULL pointer."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,313, "Arg(len) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } @@ -646,18 +646,18 @@ analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, LOG_LV_DEBUG == sslid_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { char sslid_str[DEBUG_STR_LEN] = {0}; l7vs_sslid_service_c_str(sslid_str, sslid_service); - PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,104, "pointer assign: sslid_service=&(%s)", + PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,326, "pointer assign: sslid_service=&(%s)", sslid_str); } /*------ DEBUG LOG END ------*/ if (sslid_service == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,89, "Could not find such service handle's sslid service."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,314, "Could not find such service handle's sslid service."); return_value = -1; goto analyze_cldata_out; } if (sslid_service->session == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,90, + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,315, "Service has NULL pointer session."); return_value = -1; goto analyze_cldata_out; @@ -667,7 +667,7 @@ analyze_cldata_out: /*-------- DEBUG LOG --------*/ if (sslid_protomod.get_log_level != NULL && LOG_LV_DEBUG == sslid_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { - PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,107, + PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL,327, "out_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len):return_value=%d", return_value); } @@ -1425,20 +1425,20 @@ static void l7vs_protomod_sslid_read_replication_data(struct l7vs_sslid_service* /* check null */ if (sslid_service == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, "Arg(sslid_service) is NULL pointer."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 294, "Arg(sslid_service) is NULL pointer."); goto read_replication_data_out; } if (sslid_service->session == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, "Arg(sslid_service->session) is NULL pointer."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 295, "Arg(sslid_service->session) is NULL pointer."); goto read_replication_data_out; } if (srv == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 296, "Service that has handle(%d) is not found.", sslid_service->service_handle); goto read_replication_data_out; } if (srv->lsock == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 297, "Conn of service that has handle(%d) is NULL pointer.", sslid_service->service_handle); goto read_replication_data_out; } @@ -1454,7 +1454,7 @@ static void l7vs_protomod_sslid_read_replication_data(struct l7vs_sslid_service* used += head->size; if (data_size * DATA_SIZE < sizeof(struct replication_header) * (SSLID_SERVICE_NUMBER - 1) + used) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, "Over replication area."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 298, "Over replication area."); goto read_replication_data_out; } @@ -1480,7 +1480,7 @@ static void l7vs_protomod_sslid_read_replication_data(struct l7vs_sslid_service* /* area size check */ if (sizeof(struct replication_header) * (SSLID_SERVICE_NUMBER - 1) + used + sslid_service->maxlist * sizeof(struct ssl_session) > data_size * DATA_SIZE) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 299, "Replication area is full."); goto read_replication_data_out; } @@ -1499,7 +1499,7 @@ static void l7vs_protomod_sslid_read_replication_data(struct l7vs_sslid_service* LOG_LV_DEBUG == sslid_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { char head_str[DEBUG_STR_LEN]; replication_header_c_str(head_str, pick); - PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, + PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 318, "Write replication area: head=(%s)", head_str); } /*------ DEBUG LOG END ------*/ @@ -1508,7 +1508,7 @@ static void l7vs_protomod_sslid_read_replication_data(struct l7vs_sslid_service* } } else { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 300, "Replication area is full."); goto read_replication_data_out; } @@ -1524,7 +1524,7 @@ static void l7vs_protomod_sslid_read_replication_data(struct l7vs_sslid_service* LOG_LV_DEBUG == sslid_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { char head_str[DEBUG_STR_LEN]; replication_header_c_str(head_str, head); - PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, + PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 319, "Write replication area: head=(%s)", head_str); } /*------ DEBUG LOG END ------*/ @@ -1536,7 +1536,7 @@ static void l7vs_protomod_sslid_read_replication_data(struct l7vs_sslid_service* /* area size check */ if (sizeof(struct replication_header) * (SSLID_SERVICE_NUMBER - 1) + used + sslid_service->maxlist * sizeof(struct ssl_session) > data_size * DATA_SIZE) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 301, "Replication area is full."); goto read_replication_data_out; } @@ -1554,14 +1554,14 @@ static void l7vs_protomod_sslid_read_replication_data(struct l7vs_sslid_service* LOG_LV_DEBUG == sslid_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { char head_str[DEBUG_STR_LEN]; replication_header_c_str(head_str, pick); - PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, + PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 320, "Write replication area: head=(%s)", head_str); } /*------ DEBUG LOG END ------*/ } } else { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 302, "Replication area is full."); goto read_replication_data_out; } @@ -1598,11 +1598,11 @@ static void l7vs_protomod_sslid_write_replication_data(struct l7vs_sslid_service /* check null */ if (sslid_service == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, "Arg(sslid_service) is NULL pointer."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 303, "Arg(sslid_service) is NULL pointer."); goto write_replication_data_out; } if (sslid_service->session == NULL) { - PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, "Arg(sslid_service->session) is NULL pointer."); + PUT_LOG_ERROR(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 304, "Arg(sslid_service->session) is NULL pointer."); goto write_replication_data_out; } /* no replicate setting */ @@ -1619,7 +1619,7 @@ static void l7vs_protomod_sslid_write_replication_data(struct l7vs_sslid_service LOG_LV_DEBUG == sslid_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { char session_str[DEBUG_STR_LEN]; ssl_session_c_str(session_str, (struct ssl_session*) sslid_service->replication_addr); - PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 0, "Write replication area: session=(%s)", + PUT_LOG_DEBUG(sslid_protomod, LOG_CAT_L7VSD_PROTOCOL, 321, "Write replication area: session=(%s)", session_str); } /*------ DEBUG LOG END ------*/ diff --git a/module/protocol/protomod_url.c b/module/protocol/protomod_url.c index 003bff1..e4aa18d 100644 --- a/module/protocol/protomod_url.c +++ b/module/protocol/protomod_url.c @@ -741,7 +741,7 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, else { strncpy(len_str, "NULL", DEBUG_STR_LEN); } - PUT_LOG_DEBUG(url_protomod, LOG_CAT_L7VSD_PROTOCOL,148, + PUT_LOG_DEBUG(url_protomod, LOG_CAT_L7VSD_PROTOCOL,328, "in_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len):srv=&(%s), conn=&(%s), " "request=\"%s\", len=&(%s)", @@ -751,22 +751,22 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, /* check null */ if (srv == NULL) { - PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,123, "Arg(srv) is NULL pointer."); + PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,319, "Arg(srv) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (srv->pm == NULL) { - PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,124, "Arg(srv->pm) is NULL pointer."); + PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,320, "Arg(srv->pm) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (request == NULL) { - PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,125, "Arg(request) is NULL pointer."); + PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,321, "Arg(request) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } if (len == NULL) { - PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,126, "Arg(len) is NULL pointer."); + PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,322, "Arg(len) is NULL pointer."); return_value = -1; goto analyze_cldata_out; } @@ -779,13 +779,13 @@ analyze_cldata(struct l7vs_service *srv, struct l7vs_conn *conn, LOG_LV_DEBUG == url_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { char url_str[DEBUG_STR_LEN] = {0}; l7vs_url_service_c_str(url_str, url_service); - PUT_LOG_DEBUG(url_protomod, LOG_CAT_L7VSD_PROTOCOL,149, "pointer assign: url_service=&(%s)", + PUT_LOG_DEBUG(url_protomod, LOG_CAT_L7VSD_PROTOCOL,329, "pointer assign: url_service=&(%s)", url_str); } /*------ DEBUG LOG END ------*/ if (url_service == NULL) { - PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,129, "Could not find such service handle's url service."); + PUT_LOG_ERROR(url_protomod, LOG_CAT_L7VSD_PROTOCOL,323, "Could not find such service handle's url service."); return_value = -1; goto analyze_cldata_out; } @@ -832,7 +832,7 @@ analyze_cldata_out: /*-------- DEBUG LOG --------*/ if (url_protomod.get_log_level != NULL && LOG_LV_DEBUG == url_protomod.get_log_level(LOG_CAT_L7VSD_PROTOCOL)) { - PUT_LOG_DEBUG(url_protomod, LOG_CAT_L7VSD_PROTOCOL,150, + PUT_LOG_DEBUG(url_protomod, LOG_CAT_L7VSD_PROTOCOL,330, "out_function: int analyze_cldata(struct l7vs_service* srv, struct l7vs_conn* conn, " "char* request, size_t* len, struct l7vs_dest** dest, int* tcps):return_value=%d", return_value); -- 2.11.0