int tipc_disc_create(struct tipc_bearer *b_ptr, struct tipc_media_addr *dest, u32 dest_domain) { struct tipc_link_req *req; req = kmalloc(sizeof(*req), GFP_ATOMIC); if (!req) return -ENOMEM; req->buf = tipc_disc_init_msg(DSC_REQ_MSG, dest_domain, b_ptr); if (!req->buf) { kfree(req); return -ENOMSG; } memcpy(&req->dest, dest, sizeof(*dest)); req->bearer = b_ptr; req->domain = dest_domain; req->num_nodes = 0; req->timer_intv = TIPC_LINK_REQ_INIT; k_init_timer(&req->timer, (Handler)disc_timeout, (unsigned long)req); k_start_timer(&req->timer, req->timer_intv); b_ptr->link_req = req; disc_send_msg(req); return 0; }
struct link_req *tipc_disc_init_link_req(struct bearer *b_ptr, const struct tipc_media_addr *dest, u32 dest_domain, u32 req_links) { struct link_req *req; req = kmalloc(sizeof(*req), GFP_ATOMIC); if (!req) return NULL; req->buf = tipc_disc_init_msg(DSC_REQ_MSG, req_links, dest_domain, b_ptr); if (!req->buf) { kfree(req); return NULL; } memcpy(&req->dest, dest, sizeof(*dest)); req->bearer = b_ptr; req->timer_intv = TIPC_LINK_REQ_INIT; k_init_timer(&req->timer, (Handler)disc_timeout, (unsigned long)req); k_start_timer(&req->timer, req->timer_intv); return req; }