void prov_tcp_init(void) { prcom_add_function("tcp:::state-change", "tcp_set_state"); prcom_add_callback("tcp:::connect-established", "tcp_set_state", tcp_connect_established); prcom_add_callback("tcp:::connect-request", "tcp_set_state", tcp_connect_request); /***********************************************/ /* Two scenarios for refusal - host is up */ /* and port is not open, or host is not up, */ /* and connection is similuated/close. */ /***********************************************/ prcom_add_callback("tcp:::connect-refused", "tcp_reset", tcp_connect_refused); prcom_add_callback("tcp:::connect-refused", "tcp_set_state", tcp_connect_refused2); prcom_add_callback("tcp:::accept-established", "tcp_set_state", tcp_accept_established); /***********************************************/ /* The tcp_send functions below changed */ /* names in the kernel. */ /***********************************************/ # if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) prcom_add_callback("tcp:::send", "tcp_event_data_sent", tcp_send); # else prcom_add_callback("tcp:::send", "tcp_event_new_data_sent", tcp_send); # endif prcom_add_callback("tcp:::receive", "tcp_event_data_recv", tcp_recv); /***********************************************/ /* UDP. */ /***********************************************/ prcom_add_callback("udp:::receive", "udp_queue_rcv_skb", udp_recv); prcom_add_callback("udp:::send", "udp_sendmsg", udp_send); }
void tcp_init(void) { prcom_add_function("tcp:::state-change", "tcp_set_state"); }