Date: Wed, 7 Apr 2010 17:51:58 +0200 From: serena zanetta <sz3003@gmail.com> To: freebsd-net@freebsd.org Subject: Handle netgraph control messages Message-ID: <o2xb2ecfd381004070851gd1f7f1a4l7d8911bf77f5c338@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
I=92ve modified the ng_hub node code in order to send a =93connect=94 contr= ol message to the following ng_ksocket node. I=92ve filled a sockaddr_in structure, named connect_saddrin, as: connect_saddrin.sin_len =3D 16; connect_saddrin.sin_family =3D AF_INET; connect_saddrin.sin_port =3D htonl(55056); connect_saddrin.sin_addr.s_addr =3D htonl(remoteIP.s_addr); And then I=92ve initialized the control message and send it out: NG_MKMESSAGE(connect_msg,NGM_KSOCKET_COOKIE,NGM_KSOCKET_CONNECT,sizeof(stru= ct sockaddr_in),M_NOWAIT); *(struct sockaddr_in *)connect_msg->data =3D connect_saddrin; NG_SEND_MSG_HOOK(error,node,connect_msg,hook2,0); But it doesn=92t work: no message is received by the ng_ksocket node! Can anyone help me please? Thank you, Serena
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?o2xb2ecfd381004070851gd1f7f1a4l7d8911bf77f5c338>