Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

interface.c File Reference

#include "model.h"

Defines

#define SET_INTERFACE_DETAIL(pstmt, idetail)

Functions

int32_t aw_model_interface_create (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t nodeid, const byte_t *ip)
 Create a interface record with assoc node,ip.

int32_t aw_model_interface_list_by_node (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t nodeid, u_int32_t deleted, aw_model_interface_listing_t *interface_listing)
 Itertator to fill listing with data from interface table for an interface. Call interface_listing->iter.next() until <= 0 .

int32_t aw_model_interface_name_query (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t interfaceid, aw_model_interface_name_t *interface_name)
 Fill interface with data from interface table.

int32_t aw_model_interface_netmon_list (aw_model_t *model, const aw_model_userhandle_t *handle, aw_model_interface_netmon_listing_t *interface_netmon_listing)
 Itertator to fill listing with data from interface table for an interface network probe. Call interface_listing->iter.next() until <= 0 .

int32_t aw_model_interface_query (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t interfaceid, aw_model_interface_detail_t *interfacedetail)
 Fill interface with data from interface table.

int32_t aw_model_interface_update (aw_model_t *model, const aw_model_userhandle_t *handle, const aw_model_interface_detail_t *updated_interfacedetail)
 Update interface record.


Define Documentation

#define SET_INTERFACE_DETAIL (  pstmt,
idetail   ) 
 

Value:

{ \
  u_int32_t index=0; \
\
  /* this series needs to be 1-1 with prepared stmt, order matters! */ \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . interfaceid); \
  AWMODEL_SET_TEXT_MBR(model, pstmt, index++, idetail . name.prettyname); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . outage); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . up); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . snmp); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . active); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . deleted); \
\
  AWMODEL_SET_TEXT_MBR(model, pstmt, index++, idetail . ip); \
  AWMODEL_SET_TEXT_MBR(model, pstmt, index++, idetail . snmp_community); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . timeout); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . cycle); \
  AWMODEL_SET_TEXT_MBR(model, pstmt, index++, idetail . handlercron); \
  AWMODEL_SET_TEXT_MBR(model, pstmt, index++, idetail . maintcron); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . perf); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . traffic); \
}


Function Documentation

int32_t aw_model_interface_create (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  nodeid,
const byte_t *  ip
) 
 

Create a interface record with assoc node,ip.

aw_model_interface_create

Parameters:
model Model object
handle Handle object for current user
nodeid Id of node to assoc this interface
ip Ip of interface
Returns:
<=0 on error, else id of interface record

int32_t aw_model_interface_list_by_node (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  nodeid,
u_int32_t  deleted,
aw_model_interface_listing_t *  interface_listing
) 
 

Itertator to fill listing with data from interface table for an interface. Call interface_listing->iter.next() until <= 0 .

aw_model_interface_list_by_node

Parameters:
model Model object
handle Handle object for current user
nodeid The id for the node that we want to get the interfaces
deleted If non-zero, then return users marked deleted
interface_listing Listing object to be filled
Returns:
0 on data and -1 on error

int32_t aw_model_interface_name_query (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  interfaceid,
aw_model_interface_name_t *  interface_name
) 
 

Fill interface with data from interface table.

aw_model_interface_name_query

Parameters:
model Model object
handle Handle object for current user
interfaceid Interface id of record to look up
interface_name Interface name
Returns:
Non-zero on error

int32_t aw_model_interface_netmon_list (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
aw_model_interface_netmon_listing_t *  interface_netmon_listing
) 
 

Itertator to fill listing with data from interface table for an interface network probe. Call interface_listing->iter.next() until <= 0 .

aw_model_interface_netmon_list

Parameters:
model Model object
handle Handle object for current user
interface_netmon_listing Listing object to be filled
Returns:
0 on data and -1 on error

int32_t aw_model_interface_query (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  interfaceid,
aw_model_interface_detail_t *  interfacedetail
) 
 

Fill interface with data from interface table.

aw_model_interface_query

Parameters:
model Model object
handle Handle object for current user
interfaceid Interface id of record to look up
interfacedetail Interface object to be filled
Returns:
Non-zero on error

int32_t aw_model_interface_update (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
const aw_model_interface_detail_t *  updated_interfacedetail
) 
 

Update interface record.

aw_model_interface_update

Parameters:
model Model object
handle Handle object for current user
updated_interfacedetail Interface object used to update record
Returns:
Non-zero on error

Todo:
we should just update the interface probe

Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)