~ubuntu-branches/ubuntu/utopic/sysdig/utopic

« back to all changes in this revision

Viewing changes to userspace/libscap/scap.h

  • Committer: Package Import Robot
  • Author(s): Evgeni Golov
  • Date: 2014-05-01 14:53:09 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140501145309-yy0hkts9nlu43omp
Tags: 0.1.81-1
* New upstream release
* Add B-D on zlib1g-dev and use it for building
* drop LuaJIT from debian/copyright, upstream does not ship the
  copy anymore
* Only require and execute dh_dkms when building arch-independent
  stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
374
374
        SCAP_ED_OUT = 1
375
375
}event_direction;
376
376
 
 
377
/*!
 
378
  \brief Indicates the compression type used when writing a tracefile
 
379
*/
 
380
typedef enum compression_mode
 
381
{
 
382
        SCAP_COMPRESSION_NONE = 0,
 
383
        SCAP_COMPRESSION_GZIP = 1
 
384
}compression_mode;
 
385
 
377
386
typedef struct scap_dumper scap_dumper_t;
378
387
/*@}*/
379
388
 
417
426
                        
418
427
  \return The capture instance handle in case of success. NULL in case of failure.
419
428
*/
420
 
scap_t* scap_open_offline(char* fname, char *error);
 
429
scap_t* scap_open_offline(const char* fname, char *error);
421
430
 
422
431
/*!
423
432
  \brief Close a capture handle.
497
506
const struct ppm_event_info* scap_event_getinfo(scap_evt* e);
498
507
 
499
508
/*!
 
509
  \brief Return the current offset in the file opened by scap_open_offline(),
 
510
  or -1 if this is a live capture.
 
511
 
 
512
  \param handle Handle to the capture instance.
 
513
*/
 
514
int64_t scap_get_readfile_offset(scap_t* handle);
 
515
 
 
516
/*!
500
517
  \brief Open a tracefile for writing 
501
518
 
502
519
  \param handle Handle to the capture instance.
504
521
 
505
522
  \return Dump handle that can be used to identify this specific dump instance. 
506
523
*/
507
 
scap_dumper_t* scap_dump_open(scap_t *handle, const char *fname);
 
524
scap_dumper_t* scap_dump_open(scap_t *handle, const char *fname, compression_mode compress);
508
525
 
509
526
/*!
510
527
  \brief Close a tracefile. 
519
536
  \param d The dump handle, returned by \ref scap_dump_open
520
537
  \return The current size of the dump file pointed by d. 
521
538
*/
522
 
uint64_t scap_dump_ftell(scap_dumper_t *d);
 
539
int64_t scap_dump_get_offset(scap_dumper_t *d);
 
540
 
 
541
/*!
 
542
  \brief Flush all pending output into the file. 
 
543
 
 
544
  \param d The dump handle, returned by \ref scap_dump_open
 
545
*/
 
546
void scap_dump_flush(scap_dumper_t *d);
523
547
 
524
548
/*!
525
549
  \brief Write an event to a trace file