lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: RE : [lwip-users] using 2 IP numbers at the same time


From: KORAY KORKMAZER \(MIKES INTERNET\)
Subject: RE: RE : [lwip-users] using 2 IP numbers at the same time
Date: Fri, 9 Nov 2007 14:13:07 +0200

Sorry for my late answer.

 

>I have an ethernet interface for communication and using LwIP(LwIP 2.00.a version)

>>I suppose this is a release number provided by your port maintainer. Currently, last release is 1.2.0

 

Yes , you are right. 2.00.a must be my maintainer release number. How  can I learn the version of the lwip that I am using?

 

 

>From mail group , I read that this  is possible with creating seperate network interfaces with ‘netif_add’ function.

>>Can you provide these mails references?

 

I researched the threads , and found 2 threads relating with this issue.

 

http://lists.nongnu.org/archive/html/lwip-users/2007-06/msg00015.html

 

http://lists.nongnu.org/archive/html/lwip-users/2007-05/msg00088.html

 

May be these threads are not relating exactly with my case, but they made me to think that ‘using 2 IP numbers  at the same time’ is possibble.

 

 

>>I'm not sure that lwIP support that like this. Perhaps it's possible, but your driver should handle that. How do you have implemented your driver "low_level_input" calls?

Actually , I didn`t make any modifications on low-level-input calls. I am linking lwip as a seperate library and using it as in the form that I received from our  maintainer(xilinx).

From your answer, I understand that I should make some modificaitons on low-level-input calls.

As I said before, I am pretty new in using lwip and tcp/ip. Is there any document that you can share with me  in order to learn the main structure of lwip.

I will work on this issue, will  notify you if I can  manage to handle it.

 

 

Koray.


From: address@hidden [mailto:address@hidden On Behalf Of Frédéric BERNON
Sent: Wednesday, November 07, 2007 1:20 PM
To: Mailing list for lwIP users
Subject: RE : [lwip-users] using 2 IP numbers at the same time

 

>I have an ethernet interface for communication and using LwIP(LwIP 2.00.a version)

I suppose this is a release number provided by your port maintainer. Currently, last release is 1.2.0

 

>From mail group , I read that this  is possible with creating seperate network interfaces with ‘netif_add’ function.

Can you provide these mails references?

 

>In my design , I thought of creating two threads which  will establish two sockets and add seperate network interfaces at the same time.

>But it didn`t work. While I  could communicate with one IP number , the other connection could not be established.

 

I'm not sure that lwIP support that like this. Perhaps it's possible, but your driver should handle that. How do you have implemented your driver "low_level_input" calls?

 

 

====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : address@hidden
Web Site : http://www.hymatom.fr
====================================

P Avant d'imprimer, penser à l'environnement

 

-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de KORAY KORKMAZER (MIKES INTERNET)
Envoyé : mercredi 7 novembre 2007 10:21
À : address@hidden
Objet : [lwip-users] using 2 IP numbers at the same time

Hello,

 

I am pretty new in using lwip and  want to ask your recommendations on an issue about using 2 IP numbers at the same time.

 

Let me describe my design first:

I am working on an Xilinx ML-403 platform and writing code for PPC inside the FGPGA. I have an ethernet interface for communication and using LwIP(LwIP 2.00.a version) for it.

Also using Xilinx MicroKernel.

Simply my application will have a static IP number and will communicate with another system which has a static IP number too.

 

But now another requirement has been arised. That is my application must communicate  with a second  system from an another IP number. And I still have one physical ethernet port.

This means that my application must  have 2 IP numbers. And it must listen both connections at the same time.

 

From mail group , I read that this  is possible with creating seperate network interfaces with ‘netif_add’ function.

In my design , I thought of creating two threads which  will establish two sockets and add seperate network interfaces at the same time.

But it didn`t work. While I  could communicate with one IP number , the other connection could not be established.

Here is my thread that I use for creating socket:

 

void *socket_app_thread( void *arg )

{

.....//declarations an initializations  IP, port , MAC, subnet, gw

 

   xtemacif_setmac( 0, ( u8_t* )fullmac ); //Set MAC

   IP4_ADDR( &gw, gateway[ 0 ], gateway[ 1 ], gateway[ 2 ], gateway[ 3 ] );

   //Set gateway

   IP4_ADDR( &ipaddr, ip[ 0 ], ip[ 1 ], ip[ 2 ], ip[ 3 ] ); //Set ip

   IP4_ADDR( &netmask, subnet[ 0 ], subnet[ 1 ], subnet[ 2 ], subnet[ 3 ] );

   //Set subnet msk

 

   /* allocate netif structure */

   default_netif = mem_malloc( sizeof( struct netif ) );

   if ( default_netif == NULL )

   {

      return NULL;

   }

   default_netif = netif_add( default_netif,

                              &ipaddr,

                              &netmask,

                              NULL,

                              &XTemacIf_ConfigTable[ 0 ],

                              xtemacif_init,

                              tcpip_input );

 

   netif_set_default( default_netif );

 

   /* Register XEmacHandler with interrupt controller and enable interrupts

    * with XMK

    */

   register_int_handler( XPAR_OPB_INTC_0_TRIMODE_MAC_GMII_IP2INTC_IRPT_INTR,

                         (XInterruptHandler )XTemac_IntrFifoHandler,

                         xtemacif_ptr->instance_ptr );

 

   /* Enable EMAC interrupts in XMK */

   enable_interrupt( XPAR_OPB_INTC_0_TRIMODE_MAC_GMII_IP2INTC_IRPT_INTR );

   /*-----------------------------------------------------------------------*/

   /* create socket and start application                                   */

   /*-----------------------------------------------------------------------*/

   sock = socket( AF_INET, SOCK_STREAM, 0 );

   addr.sin_family = AF_INET;

   addr.sin_port = htons( port );

   addr.sin_addr.s_addr = INADDR_ANY;

   bind( sock, ( struct sockaddr* ) &addr, sizeof( addr ) );

   listen( sock, 7);

 

   SockDesc = accept( sock, ( struct sockaddr* ) &rem, &lensock );

 

}

 

 

The second thread is similar with this one, only IP  and port number is different.

Do you have any idea where I am having mistakes?

I really appreciate for your help.

 

Thanks in advance.

Koray.

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]