int main (void) { PCB *q1 = NULL; PCB *p1 = pcb_new(0, 1); PCB *p2 = pcb_new(3, 2); PCB *p3 = pcb_new(2, 3); PCB *p4 = pcb_new(1, 4); PCB *p5 = pcb_new(4, 5); PCB *x1; q1 = p1; pcb_enqueue(p2, &q1); pcb_enqueue(p3, &q1); pcb_enqueue(p4, &q1); pcb_enqueue(p5, &q1); pcb_print_list(q1); x1 = pcb_dequeue(&q1); pcb_print_list(q1); pcb_remove(p5, &q1); pcb_print_list(q1); return 0; }
/** * Create a new pcb of a specific type inside a netconn. * Called from netconn_new_with_proto_and_callback. * * @param msg the api_msg_msg describing the connection type */ void do_newconn(struct api_msg_msg *msg) { if(msg->conn->pcb.tcp == NULL) { pcb_new(msg); } /* Else? This "new" connection already has a PCB allocated. */ /* Is this an error condition? Should it be deleted? */ /* We currently just are happy and return. */ TCPIP_APIMSG_ACK(msg); }