{"size": 823, "ext": "pac", "max_stars_repo_path": "src/analyzer/protocol/syslog/syslog-protocol.pac", "max_stars_repo_name": "yaplej/bro", "max_stars_repo_stars_event_min_datetime": "2015-01-01T15:31:58.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-08T22:15:19.000Z", "max_issues_repo_path": "src/analyzer/protocol/syslog/syslog-protocol.pac", "max_issues_repo_name": "yaplej/bro", "max_issues_repo_issues_event_min_datetime": "2018-12-07T17:12:15.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T22:56:35.000Z", "max_forks_repo_path": "src/analyzer/protocol/syslog/syslog-protocol.pac", "max_forks_repo_name": "yaplej/bro", "max_forks_repo_forks_event_min_datetime": "2015-01-01T20:29:40.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-06T17:39:01.000Z"}
{"max_stars_count": 2181, "max_issues_count": 1277, "max_forks_count": 696, "avg_line_length": 26.5483870968, "max_line_length": 76, "alphanum_fraction": 0.6573511543}
type Syslog_Message_Optional_PRI = record {
	lt:       uint8;
	after_lt: bytestring &restofdata &transient;
}
&byteorder = littleendian
&exportsourcedata
&let {
	standard:    Syslog_Message(true) withinput sourcedata &if(lt == 60); # '<'
	nonstandard: Syslog_Message(false) withinput sourcedata &if(lt != 60);
};

type Syslog_Message(has_pri: bool) = record {
	opt_pri: case has_pri of {
		true  -> PRI: Syslog_Priority;
		false -> nothing: empty;
	};

	msg: bytestring &restofdata;
} &byteorder = littleendian;

type Syslog_Priority = record {
	lt    : uint8 &enforce(lt == 60); # '<'
	val   : RE/[[:digit:]]+/;
	gt    : uint8 &enforce(gt == 62); # '>'
} &let {
	val_length: int = sizeof(val) - 1;
	int_val: int = bytestring_to_int(val, 10);
	severity: int = (int_val & 0x07);
	facility: int = (int_val & 0x03f8) >> 3;
};
