Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- analyzer TEST withcontext {
- connection: TEST_Conn;
- flow: TEST_Flow;
- };
- connection TEST_Conn {
- upflow = TEST_Flow(true);
- downflow = TEST_Flow(false);
- };
- type TEST_Client = record
- {
- header: TEST_Header;
- body: TEST_Body;
- };
- type TEST_Header = record
- {
- header: "HEADER";
- } &oneline;
- type TEST_Body = record
- {
- body: bytestring &restofflow &chunked;
- };
- type TEST_PDU(is_orig: bool) = case is_orig of
- {
- true -> client: TEST_Client;
- };
- flow TEST_Flow(is_orig: bool) {
- flowunit = TEST_PDU(is_orig) withcontext (connection, this);
- };
- function header_done(header: TEST_Header): bool
- %{
- printf("Header done event\n");
- %}
- function body_done(body: TEST_Body): bool
- %{
- printf("Body done event\n");
- %}
- function message_done(pdu: TEST_PDU): bool
- %{
- printf("Message done event\n");
- %}
- refine typeattr TEST_Header += &let {
- process_header: bool = header_done(this);
- };
- refine typeattr TEST_Body += &let {
- process_body: bool = body_done(this);
- };
- refine typeattr TEST_PDU += &let {
- process_message: bool = message_done(this);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement