Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dcs_classifier
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
dcs_classifier
Commits
2ad82986
Commit
2ad82986
authored
Aug 05, 2015
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use named command line arguments, prepare for more than one dbfile
parent
33bc6f6c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
16 deletions
+34
-16
Makefile.am
src/gen/Makefile.am
+8
-8
gen_dcs_classifier.pl
src/gen/gen_dcs_classifier.pl
+26
-8
No files found.
src/gen/Makefile.am
View file @
2ad82986
...
...
@@ -30,16 +30,16 @@ dcs_classifier.c: $(srcdir)/gen_dcs_classifier.pl dbfile $(srcdir)/../classes.co
@
if
$(AM_V_P)
;
then
set
-x
;
else
echo
" GEN dcs_classifier.c ... "
;
fi
;
\
if
[[
-f
fixup.remove
]]
&&
[[
-f
fixup.reorder
]]
;
then
\
$(srcdir)
/gen_dcs_classifier.pl
\
dbfile
\
$(DCS_KEY)
\
$(srcdir)
/../classes.conf
\
fixup.remove
\
fixup.reorder
;
\
--key
$(DCS_KEY)
\
--classes
$(srcdir)
/../classes.conf
\
--remove
fixup.remove
\
--reorder
fixup.reorder
\
dbfile
;
\
else
\
$(srcdir)
/gen_dcs_classifier.pl
\
dbfile
\
$(DCS_KEY)
\
$(srcdir)
/../classes.conf
;
\
--key
$(DCS_KEY)
\
--classes
$(srcdir)
/../classes.conf
\
dbfile
;
\
fi
# -- gen_dcs_match_mem
...
...
src/gen/gen_dcs_classifier.pl
View file @
2ad82986
...
...
@@ -596,10 +596,28 @@ sub load_reorder($) {
\
@reorder
;
}
my
(
$dbref
,
$dbchecksum
)
=
load_classifier_db
(
$ARGV
[
0
],
$ARGV
[
1
]);
load_classes
(
$ARGV
[
2
]);
my
$removeref
=
load_remove
(
$ARGV
[
3
]);
my
$reorderref
=
load_reorder
(
$ARGV
[
4
]);
use
Getopt::
Long
;
my
%
opt
;
GetOptions
(
'key=s'
=>
\
$opt
{
key
},
'classes=s'
=>
\
$opt
{
classes
},
'remove=s'
=>
\
$opt
{
remove
},
'reorder=s'
=>
\
$opt
{
reorder
})
||
die
(
"Error in command line arguments\n"
);
# remaining arguments are db files
my
@dbrefs
;
my
@dbchecksums
;
foreach
my
$f
(
@ARGV
)
{
my
(
$dbref
,
$dbchecksum
)
=
load_classifier_db
(
$f
,
$opt
{
key
});
push
@dbrefs
,
(
$dbref
);
push
@dbchecksums
,
(
$dbchecksum
);
}
load_classes
(
$opt
{
classes
});
my
$removeref
=
load_remove
(
$opt
{
remove
});
my
$reorderref
=
load_reorder
(
$opt
{
reorder
});
my
@entries
;
use
constant
{
...
...
@@ -686,8 +704,8 @@ my %special_entries;
## build %common_subkeys
## build @entries, except that not all fields are filled
my
%
subkeys_count
;
my
$dbboilerplate
=
"checksum "
.
$dbchecksum
.
"\n"
;
foreach
(
split
(
/[\n\r\f]/
,
$
$dbref
))
{
my
$dbboilerplate
=
"checksum "
.
$dbchecksum
s
[
0
]
.
"\n"
;
foreach
(
split
(
/[\n\r\f]/
,
$
{
$dbrefs
[
0
]}
))
{
if
(
/^\s*#/
)
{
$dbboilerplate
.=
$_
.
"\n"
;
next
;
...
...
@@ -914,7 +932,7 @@ my $dcs_type_count = scalar(keys %typeenum2nbtype);
################################################################################
## generate the data
_VCL
(
F_CHECKSUM
,
VCL_TOP
,
$dbchecksum
.
"\n"
);
_VCL
(
F_CHECKSUM
,
VCL_TOP
,
$dbchecksum
s
[
0
]
.
"\n"
);
boilerplate_autogen_c
(
F_CLASSIFIER_C
,
$dbboilerplate
);
boilerplate_autogen_c
(
F_CLASSIFIER_H
,
undef
);
...
...
@@ -925,7 +943,7 @@ _VCL (F_CLASSIFIER_H, VCL_TOP, <<EOF);
#define DCS_CLASSIFIER_H 1
#include <stdint.h>
#define DCS_CHECKSUM "$dbchecksum"
#define DCS_CHECKSUM "$dbchecksum
s[0]
"
/* tunable */
#define DCS_MAX_NEGMATCH_CAND 32
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment