Send "connect" control message
serena zanetta
sz3003 at gmail.com
Tue Apr 6 15:32:42 UTC 2010
Hi,
I want to send a connect control message from an ng_hub node to the followin
ng_ksocket node.
I've tired by filling within the ng_hub node the sockaddr_in structure named
connect_addr:
connect_addr->sin_len = 16;
connect_addr->sin_family = AF_INET;
connect_addr->sin_port = htons(55056);
connect_addr->sin_addr.s_addr = htonl(IP_REMOTE);
And send it to the following node as:
*(struct sockaddr_in *)msg->data = connect_addr;
NG_MKMESSAGE(msg,NGM_GINSOCKET_COOKIE,NGM_GINSOCKET_CONNECT,sizeof(struct
sockaddr_in),M_NOWAIT);
NG_SEND_MSG_HOOK(error,node,msg,hook2,0);
But first of all, I don't know how I can convert the IP_REMOTE, which is
currently IP_REMOTE = "10.0.0.90", into a in_addr structure...
Does anyone can suggest me how to fix it?
Thank you,
Serena
More information about the freebsd-net
mailing list