This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: synthetic target network support for UDP socket.
- From: "Santoshkumar Zalake" <santoshkumar dot zalake at wipro dot com>
- To: "Andrew Lunn" <andrew at lunn dot ch>
- Cc: "eCos Disuss" <ecos-discuss at ecos dot sourceware dot org>
- Date: Wed, 9 Mar 2005 20:14:54 +0530
- Subject: Re: [ECOS] synthetic target network support for UDP socket.
- References: <024201c524b1$c19bed40$5f6bc90a@EC4SEMI118507> <20050309144025.GV27187@lunn.ch>
Hi Andrew
I am using SOL_SOCKET value as 0xffff.
Z.Santosh.
----- Original Message -----
From: "Andrew Lunn" <andrew@lunn.ch>
To: "Santoshkumar Zalake" <santoshkumar.zalake@wipro.com>
Cc: "eCos Disuss" <ecos-discuss@ecos.sourceware.org>
Sent: Wednesday, March 09, 2005 8:10 PM
Subject: Re: [ECOS] synthetic target network support for UDP socket.
> On Wed, Mar 09, 2005 at 07:40:32PM +0530, Santoshkumar Zalake wrote:
> > Hi All,
> >
> > According following mail, I used "socketcall" function calls to use
Linux
> > (native) socket function. These are working fine TCP (stream) socket.
But
> > these calls are not properly working for UDP (datagram) sockets.
> > I used following code to establish socket connection between to process
> > using synthetic eCos-2.0.
> >
> > /* To get socket */
> >
> > unsigned long sock_info[10];
> > int udp_socket_fd, socket_error,a=1;
> >
> > memset(sock_info,0x00,10*sizeof(unsigned long));
> >
> > socket_info[0] = (unsigned long) AF_INET;
> > socket_info[1] = (unsigned long) SOCK_DGRAM;
> > socket_info[2] = (unsigned long)0;
> >
> > udp_socket_fd = cyg_hal_sys_socketcall(SYS_SOCKET,socket_info);
> >
> > if(udp_socket_fd <0)
> > {
> > printf("Error Socket %d", udp_socket_fd);
> > exit(0);
> > }
> > /* To set Reuse */
> > memset(sock_info,0x00,10*sizeof(unsigned long));
> >
> > socket_info[0] = (unsigned long)udp_socket_fd;
> > socket_info[1] = (unsigned long) SOL_SOCKET;
> > socket_info[2] = (unsigned long) SO_REUSEADDR;
> > socket_info[3] = (unsigned long)(&a);
> > socket_info[4] = (unsigned long)(sizeof(int));
> >
> > socket_error = cyg_hal_sys_socketcall(SYS_SETSOCKOPT,socket_info);
> >
> > if(socket_error <0)
> > {
> > printf("ERROR SetSockOpt %d", socket_error);
> > }
> >
> >
> > In this code, I am getting socket(udp_socket_fd )value as 4 or 5. But I
am
> > getting socket_error value as -92 (according error.h this error is
> > ENOPROTOOPT which means protocol not available) in setsockopt
functionality.
>
> What value are you using for SOL_SOCKET? 0xffff or 1?
>
> Andrew
>
Confidentiality Notice
The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss