Problem in address field of recvfrom


 
Thread Tools Search this Thread
Top Forums Programming Problem in address field of recvfrom
# 1  
Old 08-30-2005
Question Problem in address field of recvfrom

When I'm making two sockets (connectionless) and then sending request from one using sendto and recieving form other using recvfrom I'm able to get the message (buffer field in sendto) but can't get the address of calling client in the value-result field of recvfrom (sockaddr_in* and socklen_t*).
What may b going wrong??
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Problem with getting awk to multiply a field by a value set based on condition of another field

Hi, So awk is driving me crazy on this one. I have searched everywhere and read man, docs and every related post Google can find and still no luck. The actual files I need to run this on are sensitive in nature, but it is the same thing as if I needed to calculate weighted grades for multiple... (15 Replies)
Discussion started by: cotilloe
15 Replies

2. Forum Support Area for Unregistered Users & Account Problems

Problem changing the email address associated with my UNIX.com account

Hello I have had an account for many years. I have attempted to change the email address associated with my account. After logging-in to unix.com and revising my email address, I received a 're-verification' email at that new address. The first link in that email took me to a page with the... (1 Reply)
Discussion started by: irb
1 Replies

3. IP Networking

Source IP address field in RREP on DSR routing

Hello I have a question about routing in MANET using Dynamic Source Routing protocol. IN RFC4728 (DSR) in section "IP fields" of RREP (Route Reply) packet we have this: ok. I read in several books and also in rfc4728 that: when a source node (node that initiate route discovery process)... (1 Reply)
Discussion started by: acu281
1 Replies

4. Debian

Problem configuring IP address on remote device

I need to add a printer with Ethernet to my local network. The default IP address in the printer is 0.0.0.0 and I need to change it to a 192.168.0.x address. I have previously temporarily changed the IP address of a computer (with ifconfig) to an address similar to the new device and changed the... (8 Replies)
Discussion started by: snorkack59
8 Replies

5. Forum Support Area for Unregistered Users & Account Problems

Problem after changing email address

Hi, I updated my email address and since then I am not able to post in any other area than here, see the adds and am not able to edit my profile in the User CP. After saving the password change the page was redirected rather fast, so not sure if I need to do anything or if I have to wait for... (3 Replies)
Discussion started by: cero
3 Replies

6. AIX

Problem with IP address when restarting AIX

Hi! I have useud SMIT to configured my static adress for AIX but when I restart the AIX the ipadress is not shown when I print netstat -in or ifconfig -a. I have to configure the ip whit smit to have it start! How can I starting the ip during boot? (6 Replies)
Discussion started by: peter.olofsson
6 Replies

7. IP Networking

recvfrom() causes segmentation fault

hi all.... i wrote a program with udp sockets.. when it reaches the function 'recvfrom()' it crashes with a core dump. the gdb trace says the following error msg... Core was generated by `/opt/fmp'. Program terminated with signal 6, Aborted. #0 0x00000055555b18e4 in recvfrom () from... (1 Reply)
Discussion started by: lameduck0123
1 Replies

8. Shell Programming and Scripting

Insert IP address into MySQL int field

Greets all, I'm using Perl trying to insert an IP address from a log file into an INT field in a MYSQL table. So it needs to be converted into an int first. I thought the pack() function could do this for me, but I'm not sure I get the right thing. I also need to be able to extract it correctly... (3 Replies)
Discussion started by: otheus
3 Replies

9. IP Networking

Error in sendto and recvfrom

Hi guys below is the code which I wrote to send some message to the server and the receive a a reply message from the server. Initially, I wrote one program to sendto and one program to receive from, it is working fine seperately. When I tried coding sendto and recvfrom in a sinlge program then... (0 Replies)
Discussion started by: arunc.kris
0 Replies

10. UNIX for Dummies Questions & Answers

IP address/hostname problem

I have a problem that when I am pinging with the IP address it is giving me whether a server is alive or not but when I am trying it with hostname it is giving unknown host I have checked in /etc/hosts file and the IP address and hostname are both there...still the problem is there.. Can... (1 Reply)
Discussion started by: uLearner
1 Replies
Login or Register to Ask a Question
NG_SOCKET(4)						   BSD Kernel Interfaces Manual 					      NG_SOCKET(4)

NAME
ng_socket -- netgraph socket node type SYNOPSIS
#include <sys/types.h> #include <netgraph/ng_socket.h> DESCRIPTION
A socket node is both a BSD socket and a netgraph node. The ng_socket node type allows user-mode processes to participate in the kernel netgraph(4) networking subsystem using the BSD socket interface. The process must have root privileges to be able to create netgraph sockets however once created, any process that has one may use it. A new ng_socket node is created by creating a new socket of type NG_CONTROL in the protocol family PF_NETGRAPH, using the socket(2) system call. Any control messages received by the node and not having a cookie value of NGM_SOCKET_COOKIE are received by the process, using recvfrom(2); the socket address argument is a struct sockaddr_ng containing the sender's netgraph address. Conversely, control messages can be sent to any node by calling sendto(2), supplying the recipient's address in a struct sockaddr_ng. The bind(2) system call may be used to assign a global netgraph name to the node. To transmit and receive netgraph data packets, a NG_DATA socket must also be created using socket(2) and associated with a ng_socket node. NG_DATA sockets do not automatically have nodes associated with them; they are bound to a specific node via the connect(2) system call. The address argument is the netgraph address of the ng_socket node already created. Once a data socket is associated with a node, any data pack- ets received by the node are read using recvfrom(2) and any packets to be sent out from the node are written using sendto(2). In the case of data sockets, the struct sockaddr_ng contains the name of the hook on which the data was received or should be sent. As a special case, to allow netgraph data sockets to be used as stdin or stdout on naive programs, a sendto(2) with a NULL sockaddr pointer, a send(2) or a write(2) will succeed in the case where there is exactly ONE hook attached to the socket node, (and thus the path is unambigu- ous). There is a user library that simplifies using netgraph sockets; see netgraph(3). HOOKS
This node type supports hooks with arbitrary names (as long as they are unique) and always accepts hook connection requests. CONTROL MESSAGES
This node type supports the generic control messages, plus the following: NGM_SOCK_CMD_NOLINGER When the last hook is removed from this node, it will shut down as if it had received a NGM_SHUTDOWN message. Attempts to access the sockets associated will return ENOTCONN. NGM_SOCK_CMD_LINGER This is the default mode. When the last hook is removed, the node will continue to exist, ready to accept new hooks until it is explic- itly shut down. All other messages with neither the NGM_SOCKET_COOKIE or NGM_GENERIC_COOKIE will be passed unaltered up the NG_CONTROL socket. SHUTDOWN
This node type shuts down and disappears when both the associated NG_CONTROL and NG_DATA sockets have been closed, or a NGM_SHUTDOWN control message is received. In the latter case, attempts to write to the still-open sockets will return ENOTCONN. If the NGM_SOCK_CMD_NOLINGER message has been received, closure of the last hook will also initiate a shutdown of the node. SEE ALSO
socket(2), netgraph(3), netgraph(4), ng_ksocket(4), ngctl(8) HISTORY
The ng_socket node type was implemented in FreeBSD 4.0. AUTHORS
Julian Elischer <julian@FreeBSD.org> BUGS
It is not possible to reject the connection of a hook, though any data received on that hook can certainly be ignored. The controlling process is not notified of all events that an in-kernel node would be notified of, e.g. a new hook, or hook removal. Some node-initiated messages should be defined for this purpose (to be sent up the control socket). BSD
January 19, 1999 BSD