Truxton event tag

From truxwiki.com
Revision as of 10:10, 2 December 2020 by Sam (talk | contribs) (→‎Sample)
Jump to navigation Jump to search

This will tag the event.

Syntax

void truxton_event_tag(uint64_t event_handle, char const * tag_name, char const * why, uint64_t origin);

Parameters

event_handle

The handle created by the truxton_event_create call.

tag_name

The small bit of text that will serve as the tag. This will show up in the user interface.

why

The reason why this item was tagged.

origin

What produced this tag. If an algorithm produced this tag, it should be set to 1. If you are calling this method because a human told you to, the value should be 2.

Sample

 1 #define TAG_ORIGIN_AUTOMATIC (1)
 2 #define TAG_ORIGIN_HUMAN     (2)
 3 
 4 void initialize_investigation(uint64_t truxton, char const * media_id, char const * file_id)
 5 {
 6    uint64_t event_handle = truxton_event_create(truxton);
 7 
 8    truxton_event_set_name( event_handle, "Phase 1" );
 9    truxton_event_set_description( event_handle, "As described by SA Barnett" );
10    truxton_event_set_start( event_handle, get_ticks( "2016-07-31T12:00:00-05:00" ) );
11    truxton_event_set_end( event_handle, get_ticks( "2017-01-04T12:00:00-05:00" ) );
12    truxton_event_set_type( event_handle, EVENT_TYPE_ADDED_BY_ANALYST );
13    truxton_event_set_media_id( event_handle, media_id );
14    truxton_event_set_file_id( event_handle, file_id );
15 
16    truxton_event_save( event_handle );
17 
18    char id[ 65 ];
19 
20    truxton_event_get_id( event_handle, id, sizeof( id ) );
21 
22    printf( "Event ID is %s\n", id );
23 
24    truxton_event_tag(event_handle, "FBI", "Lead Mushroom for investigation", TAG_ORIGIN_HUMAN);
25 
26    truxton_event_destroy(artifact);
27 }