VirtualBox

Changeset 72454 in vbox for trunk/include


Ignore:
Timestamp:
Jun 5, 2018 7:32:45 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
122935
Message:

iprt/fuzz: Some delinting. bugref:9006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/fuzz.h

    r72436 r72454  
    3434/** @defgroup grp_rt_fuzz RTFuzz - Data fuzzing framework
    3535 * @ingroup grp_rt
     36 * @sa grp_rt_test
    3637 * @{
    3738 */
    3839
    39 
    4040/** A fuzzer context handle. */
    41 typedef struct RTFUZZCTXINT *RTFUZZCTX;
     41typedef struct RTFUZZCTXINT    *RTFUZZCTX;
    4242/** Pointer to a fuzzer context handle. */
    43 typedef RTFUZZCTX *PRTFUZZCTX;
    44 /** NIL Fuzzer context handle. */
    45 #define NIL_RTFUZZCTX    ((RTFUZZCTX)~(uintptr_t)0)
     43typedef RTFUZZCTX              *PRTFUZZCTX;
     44/** NIL fuzzer context handle. */
     45#define NIL_RTFUZZCTX           ((RTFUZZCTX)~(uintptr_t)0)
    4646/** A fuzzer input handle. */
    47 typedef struct RTFUZZINPUTINT *RTFUZZINPUT;
     47typedef struct RTFUZZINPUTINT  *RTFUZZINPUT;
    4848/** Pointer to a fuzzer input handle. */
    49 typedef RTFUZZINPUT *PRTFUZZINPUT;
    50 /** NIL Fuzzer input handle. */
    51 #define NIL_RTFUZZINPUT  ((RTFUZZINPUT)~(uintptr_t)0)
     49typedef RTFUZZINPUT            *PRTFUZZINPUT;
     50/** NIL fuzzer input handle. */
     51#define NIL_RTFUZZINPUT        ((RTFUZZINPUT)~(uintptr_t)0)
    5252
    5353
    5454/** Fuzzing observer handle. */
    55 typedef struct RTFUZZOBSINT *RTFUZZOBS;
     55typedef struct RTFUZZOBSINT    *RTFUZZOBS;
    5656/** Pointer to a fuzzing observer handle. */
    57 typedef RTFUZZOBS *PRTFUZZOBS;
     57typedef RTFUZZOBS              *PRTFUZZOBS;
    5858/** NIL fuzzing observer handle. */
    59 #define NIL_RTFUZZOBS    ((RTFUZZOBS)~(uintptr_t)0)
     59#define NIL_RTFUZZOBS           ((RTFUZZOBS)~(uintptr_t)0)
    6060
    6161
     
    7676RTDECL(int) RTFuzzCtxCreate(PRTFUZZCTX phFuzzCtx);
    7777
    78 
    7978/**
    8079 * Creates a new fuzzing context from the given state.
     
    8786RTDECL(int) RTFuzzCtxCreateFromState(PRTFUZZCTX phFuzzCtx, const void *pvState, size_t cbState);
    8887
    89 
    9088/**
    9189 * Creates a new fuzzing context loading the state from the given file.
     
    9795RTDECL(int) RTFuzzCtxCreateFromStateFile(PRTFUZZCTX phFuzzCtx, const char *pszFilename);
    9896
    99 
    10097/**
    10198 * Retains a reference to the given fuzzing context.
     
    106103RTDECL(uint32_t) RTFuzzCtxRetain(RTFUZZCTX hFuzzCtx);
    107104
    108 
    109105/**
    110106 * Releases a reference from the given fuzzing context, destroying it when reaching 0.
     
    114110 */
    115111RTDECL(uint32_t) RTFuzzCtxRelease(RTFUZZCTX hFuzzCtx);
    116 
    117112
    118113/**
     
    126121RTDECL(int) RTFuzzCtxStateExport(RTFUZZCTX hFuzzCtx, void **ppvState, size_t *pcbState);
    127122
    128 
    129123/**
    130124 * Exports the given fuzzing context state to the given file.
     
    136130RTDECL(int) RTFuzzCtxStateExportToFile(RTFUZZCTX hFuzzCtx, const char *pszFilename);
    137131
    138 
    139132/**
    140133 * Adds a new seed to the input corpus of the given fuzzing context.
     
    147140RTDECL(int) RTFuzzCtxCorpusInputAdd(RTFUZZCTX hFuzzCtx, const void *pvInput, size_t cbInput);
    148141
    149 
    150142/**
    151143 * Adds a new seed to the input corpus of the given fuzzing context from the given file.
     
    157149RTDECL(int) RTFuzzCtxCorpusInputAddFromFile(RTFUZZCTX hFuzzCtx, const char *pszFilename);
    158150
    159 
    160151/**
    161152 * Adds new seeds to the input corpus of the given fuzzing context from the given directory.
    162153 *
     154 * Will only process regular files, i.e. ignores directories, symbolic links, devices, fifos
     155 * and such.
     156 *
    163157 * @returns IPRT status code.
    164158 * @param   hFuzzCtx            The fuzzing context handle.
     
    167161RTDECL(int) RTFuzzCtxCorpusInputAddFromDirPath(RTFUZZCTX hFuzzCtx, const char *pszDirPath);
    168162
    169 
    170163/**
    171164 * Restricts the maximum input size to generate by the fuzzing context.
     
    177170RTDECL(int) RTFuzzCtxCfgSetInputSeedMaximum(RTFUZZCTX hFuzzCtx, size_t cbMax);
    178171
    179 
    180172/**
    181173 * Returns the maximum input size of the given fuzzing context.
     
    186178RTDECL(size_t) RTFuzzCtxCfgGetInputSeedMaximum(RTFUZZCTX hFuzzCtx);
    187179
    188 
    189180/**
    190181 * Sets flags controlling the behavior of the fuzzing context.
     
    192183 * @returns IPRT status code.
    193184 * @param   hFuzzCtx            The fuzzing context handle.
    194  * @param   fFlags              Flags controlling the fuzzing context.
     185 * @param   fFlags              Flags controlling the fuzzing context, RTFUZZCTX_F_XXX.
    195186 */
    196187RTDECL(int) RTFuzzCtxCfgSetBehavioralFlags(RTFUZZCTX hFuzzCtx, uint32_t fFlags);
    197188
    198 
    199189/**
    200190 * Returns the current set behavioral flags for the given fuzzing context.
     
    205195RTDECL(uint32_t) RTFuzzCfgGetBehavioralFlags(RTFUZZCTX hFuzzCtx);
    206196
    207 
    208197/**
    209198 * Sets the temporary directory used by the fuzzing context.
     
    215204RTDECL(int) RTFuzzCtxCfgSetTmpDirectory(RTFUZZCTX hFuzzCtx, const char *pszPathTmp);
    216205
    217 
    218206/**
    219207 * Returns the current temporary directory.
     
    234222
    235223
     224
    236225/**
    237226 * Retains a reference to the given fuzzing input handle.
     
    242231RTDECL(uint32_t) RTFuzzInputRetain(RTFUZZINPUT hFuzzInput);
    243232
    244 
    245233/**
    246234 * Releases a reference from the given fuzzing input handle, destroying it when reaaching 0.
     
    250238 */
    251239RTDECL(uint32_t) RTFuzzInputRelease(RTFUZZINPUT hFuzzInput);
    252 
    253240
    254241/**
     
    262249RTDECL(int) RTFuzzInputQueryData(RTFUZZINPUT hFuzzInput, void **ppv, size_t *pcb);
    263250
    264 
    265251/**
    266252 * Queries the string of the MD5 digest for the given fuzzed input.
     
    274260RTDECL(int) RTFuzzInputQueryDigestString(RTFUZZINPUT hFuzzInput, char *pszDigest, size_t cchDigest);
    275261
    276 
    277262/**
    278263 * Writes the given fuzzing input to the given file.
     
    284269RTDECL(int) RTFuzzInputWriteToFile(RTFUZZINPUT hFuzzInput, const char *pszFilename);
    285270
    286 
    287271/**
    288272 * Adds the given fuzzed input to the input corpus of the owning context.
     
    294278RTDECL(int) RTFuzzInputAddToCtxCorpus(RTFUZZINPUT hFuzzInput);
    295279
    296 
    297280/**
    298281 * Removes the given fuzzed input from the input corpus of the owning context.
     
    305288
    306289
     290
    307291/**
    308292 * Creates a new fuzzing observer.
     
    313297RTDECL(int) RTFuzzObsCreate(PRTFUZZOBS phFuzzObs);
    314298
    315 
    316299/**
    317300 * Destroys a previously created fuzzing observer.
     
    322305RTDECL(int) RTFuzzObsDestroy(RTFUZZOBS hFuzzObs);
    323306
    324 
    325307/**
    326308 * Queries the internal fuzzing context of the given observer.
     
    334316RTDECL(int) RTFuzzObsQueryCtx(RTFUZZOBS hFuzzObs, PRTFUZZCTX phFuzzCtx);
    335317
    336 
    337318/**
    338319 * Sets the temp directory for the given fuzzing observer.
     
    344325RTDECL(int) RTFuzzObsSetTmpDirectory(RTFUZZOBS hFuzzObs, const char *pszTmp);
    345326
    346 
    347327/**
    348328 * Sets the binary to run for each fuzzed input.
     
    351331 * @param   hFuzzObs            The fuzzing observer handle.
    352332 * @param   pszBinary           The binary path.
    353  * @param   fFlags              Flags controlling execution of the binary.
     333 * @param   fFlags              Flags controlling execution of the binary, RTFUZZ_OBS_BINARY_F_XXX.
    354334 */
    355335RTDECL(int) RTFuzzObsSetTestBinary(RTFUZZOBS hFuzzObs, const char *pszBinary, uint32_t fFlags);
    356336
     337/** @name RTFUZZ_OBS_BINARY_F_XXX
     338 * @{ */
    357339/** The tested binary requires a real file to read from and doesn't support stdin. */
    358 #define RTFUZZ_OBS_BINARY_F_INPUT_FILE RT_BIT_32(0)
     340#define RTFUZZ_OBS_BINARY_F_INPUT_FILE  RT_BIT_32(0)
     341/** @} */
    359342
    360343/**
     
    368351RTDECL(int) RTFuzzObsSetTestBinaryArgs(RTFUZZOBS hFuzzObs, const char * const *papszArgs, unsigned cArgs);
    369352
    370 
    371353/**
    372354 * Starts fuzzing the set binary.
     
    378360 */
    379361RTDECL(int) RTFuzzObsExecStart(RTFUZZOBS hFuzzObs, uint32_t cProcs);
    380 
    381362
    382363/**
     
    399380 */
    400381RTR3DECL(RTEXITCODE) RTFuzzCmdMaster(unsigned cArgs, char **papszArgs);
     382
    401383/** @} */
    402384
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette