To: | |
---|---|
Subject: | Re: [ts-7000] RE: ts-7800 how do I make 4 (at least 2) identical network stacks? |
From: | Jonathan Leslie <> |
Date: | Mon, 4 Nov 2013 10:34:54 -0800 (PST) |
I don't know if this is relative or not, but to do what I wanted with 2 devices with the QNX OS, I boot setup was this: # start network driver display_msg "---> Starting network" io-pkt-v4-hc -d e1000 did=0x1501 -ptcpip -v waitfor /dev/socket 3 ifconfig wm0 192.168.1.127/24 #dhcp.client -u -i wm0 io-pkt-v4-hc -d e1000 did=0x10d3 -ptcpip prefix=/alt -v waitfor /alt/dev/socket 6 ... SOCK=/alt ifconfig wm0 192.168.1.27/24 sleep 1 SOCK=/ So I had two SOCK element which were the 2 different IP STACKS. In a C program all I had to do was set which SOCK I was using to determine what network I was on: ////////////////////////////////////////////////////////////////////////////// int sockReceiveThread() { struct sockaddr_in sa; struct sockaddr_in sb; unsigned char buffer[128]; int recPort = -1; ssize_t recsize; socklen_t fromlen; CIMConfigReq_t requestOut; char addrBuff[INET_ADDRSTRLEN]; setenv("SOCK", "/alt", 1); //same as boomcom, but lower than correlator and console setprio(getpid(), 21); requestOut.requestID = CIMRECPORTREQUEST; MsgSend(configCoid, &requestOut, sizeof(CIMConfigReq_t), &cimRecPort, sizeof(int)); //printf("Crows receive port = %d\n", cimRecPort); cimRecSocket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); if (cimRecSocket == -1) {
sprintf(lmsg.buff, "INIT->ERROR: CROWSCOM could not open socket\n"); MsgSend(loggerCoid, &lmsg, sizeof(logMessage_t), NULL, 0); } memset(&sa, 0x0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl(INADDR_ANY); sa.sin_port = htons(cimRecPort); if (-1 == bind(cimRecSocket, (struct sockaddr*) &sa, sizeof(sa))) { sprintf(lmsg.buff, "INIT->ERROR: CROWSCOM could not bind to socket\n");
MsgSend(loggerCoid, &lmsg, sizeof(logMessage_t), NULL, 0); close(cimRecSocket); return -1; } fromlen = sizeof(sb); while (1) { recsize = recvfrom(cimRecSocket, (void*) buffer, sizeof(buffer), 0, (struct sockaddr*) &sb, &fromlen); // process buffer... }// end while }// end function sockReceiveThread //////////////////////////////////////////////////////////////////// I could make 2 threads, and by changing the one line: setenv("SOCK", "/alt", 1); to setenv("SOCK", "/", 1); I was on the alternate network, I was still node 1.1.1.200, but talking on a completely different network and the other program(thread) new nothing of this process. I'm in touch with the folks at QNX to see if I can add a pc104 network card and have SOCK=/ SOCK=/alt SOCK=/alt2 SOCK=/alt3 but I really want to do this with the TS-8700 board. So can I do it or not with a Ts-8700? Can I do it with a TS-7500 and 2 usb-ethernet dongles?
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe __,_._,___ |
Previous by Date: | RE: [ts-7000] RE: ts-7800 how do I make 4 (at least 2) identical network stacks?, Paul Yanzick |
---|---|
Next by Date: | RE: Re: [ts-7000] RE: ts-7800 how do I make 4 (at least 2) identical network stacks?, bomr |
Previous by Thread: | Re: [ts-7000] RE: ts-7800 how do I make 4 (at least 2) identical network stacks?, Jonathan Leslie |
Next by Thread: | RE: Re: [ts-7000] RE: ts-7800 how do I make 4 (at least 2) identical network stacks?, bomr |
Indexes: | [Date] [Thread] [Top] [All Lists] |
Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU