Solaris Bandwidth Manager 1.6 の開発

引数

ba_get_next_event() 関数には次の引数を渡します。

event

FIFO バッファー内の次のイベントについての情報が入った ba_event_t 型の構造体を指すポインタ

blocking

ブロックモードまたは非ブロックモードを設定する整数。値ゼロはブロックモードを有効にし、ゼロ以外の値は非ブロックモードを有効にする 

ba_event_t 型の構造体は次のように定義されています。


typedef struct {
        uint_t          ba_event_type;
        uint_t          ba_event_drops;
        union {
                struct {
                        ba_name_t       ba_event_iface;
                        ba_name_t       ba_event_info;
                } ba_event_config;
                struct {
                        ba_name_t       ba_flow_iface;
                        uint_t          ba_num_flows;
                        ba_flow_event_t ba_event_flows[BA_EVENT_MAX_FLOWS];
                } ba_event_flow;
                ba_class_stats_t        ba_event_stats;
                /* the following is for Bandwidth Manager internal use only */
                ba_filter_event_t       ba_event_filter;
                ba_cl_filter_event_t    ba_event_cl_filter;
        } ba_event_union;
} ba_event_t;

ba_event_t 型の構造体の要素は次のように設定されます。

ba_event_type

発生したイベントタイプを識別できるように設定される。可能な値については、表 3-1 を参照してください。

ba_event_iface

イベントが発生したインタフェースを識別できるように設定される。イベントの型が、BA_EVENT_CONFIG_STARTING または BA_EVENT_CONFIG_ENDING の場合は、再設定されたインタフェース名が設定され、BA_EVENT_DAEMON_ENDING の場合は、空文字列が設定される。

ba_event_info

将来使用するために予約されている 

ba_flow_event_t 型の構造体は次のように定義されています。


typedef struct {
     ba_name_t       classname_in; 
     ba_name_t       classname_out;
     struct in_addr  ip_local;
     struct in_addr  ip_remote;
     uchar_t         protocol;
     ushort_t        port_local;
     ushort_t        port_remote;
     uchar_t         tos_sent_in;
     uchar_t         tos_sent_out;
     uint_t          npackets_in;
     uint_t          nbytes_in;
     uint_t          npackets_out;
     uint_t          nbytes_out;
     uint_t          url_length;
     union {
             uchar_t         *url;
             u_longlong_t    url_pad;} url_union;
     hrtime_t   firstseen_in; /* timestamp of first packet sent (ns)*/
     hrtime_t   lastseen_in;  /* timestamp of last packet sent (ns) */
     hrtime_t   firstseen_out;/* timestamp of first packet sent (ns)*/
     hrtime_t   lastseen_out; /* timestamp of last packet sent (ns) */
} ba_flow_event_t;
 
#define ba_flow_url     url_union.url