Ejemplo n.º 1
0
void DPReceivePeer_Init (DPReceivePeer *o, DPReceiveDevice *device, peerid_t peer_id, FrameDeciderPeer *decider_peer, int is_relay_client)
{
    DebugObject_Access(&device->d_obj);
    ASSERT(is_relay_client == 0 || is_relay_client == 1)
    
    // init arguments
    o->device = device;
    o->peer_id = peer_id;
    o->decider_peer = decider_peer;
    o->is_relay_client = is_relay_client;
    
    // init relay source
    DPRelaySource_Init(&o->relay_source, &device->relay_router, o->peer_id, device->reactor);
    
    // init relay sink
    DPRelaySink_Init(&o->relay_sink, o->peer_id);
    
    // have no sink
    o->dp_sink = NULL;
    
    // insert to peers list
    LinkedList1_Append(&device->peers_list, &o->list_node);
    
    DebugCounter_Init(&o->d_receivers_ctr);
    DebugObject_Init(&o->d_obj);
}
Ejemplo n.º 2
0
void BPendingGroup_Init (BPendingGroup *g)
{
    // init jobs list
    LinkedList1_Init(&g->jobs);
    
    // init pending counter
    DebugCounter_Init(&g->pending_ctr);
    
    // init debug object
    DebugObject_Init(&g->d_obj);
}
Ejemplo n.º 3
0
void PacketPassFifoQueue_Init (PacketPassFifoQueue *o, PacketPassInterface *output, BPendingGroup *pg)
{
    // init arguments
    o->output = output;
    o->pg = pg;
    
    // init output
    PacketPassInterface_Sender_Init(output, (PacketPassInterface_handler_done)output_handler_done, o);
    
    // init waiting flows list
    LinkedList1_Init(&o->waiting_flows_list);
    
    // set no sending flow
    o->sending_flow = NULL;
    
    // init schedule job
    BPending_Init(&o->schedule_job, pg, (BPending_handler)schedule_job_handler, o);
    
    // set not freeing
    o->freeing = 0;
    
    DebugCounter_Init(&o->d_flows_ctr);
    DebugObject_Init(&o->d_obj);
}