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

service.c File Reference

#include "model.h"

Defines

#define SET_SERVICE_DETAIL(pstmt, idetail)

Functions

int32_t aw_model_service2port_list (aw_model_t *model, const aw_model_userhandle_t *handle, aw_model_service2port_listing_t *service2port_listing)
 Itertator to fill listing with data from sport2service table. Call service2port_listing->iter.next() until <= 0 .

int32_t aw_model_service_create (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t interfaceid, const byte_t *service)
 Create a service record with assoc interface,service.

int32_t aw_model_service_id_query (aw_model_t *model, const aw_model_userhandle_t *handle, const byte_t *ip, u_int32_t port)
 Get service id from ip/port.

int32_t aw_model_service_list_by_interface (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t interfaceid, u_int32_t deleted, aw_model_service_listing_t *service_listing)
 Itertator to fill listing with data from service table for a service. Call service_listing->iter.next() until <= 0 .

int32_t aw_model_service_name_query (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t serviceid, aw_model_service_name_t *service_name)
 Fill service with data from service table.

int32_t aw_model_service_netmon_list (aw_model_t *model, const aw_model_userhandle_t *handle, aw_model_service_netmon_listing_t *service_netmon_listing)
 Itertator to fill listing with data from service table for an service network probe. Call service_listing->iter.next() until <= 0 .

int32_t aw_model_service_query (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t serviceid, aw_model_service_detail_t *servicedetail)
 Fill service with data from service table.

int32_t aw_model_service_unique (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t serviceid, byte_t *ip, u_int32_t port, byte_t *proto)
 Return non-zero if there WOULD be 2 ip,port,proto should this be inserted/updated.

int32_t aw_model_service_update (aw_model_t *model, const aw_model_userhandle_t *handle, const aw_model_service_detail_t *updated_servicedetail)
 Update service record.


Define Documentation

#define SET_SERVICE_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 . serviceid); \
  AWMODEL_SET_TEXT_MBR(model, pstmt, index++, idetail . name.prettyname); \
\
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . up); \
  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 . service); \
  AWMODEL_SET_TEXT_MBR(model, pstmt, index++, idetail . ip); \
  AWMODEL_SET_INT_MBR(model, pstmt, index++, idetail . port); \
  AWMODEL_SET_TEXT_MBR(model, pstmt, index++, idetail . proto); \
  AWMODEL_SET_TEXT_MBR(model, pstmt, index++, idetail . handler); \
  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); \
}


Function Documentation

int32_t aw_model_service2port_list (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
aw_model_service2port_listing_t *  service2port_listing
) 
 

Itertator to fill listing with data from sport2service table. Call service2port_listing->iter.next() until <= 0 .

aw_model_service2port_list

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

int32_t aw_model_service_create (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  interfaceid,
const byte_t *  service
) 
 

Create a service record with assoc interface,service.

aw_model_service_create

Parameters:
model Model object
handle Handle object for current user
interfaceid Id of interface to assoc this service
service Name of service
Returns:
<=0 on error, else id of service record

int32_t aw_model_service_id_query (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
const byte_t *  ip,
u_int32_t  port
) 
 

Get service id from ip/port.

aw_model_service_id_query

Parameters:
model Model object
handle Handle object for current user
ip IP address
port Port of service
Returns:
< 0 on error, 0 on nomatch, > 0 if match where value is row id

int32_t aw_model_service_list_by_interface (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  interfaceid,
u_int32_t  deleted,
aw_model_service_listing_t *  service_listing
) 
 

Itertator to fill listing with data from service table for a service. Call service_listing->iter.next() until <= 0 .

aw_model_service_list_by_interface

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

int32_t aw_model_service_name_query (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  serviceid,
aw_model_service_name_t *  service_name
) 
 

Fill service with data from service table.

aw_model_service_name_query

Parameters:
model Model object
handle Handle object for current user
serviceid Service id of record to look up
service_name Service name
Returns:
Non-zero on error

int32_t aw_model_service_netmon_list (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
aw_model_service_netmon_listing_t *  service_netmon_listing
) 
 

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

aw_model_service_netmon_list

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

int32_t aw_model_service_query (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  serviceid,
aw_model_service_detail_t *  servicedetail
) 
 

Fill service with data from service table.

aw_model_service_query

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

int32_t aw_model_service_unique (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  serviceid,
byte_t *  ip,
u_int32_t  port,
byte_t *  proto
) 
 

Return non-zero if there WOULD be 2 ip,port,proto should this be inserted/updated.

aw_model_service_unique

Parameters:
model Model object
handle Handle object for current user
serviceid Id of service
ip IP
port Port
proto Protcol
Returns:
See discussion

int32_t aw_model_service_update (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
const aw_model_service_detail_t *  updated_servicedetail
) 
 

Update service record.

aw_model_service_update

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

Todo:
we should just update the service probe

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