|
1 |
| -# $Id: ouiparse.awk,v 1.1 2000/08/2306:02:23 thomas Exp $ |
| 1 | +# $Id: ouiparse.awk,v 1.2 2000/08/2313:44:14 thomas Exp $ |
2 | 2 | #
|
3 | 3 | # ouiparse.awk
|
4 | 4 | # Author: Lawrence E. Rosenman <ler@lerctr.org>
|
|
10 | 10 | # manufacturer text);
|
11 | 11 | # the table name is set by setting the AWK variable TABLE
|
12 | 12 | #
|
13 |
| -# we translate the character apostrophe (') tospace inside the company name |
14 |
| -# to avoid SQL errors. |
| 13 | +# we translate the character apostrophe (') todouble apostrophe ('') inside |
| 14 | +#the company nameto avoid SQL errors. |
15 | 15 | #
|
16 |
| -# match ONLY lines that begin with 2 hex numbers, -, and another hex number |
17 | 16 |
|
18 | 17 | BEGIN {
|
19 | 18 | TABLE="macoui";
|
|
27 | 26 | printf"COMMIT TRANSACTION;";
|
28 | 27 | }
|
29 | 28 |
|
| 29 | +# match ONLY lines that begin with 2 hex numbers, -, and another hex number |
30 | 30 | /^[0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F]/ {
|
31 | 31 | #if (nrec >= 100) {
|
32 | 32 | #printf "COMMIT TRANSACTION;";
|
|
47 | 47 | Company=Company"" $i;
|
48 | 48 | # Modify any apostrophes (') to avoid grief below.
|
49 | 49 | gsub("'","''",Company);
|
50 |
| -# Print out for the'C' structure in mac.c |
| 50 | +# Print out for theSQL table insert |
51 | 51 | printf"INSERT INTO %s (addr, name) VALUES (trunc(macaddr \'%s\'),\'%s\');\n",
|
52 | 52 | TABLE,OUI,Company;
|
53 | 53 | }
|