Skip to content
Snippets Groups Projects
Commit 3fa8ca1a authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Text processing adjusted to include directive

parent 53f80d8b
Branches
Tags
No related merge requests found
- the class IN is supported only
- time values can have maximal 1 unit (NOT 1D2H)
- \x and \DDD notation is allowed in domain_name only
- \x and \DDD notation is allowed in domain_name and text only
- @ can be used on the right side
- line number in multiline is the number of the last record part
- hex blocks multiple of 2, base64 blocks multiple of 4, base32hex blocks multiple of 8 (DHCID problem)
......
This diff is collapsed.
......@@ -452,20 +452,30 @@
action _text_init {
s->item_length = 0;
s->item_length_location = s->r_data_end;
s->r_data_length++;
s->r_data_end++;
}
action _text_exit {
*(s->item_length_location) = s->item_length;
s->r_data_length += s->item_length;
}
text = (('\"' . quoted_text_char* . '\"') | text_char+)
>_text_init %_text_exit;
text_array = text . (sep . text)*;
action _text_length_init {
s->item_length_location = s->r_data_end;
s->r_data_length++;
s->r_data_end++;
}
action _text_length_exit {
*(s->item_length_location) = s->item_length;
}
text_with_length = text >_text_length_init %_text_length_exit;
text_array = text_with_length . (sep . text_with_length)*;
# filename = text;
# END
# BEGIN - Directives processing
......@@ -669,7 +679,7 @@
base64_char = alnum | [+/];
base64_padd = '=';
base64_quarted =
base64_quartet =
( base64_char $_first_base64_char . # A
base64_char $_second_base64_char . # AB
( ( base64_char $_third_base64_char . # ABC
......@@ -682,7 +692,7 @@
);
# Base64 array with possibility of inside white spaces and multiline.
base64 = (base64_quarted+ . sep?)+ $!_base64_char_error;
base64 = (base64_quartet+ . sep?)+ $!_base64_char_error;
# END
# BEGIN - Base32hex processing (RFC 4648).
......@@ -930,6 +940,7 @@
}
}
# Blank bitmap is allowed too.
bitmap := (sep? | (sep . type_bit)* . sep?) >_bitmap_init
%_bitmap_exit %_ret $!_bitmap_error . end_wchar;
......
......@@ -38,7 +38,7 @@ extern const uint8_t digit_to_num[];
extern const uint8_t first_hex_to_num[];
extern const uint8_t second_hex_to_num[];
// Transformation array for Base64 encoding.
// Transformation arrays for Base64 encoding.
extern const uint8_t first_base64_to_num[];
extern const uint8_t second_left_base64_to_num[];
extern const uint8_t second_right_base64_to_num[];
......@@ -46,7 +46,7 @@ extern const uint8_t third_left_base64_to_num[];
extern const uint8_t third_right_base64_to_num[];
extern const uint8_t fourth_base64_to_num[];
// Transformation array for Base32hex encoding.
// Transformation arrays for Base32hex encoding.
extern const uint8_t first_base32hex_to_num[];
extern const uint8_t second_left_base32hex_to_num[];
extern const uint8_t second_right_base32hex_to_num[];
......
......@@ -58,3 +58,6 @@ $ORIGIN gut.
vv A 1.1.1.1
. AAAA ::5 ())
$INCLUDE file1
$INCLUDE file2 example.com
......@@ -25,7 +25,7 @@
#include "zscanner/scanner.h"
void print_wire_dname(const uint8_t *dname, uint32_t dname_length)
static void print_wire_dname(const uint8_t *dname, uint32_t dname_length)
{
uint32_t label_length = 0, i = 0;
......
......@@ -27,12 +27,8 @@
#ifndef _ZSCANNER__TEST_FUNCTIONS_H_
#define _ZSCANNER__TEST_FUNCTIONS_H_
#include <stdint.h>
#include "zscanner/scanner.h"
void print_wire_dname(const uint8_t *dname, uint32_t dname_length);
void process_error(const scanner_t *scanner);
void process_record(const scanner_t *scanner);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment