IDA SDK

- Main Page
- Header Files
- Classes
- Modules

- Class List
- Class Index
- Class Hierarchy
- Class Members

Friends | List of all members
netnode Class Reference

## Detailed Description

Definition of the IDA database node.

Note that the size of the 'netnode' class is 4 bytes and it can be freely casted to 'uint32' and back. This makes it easy to store information about the program location in the netnodes. Please pass netnodes to functions by value.

## Public Member Functions
Constructors, conversions and assignments
| netnode (void)
| Empty constructor.
| netnode (nodeidx_t num)
| Constructor to create a netnode to access information about the specified linear address.
| operator nodeidx_t () const
| Conversion from netnode to linear address.
| netnode (const char *_name, size_t namlen=0, bool do_create=false)
| Construct an instance of netnode class to access the specified netnode. More...
Create/Delete
Note You can check if a netnode already exists with exist()
bool | create (const char *_name, size_t namlen=0)
| Create a named netnode. More...
bool | create (void)
| Create unnamed netnode. More...
void | kill (void)
| Delete a netnode with all information attached to it.
Netnode names
ssize_t | get_name (qstring *buf) const
| Get the netnode name. More...
bool | rename (const char *newname, size_t namlen=0)
| Rename a netnode. More...
Value of netnode
ssize_t | valobj (void *buf, size_t bufsize) const
| Get value of netnode. More...
ssize_t | valstr (char *buf, size_t bufsize) const
| Get string value of netnode. More...
bool | set (const void *value, size_t length=0)
| Set value of netnode. More...
bool | delvalue (void)
| Delete value of netnode. More...
bool | set_long (nodeidx_t x)
| Value of netnode as a long number:
bool | value_exists (void) const
nodeidx_t | long_value (void) const
Arrays of altvals.
altvals: a sparse array of 32-bit values. indexes in this array may be 8-bit or 32-bit values
nodeidx_t | altval (nodeidx_t alt, char tag=atag) const
| Get altval element of the specified array. More...
bool | altset (nodeidx_t alt, nodeidx_t value, char tag=atag)
| Set value of altval array. More...
bool | altdel (nodeidx_t alt, char tag=atag)
| Delete element of altval array. More...
nodeidx_t | alt1st (char tag=atag) const
| Get first existing element of altval array. More...
nodeidx_t | altnxt (nodeidx_t cur, char tag=atag) const
| Get next existing element of altval array. More...
nodeidx_t | altlast (char tag=atag) const
| Get last element of altval array. More...
nodeidx_t | altprev (nodeidx_t cur, char tag=atag) const
| Get previous existing element of altval array. More...
size_t | altshift (nodeidx_t from, nodeidx_t to, nodeidx_t size, char tag=atag)
| Shift the altval array elements. More...
void | altadjust (nodeidx_t from, nodeidx_t to, nodeidx_t size, bool(idaapi *should_skip)(nodeidx_t ea)=NULL)
| Adjust values of altval arrays elements. More...
Arrays of altvals: 8-bit values
The following functions behave in the same manner as the functions described above. The only difference is that the array value is 8-bits. index: 32 bits value: 8 bits
uchar | charval (nodeidx_t alt, char tag) const
bool | charset (nodeidx_t alt, uchar val, char tag)
bool | chardel (nodeidx_t alt, char tag)
nodeidx_t | char1st (char tag) const
nodeidx_t | charnxt (nodeidx_t cur, char tag) const
nodeidx_t | charlast (char tag) const
nodeidx_t | charprev (nodeidx_t cur, char tag) const
size_t | charshift (nodeidx_t from, nodeidx_t to, nodeidx_t size, char tag)
Arrays of altvals: 8-bit indexes
Another set of functions to work with altvals. The only difference is that the array index is 8-bits, and therefore the array may contain up to 256 elements only. index: 8 bits value: 32 bits
nodeidx_t | altval_idx8 (uchar alt, char tag) const
bool | altset_idx8 (uchar alt, nodeidx_t val, char tag)
bool | altdel_idx8 (uchar alt, char tag)
nodeidx_t | alt1st_idx8 (char tag) const
nodeidx_t | altnxt_idx8 (uchar cur, char tag) const
nodeidx_t | altlast_idx8 (char tag) const
nodeidx_t | altprev_idx8 (uchar cur, char tag) const
More altvals
Another set of functions to work with altvals. index: 8 bits value: 8 bits
uchar | charval_idx8 (uchar alt, char tag) const
bool | charset_idx8 (uchar alt, uchar val, char tag)
bool | chardel_idx8 (uchar alt, char tag)
nodeidx_t | char1st_idx8 (char tag) const
nodeidx_t | charnxt_idx8 (uchar cur, char tag) const
nodeidx_t | charlast_idx8 (char tag) const
nodeidx_t | charprev_idx8 (uchar cur, char tag) const
Delete altvals
Note To delete range of elements in an altval array, see supdel_range()
bool | altdel (void)
| Delete all elements of altval array. More...
bool | altdel_all (char tag)
| Delete all elements of the specified altval array. More...
Arrays of supvals
supvals: an array of arbitrary sized objects. (size of each object is limited by MAXSPECSIZE). indexes in this array may be 8-bit or 32-bit values.
ssize_t | supval (nodeidx_t alt, void *buf, size_t bufsize, char tag=stag) const
| Get value of the specified supval array element. More...
ssize_t | supstr (nodeidx_t alt, char *buf, size_t bufsize, char tag=stag) const
| Get string value of the specified supval array element. More...
bool | supset (nodeidx_t alt, const void *value, size_t length=0, char tag=stag)
| Set value of supval array element. More...
bool | supdel (nodeidx_t alt, char tag=stag)
| Delete supval element. More...
nodeidx_t | sup1st (char tag=stag) const
| Get first existing element of supval array. More...
nodeidx_t | supnxt (nodeidx_t cur, char tag=stag) const
| Get next existing element of supval array. More...
nodeidx_t | suplast (char tag=stag) const
| Get last existing element of supval array. More...
nodeidx_t | supprev (nodeidx_t cur, char tag=stag) const
| Get previous existing element of supval array. More...
size_t | supshift (nodeidx_t from, nodeidx_t to, nodeidx_t size, char tag=stag)
| Shift the supval array elements. More...
Arrays of supvals: 8-bit indexes
The following functions behave in the same manner as the functions described above. The only difference is that the array index is 8-bits and therefore the array may contains up to 256 elements only.
ssize_t | supval_idx8 (uchar alt, void *buf, size_t bufsize, char tag) const
ssize_t | supstr_idx8 (uchar alt, char *buf, size_t bufsize, char tag) const
bool | supset_idx8 (uchar alt, const void *value, size_t length, char tag)
bool | supdel_idx8 (uchar alt, char tag)
nodeidx_t | sup1st_idx8 (char tag) const
nodeidx_t | supnxt_idx8 (uchar alt, char tag) const
nodeidx_t | suplast_idx8 (char tag) const
nodeidx_t | supprev_idx8 (uchar alt, char tag) const
Delete supvals
bool | supdel (void)
| Delete all elements of supval array. More...
bool | supdel_all (char tag)
| Delete all elements of the specified supval array. More...
int | supdel_range (nodeidx_t idx1, nodeidx_t idx2, char tag)
| Delete range of elements in the specified supval array. More...
int | supdel_range_idx8 (uchar idx1, uchar idx2, char tag)
| Same as above, but accepts 8-bit indexes.
Hashes
Associative arrays indexed by strings. hashvals: Indexes in this array are strings. Values are arbitrary sized (max size is MAXSPECSIZE)
ssize_t | hashval (const char *idx, void *buf, size_t bufsize, char tag=htag) const
| Get value of the specified hash element. More...
ssize_t | hashstr (const char *idx, char *buf, size_t bufsize, char tag=htag) const
| Similar to supstr(), but accepts a hash index.
nodeidx_t | hashval_long (const char *idx, char tag=htag) const
| Get value of the specified hash element. More...
bool | hashset (const char *idx, const void *value, size_t length=0, char tag=htag)
| Set value of hash element. More...
bool | hashset (const char *idx, nodeidx_t value, char tag=htag)
| Set value of hash element to long value. More...
bool | hashdel (const char *idx, char tag=htag)
| Delete hash element. More...
ssize_t | hash1st (char *buf, size_t bufsize, char tag=htag) const
| Get first existing element of hash. More...
ssize_t | hashnxt (const char *idx, char *buf, size_t bufsize, char tag=htag) const
| Get next existing element of hash. More...
ssize_t | hashlast (char *buf, size_t bufsize, char tag=htag) const
| Get last existing element of hash. More...
ssize_t | hashprev (const char *idx, char *buf, size_t bufsize, char tag=htag) const
| Get previous existing element of supval array. More...
bool | hashdel_all (char tag=htag)
| Delete all elements of hash. More...
Blobs
Virtually unlimited size binary objects. Blobs are stored in several supval array elements.
size_t | blobsize (nodeidx_t _start, char tag)
| Get size of blob. More...
void * | getblob (void *buf, size_t *bufsize, nodeidx_t _start, char tag)
| Get blob from a netnode. More...
bool | setblob (const void *buf, size_t size, nodeidx_t _start, char tag)
| Store a blob in a netnode. More...
int | delblob (nodeidx_t _start, char tag)
| Delete a blob. More...
Links
Warning links are deprecated! (We can not delete them because they are used in ancient databases)
int | link (netnode to, netlink linktype, const char *linkspec)
void | unlink (netnode to, netlink linktype)
ssize_t | linkspec (netnode to, char *buf, size_t bufsize, netlink linktype) const
Enumerate all netnodes
bool | start (void)
| Get first netnode in the graph. More...
bool | end (void)
| Get last netnode in the graph. More...
bool | next (void)
| Get next netnode in the graph. More...
bool | prev (void)
| Get prev netnode in the graph. More...
Move and copy netnodes
  Parameters
  target | the target netnode
  count | how many netnodes to copy
Returns number of copied/moved keys, BADNODE if failure or not enough memory
size_t | copyto (netnode target, nodeidx_t count=1)
size_t | moveto (netnode target, nodeidx_t count=1)
Netnode comparisons
bool | operator== (netnode &n) const
bool | operator!= (netnode &n) const
bool | operator== (nodeidx_t x) const
bool | operator!= (nodeidx_t x) const

## Static Public Member Functions
Internals
Warning The following netnode definitions are for the kernel only. Functions for global base manipulating.
static bool | createbase (const char *fname, nodeidx_t initial_nodeid=0)
static int | checkbase (const char *fname)
static void | set_close_flag (bool closeflag)
static nodeidx_t | reserve_nodes (nodeidx_t n)
static int32 | validate (const char *badbase, const char *newbase, void(*cb)(uint32))
static void | upgrade16 (const char *oldbase, const char *newbase, void(*cb)(uint32))
static void | upgrade (void(*cb)(uint32))
static void | compress (const char *oldbase, const char *newbase, void(*cb)(uint32))
static bool | inited (void)
static bool | can_write ()
static void | init (const char *file, size_t cachesize, bool can_modify)
static void | flush (void)
static linput_t * | get_linput ()
static void | term (void)
static void | killbase (nodeidx_t iniNumber=0)
static int | getdrive (void)
static int | getgraph (void)
static int | registerbase (const char *filename, size_t cachesize, bool writeFlag=true)
static bool | setbase (int drive, int graph=atag)
static int32 | validate_names (qstrvec_t *errmsgs)

## Friends
bool ida_export | netnode_exist (const netnode &n)
| See exist()
bool ida_export | exist (const netnode &n)
| Does the specified netnode exist?. More...

## Constructor & Destructor Documentation

netnode::netnode | ( | const char * | _name,
|  | size_t | namlen = `0`,
|  | bool | do_create = `false`
| ) |  |
| inline

Construct an instance of netnode class to access the specified netnode.

Parameters

  _name | name of netnode
  namlen | length of the name. may be omitted, in this case the length will be calculated with strlen()
  do_create | true: create the netnode if it doesn't exist yet. false: don't create the netnode, set netnumber to BADNODE if it doesn't exist

## Member Function Documentation

bool netnode::create | ( | const char * | _name,
|  | size_t | namlen = `0`
| ) |  |
| inline

Create a named netnode.

Parameters

  _name | name of netnode to create. names of user-defined netnodes must have the "$ " prefix in order to avoid clashes with program byte names.
  namlen | length of the name. if not specified, it will be calculated using strlen()

Return values

  1 | ok, the node is created
  0 | the node already exists. you may use the netnode class to access it.

bool netnode::create | ( | void |  | ) |
| inline

Create unnamed netnode.

Return values

  1 | ok
  0 | should not happen, indicates internal error

ssize_t netnode::get_name | ( | qstring * | buf | ) | const
| inline

Get the netnode name.

Returns
  -1 if netnode is unnamed (buf is untouched in this case), otherwise the name length

bool netnode::rename | ( | const char * | newname,
|  | size_t | namlen = `0`
| ) |  |
| inline

Rename a netnode.

Parameters

  newname | new name of netnode. NULL or "" means to delete name. names of user-defined netnodes must have the "$ " prefix in order to avoid clashes with program byte names.
  namlen | length of new name. if not specified, it will be calculated using strlen()

Return values

  1 | ok
  0 | failed, newname is already used

ssize_t netnode::valobj | ( | void * | buf,
|  | size_t | bufsize
| ) |  | const
| inline

Get value of netnode.

Netnode values are arbitrary sized objects with max size is MAXSPECSIZE. NB: do not use this function for strings - see valstr().

Returns
  length of value, -1 if no value present

ssize_t netnode::valstr | ( | char * | buf,
|  | size_t | bufsize
| ) |  | const
| inline

Get string value of netnode.

See explanations for supstr() function about the differences between valobj() and valstr()

Returns
  length of value, -1 if no value present

bool netnode::set | ( | const void * | value,
|  | size_t | length = `0`
| ) |  |
| inline

Set value of netnode.

Parameters

  value | pointer to value
  length | length of value. if not specified, it will be calculated using strlen()

Returns
  1 - ok

bool netnode::delvalue | ( | void |  | ) |
| inline

Delete value of netnode.

Return values

  1 | ok
  0 | failed, netnode is bad or other error

nodeidx_t netnode::altval | ( | nodeidx_t | alt,
|  | char | tag = `atag`
| ) |  | const
| inline

Get altval element of the specified array.

Parameters

  alt | index into array of altvals
  tag | tag of array. may be omitted

Returns
  value of altval element. nonexistent altval members are returned as zeroes

bool netnode::altset | ( | nodeidx_t | alt,
|  | nodeidx_t | value,
|  | char | tag = `atag`
| ) |  |
| inline

Set value of altval array.

Parameters

  alt | index into array of altvals
  value | new value of altval element
  tag | tag of array

Return values

  1 | ok
  0 | failed, normally should not occur

bool netnode::altdel | ( | nodeidx_t | alt,
|  | char | tag = `atag`
| ) |  |
| inline

Delete element of altval array.

Parameters

  alt | index into array of altvals
  tag | tag of array

Return values

  1 | ok
  0 | failed, element doesn't exist

nodeidx_t netnode::alt1st | ( | char | tag = `atag` | ) | const
| inline

Get first existing element of altval array.

Parameters

  tag | tag of array

Returns
  index of first existing element of altval array, BADNODE if altval array is empty

nodeidx_t netnode::altnxt | ( | nodeidx_t | cur,
|  | char | tag = `atag`
| ) |  | const
| inline

Get next existing element of altval array.

Parameters

  cur | current index
  tag | tag of array

Returns
  index of the next existing element of altval array, BADNODE if no more altval array elements exist

nodeidx_t netnode::altlast | ( | char | tag = `atag` | ) | const
| inline

Get last element of altval array.

Parameters

  tag | tag of array

Returns
  index of last existing element of altval array, BADNODE if altval array is empty

nodeidx_t netnode::altprev | ( | nodeidx_t | cur,
|  | char | tag = `atag`
| ) |  | const
| inline

Get previous existing element of altval array.

Parameters

  cur | current index
  tag | tag of array

Returns
  index of the previous existing element of altval array, BADNODE if no more altval array elements exist

size_t netnode::altshift | ( | nodeidx_t | from,
|  | nodeidx_t | to,
|  | nodeidx_t | size,
|  | char | tag = `atag`
| ) |  |
| inline

Shift the altval array elements.

Moves the array elements at (from..from+size) to (to..to+size)

Returns
  number of shifted elements

void netnode::altadjust | ( | nodeidx_t | from,
|  | nodeidx_t | to,
|  | nodeidx_t | size,
|  | bool(idaapi *)(nodeidx_t ea) | should_skip = `NULL`
| ) |  |
| inline

Adjust values of altval arrays elements.

All altvals in the range from+1..from+size+1 and adjusted to have values in the range to+1..to+size+1. The parameter should_skip() can be used to skip the adjustment of some altvals

bool netnode::altdel | ( | void |  | ) |
| inline

Delete all elements of altval array.

This function may be applied to 32-bit and 8-bit altval arrays. This function deletes the whole altval array.

Returns
  success

bool netnode::altdel_all | ( | char | tag | ) |
| inline

Delete all elements of the specified altval array.

This function may be applied to 32-bit and 8-bit altval arrays. This function deletes the whole altval array.

Parameters

  tag | tag of array

Returns
  success

ssize_t netnode::supval | ( | nodeidx_t | alt,
|  | void * | buf,
|  | size_t | bufsize,
|  | char | tag = `stag`
| ) |  | const
| inline

Get value of the specified supval array element.

NB: do not use this function to retrieve strings, see supstr()!

Parameters

  alt | index into array of supvals
  buf | output buffer, may be NULL
  bufsize | size of output buffer
  tag | tag of array. Default: stag

Returns
  size of value, -1 if element doesn't exist

ssize_t netnode::supstr | ( | nodeidx_t | alt,
|  | char * | buf,
|  | size_t | bufsize,
|  | char | tag = `stag`
| ) |  | const
| inline

Get string value of the specified supval array element.

The differences between supval() and supstr() are the following:

1. Strings are stored with the terminating zero in the old databases. supval() returns the exact size of the stored object (with the terminating zero) but supstr returns the string length without the terminating zero. supstr() can handle strings stored with or without the terminating zero.
2. supstr() makes sure that the string is terminated with 0 even if the string was stored in the database without it or the output buffer is too small to hold the entire string. In the latter case the string will be truncated but still will have the terminating zero.

If you do not use the string length returned by supval/supstr() functions and you are sure that the output buffer is big enough to hold the entire string and the string has been stored in the database with the terminating zero, then you can continue to use supval() instead of supstr().

Parameters

  alt | index into array of supvals
  buf | output buffer, may be NULL
  bufsize | size of output buffer
  tag | tag of array. Default: stag

Returns
  length of the output string, -1 if element doesn't exist

bool netnode::supset | ( | nodeidx_t | alt,
|  | const void * | value,
|  | size_t | length = `0`,
|  | char | tag = `stag`
| ) |  |
| inline

Set value of supval array element.

Parameters

  alt | index into array of supvals
  value | pointer to supval value
  length | length of 'value'. If not specified, the length is calculated using strlen()+1.
  tag | tag of array

Return values

  1 | ok
  0 | should not occur - indicates internal error

bool netnode::supdel | ( | nodeidx_t | alt,
|  | char | tag = `stag`
| ) |  |
| inline

Delete supval element.

Parameters

  alt | index into array of supvals
  tag | tag of array

Return values

  true | deleted
  false | element does not exist

nodeidx_t netnode::sup1st | ( | char | tag = `stag` | ) | const
| inline

Get first existing element of supval array.

Parameters

  tag | tag of array

Returns
  index of first existing element of supval array, BADNODE if supval array is empty

nodeidx_t netnode::supnxt | ( | nodeidx_t | cur,
|  | char | tag = `stag`
| ) |  | const
| inline

Get next existing element of supval array.

Parameters

  cur | current index
  tag | tag of array

Returns
  index of the next existing element of supval array, BADNODE if no more supval array elements exist

nodeidx_t netnode::suplast | ( | char | tag = `stag` | ) | const
| inline

Get last existing element of supval array.

Parameters

  tag | tag of array

Returns
  index of last existing element of supval array, BADNODE if supval array is empty

nodeidx_t netnode::supprev | ( | nodeidx_t | cur,
|  | char | tag = `stag`
| ) |  | const
| inline

Get previous existing element of supval array.

Parameters

  cur | current index
  tag | tag of array

Returns
  index of the previous existing element of supval array BADNODE if no more supval array elements exist

size_t netnode::supshift | ( | nodeidx_t | from,
|  | nodeidx_t | to,
|  | nodeidx_t | size,
|  | char | tag = `stag`
| ) |  |
| inline

Shift the supval array elements.

Moves the array elements at (from..from+size) to (to..to+size)

Returns
  number of shifted elements

bool netnode::supdel | ( | void |  | ) |
| inline

Delete all elements of supval array.

This function may be applied to 32-bit and 8-bit supval arrays. This function deletes the whole supval array.

Returns
  success

bool netnode::supdel_all | ( | char | tag | ) |
| inline

Delete all elements of the specified supval array.

This function may be applied to 32-bit and 8-bit supval arrays. This function deletes the whole supval array.

Returns
  success

int netnode::supdel_range | ( | nodeidx_t | idx1,
|  | nodeidx_t | idx2,
|  | char | tag
| ) |  |
| inline

Delete range of elements in the specified supval array.

Elements in range [idx1, idx2) will be deleted.

Note
  This function can also be used to delete a range of altval elements

Parameters

  idx1 | first element to delete
  idx2 | last element to delete + 1
  tag | tag of array

Returns
  number of deleted elements

ssize_t netnode::hashval | ( | const char * | idx,
|  | void * | buf,
|  | size_t | bufsize,
|  | char | tag = `htag`
| ) |  | const
| inline

Get value of the specified hash element.

Parameters

  idx | index into hash
  buf | output buffer, may be NULL
  bufsize | output buffer size
  tag | tag of hash. Default: htag

Returns
  -1 if element doesn't exist or idx is NULL. otherwise returns the value size in bytes

nodeidx_t netnode::hashval_long | ( | const char * | idx,
|  | char | tag = `htag`
| ) |  | const
| inline

Get value of the specified hash element.

Parameters

  idx | index into hash
  tag | tag of hash. Default: htag

Returns
  value of hash element (it should be set using hashset(nodeidx_t)), 0 if the element does not exist

bool netnode::hashset | ( | const char * | idx,
|  | const void * | value,
|  | size_t | length = `0`,
|  | char | tag = `htag`
| ) |  |
| inline

Set value of hash element.

Parameters

  idx | index into hash
  value | pointer to value
  length | length of 'value'. If not specified, the length is calculated using strlen()+1.
  tag | tag of hash. Default: htag

Return values

  1 | ok
  0 | should not occur - indicates internal error

bool netnode::hashset | ( | const char * | idx,
|  | nodeidx_t | value,
|  | char | tag = `htag`
| ) |  |
| inline

Set value of hash element to long value.

Parameters

  idx | index into hash
  value | new value of hash element
  tag | tag of hash. Default: htag

Return values

  1 | ok
  0 | should not occur - indicates internal error

bool netnode::hashdel | ( | const char * | idx,
|  | char | tag = `htag`
| ) |  |
| inline

Delete hash element.

Parameters

  idx | index into hash
  tag | tag of hash. Default: htag

Return values

  true | deleted
  false | element does not exist

ssize_t netnode::hash1st | ( | char * | buf,
|  | size_t | bufsize,
|  | char | tag = `htag`
| ) |  | const
| inline

Get first existing element of hash.

Note
  elements of hash are kept sorted in lexical order

Parameters

  buf | output buffer, may be NULL
  bufsize | output buffer size
  tag | tag of hash. Default: htag

Returns
  size of index of first existing element of hash, -1 if hash is empty

ssize_t netnode::hashnxt | ( | const char * | idx,
|  | char * | buf,
|  | size_t | bufsize,
|  | char | tag = `htag`
| ) |  | const
| inline

Get next existing element of hash.

Note
  elements of hash are kept sorted in lexical order

Parameters

  idx | current index into hash
  buf | output buffer, may be NULL
  bufsize | output buffer size
  tag | tag of hash. Default: htag

Returns
  size of index of the next existing element of hash, -1 if no more hash elements exist

ssize_t netnode::hashlast | ( | char * | buf,
|  | size_t | bufsize,
|  | char | tag = `htag`
| ) |  | const
| inline

Get last existing element of hash.

Note
  elements of hash are kept sorted in lexical order

Parameters

  buf | output buffer, may be NULL
  bufsize | output buffer size
  tag | tag of hash. Default: htag

Returns
  size of index of last existing element of hash, -1 if hash is empty

ssize_t netnode::hashprev | ( | const char * | idx,
|  | char * | buf,
|  | size_t | bufsize,
|  | char | tag = `htag`
| ) |  | const
| inline

Get previous existing element of supval array.

Note
  elements of hash are kept sorted in lexical order

Parameters

  idx | current index into hash
  buf | output buffer, may be NULL
  bufsize | output buffer size
  tag | tag of hash. Default: htag

Returns
  size of index of the previous existing element of hash, -1 if no more hash elements exist

bool netnode::hashdel_all | ( | char | tag = `htag` | ) |
| inline

Delete all elements of hash.

This function deletes the whole hash.

Parameters

  tag | tag of hash. Default: htag

Returns
  success

size_t netnode::blobsize | ( | nodeidx_t | _start,
|  | char | tag
| ) |  |
| inline

Get size of blob.

Parameters

  _start | index of the first supval element used to store blob
  tag | tag of supval array

Returns
  number of bytes required to store a blob

void* netnode::getblob | ( | void * | buf,
|  | size_t * | bufsize,
|  | nodeidx_t | _start,
|  | char | tag
| ) |  |
| inline

Get blob from a netnode.

Parameters

  | buf | buffer to read into. if NULL, the buffer will be allocated using qalloc()
  [in,out] | bufsize | in: size of 'buf' in bytes (if buf == NULL then meaningless). out: size of the blob if it exists. bufsize may be NULL
  | _start | index of the first supval element used to store blob
  | tag | tag of supval array

Returns
  NULL if blob doesn't exist, otherwise returns pointer to blob

bool netnode::setblob | ( | const void * | buf,
|  | size_t | size,
|  | nodeidx_t | _start,
|  | char | tag
| ) |  |
| inline

Store a blob in a netnode.

Parameters

  buf | pointer to blob to save
  size | size of blob in bytes
  _start | index of the first supval element used to store blob
  tag | tag of supval array

Returns
  success

int netnode::delblob | ( | nodeidx_t | _start,
|  | char | tag
| ) |  |
| inline

Delete a blob.

Parameters

  _start | index of the first supval element used to store blob
  tag | tag of supval array

Returns
  number of deleted supvals

bool netnode::start | ( | void |  | ) |
| inline

Get first netnode in the graph.

Sets netnodenumber to the lowest existing number.

Return values

  true | ok
  false | graph is empty

bool netnode::end | ( | void |  | ) |
| inline

Get last netnode in the graph.

Sets netnodenumber to the highest existing number.

Return values

  true | ok
  false | graph is empty

bool netnode::next | ( | void |  | ) |
| inline

Get next netnode in the graph.

Sets netnodenumber to the next existing number

Return values

  true | ok
  false | no more netnodes

bool netnode::prev | ( | void |  | ) |
| inline

Get prev netnode in the graph.

Sets netnodenumber to the previous existing number

Return values

  true | ok
  false | no more netnodes

## Friends And Related Function Documentation

bool ida_export exist | ( | const netnode & | n | ) |
| friend

Does the specified netnode exist?.

Return values

  true | there is some information attached to the netnode.
  false | unnamed netnode without any information

The documentation for this class was generated from the following file:

- netnode.hpp