Feed for discussion io-net migration in project Networking. http://community.qnx.com/sf/discussion/do/listTopics/projects.networking/discussion.io_net_migration Posts for io-net migration post119285: Re: io-net migrating nicinfo http://community.qnx.com/sf/go/post119285 Hello All, Need information on alternative of /dev/io-net/en0 in io-pkt. Please suggest how to execute ioctls like SIOCSDRVSPEC (Since there will be no device node when using io-pkt drivers) Wed, 14 Nov 2018 14:52:36 GMT http://community.qnx.com/sf/go/post119285 bhavya ramu(deleted) 2018-11-14T14:52:36Z post119284: Re: RE: Get MAC with io-pkt http://community.qnx.com/sf/go/post119284 Hello All, I checked links given above, but itseems to be not available. Please suggest how to get mac address with io-pkt for "fec0" interface. Thanks. Wed, 14 Nov 2018 09:32:49 GMT http://community.qnx.com/sf/go/post119284 bhavya ramu(deleted) 2018-11-14T09:32:49Z post118960: Ethernet over USB using RNDIS on x86 http://community.qnx.com/sf/go/post118960 Hi I'm new so I hope I'm posting in the right place... if not feel free to move this post. I have an x86 target which is acting as a USB host to communicate with a USB device using RNDIS. I'm using QNX 6.6. I'm attempting the following: io-pkt-v4-hc verbose -p tcpip io-usb-dcd -dehci -duhci -dohci waitfor /dev/io-usb-dcd/io-usb 5 mount -Tio-pkt -o mac=00D056F2B512,usbdnet_mac=00D056F2B513,protocol=rndis devnp-usbdnet.so if_up -p rndis0 ifconfig rndis0 10.100.8.113 what I see is to the following: # sloginfo -c Time Sev Major Minor Args Jul 16 15:51:19 5 14 0 tcpip starting Jul 16 15:51:19 3 14 0 Using pseudo random generator. See "random" option Jul 16 15:51:19 5 14 0 initializing IPsec... done Jul 16 15:51:19 5 14 0 IPsec: Initialized Security Association Processing. Jul 16 15:51:19 2 10 0 usbmgr_connection_create() Failed to attach to root device for cfg (status = 19) Jul 16 15:51:19 2 10 0 usbdif_init() Couln't create configuration connection to the usb stack... using default descriptors ( error = 19 ) Jul 16 15:51:19 5 14 0 rndis0 Questions: 1) The usbdnet_mac is incorrect. How do I display the MAC address of the local USB port in QNX? I will try to see if I can give it when I attached the device to Windows. 2) Does anyone have a suggestion of usbmgr_connection_create() is failing to attach? The "usb -v" dump is attached. Tue, 17 Jul 2018 00:15:17 GMT http://community.qnx.com/sf/go/post118960 Tim Spargo(deleted) 2018-07-17T00:15:17Z post118146: How do i determine Ethertype in PFIL filter http://community.qnx.com/sf/go/post118146 Hi, I replacing an io-net filter with a PFIL filter. Previously we would look at the Ethertype field to determine the filter action. This was to support filtering of IEC GOOSE message which use their own Ethernet frame types. I'm struggling to determine how I can get to the same field in the PFIL interface. The mbuf data starts at the payload which is too far in the frame. Is the Ethertype available somewhere else in the mbuf chain? I've included io-net code snippet for info:- int goose_rx_up( npkt_t *npkt, void *func_hdl, int off, int framlen_sub, uint16_t cell, // 1 = "en" uint16_t endpoint, // endpoint gives us the originating ethernet port; 0=en0, 1=en1 uint16_t iface ) { net_buf_t *buf; net_iov_t *iov; buf = TAILQ_FIRST(&npkt->buffers); iov = buf->net_iov; // check to see if this is a ETHERTYPE_VLAN goose message; if so, filter it away to the goose app if connected ptr16 = (uint16_t *)(iov->iov_base); /* * Check for ether VLAN 0x8100 AND goose type 0x88b8 or goose type 0x88b9 or Goose Types on their own... */ if ( ( ptr16[ETH_VLAN_WORD_POS] == ETH_TYPE_IEC61850_GOOSE ) || ( ptr16[ETH_VLAN_WORD_POS] == ETH_TYPE_IEC61850_GSE_MGMNT ) || ( ptr16[ETH_VLAN_WORD_POS] == ETHERTYPE_VLAN && (ptr16[ETH_GOOSE_TYPE_WORD_POS] == ETH_TYPE_IEC61850_GOOSE || ptr16[ETH_GOOSE_TYPE_WORD_POS] == ETH_TYPE_IEC61850_GSE_MGMNT) ) ) { #ifdef DEBUG fprintf(stderr, "Incoming subscriber goose msg rxd, len=%d\n", npkt->framelen); #endif } } Tue, 24 Oct 2017 14:28:53 GMT http://community.qnx.com/sf/go/post118146 Jasver Singh 2017-10-24T14:28:53Z post117943: Adding / deleting permanent entries in NDP http://community.qnx.com/sf/go/post117943 Hello, I need to add/delete a permanent entry to ndp table in QNX. I found a way to add entry to ndp table in linux using the following command "ip -6 neigh add <IPv6 address> lladdr <link-layer address> dev <device>" Can u please suggest me an alternative command for adding / deleting the permanent entry to ndp table in QNX Thanks, Jashitha Fri, 04 Aug 2017 06:30:00 GMT http://community.qnx.com/sf/go/post117943 jashitha kp(deleted) 2017-08-04T06:30:00Z post115955: Unable to load devn driver in io-pkt http://community.qnx.com/sf/go/post115955 Hi, I have a devn driver written for io-net which I'm trying to mount for io-pkt. I'm executing the command: mount -v -T io-pkt -omac=001122334455 /tmp/devn-znet.so But I get the error: Parsed: mount from [/tmp/devn-znet.so] mount on [NULL] type [io-pkt] mount: Can't mount / (type io-pkt) mount: Possible reason: No such device or address In sloginfo, I see: Time Sev Major Minor Args Mar 15 20:14:52 4 4 0 ksh: /sbin/mount(-v,-T,io-pkt,-omac=001122334455,/tmp/devn-znet.so) Mar 15 20:14:52 2 14 0 Unable to load /tmp/devn-znet.so: (null) "ls -l /tmp/devn-znet.so" gives: -rwxrwxrwx 1 root root 36687 Mar 15 20:11 /tmp/devn-znet.so "pidin -pio-pkt-v6-hc mem" gives: pid tid name prio STATE code data stack 4784153 1 sbin/io-pkt-v6-hc 21r SIGWAITINFO 2300K 2808K 8192(516K)* 4784153 2 sbin/io-pkt-v6-hc 10r RECEIVE 2300K 2808K 8192(132K) 4784153 3 sbin/io-pkt-v6-hc 21r RECEIVE 2300K 2808K 4096(132K) 4784153 4 sbin/io-pkt-v6-hc 10r RECEIVE 2300K 2808K 4096(132K) libc.so.3 @fe300000 512K 12K devnp-shim.so @fe386000 44K 4096 devn-mpc85xx.so @fe392000 52K 4096 /dev/mem @80100000 (f7024000) 4096 /dev/mem @80101000 (f7024000) 4096 /dev/mem @80102000 (f7026000) 4096 /dev/mem @80103000 (f7024000) 4096 How can I debug further? Any help would be much appreciated. Thanks. Tarun. Tue, 15 Mar 2016 11:57:32 GMT http://community.qnx.com/sf/go/post115955 Tarun R(deleted) 2016-03-15T11:57:32Z post105896: Intel platform native io-pkt driver, but nicinfo refers to /dev/io-net/en0 http://community.qnx.com/sf/go/post105896 Hi I'm seeing an issue with nicinfo on QNX 6.5.0 SDP with a native io-pkt driver. nicinfo reports "/dev/io-net/en0 no such file or directory" Any idea on why nicinfo tries to see the io-net path even though the driver is native io-pkt. Thanks in advacne. -CT Mon, 14 Oct 2013 02:45:35 GMT http://community.qnx.com/sf/go/post105896 Chris Tucker 2013-10-14T02:45:35Z post102144: io-net migrating nicinfo http://community.qnx.com/sf/go/post102144 Hi, I need a replacement of accessing /dev/io-net/en0 in io-pkt-v4 I use it like below nicFD = open( "/dev/io-net/en0", O_ACCMODE ); If there any api in io-pkt which can return me a file descriptor for any desired interface Tue, 11 Jun 2013 11:32:54 GMT http://community.qnx.com/sf/go/post102144 nishant mishra 2013-06-11T11:32:54Z post91673: Re: io-pkt & Multicasting http://community.qnx.com/sf/go/post91673 Looked into io-pkt-v4-hc ? ----- Original Message ----- From: antony Lewis [mailto:community-noreply@qnx.com] Sent: Monday, February 20, 2012 09:47 AM To: ionetmig-networking <post91671@community.qnx.com> Subject: io-pkt & Multicasting Dear Friends According to QNX docs, io-pkt-v4 doesn't support Multicast routing. (http://www.qnx.com/developers/docs/6.4.1/neutrino/utilities/i/io-pkt.html) What is the alternative for io-pkt-v4 to have Multicast routing ? Regards _______________________________________________ io-net migration http://community.qnx.com/sf/go/post91671 Mon, 20 Feb 2012 16:51:58 GMT http://community.qnx.com/sf/go/post91673 Mate Szarvas 2012-02-20T16:51:58Z post91671: io-pkt & Multicasting http://community.qnx.com/sf/go/post91671 Dear Friends According to QNX docs, io-pkt-v4 doesn't support Multicast routing. (http://www.qnx.com/developers/docs/6.4.1/neutrino/utilities/i/io-pkt.html) What is the alternative for io-pkt-v4 to have Multicast routing ? Regards Mon, 20 Feb 2012 14:47:45 GMT http://community.qnx.com/sf/go/post91671 antony Lewis 2012-02-20T14:47:45Z post86507: devn-mpc-85xx http://community.qnx.com/sf/go/post86507 Hello. I have a core dump while trying to use the devn-mpc85xx.so with io-pkt : # # # io-pkt-v4-hc -dmpc85xx -v Memory fault (core dumped) # ls -l /proc/boot/devn* -rwxrwxrwx 1 root 0 57344 Nov 28 2008 /proc/boot/devn-mpc85xx.so -rwxrwxrwx 1 root 0 39161 May 20 2009 /proc/boot/devnp-shim.so # sloginfo -c Time Sev Major Minor Args Apr 07 08:14:08 5 14 0 tcpip starting Apr 07 08:14:08 5 17 0 io_open for id = 10005 Apr 07 08:14:08 3 14 0 Using pseudo random generator. See "random" option Apr 07 08:14:08 5 14 0 initializing IPsec... done Apr 07 08:14:08 5 14 0 IPsec: Initialized Security Association Processing. Apr 07 08:14:08 5 17 0 io_close_ocb # # io-pkt-v4-hc # pidin a pid Arguments 1 procnto-booke-instr 2 devc-ser8250-mpc8540 -e -c396000000 -b 115200 0xf0004500,26 3 slogger 4 pipe 5 pci-men_em3fam -B -vvvv 6 smb-men_em03 20487 devc-pty 20488 qconn 20490 inetd 32777 sh 32779 mdis_kernel_dbg 208908 io-pkt-v4-hc 213005 pidin a # mount -T io-pkt /proc/boot/devn-mpc85xx.so mount: Can't mount / (type io-pkt) mount: Possible reason: No such process # pidin a pid Arguments 1 procnto-booke-instr 2 devc-ser8250-mpc8540 -e -c396000000 -b 115200 0xf0004500,26 3 slogger 4 pipe 5 pci-men_em3fam -B -vvvv 6 smb-men_em03 20487 devc-pty 20488 qconn 20490 inetd 32777 sh 32779 mdis_kernel_dbg 245772 pidin a # is that normal ? Why ? Wed, 08 Jun 2011 13:59:31 GMT http://community.qnx.com/sf/go/post86507 Guillaume Varlet 2011-06-08T13:59:31Z post83049: Re: RE: LSM name shown by pidin http://community.qnx.com/sf/go/post83049 Has there been any progress toward fixing this "buglet", #PR43050. The problem still exists in 6.50, and is causing us a bit of grief. Murf Wed, 09 Feb 2011 19:49:43 GMT http://community.qnx.com/sf/go/post83049 John Murphy 2011-02-09T19:49:43Z post78785: Re: mbuf Memory Management in pfil Hook http://community.qnx.com/sf/go/post78785 Hi Mark: Looks like the NetBSD man pages have a bit more information: http://netbsd.gw.com/cgi-bin/man-cgi?pfil_add_hook++NetBSD-4.0 Note the line: "If the packet processing is to stop, it is the responsibility of the filter to free the packet." (and, conversely, if you don't block the packet, you don't free it since it has to continue on up the stack). Not 100% sure about the outgoing stage, but given that the filter has no way of knowing when the driver has consumed the packet, I'd say that the driver doing the free would be the only way that makes sense. Hope that helps, Robert. Wed, 15 Dec 2010 05:15:07 GMT http://community.qnx.com/sf/go/post78785 Robert craig 2010-12-15T05:15:07Z post74738: mbuf Memory Management in pfil Hook http://community.qnx.com/sf/go/post74738 I've read the Filtering Wiki and the io-net migration guide and despite the note in these references saying there are many places on the web with information about mbuf's, I haven't been able to find anything about mbuf memory management in hooks. In our case, we have a protocol running above Ethernet. We register a PFIL_IN hook to collect packets off the wire. From the filtering wiki, it looks like our hook routine should return a non-zero value if we consume a packet and zero if packet processing should continue. It would make sense that we are responsible for freeing an mbuf if we consume a packet. Is that true? Similarly, we should not free the mbuf if our input hook returns 0, correct? On the send side, we allocate an mbuf and call if_output to send the packet. Are we correct in assuming the driver will free this outgoing mbuf when it is no longer needed? We currently free the mbuf if if_output returns a non-zero value. Is that correct? Thanks. Mark Mon, 15 Nov 2010 23:57:26 GMT http://community.qnx.com/sf/go/post74738 Mark Dowdy(deleted) 2010-11-15T23:57:26Z post65836: about networking on QNX6? http://community.qnx.com/sf/go/post65836 hi ,all: I am working on a BSP AT91SAM9263.now,i have to make the target connect with IDE,But I have no idea of how to do.can anyone give some suggestions or tell me where I can find the reference about the network. thank. best regard! yang. Fri, 03 Sep 2010 09:04:41 GMT http://community.qnx.com/sf/go/post65836 yang hui 2010-09-03T09:04:41Z post60286: Multiple Interfaces in QNX 6.4.1 http://community.qnx.com/sf/go/post60286 Hi, We have a computer with 2 voards. 1 of the CPU connects to the network using DHCP and it also connects to the other CPU using Serial over TCP communication. I am porting this project from 6.3.1. The earlier code was: The earlier code for having the network up for the CC project(Lower Board) was: io-net -dspeedo -dfd fd=/dev/ser1,mac=000102030405,ahdlc -ptcpip ifconfig en1 1.1.1.1 netmask 255.255.255.252 For the MC project (Upper Board) it was: io-net -dspeedo -dfd fd=/dev/ser1,mac=000102030406,ahdlc -ptcpip ifconfig en1 1.1.1.2 netmask 255.255.255.252 As we can see that there were two interfaces en0 and en1. Since we connect the lower board’s Ethernet port to the network so the lower board was getting 2 IP’s for 2 different interfaces. The interface en1 of the lower board was used to communicate with the upper board and the interface en0 was used to communicate with the network. But i dont know how can we have multiple interfaces in QNX 6.4.1. I could not see an appropriate answer when I searched through web Please Help. Thu, 22 Jul 2010 14:33:13 GMT http://community.qnx.com/sf/go/post60286 Raj Vardhan 2010-07-22T14:33:13Z post58860: io-net traces/code http://community.qnx.com/sf/go/post58860 HI I need to have a look into io-net's mind somehow!! Can i access its source code somewhere? Or is there a way to get traces out of io-net? I tried -v option while loading io-net but that does not show anything in sloginfo... Regards Vineet Wed, 07 Jul 2010 17:57:37 GMT http://community.qnx.com/sf/go/post58860 Vineet Garg 2010-07-07T17:57:37Z post57146: RE: Not Able to Start the Network http://community.qnx.com/sf/go/post57146 > we changed the computer ... worked perfectly fine Sometimes when this happens, the problem might be with the interrupt not firing for some reason. I haven't seen any "nicinfo" or "ifconfig -v" output but a malfunctioning interrupt looks like: 1) link is ok 2) packets are transmitted 3) no packets are received Just a shot in the dark. P.S. I really hate shared interrupts. Not as much as a trip to the dentist, but they're still pretty evil: http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Dr ivers_wiki_page -- cut -- Shared Interrupts - Problems? Different devices sharing a hardware interrupt is kind of a neat idea, but unless you really need to do it - because you've run out of hardware interrupt lines - it generally doesn't help you much. In fact, it can cause you trouble. For example, if your driver doesn't work - e.g. no received packets - check and see if it is sharing an interrupt with another device, and if so, re-configure your board so it does not. Most of the times, when shared interrupts are configured, there is no good reason for it - i.e. you haven't really run out of interrupts - and this can decrease your performance, because when the interrupt fires, ALL of the devices sharing the interrupt need to run and check and see if it is for them. If you check the source, you can see that some drivers do the "right thing" which is to read registers in their interrupt handlers to see if the interrupt is really for them, and ignore it if not. But many, many drivers do not - they schedule their thread-level event handlers to check their hardware, which is inefficient and reduces performance. If you are using PCI bus, use the "pci -v" utility to check interrupt allocation. You may be surprised as to what you see. Another point worth making is that sharing interrupts can vastly increase interrupt latency, depending upon exactly what each of the drivers do. Remember that after an interrupt fires, it will NOT be re-enabled by the kernel until ALL driver handlers tell the kernel that they have completed handling. So, if one driver takes a long, long time servicing a shared interrupt which is masked, if another device on the same interrupt causes an interrupt during that time period, processing of that interrupt can be delayed for an unknown duration of time. Bottom line is that interrupt sharing can cause problems, and reduce performance, increase cpu consumption, and seriously increase latency. Unless you really need to do it, don't. If you must share interrupts, make sure your drivers are doing the "right thing". Face it - shared interrupts are the new "trans fats" :) -- cut -- -- aboyd www.pittspecials.com/movies/headon.wmv Fri, 18 Jun 2010 13:14:35 GMT http://community.qnx.com/sf/go/post57146 Andrew Boyd(deleted) 2010-06-18T13:14:35Z post57132: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post57132 Today we changed the computer and tried running our code in it. The code worked perfectly fine and an IP address got assigned to the computer. We were able to ping other systems on the network. But the computer on which we were testing earlier is still not able get an IP address. Please note that the images created on QNX 6.3.2 is working on both the computer. I tried checking the SLOGGER file on both the computer. SLOGGER result on first controller (On which the CONFIGDEBUG on QNX 6.4.1 is working fine): Time Sev Major Minor Args Jun18 12:32:26 5 14 0 tcpip starting Jun18 12:32:26 5 14 0 Using pseudo random generator. See “random” option Jun18 12:32:27 5 14 0 Intel 82557 Jun18 12:32:27 5 14 0 Vendor …………………………..0x8086 Jun18 12:32:27 5 14 0 Device …………………………..0x1209 Jun18 12:32:27 5 14 0 Revision …………………………..0x10 Jun18 12:32:27 5 14 0 I/O port base …………………………..0x1000 Jun18 12:32:27 5 14 0 Memory base …………………………..0xfcc20000 Jun18 12:32:27 5 14 0 Interrupt …………………………..0xb Jun18 12:32:27 5 14 0 MAC address …………………………..00e04b 0eb169 Jun18 12:33:00 5 14 0 devn-speedo: MII transceiver found at address. Jun18 12:33:02 5 14 0 devn-speedo: MII transceiver found at address. Jun18 12:33:02 5 14 0 devn-speedo: link up (100 base T Full Duplex) Jun18 12:33:05 2 14 0 devn-speedo: speedo_MDI_MonitorPhy():Calling DI_monitorPhy() While the SLOGGER file on the earlier computer says: Time Sev Major Minor Args Jun11 13:32:26 5 14 0 tcpip starting Jun11 13:32:26 5 14 0 Using pseudo random generator. See “random” option Jun11 13:32:27 5 14 0 Unknown Chip ID Jun11 13:32:27 5 14 0 Vendor …………………………..0x8086 Jun11 13:32:27 5 14 0 Device …………………………..0x1209 Jun11 13:32:27 5 14 0 Revision …………………………..0x10 Jun11 13:32:27 5 14 0 I/O port base …………………………..0x1000 Jun11 13:32:27 5 14 0 Memory base …………………………..0xfcc20000 Jun11 13:32:27 5 14 0 Interrupt …………………………..0xb Jun11 13:32:27 5 14 0 MAC address …………………………..00e04b 0eb169 Jun11 13:33:00 5 14 0 devn-speedo: MII transceiver found at address. Jun11 13:33:02 5 14 0 devn-speedo: MII transceiver found at address. Jun11 13:33:05 2 14 0 devn-speedo: speedo_MDI_MonitorPhy():Calling DI_monitorPhy() If I query IFCONFIG on the first computer, the result is: lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 inet 127.0.0.1 netmask 0xff000000 fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 address: 00:11:22:33:aa:bb media: Ethernet autoselect (100baseTX full –duplex) status: active inet 10.11.148.217 netmask 0xfffffe00 broadcat 255.255.255.255 While the IFCONFIG on the second computer gives this result: lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 inet 127.0.0.1 netmask 0xff000000 fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 address: 00:11:22:33:aa:bb media: Ethernet none inet 0.0.0.0 netmask 0xff000000 broadcat 255.255.255.255 There might be a problem with the Ethernet card on the earlier computer but why the old code was running properly on that? Do you have an idea on this? Fri, 18 Jun 2010 10:14:37 GMT http://community.qnx.com/sf/go/post57132 Raj Vardhan 2010-06-18T10:14:37Z post57104: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post57104 Same setup, including same hub and cbles, same hardware, everything the same... and it works in 6.3.2, but not 6.4.1? Very curious case... :-) Because there's no light, doesn't that indicate the link isn't establishing? Can you figure out what media the 6.3.2 negotiated and use a driver option or ifconfig media to set the same in 6.4.1? On 10-06-17 05:45 AM, Raj Vardhan wrote: > There is no light at any of the ends. but there is no problem with cabling because the old code in QNX 6.3.2 is working fine. Thu, 17 Jun 2010 18:30:52 GMT http://community.qnx.com/sf/go/post57104 Patrik Lahti 2010-06-17T18:30:52Z post57052: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post57052 There is no light at any of the ends. but there is no problem with cabling because the old code in QNX 6.3.2 is working fine. Thu, 17 Jun 2010 09:45:54 GMT http://community.qnx.com/sf/go/post57052 Raj Vardhan 2010-06-17T09:45:54Z post57051: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post57051 Im connected to a hub. Thu, 17 Jun 2010 09:44:52 GMT http://community.qnx.com/sf/go/post57051 Raj Vardhan 2010-06-17T09:44:52Z post56958: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post56958 What are you connected to? A hub? A switch? A router? Another PC? Do you see the lights go on on both ends? On 10-06-16 05:31 AM, Raj Vardhan wrote: > Ya i have checked the cabling and all. Everything of fine. Wed, 16 Jun 2010 13:39:57 GMT http://community.qnx.com/sf/go/post56958 Patrik Lahti 2010-06-16T13:39:57Z post56935: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post56935 Ya i have checked the cabling and all. Everything of fine. My Network card details are: CLASS =Network(Ethernet) Vendor ID = 8086h , Intel Corporation 1209h, 8255xER/82551IT Fast Ethernet Controller PCI index = 0h PCI Mem Address = fcc20000h enabled PCI I0 Address = 1000h enabled PCI Mem Address = fcc 00000h enabled PCI Expansion ROM 0h disaled PCI Int Pin =INT A Interrupt Line =11 CPU Inetrrupt = bh I am using a dvnp-speedo driver? Is it correct or do i have to use devnp-e1000 driver Wed, 16 Jun 2010 09:30:59 GMT http://community.qnx.com/sf/go/post56935 Raj Vardhan 2010-06-16T09:30:59Z post56853: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post56853 So you're having a problem that the interface doesn't come up. Have you checked the cabling? What are you connected to? Are you using a cross-over cable? /P On 10-06-15 10:21 AM, Raj Vardhan wrote: > No.. I am not able to see any traffic using tcpdump. Tue, 15 Jun 2010 14:27:12 GMT http://community.qnx.com/sf/go/post56853 Patrik Lahti 2010-06-15T14:27:12Z post56850: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post56850 No.. I am not able to see any traffic using tcpdump. Tue, 15 Jun 2010 14:21:30 GMT http://community.qnx.com/sf/go/post56850 Raj Vardhan 2010-06-15T14:21:30Z post56839: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post56839 > We are working on the porting of io-net driver. The earlier code used io-net > and but since io-net is not available in QNX 6.4.1 we are using io-pkt. > > To start io-pkt we ran this command: > > io-pkt-v4-hc -d /lib/dll/devnp-speedo.so -p tcpip > > The above command ran without any error. > At This point I Checked the IFCONFIG I got the following result: > > lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 > inet 127.0.0.1 netmask 0xff000000 > fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 > address: 00:11:22:33:aa:bb > media: Ethernet autoselct(none full-duplex) > status:active > > Then I ran the dhcp.client > dhcp.client > > Then I tried checking the IP address of the machine by typing IFCONFIG in the > prompt.The output was: > > lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 > inet 127.0.0.1 netmask 0xff000000 > fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 > address: 00:11:22:33:aa:bb > media: Ethernet none > inet 0.0.0.0 netmask 0xff000000 broadcat 255.255.255.255 > > I then ran q conn in the prompt. > QCONN > > Still I got the same result for IFCONFIG > > lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 > inet 127.0.0.1 netmask 0xff000000 > fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 > address: 00:11:22:33:aa:bb > media: Ethernet none > inet 0.0.0.0 netmask 0xff000000 broadcat 255.255.255.255 > > I even tried setting the IP address by running the command > IFCONFIG FXP0 <ip address> > > An IP address gets assigned but media remains none and I m still not able to > ping any other computer in the network. > Please help fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 address: 00:11:22:33:aa:bb media: Ethernet none inet 0.0.0.0 netmask 0xff000000 broadcat 255.255.255.255 interface is not up even:( Tue, 15 Jun 2010 13:29:30 GMT http://community.qnx.com/sf/go/post56839 Yao Zhao(deleted) 2010-06-15T13:29:30Z post56838: Re: Not Able to Start the Network http://community.qnx.com/sf/go/post56838 Do you see any traffic using tcpdump? /P Tue, 15 Jun 2010 13:25:17 GMT http://community.qnx.com/sf/go/post56838 Patrik Lahti 2010-06-15T13:25:17Z post56824: Not Able to Start the Network http://community.qnx.com/sf/go/post56824 We are working on the porting of io-net driver. The earlier code used io-net and but since io-net is not available in QNX 6.4.1 we are using io-pkt. To start io-pkt we ran this command: io-pkt-v4-hc -d /lib/dll/devnp-speedo.so -p tcpip The above command ran without any error. At This point I Checked the IFCONFIG I got the following result: lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 inet 127.0.0.1 netmask 0xff000000 fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 address: 00:11:22:33:aa:bb media: Ethernet autoselct(none full-duplex) status:active Then I ran the dhcp.client dhcp.client Then I tried checking the IP address of the machine by typing IFCONFIG in the prompt.The output was: lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 inet 127.0.0.1 netmask 0xff000000 fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 address: 00:11:22:33:aa:bb media: Ethernet none inet 0.0.0.0 netmask 0xff000000 broadcat 255.255.255.255 I then ran q conn in the prompt. QCONN Still I got the same result for IFCONFIG lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 inet 127.0.0.1 netmask 0xff000000 fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 address: 00:11:22:33:aa:bb media: Ethernet none inet 0.0.0.0 netmask 0xff000000 broadcat 255.255.255.255 I even tried setting the IP address by running the command IFCONFIG FXP0 <ip address> An IP address gets assigned but media remains none and I m still not able to ping any other computer in the network. Please help Tue, 15 Jun 2010 10:20:59 GMT http://community.qnx.com/sf/go/post56824 Raj Vardhan 2010-06-15T10:20:59Z post52339: Re: problem with asix usb-ethernet http://community.qnx.com/sf/go/post52339 first "usb" should show the asix usb, if no then io-pkt won't drive it. Wed, 21 Apr 2010 22:27:07 GMT http://community.qnx.com/sf/go/post52339 Yao Zhao(deleted) 2010-04-21T22:27:07Z post52316: Re: problem with asix usb-ethernet http://community.qnx.com/sf/go/post52316 Try looking at 'sloginfo' for more clues. And 'pidin mem' will tell you if the driver is succesfully loaded in io-pkt or not. /P Wed, 21 Apr 2010 19:53:40 GMT http://community.qnx.com/sf/go/post52316 Patrik Lahti 2010-04-21T19:53:40Z post52304: problem with asix usb-ethernet http://community.qnx.com/sf/go/post52304 Hi I have installed QNX in a Beagle board. I have a usb-ethernet dongle (Linksys ASIX AX88772 USB2.0 to Fast Ethernet Adapter). However, I could not make it work. When I run io-pkt-v4 -dasix, I see it's running via pidin. 69646 1 roc/boot/io-pkt-v4 21r SIGWAITINFO 69646 2 roc/boot/io-pkt-v4 21r RECEIVE 1 69646 3 roc/boot/io-pkt-v4 21r REPLY 12295 when I run usb, it does not show asix: # usb USB 0 (EHCI) v1.10, v1.01 DDK, v1.01 HCD USB 1 (MENTOR) v1.10, v1.01 DDK, v1.01 HCD ifconfig gives me: lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 inet 127.0.0.1 netmask 0xff000000 When I tried to add an ip address to en0, i get # ifconfig en0 192.168.1.130 ifconfig: SIOCGIFFLAGS en0: No such device or address Can someone help me out? Thanks --Ahsan Wed, 21 Apr 2010 19:19:44 GMT http://community.qnx.com/sf/go/post52304 Ahsan Habib 2010-04-21T19:19:44Z post49400: RE: Converting io-net filter to pfil hook http://community.qnx.com/sf/go/post49400 The pci manager only allows a device to be attached to once. If the first stack has a driver handling a particular nic the second instance of the driver in the second stack will fail. Regards, -seanb -----Original Message----- From: Mark Dowdy [mailto:community-noreply@qnx.com] Sent: Fri 3/12/2010 7:06 PM To: ionetmig-networking Subject: Re: Converting io-net filter to pfil hook Thanks for the LD_LIBRARY_PATH key. That was the missing piece. If we slay io-pkt and restart it after we've included the path to our binaries in LD_LIBRARY_PATH, we are able to mount our hook. We'll likely head down that path instead of wrestling with the second instance of io-pkt. FWIW, here's what we see when we try to start the second instance of io-pkt. # io-pkt-v4 -i1 -ptcpip prefix=/alt # SOCK=/alt ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 inet 127.0.0.1 netmask 0xff000000 # mount -Tio-pkt1 /lib/dll/devnp-e1000.so mount: Can't mount / (type io-pkt1) mount: Possible reason: No such device When we run sloginfo, we see an entry that contains 'Unable to init /lib/dll/devnp-e1000.so : No such device _______________________________________________ io-net migration http://community.qnx.com/sf/go/post49399 Sat, 13 Mar 2010 00:42:16 GMT http://community.qnx.com/sf/go/post49400 Sean Boudreau(deleted) 2010-03-13T00:42:16Z post49399: Re: Converting io-net filter to pfil hook http://community.qnx.com/sf/go/post49399 Thanks for the LD_LIBRARY_PATH key. That was the missing piece. If we slay io-pkt and restart it after we've included the path to our binaries in LD_LIBRARY_PATH, we are able to mount our hook. We'll likely head down that path instead of wrestling with the second instance of io-pkt. FWIW, here's what we see when we try to start the second instance of io-pkt. # io-pkt-v4 -i1 -ptcpip prefix=/alt # SOCK=/alt ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 inet 127.0.0.1 netmask 0xff000000 # mount -Tio-pkt1 /lib/dll/devnp-e1000.so mount: Can't mount / (type io-pkt1) mount: Possible reason: No such device When we run sloginfo, we see an entry that contains 'Unable to init /lib/dll/devnp-e1000.so : No such device Sat, 13 Mar 2010 00:06:00 GMT http://community.qnx.com/sf/go/post49399 Mark Dowdy(deleted) 2010-03-13T00:06:00Z post49388: Re: Converting io-net filter to pfil hook http://community.qnx.com/sf/go/post49388 On Fri, Mar 12, 2010 at 03:31:08PM -0500, Mark Dowdy wrote: > We are attempting to migrate an io-net filter to an io-pkt pfil hook. > Thus far, we've only had limited success. When we try to mount our hook, > we end up with quite a few undefined symbols. These symbols are defined > in shared libraries that we build from our sources and then link into > the hook. The LD_LIBRARY_PATH variable is set to the location of the > required shared object files. Unfortunately, mount can't seem to find > them. Is there some other way to specify where mount should look for > shared libraries or is shared library use by LSM's just not supported? You need to set LD_LIBRARY path on io-pkt, not mount. > > > > The answer to the question above seems be "LSM's can load shared > modules" because when we tried starting a second instance of io-pkt we > were able to mount our pfil hook. Unfortunately, the second instance of > io-pkt didn't have any interfaces. Additionally, starting the second > instance of io-pkt seems to kill the existing, working interfaces (i.e. > we can no longer telnet into the box, ifconfig only lists lo0). So, > mounting our hook onto a second io-pkt instance doesn't do us much good > because there are no interfaces for data. When we try to mount a driver > onto the second io-pkt instance, the mount fails (Can't mount / (type > io-pkt2)). We tried creating the second instance of io-pkt because we > were using a second instance of io-net for our filter. Having two > instances of the stack probably doesn't make much sense because we want > to attach our hook to one interface on an Intel 82563 dual interface > NIC. Check out the io-pkt docs for the options that control targeting multiple stacks. In particular # io-pkt -i1 -ptcpip prefix=/alt ... # mount -T io-pkt1 ... # SOCK=/alt ifconfig Regards, -seanb Fri, 12 Mar 2010 20:37:51 GMT http://community.qnx.com/sf/go/post49388 Sean Boudreau(deleted) 2010-03-12T20:37:51Z post49387: Converting io-net filter to pfil hook http://community.qnx.com/sf/go/post49387 We are attempting to migrate an io-net filter to an io-pkt pfil hook. Thus far, we've only had limited success. When we try to mount our hook, we end up with quite a few undefined symbols. These symbols are defined in shared libraries that we build from our sources and then link into the hook. The LD_LIBRARY_PATH variable is set to the location of the required shared object files. Unfortunately, mount can't seem to find them. Is there some other way to specify where mount should look for shared libraries or is shared library use by LSM's just not supported? The answer to the question above seems be "LSM's can load shared modules" because when we tried starting a second instance of io-pkt we were able to mount our pfil hook. Unfortunately, the second instance of io-pkt didn't have any interfaces. Additionally, starting the second instance of io-pkt seems to kill the existing, working interfaces (i.e. we can no longer telnet into the box, ifconfig only lists lo0). So, mounting our hook onto a second io-pkt instance doesn't do us much good because there are no interfaces for data. When we try to mount a driver onto the second io-pkt instance, the mount fails (Can't mount / (type io-pkt2)). We tried creating the second instance of io-pkt because we were using a second instance of io-net for our filter. Having two instances of the stack probably doesn't make much sense because we want to attach our hook to one interface on an Intel 82563 dual interface NIC. Any ideas on what we're missing would be appreciated? Mark Fri, 12 Mar 2010 20:31:07 GMT http://community.qnx.com/sf/go/post49387 Mark Dowdy(deleted) 2010-03-12T20:31:07Z post45694: PFIL_IN & PFIL_OUT http://community.qnx.com/sf/go/post45694 Hi Forum, One more question regarding the PFIL_IN and PFIL_OUT usage. As I mentioned in other questions. I have the below described problem to which I am writing the solution using pfil hook in io-pkt Machine X and Machine Y are on the private network. Machine X is master and Machine Y is slave. All the startup code to detect master and slave is in place and this code is proven. Now the question is slave sends some data packets to master. And master reads those data packets and master in turn will send other data and slave will read it. Its a full duplex communication on different ports of the machines. Master and slave have more than 2 ports. My design idea using PFIL Machine X will create an input hook to the stack using PFIL_IN so that it can read all the stack data. After the data read on the stack from Machine Y, the Machine X will send some data to Machine Y using mbuf and "if_output()" call which is on ifnet struct. Machine Y will also create an input hook to the stack using PFIL_IN. It will also read the stack to read the data from Machine X. Machine Y will also use mbuf and "if_output()" call on ifnet struct to send data to Machine X. In this 2 way communication while creating the hook I want to use struct pfil_head *pfh_inet; pfh_inet = pfil_head_get(FIL_TYPE_AF, AF_INET) pfil_add_hook(My_hook, NULL, PFIL_IN|PFIL_WAITOK, pfh_inet); Will this work for my problem described above or do I have to use the below one. struct pfil_head *pfh_inet; pfh_inet = pfil_head_get(FIL_TYPE_IFNET, 0) pfil_add_hook(My_hook, NULL, PFIL_IFNET, pfh_inet); Thanks Vinod Thu, 21 Jan 2010 18:46:39 GMT http://community.qnx.com/sf/go/post45694 Vinod Kolapuram 2010-01-21T18:46:39Z post45686: nw_pthread_create() & iov_t doubts. http://community.qnx.com/sf/go/post45686 Hi Forum, I am new to QNX and basically porting from io-net to io-pkt. I will be using nw_pthread_create() , I was looking at some implementations as suggested by the website for porting and I see that there is a init function as 6th argument, where wtp is intialized and on it "wtp->quiesce_callout" is called for a user specific function which basically will call "MsgSendPulse()". Is it a must to have a init_function. What if I put all NULLs to the extra last 3 arugments in nw_pthread_create()? Will it work? And I have a question regarding the iov_t. The existing implementation for io-net was done using iov now I am trying to port to io-pkt. Do I need to use iov or just copy the address of my data location to mbuf to send it across to other machine using "if_output()" funtion available on ifnet struct. I am thinking if_output() function will take care of sending it in its own format and on the other end when mbuf is received I will have a "PFIL_IN" hook which gets the mbuf content. The below is the structs of iov on io-net.h file typedef struct _net_iovec net_iov_t; struct _net_iovec { void *iov_base; paddr_t iov_phys; size_t iov_len; }; typedef struct _net_buf net_buf_t; struct _net_buf { TAILQ_ENTRY(_net_buf) ptrs; int niov; net_iov_t *net_iov; }; I also see that in io-net implementation at some point we need to insert net_buf in "_npkt" struct as described below. I have just copied some code line below from my io-net implementation. /* Insert net_buf in npkt */ TAILQ_INSERT_HEAD(&npkt->buffers, nb, ptrs); /* Setup iov, it lives right after the net_buf */ iov = (net_iov_t *)(nb + 1); nb->niov = 1; nb->net_iov = iov; iov->iov_base = (char *)ptr; /* Iov points to data buffer */ /* Align it */ if (((int) iov->iov_base) % 4) { (char *)iov->iov_base += 3; iov->iov_base = (char *)((int)iov->iov_base & ~3); } iov->iov_len = HM_TOTAL_PACKET_SZ; iov->iov_phys = (paddr_t)(pfilter_ctrl->npi->mphys(iov->iov_base)); npkt->org_data = ptr; npkt->next = NULL; npkt->tot_iov = 1; return npkt; For "io-pkt" implementation I have the iov_t on the nw_stk_ctl struct in nw_datastruct.h . Is it a must to use iov to send and receive data. Thanks Vinod Thu, 21 Jan 2010 18:03:16 GMT http://community.qnx.com/sf/go/post45686 Vinod Kolapuram 2010-01-21T18:03:16Z post45604: Re: allocating memory for mbuf http://community.qnx.com/sf/go/post45604 Hi Sean, I will be using nw_pthread_create() , I was looking at some implementations as suggested by the website for porting and I see that there is a init function as 6th argument, where wtp is intialized and on it "wtp->quiesce_callout" is called for a user specific function which basically will call "MsgSendPulse(). Is it a must to have a init function. What if I put all NULLs to the extra last 3 arugments in nw_pthread_create()? And I have a question regarding the iov_t. The existing implementation for io-net was done using iov now I am trying to port to io-pkt. Do I need to use iov or just copy the address of my data to mbuf to send it across to other machine using "if_output()" funtion available on ifnet struct. I am thinking mbuf will take care of sending it in its own format and on the other end when mbuf is received I will have a "PFIL_IN" hook which gets the mbuf content. The below is the structs of iov on io-net.h file typedef struct _net_iovec net_iov_t; struct _net_iovec { void *iov_base; paddr_t iov_phys; size_t iov_len; }; typedef struct _net_buf net_buf_t; struct _net_buf { TAILQ_ENTRY(_net_buf) ptrs; int niov; net_iov_t *net_iov; }; For "io-pkt" implementation I have the iov_t on the nw_stk_ctl struct in nw_datastruct.h . I am new to QNX, is it a must to use iov to send and receive data. Thanks Vinod Thu, 21 Jan 2010 00:39:03 GMT http://community.qnx.com/sf/go/post45604 Vinod Kolapuram 2010-01-21T00:39:03Z post45522: Re: allocating memory for mbuf http://community.qnx.com/sf/go/post45522 On Tue, Jan 19, 2010 at 08:28:16PM -0500, Vinod Kolapuram wrote: > Hi , > 1. Do we neet to just use malloc to allocate memory for mbuf? In io-net there are inbuilt functions on io-net structure for allocation and free. No, malloc doesn't provide memory that is safe for packet buffers, use m_get(), m_gethdr() or m_getcl(). For 512 bytes you'll probably need a cluster. > > 2. Since io-net is not available now for 6.4.0 and above, we don't have to use iov which was part of io-net for porting to io-pkt right? This is vague. There's various iovs in both io-net and io-pkt. > > 3. At the porting point where I am right now makes me feel, that the _iopkt_self structure usage in io-pkt is very minimal compared to _io_net_self usage in io-net. Even though we are using_iopkt_self struct in the entry function, looks like most of the functionality is for the thread handling. > > 4. I have around 512 bytes of data to read from stack and do my modification and then put back on stack to send it to other machine. From high level its very simple, but when I looking at the structure usage, its getting more entangled in other complex manipulations. Can any suggest simple steps to achive this using the io-pkt features and functionality. There's various ways to do this. The most portable would be with userland sockets. Regards, -seanb Wed, 20 Jan 2010 03:15:11 GMT http://community.qnx.com/sf/go/post45522 Sean Boudreau(deleted) 2010-01-20T03:15:11Z post45518: allocating memory for mbuf http://community.qnx.com/sf/go/post45518 Hi , 1. Do we neet to just use malloc to allocate memory for mbuf? In io-net there are inbuilt functions on io-net structure for allocation and free. 2. Since io-net is not available now for 6.4.0 and above, we don't have to use iov which was part of io-net for porting to io-pkt right? 3. At the porting point where I am right now makes me feel, that the _iopkt_self structure usage in io-pkt is very minimal compared to _io_net_self usage in io-net. Even though we are using_iopkt_self struct in the entry function, looks like most of the functionality is for the thread handling. 4. I have around 512 bytes of data to read from stack and do my modification and then put back on stack to send it to other machine. From high level its very simple, but when I looking at the structure usage, its getting more entangled in other complex manipulations. Can any suggest simple steps to achive this using the io-pkt features and functionality. Thanks Vinod Wed, 20 Jan 2010 01:28:15 GMT http://community.qnx.com/sf/go/post45518 Vinod Kolapuram 2010-01-20T01:28:15Z post45352: Re: Why doesn't the pfil filter module attach to the active ethernet driver? http://community.qnx.com/sf/go/post45352 On 14/01/10 03:30 PM, Vinod Kolapuram wrote: > Hi, > Isn't the ethernet driver mounted first than the pfil filter module. If that is the case then why doesn't the pfil filter module attach to the active ethernet driver by itself when mounted. > I think I wrote it elsewhere too just a few minutes ago, so sorry for the repetition. Your filter module registers with the stack, not with a driver directly. > How can I explicitily attach a pfil filter module to already mounted ethernet driver? If I do it, I get an error saying the resource is busy. And that is what even I was expecting. The ethernet driver is already mounted after startup. > I'm not sure what you mean when you say you try explicitly attach a pfil filter module to an ethernet driver, what commands did you do? > Is it not true that pfil filter module has to be mounted only after the ethernet driver is loaded. Only then it makes sense for data extraction on the stack. > It's not true. The network drivers can be mounted at any time before or after the packet filter module. Yes, the filter will only get some data packets once there's at least one network driver mounted so that there is at least one network interface to get packets from the network. > Please correct me if I am wrong. > > All I want to do is attach my pfil filter module to my devn-i82544.so driver module which is already mounted. > This request doesn't make sense, please see above and previous posts. I'm must assume you want to get packets from network interfaces that this particular driver is creating? The example filter module on the wiki (http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Filtering_wiki_page) will get the input/output_hook() functions invoked with packets sent/received by the stack. The arguments to this function can be used to determine where the packets are going to/from etc. If you're interested in digging deeper into this topic, try printing some of the contents of the arguments of the hooks and look at other code that's using the pf API (e.g. nraw and autoip: http://community.qnx.com/integration/viewvc/viewvc.cgi/trunk/lib/io-pkt/sys/lsm/?root=core_networking&system=exsy1001) Hope this helps! /P Fri, 15 Jan 2010 22:27:45 GMT http://community.qnx.com/sf/go/post45352 Patrik Lahti 2010-01-15T22:27:45Z post45350: Re: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45350 On 14/01/10 03:53 PM, Vinod Kolapuram wrote: > Hi Patrik, > I have added some log messages on each function of the sample pfil filter code which you are reffering to. I even have one message when the interface is attached or detached. > My question is, in my case when the pfil filter module is mounted manually with mount command from the shell, by then already the ethernet driver is loaded and available. > Yes, the ethernet driver is already loaded an the network interfaces it creates are already created. Hence when you load the example filter the stack won't call any PFIL_IFNET hooks for creation of interface since the interface already exists. > Do you mean to say the pfil hook interface is attached to the ethernet driver when I mount the pfil filter module > > Or > > the pfil hook interface is yet to be attached to the driver. If it is yet to be attached, then how do I attach my pfil filter module to the ethernet driver. Only then it makes sense to extract the stack data. > The pfil hook interface is to the stack, not the driver. Your example pfil code is registering hooks with the stack not the driver. > I just posted one more question please respond to that. > Sure, I'll try my best :-) PS. If you need prompt support then please go through the appropriate QNX support channels. We're a community here and everyone here makes every attempt to help on their own time but sometimes there's a lot to do... :-) Hope we'll get this cleared out, have a good weekend! /P Fri, 15 Jan 2010 22:14:18 GMT http://community.qnx.com/sf/go/post45350 Patrik Lahti 2010-01-15T22:14:18Z post45348: Re: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45348 On 14/01/10 05:25 PM, Robert craig wrote: > Hi Vinod: > > I think that the confusion is coming from the fact that the pfil hook attaches itself to the stack (above the driver interface), and not into a driver . > Yes, thanks Robert, I see that it makes sense that this was where the confusion was coming from... /P Fri, 15 Jan 2010 22:03:36 GMT http://community.qnx.com/sf/go/post45348 Patrik Lahti 2010-01-15T22:03:36Z post45347: Re: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45347 On 14/01/10 07:26 PM, Vinod Kolapuram wrote: >> Hi Vinod: >> >> I think that the confusion is coming from the fact that the pfil hook attaches >> itself to the stack (above the driver interface), and not into a driver . >> >> The iface hook will get invoked when an ethernet interface is either added >> into the stack (mounted) or removed from the stack (destroyed). There >> doesn't have to be any driver interface present when you load in the pfil hook >> . >> > Robert Can you please help me find in QXN boot up sequence as I want to mount my pfil filter module before the ethernet driver is loaded. I think its in some rc files. Please let me know where to change the sequence > You're in control of this (at least the parts that are discussed in this context). You can create your own script inside an image. But I'm assuming from your earlier questions that you are using a standard PC install, in which case you have several options, e.g. can change the enum scripts or slay the stack in rc.local and restart it with the drivers and lsms in the order you want... The latter is probably easiest. >> The sample code does something a bit peculiar in that it detaches itself as >> soon as any interface is destroyed. This was just a convenient mechanism for >> showing how to remove the pfil hook and not representative of any standard way >> of operating. >> >> The ifacecfg hook will get called if you re-configure any interface (e.g. by >> bringing any interface up or down). >> > Can I reconfigure the ethernet driver devn-i82544.so. I mean its running under io-pkt and I think the driver cannot me unmounted in io-pkt. > I don't understand what you're asking, it doesn't make sense. Reconfigure and unmount are two different things. /P Fri, 15 Jan 2010 22:00:55 GMT http://community.qnx.com/sf/go/post45347 Patrik Lahti 2010-01-15T22:00:55Z post45268: Re: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45268 > Hi Vinod: > > I think that the confusion is coming from the fact that the pfil hook attaches > itself to the stack (above the driver interface), and not into a driver . > > The iface hook will get invoked when an ethernet interface is either added > into the stack (mounted) or removed from the stack (destroyed). There > doesn't have to be any driver interface present when you load in the pfil hook > . Robert Can you please help me find in QXN boot up sequence as I want to mount my pfil filter module before the ethernet driver is loaded. I think its in some rc files. Please let me know where to change the sequence > > The sample code does something a bit peculiar in that it detaches itself as > soon as any interface is destroyed. This was just a convenient mechanism for > showing how to remove the pfil hook and not representative of any standard way > of operating. > > The ifacecfg hook will get called if you re-configure any interface (e.g. by > bringing any interface up or down). Can I reconfigure the ethernet driver devn-i82544.so. I mean its running under io-pkt and I think the driver cannot me unmounted in io-pkt. > > Robert. Thanks Vinod Fri, 15 Jan 2010 00:26:22 GMT http://community.qnx.com/sf/go/post45268 Vinod Kolapuram 2010-01-15T00:26:22Z post45266: Re: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45266 Hi Vinod: I think that the confusion is coming from the fact that the pfil hook attaches itself to the stack (above the driver interface), and not into a driver . The iface hook will get invoked when an ethernet interface is either added into the stack (mounted) or removed from the stack (destroyed). There doesn't have to be any driver interface present when you load in the pfil hook. The sample code does something a bit peculiar in that it detaches itself as soon as any interface is destroyed. This was just a convenient mechanism for showing how to remove the pfil hook and not representative of any standard way of operating. The ifacecfg hook will get called if you re-configure any interface (e.g. by bringing any interface up or down). Robert. Thu, 14 Jan 2010 22:25:05 GMT http://community.qnx.com/sf/go/post45266 Robert craig 2010-01-14T22:25:05Z post45258: Re: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45258 Hi Patrik, I have added some log messages on each function of the sample pfil filter code which you are reffering to. I even have one message when the interface is attached or detached. My question is, in my case when the pfil filter module is mounted manually with mount command from the shell, by then already the ethernet driver is loaded and available. Do you mean to say the pfil hook interface is attached to the ethernet driver when I mount the pfil filter module Or the pfil hook interface is yet to be attached to the driver. If it is yet to be attached, then how do I attach my pfil filter module to the ethernet driver. Only then it makes sense to extract the stack data. I just posted one more question please respond to that. Thanks Vinod Thu, 14 Jan 2010 20:53:38 GMT http://community.qnx.com/sf/go/post45258 Vinod Kolapuram 2010-01-14T20:53:38Z post45256: Why doesn't the pfil filter module attach to the active ethernet driver? http://community.qnx.com/sf/go/post45256 Hi, Isn't the ethernet driver mounted first than the pfil filter module. If that is the case then why doesn't the pfil filter module attach to the active ethernet driver by itself when mounted. How can I explicitily attach a pfil filter module to already mounted ethernet driver? If I do it, I get an error saying the resource is busy. And that is what even I was expecting. The ethernet driver is already mounted after startup. Is it not true that pfil filter module has to be mounted only after the ethernet driver is loaded. Only then it makes sense for data extraction on the stack. Please correct me if I am wrong. All I want to do is attach my pfil filter module to my devn-i82544.so driver module which is already mounted. Thanks Vinod Thu, 14 Jan 2010 20:30:33 GMT http://community.qnx.com/sf/go/post45256 Vinod Kolapuram 2010-01-14T20:30:33Z post45255: Re: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45255 I'm sorry, I don't really understand where the misunderstanding is. If anybody else knows, please jump in! Please see below... > When you say the interface is attached to which interface are you referring. The network interface, e.g. en0 or wm0. What you create by loading a devn-/devnp- network driver with correct parameters and which you remove by calling ifconfig <ifname> destroy. In stack terminology this leads to "attaching" and "detaching" the interface respectively. Maybe the confusion is with these terms vs. the pf API which uses terms "attach" and "detach" interface hooks? It's because they too refer to the same event happening in the stack when they're called. > My ethernet driver has to be mounted even before my filter gets mounted right? > I don't think there's a requirement that one loads before the other. > My question is how to exercise my attach functionality and why doesn't the pfil filter module get attached to the active ethernet driver. > I'm afraid I don't understand what you mean here. As I wrote before, "The PFIL_IFNET hook is invoked when the [network] interface is attached (created) or detached (destroyed)." I.e. if you've already loaded the network driver, then the network interface has likely already been created and the PFIL_IFNET hook will be called for it until the it is destroyed. I'm hoping the above will help, if not then here's a good wiki page on the topic: http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Filtering_wiki_page /P Thu, 14 Jan 2010 20:25:22 GMT http://community.qnx.com/sf/go/post45255 Patrik Lahti 2010-01-14T20:25:22Z post45254: Re: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45254 Hi Patrik, Well that is my question. When you say the interface is attached to which interface are you referring. My ethernet driver has to be mounted even before my filter gets mounted right? My question is how to exercise my attach functionality and why doesn't the pfil filter module get attached to the active ethernet driver. Regards Vinod Thu, 14 Jan 2010 19:45:11 GMT http://community.qnx.com/sf/go/post45254 Vinod Kolapuram 2010-01-14T19:45:11Z post45246: Re: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45246 On 13/01/10 08:20 PM, Vinod Kolapuram wrote: > Hi, > In io-pkt implementation , when does the iface_hook gets invoked. The PFIL_IFNET hook is invoked when the interface is attached (created) or detached (destroyed). > I mount the filter and I see the input hook and output hook get invoked as a when packets come in and go out of stack. But I am unable to see the message I have put in when the iface_hook is added. > You probably loaded the filter after the interface was created. Hope this helps! /P Thu, 14 Jan 2010 15:56:34 GMT http://community.qnx.com/sf/go/post45246 Patrik Lahti 2010-01-14T15:56:34Z post45214: when does the iface_hook() gets invoked http://community.qnx.com/sf/go/post45214 Hi, In io-pkt implementation , when does the iface_hook gets invoked. I mount the filter and I see the input hook and output hook get invoked as a when packets come in and go out of stack. But I am unable to see the message I have put in when the iface_hook is added. If I am not wrong this gets invoked when the filter module attaches to the driver ethernet driver module. I do not see this happening. I am just executing the sample code. Can anyone please put in the right direction? Regards Vinod Thu, 14 Jan 2010 01:20:15 GMT http://community.qnx.com/sf/go/post45214 Vinod Kolapuram 2010-01-14T01:20:15Z post44676: Re: io-pkt mount problem http://community.qnx.com/sf/go/post44676 On 05/01/10 08:12 PM, Vinod Kolapuram wrote: > Hi, > I am trying to mount a .so module for pfil implementation on QNX 6.4.0 > > When I use "mount -Tio-pkt -o /root/install/myfilter.so" > I get no file system table enry error as "No fstab entries found for type io-pkt" > -o is used for passing options to the .so you're trying to mount. But you're passing no arguments after the -o. Please see the documentation for mount, e.g. 'use mount' or http://www.qnx.com/developers/docs/6.4.1/neutrino/utilities/m/mount.html > Then I tried without the -o option "mount -Tio-pkt /root/install/myfilter.so" > I get "Can't mount / (type io-pkt)" > "possible reason: No such device or address" > I believe that can happen when there is unresolved symbols while loading your .so. Such as when attempting to load a module which requires IPv6 parts of the stack into a stack that's io-pkt-v4*. Perhaps using the -v option will tell you what's going on. /P Wed, 06 Jan 2010 16:42:15 GMT http://community.qnx.com/sf/go/post44676 Patrik Lahti 2010-01-06T16:42:15Z post44638: io-pkt mount problem http://community.qnx.com/sf/go/post44638 Hi, I am trying to mount a .so module for pfil implementation on QNX 6.4.0 When I use "mount -Tio-pkt -o /root/install/myfilter.so" I get no file system table enry error as "No fstab entries found for type io-pkt" Then I tried without the -o option "mount -Tio-pkt /root/install/myfilter.so" I get "Can't mount / (type io-pkt)" "possible reason: No such device or address" Can anyone help me? Thanks Vinod Wed, 06 Jan 2010 01:12:51 GMT http://community.qnx.com/sf/go/post44638 Vinod Kolapuram 2010-01-06T01:12:51Z post44634: Re: RE: ethernet driver for intel device ID: 10c9h http://community.qnx.com/sf/go/post44634 Thanks Andrew. Wed, 06 Jan 2010 00:21:37 GMT http://community.qnx.com/sf/go/post44634 Vinod Kolapuram 2010-01-06T00:21:37Z post44631: RE: ethernet driver for intel device ID: 10c9h http://community.qnx.com/sf/go/post44631 > device ID: "10c9h" That's an intel 82576 which is supported by devnp-e1000.so -- aboyd Tue, 05 Jan 2010 23:47:04 GMT http://community.qnx.com/sf/go/post44631 Andrew Boyd(deleted) 2010-01-05T23:47:04Z post44604: ethernet driver for intel device ID: 10c9h http://community.qnx.com/sf/go/post44604 Hi, In the process of porting to io-pkt from io-net, now I face a problem with ethernet driver. I have a supermicro system with 5 ethernet ports, the make is Intel. I need the driver for Intel (R) PRO/100/1000. I looked at the device ID and its "10c9h". But the avaialble driver list with QNX 6.4.0 ends at "10b9h" which has a part number as "-82572EI". Can anyone help me find the driver for device ID: "10c9h"? Thanks Vinod Tue, 05 Jan 2010 20:03:02 GMT http://community.qnx.com/sf/go/post44604 Vinod Kolapuram 2010-01-05T20:03:02Z post44458: Re: qconn doesnt work after migration http://community.qnx.com/sf/go/post44458 > Multicast Packets Received OK .............. 318 > I see Andrew already spotted the problem for you, but for anybody listening, here you see that all the packets you received were treated as multicasts (because of that MAC address). /P Wed, 30 Dec 2009 14:18:39 GMT http://community.qnx.com/sf/go/post44458 Patrik Lahti 2009-12-30T14:18:39Z post44456: Re: RE: qconn doesnt work after migration http://community.qnx.com/sf/go/post44456 > > ># nicinfo > > Current Physical Node ID ................... 111213 141516 > > Please set the first byte of your mac address to be zero instead > of 0x11, because you have accidentally set the multicast bit > in a unicast address. > > There's a better way to generate a mac address, if you're > going to use this on a larger network. > > -- > aboyd > > Thank a lot and a lot , Andrew. It works! I didnt know that mac address has such a rule.... Wed, 30 Dec 2009 12:04:10 GMT http://community.qnx.com/sf/go/post44456 Jesse Shao 2009-12-30T12:04:10Z post44455: RE: qconn doesnt work after migration http://community.qnx.com/sf/go/post44455 ># nicinfo > Current Physical Node ID ................... 111213 141516 Please set the first byte of your mac address to be zero instead of 0x11, because you have accidentally set the multicast bit in a unicast address. There's a better way to generate a mac address, if you're going to use this on a larger network. -- aboyd Wed, 30 Dec 2009 11:30:42 GMT http://community.qnx.com/sf/go/post44455 Andrew Boyd(deleted) 2009-12-30T11:30:42Z post44449: Re: qconn doesnt work after migration http://community.qnx.com/sf/go/post44449 it seems tcp received the request. why doesnt the qconn socket accept the request? It's just listening peacefully,but does nothing... Wed, 30 Dec 2009 01:56:05 GMT http://community.qnx.com/sf/go/post44449 Jesse Shao 2009-12-30T01:56:05Z post44448: Re: qconn doesnt work after migration http://community.qnx.com/sf/go/post44448 sorry, i typed a bad command just now... now here's what i got: ------------------------------------------------ # netstat -p ip ip: 38 total packets received 0 bad header checksums 0 with size smaller than minimum 0 with data size < data length 0 with length > max ip packet size 0 with header length < data size 0 with data length < header length 0 with bad options 0 with incorrect version number 0 fragments received 0 fragments dropped (dup or out of space) 0 fragments dropped (out of ipqent) 0 malformed fragments dropped 0 fragments dropped after timeout 0 packets reassembled ok 38 packets for this host 0 packets for unknown/unsupported protocol 0 packets forwarded (0 packets fast forwarded) 0 packets not forwardable 0 redirects sent 0 packets no matching gif found 0 packets sent from this host 0 packets sent with fabricated ip header 0 output packets dropped due to no bufs, etc. 0 output packets discarded due to no route 0 output datagrams fragmented 0 fragments created 0 datagrams that can't be fragmented 0 datagrams with bad address in header # netstat -p tcp tcp: 0 packets sent 0 data packets (0 bytes) 0 data packets (0 bytes) retransmitted 0 ack-only packets (0 delayed) 0 URG only packets 0 window probe packets 0 window update packets 0 control packets 0 send attempts resulted in self-quench 18 packets received 0 acks (for 0 bytes) 0 duplicate acks 0 acks for unsent data 0 packets (0 bytes) received in-sequence 0 completely duplicate packets (0 bytes) 0 old duplicate packets 0 packets with some dup. data (0 bytes duped) 0 out-of-order packets (0 bytes) 0 packets (0 bytes) of data after window 0 window probes 0 window update packets 0 packets received after close 0 discarded for bad checksums 0 discarded for bad header offset fields 0 discarded because packet too short 0 connection requests 0 connection accepts 0 connections established (including accepts) 0 connections closed (including 0 drops) 0 embryonic connections dropped 0 delayed frees of tcpcb 0 segments updated rtt (of 0 attempts) 0 retransmit timeouts 0 connections dropped by rexmit timeout 0 persist timeouts (resulting in 0 dropped connections) 0 keepalive timeouts 0 keepalive probes sent 0 connections dropped by keepalive 0 correct ACK header predictions 0 correct data packet header predictions 0 PCB hash misses 0 dropped due to no socket 0 connections drained due to memory shortage 0 PMTUD blackholes detected 0 bad connection attempts 0 SYN cache entries added 0 hash collisions 0 completed 0 aborted (no space to build PCB) 0 timed out 0 dropped due to overflow 0 dropped due to bucket overflow 0 dropped due to RST 0 dropped due to ICMP unreachable 0 delayed free of SYN cache entries 0 SYN,ACKs retransmitted 0 duplicate SYNs received for entries already in the cache 0 SYNs dropped (no route or no space) 0 packets with bad signature 0 packets with good signature 0 sucessful ECN handshakes 0 packets with ECN CE bit 0 packets ECN ECT(0) bit # --------------------------------------------------------- Wed, 30 Dec 2009 01:38:25 GMT http://community.qnx.com/sf/go/post44448 Jesse Shao 2009-12-30T01:38:25Z post44447: Re: qconn doesnt work after migration http://community.qnx.com/sf/go/post44447 thanks a lot for early reply, Patrik With your help,I found something wrong... >What do the driver stats and the stack stats say? (nicinfo and netstat >-p ip/tcp) --------------------------------------------------------------------- # nicinfo dm0: DM9000 Ethernet Controller Physical Node ID ........................... 000000 000000 Current Physical Node ID ................... 111213 141516 Current Operation Rate ..................... 100.00 Mb/s full-duplex Active Interface Type ...................... MII Active PHY address ....................... 0 Maximum Transmittable data Unit ............ 1500 Maximum Receivable data Unit ............... 1500 Hardware Interrupt ......................... 0x6b Memory Aperture ............................ 0x1800300 - 0x18003ff Promiscuous Mode ........................... Off Multicast Support .......................... Enabled Packets Transmitted OK ..................... 3 Bytes Transmitted OK ....................... 126 Broadcast Packets Transmitted OK ........... 0 Multicast Packets Transmitted OK ........... 0 Memory Allocation Failures on Transmit ..... 0 Packets Received OK ........................ 318 Bytes Received OK .......................... 24468 Broadcast Packets Received OK .............. 0 Multicast Packets Received OK .............. 318 Memory Allocation Failures on Receive ...... 0 Single Collisions on Transmit .............. 0 Multiple Collisions on Transmit ............ 0 Late Collision on Transmit errors .......... 0 Transmits aborted (excessive collisions) ... 0 Transmit Underruns ......................... 0 No Carrier on Transmit ..................... 0 Receive Alignment errors ................... 0 Received packets with CRC errors ........... 0 Packets Dropped on receive ................. 0 Short packets .............................. 0 Total Frames experiencing Collison(s) ...... 0 # netstat -p ip/tcp netstat: ip/tcp: unknown or uninstrumented protocol ----------------------------------------------------------------------- But isnt tcpip the default protocol of io-pkt??? why the protocol isnt up? Wed, 30 Dec 2009 01:21:48 GMT http://community.qnx.com/sf/go/post44447 Jesse Shao 2009-12-30T01:21:48Z post44443: Re: qconn doesnt work after migration http://community.qnx.com/sf/go/post44443 Yes, qconn should work with io-pkt. And AFAIK if qconn starts then all libs it needs must be available. What other programs it might need depends on what you're doing, e.g. I believe pdebug is necessary on the target for debugging with the IDE. Looks like you've got that though. (Just check that it's available in qconn's path?) Can you connect to any other TCP service on the target? E.g. telnetd, sshd? What about UDP or raw IP? Does anything work? What do the driver stats and the stack stats say? (nicinfo and netstat -p ip/tcp) Is there another driver you can try with and see if that works? E.g. your original devn (io-net) driver? Hope this may help! /P Tue, 29 Dec 2009 22:02:20 GMT http://community.qnx.com/sf/go/post44443 Patrik Lahti 2009-12-29T22:02:20Z post44436: qconn doesnt work after migration http://community.qnx.com/sf/go/post44436 Hi, I've just migrated the kernel from 6.3.2 to 6.4.1(QNX momentics ide 4.6.0), and re-coded the network driver which is a native io-pkt driver. Host(windows) and target(arm9) can “ping" each other. But when I want to debug an application via qconn, I found that IDE cant connect to the target. Then I telnet the qconn port (8000) to the target under windows, cant connect too. I made a tcpdump, shows that target gets the "qconn request packet"(used the wireshark to check out what the qconn request packet is like...), but driver doesnt tx any packets, it seems the protocol stack doesnt make any response to that request. Q: Is the qconn shipped with momentics 4.6.0 compatible with the new io-pkt framework? Should I add any other libaries to image besides libsocket? ---------------------------------------- # netstat Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *.8000 *.* LISTEN udp 0 0 *.* *.* # pidin -p qconn pid tid name prio STATE Blocked 4103 1 sbin/qconn 10r SIGWAITINFO 4103 2 sbin/qconn 10r CONDVAR (0x120bc0) 4103 3 sbin/qconn 10r RECEIVE 1 4103 4 sbin/qconn 10r RECEIVE 3 # pidin -p qconn fd pid name 4103 sbin/qconn 0 4 rw 0 /dev/ser1 1 4 rw 0 /dev/ser1 2 4 rw 0 /dev/ser1 3 5 rw 0 I4TCP *.8000 *.* LISTEN 4 4103 0s 1 2s 1 MP 0 /dev/dbgmem 4s 1 MP 0 /dev/profiler # ---------------------------------------- attachment's my build file Tue, 29 Dec 2009 12:06:50 GMT http://community.qnx.com/sf/go/post44436 Jesse Shao 2009-12-29T12:06:50Z post44144: Re: compile errors on 6.4.0 for pfil implementation http://community.qnx.com/sf/go/post44144 Hi Sean, Thanks for letting me know that the io-pkt + drivers + lsm headers haven't been vetted for C++. I compiled the code using C compiler and I am able to build .so now. Regards, VK Fri, 18 Dec 2009 17:43:15 GMT http://community.qnx.com/sf/go/post44144 Vinod Kolapuram 2009-12-18T17:43:15Z post44091: Re: pfil functions error http://community.qnx.com/sf/go/post44091 Vinod Kolapuram wrote: > Hi Patrik, > Thanks for the input. I am not using VMware. Well, it shouldn't take that long to build. Could be because you're using Windows and/or cygwin. My full build took 7 minutes. Now we probably have different hardware, so this is no indication of how long it should take for you, but it shouldn't take a couple of hours. > When I do a hinstall at libstartup folder nothing happens. > Err, I was thinking about a different repository. The file should be installed into stage when you build io-pkt. > I have a question regarding the stage folder. > > Since you siad stage folder should be in parallel to trunk. There's no hard rule. I mentioned it is good practice because then you know which stage is for what code (if you have multiple workspaces at the same time). Make sure you have set the QCONF_OVERRIDE environment variable (note that it is underscore "_" not a dash "-" in the middle) and that it has correct contents. > When I executed the > below commands > > % cd <BUILD_ROOT>/trunk > % make OSLIST=nto hinstall > > which are at step 5 in the "build the OS Source". There was nothing written into stage folder. Don't you think there should be some out put written into this stage folder at this point of time? > Again, since the repository has changed, the wikis aren't totally up to date. You'll need to cd deeper into the trunk before starting your build. First into lib/socket to hinstall its headers, then into lib/io-pkt to build the stack. When you're actually building something you'll see that the stage area builds up with header files and executables and libraries. Also take note of: "Request your patience that you work around the build by adding in a Makefile.dnm to the component that is not building (Makefile.dnm == Makefile Do No Make )" http://community.qnx.com/sf/wiki/do/viewPage/projects.core_os/wiki/BuildTheOSSource > I have other problem with cygwin. As I mentioned earlier there are 4 versions of QNX OS on my machine. 630 632 640 and 641. I have installed cygwin from the net in my "C" folder. When I tried to execute the hinstall command from Libstartup folder, it gives me fatal error "system shared memory version mismatch detected - 0x8A88009C/0x2D1E009C". It clearly says that there might me more than one version of cygwin.dll, try deleting all except the latest version. I don't know if its a good idea now. > Each version of QNX has a cygwin dll in the "bin" folder. > I don't have experience with cygwin. Nor have I used multiple versions of the development tools installed at the same time. Perhaps you could ask at the tools forum: http://community.qnx.com/sf/discussion/do/listTopics/projects.toolchain/discussion.core_development_tools Or one of the core os forums: http://community.qnx.com/sf/go/projects.core_os/discussion > Making the source code compile has become a big task for me. > I'm sorry about that. It shouldn't be that hard. Please try the steps and checks I've outlined. I just verified on a fresh checkout that it works for me. I only had to create a Makefile.dnm in lib/io-pkt/sys/dev_qnx/e1000 directory because of an outside dependency. Hope this helps! /P Fri, 18 Dec 2009 02:41:41 GMT http://community.qnx.com/sf/go/post44091 Patrik Lahti 2009-12-18T02:41:41Z post44087: Re: compile errors on 6.4.0 for pfil implementation http://community.qnx.com/sf/go/post44087 Thanks Sean. Now I have to update my Jam make file to make it use C compiler. Do you have any idea of changing the option in Jam file or is it again in some binary where you cannot change it? I am looking on the website too, but thought of asking you, if you know already. Regards Vinod Thu, 17 Dec 2009 22:37:47 GMT http://community.qnx.com/sf/go/post44087 Vinod Kolapuram 2009-12-17T22:37:47Z post44086: Re: compile errors on 6.4.0 for pfil implementation http://community.qnx.com/sf/go/post44086 On Thu, Dec 17, 2009 at 04:59:14PM -0500, Vinod Kolapuram wrote: > Hi, > We have all the binaries for 6.4.0 on which we are planning port ion-net to io-pkt. I am attaching the errors I get which makes me feel that the header files and the binaries are in mismatch. > > I am running a sample pfil code. > > Can anyone please guess whats going on. You're using c++. The io-pkt + drivers + lsm headers haven't been vetted for C++. Regards, -seanb Thu, 17 Dec 2009 22:09:14 GMT http://community.qnx.com/sf/go/post44086 Sean Boudreau(deleted) 2009-12-17T22:09:14Z post44085: compile errors on 6.4.0 for pfil implementation http://community.qnx.com/sf/go/post44085 Hi, We have all the binaries for 6.4.0 on which we are planning port ion-net to io-pkt. I am attaching the errors I get which makes me feel that the header files and the binaries are in mismatch. I am running a sample pfil code. Can anyone please guess whats going on. Regards Vinod Thu, 17 Dec 2009 21:59:12 GMT http://community.qnx.com/sf/go/post44085 Vinod Kolapuram 2009-12-17T21:59:12Z post44050: Re: pfil functions error http://community.qnx.com/sf/go/post44050 Hi Patrik, Thanks for the input. I am not using VMware. When I do a hinstall at libstartup folder nothing happens. I have a question regarding the stage folder. Since you siad stage folder should be in parallel to trunk. When I executed the below commands % cd <BUILD_ROOT>/trunk % make OSLIST=nto hinstall which are at step 5 in the "build the OS Source". There was nothing written into stage folder. Don't you think there should be some out put written into this stage folder at this point of time? I have other problem with cygwin. As I mentioned earlier there are 4 versions of QNX OS on my machine. 630 632 640 and 641. I have installed cygwin from the net in my "C" folder. When I tried to execute the hinstall command from Libstartup folder, it gives me fatal error "system shared memory version mismatch detected - 0x8A88009C/0x2D1E009C". It clearly says that there might me more than one version of cygwin.dll, try deleting all except the latest version. I don't know if its a good idea now. Each version of QNX has a cygwin dll in the "bin" folder. Making the source code compile has become a big task for me. Or can anyone please let me know the libs and binaries needed for implemention pfil hook under io-pkt for QNX6.4.0 . I just want to try out with the latest headers & binaries so that I can rule out the possibility of missing stuff. Thanks Vinod Thu, 17 Dec 2009 19:33:46 GMT http://community.qnx.com/sf/go/post44050 Vinod Kolapuram 2009-12-17T19:33:46Z post44010: Re: pfil functions error http://community.qnx.com/sf/go/post44010 Vinod Kolapuram wrote: > Hi Patrik, > That is what I was thinking too, there is no make file except the "qconf-override.mk" I buiild with few parameters as explained in the link below. > > But the below links suggested I should build it from the build directory (which is the directory where I do a svn checkout . > > http://community.qnx.com/sf/wiki/do/viewPage/projects.core_os/wiki/BuildTheOSSource > > http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Source_Guide > Perhaps the wiki needs updating now that in the repository splits libsocket and the stack: trunk/lib/socket <- libsocket trunk/lib/io-pkt <- stack stuff It used to be that the two shared trunk root dir. > Then according to you even the "stage" folder has to be created in io-pkt folder for the binaries to be put in there. > The stage can really be anywhere. It's good practice to have it parallel to your trunk dir. > Most of the information or statements here contradict each other. For a new comer like me its a never ending ride. > Apologies if it's confusing, we've just moved things in the repository around. > It took almost couple of hours to build That's surprising, what are you building on? VMware? > and broke at "io-pkt/sys/lib/libdrvr". Here a file "hwi_find_bus.c" includes "<drvr/hwinfo.h>", this file in turn includes "<sys/hwinfo.h>" This file is located at "io-pkt/sys/lib/libstartup/public/sys/". The errors I get is this "sys/hwinfo.h" is not available to the make file. Should I update the header file with full path or should I update the make file itself. I am not that familiar with make file, but I have attached the one which should infact make that folder available for compilation. Can you have a look at let me know. > You'll need to hinstall from lib/libstartup. /P Thu, 17 Dec 2009 13:56:24 GMT http://community.qnx.com/sf/go/post44010 Patrik Lahti 2009-12-17T13:56:24Z post43978: Re: pfil functions error http://community.qnx.com/sf/go/post43978 Hi Patrik, That is what I was thinking too, there is no make file except the "qconf-override.mk" I buiild with few parameters as explained in the link below. But the below links suggested I should build it from the build directory (which is the directory where I do a svn checkout . http://community.qnx.com/sf/wiki/do/viewPage/projects.core_os/wiki/BuildTheOSSource http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Source_Guide Then according to you even the "stage" folder has to be created in io-pkt folder for the binaries to be put in there. Most of the information or statements here contradict each other. For a new comer like me its a never ending ride. I though of building at least the lsm folder under "io-pkt/sys/". I was able to buiid it successfully. Then I though od building the whole source tree from io-pkt folder. So I executed the " make OSLIST=nto hinstall " and it seemed to work. Then I executed "make OSLIST=nto install " It took almost couple of hours to build and broke at "io-pkt/sys/lib/libdrvr". Here a file "hwi_find_bus.c" includes "<drvr/hwinfo.h>", this file in turn includes "<sys/hwinfo.h>" This file is located at "io-pkt/sys/lib/libstartup/public/sys/". The errors I get is this "sys/hwinfo.h" is not available to the make file. Should I update the header file with full path or should I update the make file itself. I am not that familiar with make file, but I have attached the one which should infact make that folder available for compilation. Can you have a look at let me know. Thanks Vinod Thu, 17 Dec 2009 00:36:26 GMT http://community.qnx.com/sf/go/post43978 Vinod Kolapuram 2009-12-17T00:36:26Z post43954: Re: pfil functions error http://community.qnx.com/sf/go/post43954 > 1. To build a io-pkt filter module, do I need to do such a huge exercise by downloading the fullsource tree and buiilding? > That's actually not such a huge task. Try it, you might like it :-) > On the 5th step I am unable to execute "make OSLIST=nto hinstall ". I get an erro. I took a snapshort of my error and attaching it in a jpg file. On this spare machine I also have older versions of QNX630 and 632. > There's no makefile where you issue the make command. You need to navigate down to lib/io-pkt. /P Wed, 16 Dec 2009 18:26:42 GMT http://community.qnx.com/sf/go/post43954 Patrik Lahti 2009-12-16T18:26:42Z post43951: Re: pfil functions error http://community.qnx.com/sf/go/post43951 Hi Robert, Thanks for the help but I am facing few problems here. 1. To build a io-pkt filter module, do I need to do such a huge exercise by downloading the fullsource tree and buiilding? 2. For our project, we have 6.4.0. OS with needed binaries and headers. I want to build a io-pkt filter module on 6.4.0. This is on a seperate machine. 3. On the other spare machine I tried doing the full source checkout (with a pre-requisite of 6.4.1, which I installed it on my PC) and I have executed the first 4 steps to build the source tree. The steps are given at below link. http://community.qnx.com/sf/wiki/do/viewPage/projects.core_os/wiki/BuildTheOSSource On the 5th step I am unable to execute "make OSLIST=nto hinstall ". I get an erro. I took a snapshort of my error and attaching it in a jpg file. On this spare machine I also have older versions of QNX630 and 632. 4.But the ".metadata" folder is created in the build directory. 5. Even if I am making my sample code work on this new build with 6.4.1, how am I going to make it work on 6.4.0. I would end up not knowing the missing files and binaries for 6.4.0 to build the pfil hook. I am using Jamfile to build my application on 6.4.0. I think there should me a smooth transition for building io-pkt from io-net. Hi Sean, when I tried to put the _KERNEL define in my Makefile (Jamfile). I started getting lots of missing files and path mismatch. I corrected the path mismatch by including the io-pkt/sys folder in my Makefile. I was able to get rid of all the path mismatch errors. Now I get few erros like in the libkern.h file "error: 'std::uintmax_t strtoumax(const char*, char**, int)' conflicts with previous using declaration 'std::uintmax_t std::strtoumax(const char*, char**, int)' I also get many errors in systm.h for the function "copyinstr() the errors are invalid conversion from void * to char*. I think might be my project with 6.4.0 does not have the right headers or the binaries for the headers or they can be mismatch with these. Please try to put me in the right direction. Thanks Vinod Wed, 16 Dec 2009 18:06:18 GMT http://community.qnx.com/sf/go/post43951 Vinod Kolapuram 2009-12-16T18:06:18Z post43905: Re: pfil functions error http://community.qnx.com/sf/go/post43905 Hi Vinod: You can definitely build filters under 6.4.0. Just do the same thing as suggested previously by downloading and building the full source tree and then placing your build directory under sys/lsm (and copy one of the other LSM build infrastructure). Robert. Tue, 15 Dec 2009 20:12:53 GMT http://community.qnx.com/sf/go/post43905 Robert craig 2009-12-15T20:12:53Z post43904: Re: pfil functions error http://community.qnx.com/sf/go/post43904 Sorry there was a typo in my prvious posting , its QNX not QNC. Tue, 15 Dec 2009 19:56:59 GMT http://community.qnx.com/sf/go/post43904 Vinod Kolapuram 2009-12-15T19:56:59Z post43903: Re: pfil functions error http://community.qnx.com/sf/go/post43903 Hi Robert, As I mentioned I was trying to build the pfil hook application on 6.4.0, not 6.4.1. In the QNC documentation where I downloaded the Core Netowrking source code, it clearly mentions that the pre-requisite is 6.4.1. Can I not build the io-pkt pfil related application on 6.4.0. As Sean mentioned when I added the _KERNEL flag, I was able to see many missing files and might be even the different versions of the files which are needed to build the pfil hook application properly. But my question is can we not buiild pfil hook filter module on 6.4.0? If yes then what are the extra files, folder, libraries needed to support the pfil hook implementation. Or is it a msut that I should have minimum 6.4.1 version of QNX to implement pfil hook application? Right now I am downloading 6.4.1. Thanks Vinod Tue, 15 Dec 2009 19:55:11 GMT http://community.qnx.com/sf/go/post43903 Vinod Kolapuram 2009-12-15T19:55:11Z post43785: Re: pfil functions error http://community.qnx.com/sf/go/post43785 I haven't done this in a while, so maybe things have changed, but when I was building a filter, the full source tree was checked out and built, I placed the build directory under .../sys/lsm/... and I copied the build infrastructure from one of the other lsm's (common.mk etc). I'd start with copying the build infrastructure and see what happens (note that the lsm.mk file here assumes that the full tree is in place http://community.qnx.com/integration/viewvc/viewvc.cgi/trunk/lib/io-pkt/sys/lsm/?root=core_networking&system=exsy1001) ) The wiki should really be updated to include information on how to build a filter :>. Robert. Mon, 14 Dec 2009 14:27:58 GMT http://community.qnx.com/sf/go/post43785 Robert craig 2009-12-14T14:27:58Z post43739: Re: pfil functions error http://community.qnx.com/sf/go/post43739 On Fri, Dec 11, 2009 at 05:23:55PM -0500, Vinod Kolapuram wrote: > Hello, > I have a question regarding the pfil hook functions. The below link has some example code to add and remove a pfil hook along with entry function. > > http://www.qnx.com/developers/docs/6.4.1/io-pkt_en/user_guide/filtering.html#Packet_Filters > > This code when compiled gives me errors for all the pfil calls, like > pfil_head_get(), pfil_add_hook(), pfil_remove_hook() etc. Do I have to include any library. I am building this on QNX6.4.0. I have all the header files needed for io-pkt. > > I get an error saying the above pfil calls "was not declared in this scope". > > Can you please let me know if I have to include any libs for pfil functions > You probaly need to have _KERNEL defined. Also make sure you're buiding a dll. -seanb Sat, 12 Dec 2009 00:11:07 GMT http://community.qnx.com/sf/go/post43739 Sean Boudreau(deleted) 2009-12-12T00:11:07Z post43735: pfil functions error http://community.qnx.com/sf/go/post43735 Hello, I have a question regarding the pfil hook functions. The below link has some example code to add and remove a pfil hook along with entry function. http://www.qnx.com/developers/docs/6.4.1/io-pkt_en/user_guide/filtering.html#Packet_Filters This code when compiled gives me errors for all the pfil calls, like pfil_head_get(), pfil_add_hook(), pfil_remove_hook() etc. Do I have to include any library. I am building this on QNX6.4.0. I have all the header files needed for io-pkt. I get an error saying the above pfil calls "was not declared in this scope". Can you please let me know if I have to include any libs for pfil functions Thanks Vinod Fri, 11 Dec 2009 22:23:54 GMT http://community.qnx.com/sf/go/post43735 Vinod Kolapuram 2009-12-11T22:23:54Z post43719: Re: Does shim driver work with Filter/converter module? http://community.qnx.com/sf/go/post43719 Thanks Robert. I have one more question. In my posting I have included a link of the sample code (example of adding a hook and removing a hook and the entry function etc.) for io-pkt. This code when compiled gives me errors for all the pfil calls, like pfil_get_get(), pfil_add_hook(), pfil_remove_hook() etc. Do I have to include any library. I am building this on QNX6.4.0. I have all the header files needed for io-pkt. I get an error saying the above pfil calls "was not declared in this scope". Can you please let me know if I have to include any libs Thanks Vinod Fri, 11 Dec 2009 20:38:36 GMT http://community.qnx.com/sf/go/post43719 Vinod Kolapuram 2009-12-11T20:38:36Z post43592: Re: Does shim driver work with Filter/converter module? http://community.qnx.com/sf/go/post43592 Hi Vinod: The shim layer only provides compatibility for the driver interface. The filter / converter interface is in the stack, so the shim layer won't do anything for you. There's more information on io-pkt filters located here: http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Filtering_wiki_page And a good (if complicated) example is here: http://community.qnx.com/integration/viewvc/viewvc.cgi/trunk/lib/io-pkt/sys/lsm/nraw/?root=core_networking&system=exsy1001 You can also look at how mbufs and npkts are converted by taking a look in the shim layer here: http://community.qnx.com/integration/viewvc/viewvc.cgi/trunk/lib/io-pkt/sys/dev_qnx/shim/io-net.c?revision=1&root=core_networking&system=exsy1001&view=markup (look for npkt2mbuf and mbuf2npkt). Still a large learning curve, but I hope this helps, Robert. Thu, 10 Dec 2009 22:38:12 GMT http://community.qnx.com/sf/go/post43592 Robert craig 2009-12-10T22:38:12Z post43587: Does shim driver work with Filter/converter module? http://community.qnx.com/sf/go/post43587 Hello, I want to know if the shim driver which is used for backward compatibility to use with io-net NIC driver from QNX6.4 under io-pkt, is workable even for the filter/converter module. I am porting the filter module from io-net to io-pkt. If this shim driver works for filter/converter module then I can try using the shim driver. I have browsed through the forum and internet for porting related info but was able to find an example of using the pfil hook to access mbuf at http://www.qnx.com/developers/docs/6.4.1/io-pkt_en/user_guide/migrating.html Can anyone please give me some more input on using mbuf so that I can straight away convert to iov type or point me to some example in BSD implementation, which at least reduces my effort in understanding. Regards Vinod Thu, 10 Dec 2009 21:56:44 GMT http://community.qnx.com/sf/go/post43587 Vinod Kolapuram 2009-12-10T21:56:44Z post42448: Re: Can't find sys/io-pkt.h in QNX 6.4.0 http://community.qnx.com/sf/go/post42448 Thanks Robert. I will follow the same. Regards Vinod Mon, 23 Nov 2009 23:28:24 GMT http://community.qnx.com/sf/go/post42448 Vinod Kolapuram 2009-11-23T23:28:24Z post42426: Re: Can't find sys/io-pkt.h in QNX 6.4.0 http://community.qnx.com/sf/go/post42426 Hi Vinod: Putting the header files into the location specified in the wiki (i.e. in the system include directory) makes them compatible with future revisions of the OS. Robert. Mon, 23 Nov 2009 20:28:05 GMT http://community.qnx.com/sf/go/post42426 Robert craig 2009-11-23T20:28:05Z post42408: Re: Can't find sys/io-pkt.h in QNX 6.4.0 http://community.qnx.com/sf/go/post42408 Thanks Robert, I have got the whole folder. Should I maintain the same directory structure under io-pkt as it created or can I merge the sys folder files with the sysfolder. If my development goes on with this folder for io-pkt, then in new versions of QNX I might have to redo or atleast make sure the file paths are OK. Regards Vinod Mon, 23 Nov 2009 18:27:04 GMT http://community.qnx.com/sf/go/post42408 Vinod Kolapuram 2009-11-23T18:27:04Z post42407: Re: Can't find sys/io-pkt.h in QNX 6.4.0 http://community.qnx.com/sf/go/post42407 Thanks I got it from wiki Mon, 23 Nov 2009 18:21:48 GMT http://community.qnx.com/sf/go/post42407 Vinod Kolapuram 2009-11-23T18:21:48Z post42358: Re: Can't find sys/io-pkt.h in QNX 6.4.0 http://community.qnx.com/sf/go/post42358 You can also take a look at the Drivers wiki here: http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Drivers_wiki_page It's covered right at the bottom of the page. Robert. Sat, 21 Nov 2009 16:30:59 GMT http://community.qnx.com/sf/go/post42358 Robert craig 2009-11-21T16:30:59Z post42351: Re: Can't find sys/io-pkt.h in QNX 6.4.0 http://community.qnx.com/sf/go/post42351 On Fri, Nov 20, 2009 at 07:03:17PM -0500, Vinod Kolapuram wrote: > Hi, > can anyone help me find the file "sys/io-pkt.h" in QNX 6.4.0? I am working on porting of io-net to io-pkt and I do not see the mentioned file. I would really appreciate if someone who already worked on this, can guide me please. That file didn't exist in 6.4.0. It appeared in 6.4.1. You can get it from the repo in the networking project though. -seanb Sat, 21 Nov 2009 00:20:51 GMT http://community.qnx.com/sf/go/post42351 Sean Boudreau(deleted) 2009-11-21T00:20:51Z post42350: Can't find sys/io-pkt.h in QNX 6.4.0 http://community.qnx.com/sf/go/post42350 Hi, can anyone help me find the file "sys/io-pkt.h" in QNX 6.4.0? I am working on porting of io-net to io-pkt and I do not see the mentioned file. I would really appreciate if someone who already worked on this, can guide me please. Thanks Vinod Sat, 21 Nov 2009 00:03:16 GMT http://community.qnx.com/sf/go/post42350 Vinod Kolapuram 2009-11-21T00:03:16Z post40579: RE: RE: about CAN card driver http://community.qnx.com/sf/go/post40579 thank you! I found a card from steinhoff company. so I donnot need to develop the driver.   the next step, I must learn to how to use it. --- 09年10月21日,周三, Andrew Boyd <community-noreply@qnx.com> 写道: 发件人: Andrew Boyd <community-noreply@qnx.com> 主题: RE: RE: about CAN card driver 收件人: "ionetmig-networking" <post40421@community.qnx.com> 日期: 2009年10月21日,周三,下午9:41 > I want to use the PCI CAN Card ok, it was worth a shot - CANBUS isn't exactly high-bandwidth  :) I would recommend seeing what documentation (registers etc) you can dig up, and perhaps a sample source driver for another OS for this card. Then, look at how memory is mapped in QNX, and interrupts are handled - both ridiculously easy, look at any QNX driver source on the foundry - and that's probably about all you need. -- aboyd _______________________________________________ io-net migration http://community.qnx.com/sf/go/post40421 ___________________________________________________________ 好玩贺卡等你发,邮箱贺卡全新上线! http://card.mail.cn.yahoo.com/ Fri, 23 Oct 2009 02:23:53 GMT http://community.qnx.com/sf/go/post40579 di hu 2009-10-23T02:23:53Z post40421: RE: RE: about CAN card driver http://community.qnx.com/sf/go/post40421 > I want to use the PCI CAN Card ok, it was worth a shot - CANBUS isn't exactly high-bandwidth :) I would recommend seeing what documentation (registers etc) you can dig up, and perhaps a sample source driver for another OS for this card. Then, look at how memory is mapped in QNX, and interrupts are handled - both ridiculously easy, look at any QNX driver source on the foundry - and that's probably about all you need. -- aboyd Wed, 21 Oct 2009 13:41:00 GMT http://community.qnx.com/sf/go/post40421 Andrew Boyd(deleted) 2009-10-21T13:41:00Z post40392: Re: RE: about CAN card driver http://community.qnx.com/sf/go/post40392 Yes I want to use the PCI CAN Card if anyone have the PCI CAN Card driver that good Our system cannot use the CAN-USB adopter, because it is not real-time, and communicate with the other device by USB, I think it is not a good idea. thank you! Wed, 21 Oct 2009 05:50:42 GMT http://community.qnx.com/sf/go/post40392 di hu 2009-10-21T05:50:42Z post40325: RE: about CAN card driver http://community.qnx.com/sf/go/post40325 > I want to develop a PCI bus CAN card driver Does it have to be PCI? I think people here have a CANBUS-to-USB adapter running under QNX. Would that do what you want? You don't have to write any software to make that work, just get the canbus-to-usb adapter, which I don't think was very expensive.. -- aboyd www.poweredbyqnx.com/movies/L39_form.wmv Tue, 20 Oct 2009 13:38:29 GMT http://community.qnx.com/sf/go/post40325 Andrew Boyd(deleted) 2009-10-20T13:38:29Z post40306: about CAN card driver http://community.qnx.com/sf/go/post40306 hello, I want to develope a PCI bus CAN card driver. where could get the example driver? and some introduction about PCI Card driver develope. Thank you! Tue, 20 Oct 2009 08:41:59 GMT http://community.qnx.com/sf/go/post40306 di hu 2009-10-20T08:41:59Z post37394: Re: ntpdate failure http://community.qnx.com/sf/go/post37394 I had /etc/services, but only entries for ftp and telnet. Added ntp and it now works. It worked under QNX6.3.2 without that entry. Thanks! > > Shot in the dark... > > Do you have /etc/services ? > > -seanb > Fri, 04 Sep 2009 16:38:54 GMT http://community.qnx.com/sf/go/post37394 Todd Peterson 2009-09-04T16:38:54Z post37391: Re: ntpdate failure http://community.qnx.com/sf/go/post37391 Shot in the dark... Do you have /etc/services ? -seanb On Fri, Sep 04, 2009 at 11:56:21AM -0400, Todd Peterson wrote: > I issue the following commands after the network is up under QNX6.3.2: > > export TZ=MST7MDT > ntpdate ntp > ntpd -g > > All works fine. > > Under QNX6.4.1 I get the following behavior: > > # export TZ=MST7MDT > # ntpdate ntp > Error : servname not supported for ai_socktype > 31 Dec 17:30:11 ntpdate[274445]: can't find host ntp > > 31 Dec 17:30:11 ntpdate[274445]: no servers can be used, exiting > > Process 274445 (ntpdate) exited status=1. > > ntp is in my /etc/hosts file and I can ping & nslookup ntp: > > # ping ntp > PING ntp.mgtsciences.com (172.23.93.7): 56 data bytes > 64 bytes from 172.23.93.7: icmp_seq=0 ttl=64 time=9 ms > 64 bytes from 172.23.93.7: icmp_seq=1 ttl=64 time=4 ms > 64 bytes from 172.23.93.7: icmp_seq=2 ttl=64 time=3 ms > 64 bytes from 172.23.93.7: icmp_seq=3 ttl=64 time=5 ms > 64 bytes from 172.23.93.7: icmp_seq=4 ttl=64 time=4 ms > > ----ntp.mgtsciences.com PING Statistics---- > 5 packets transmitted, 5 packets received, 0% packet loss > round-trip min/avg/max = 3/5/9 ms variance = 5 ms^2 > > Process 290829 (ping) exited status=0. > # nslookup ntp > Server: 172.23.93.3 > Address: 172.23.93.3#53 > > Name: ntp.mgtsciences.com > Address: 172.23.93.7 > > > Process 299021 (nslookup) exited status=0. > > sloginfo did not produce anything other than a line: > Dec 31 17:00:26 3 25 0 Couldn't initialize listen service: tcp (Address already in use) > > > Any suggestions? > > > > > > _______________________________________________ > > io-net migration > http://community.qnx.com/sf/go/post37384 > Fri, 04 Sep 2009 16:12:18 GMT http://community.qnx.com/sf/go/post37391 Sean Boudreau(deleted) 2009-09-04T16:12:18Z post37384: ntpdate failure http://community.qnx.com/sf/go/post37384 I issue the following commands after the network is up under QNX6.3.2: export TZ=MST7MDT ntpdate ntp ntpd -g All works fine. Under QNX6.4.1 I get the following behavior: # export TZ=MST7MDT # ntpdate ntp Error : servname not supported for ai_socktype 31 Dec 17:30:11 ntpdate[274445]: can't find host ntp 31 Dec 17:30:11 ntpdate[274445]: no servers can be used, exiting Process 274445 (ntpdate) exited status=1. ntp is in my /etc/hosts file and I can ping & nslookup ntp: # ping ntp PING ntp.mgtsciences.com (172.23.93.7): 56 data bytes 64 bytes from 172.23.93.7: icmp_seq=0 ttl=64 time=9 ms 64 bytes from 172.23.93.7: icmp_seq=1 ttl=64 time=4 ms 64 bytes from 172.23.93.7: icmp_seq=2 ttl=64 time=3 ms 64 bytes from 172.23.93.7: icmp_seq=3 ttl=64 time=5 ms 64 bytes from 172.23.93.7: icmp_seq=4 ttl=64 time=4 ms ----ntp.mgtsciences.com PING Statistics---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 3/5/9 ms variance = 5 ms^2 Process 290829 (ping) exited status=0. # nslookup ntp Server: 172.23.93.3 Address: 172.23.93.3#53 Name: ntp.mgtsciences.com Address: 172.23.93.7 Process 299021 (nslookup) exited status=0. sloginfo did not produce anything other than a line: Dec 31 17:00:26 3 25 0 Couldn't initialize listen service: tcp (Address already in use) Any suggestions? Fri, 04 Sep 2009 15:56:20 GMT http://community.qnx.com/sf/go/post37384 Todd Peterson 2009-09-04T15:56:20Z post37327: Re: io-pkt and Asix driver behavior http://community.qnx.com/sf/go/post37327 I seem to remember that the ASIX driver had this SIGKILL thing that it would do if it couldn't set something up, so it's possible that this is what you're seeing (and this would be a driver issue rather than the stack). You might want to try starting the driver up in verbose mode and post the sloginfo output. To me, this seems to be more of a problem with io-usb than io-pkt. If io-usb has registered /dev/io-usb before it's ready to process requests, then this would be a Bad Thing. Someone should take a dig through the driver code for 6.4.1 to confirm what's causing the SIGKILL to be sure. R. Thu, 03 Sep 2009 20:47:14 GMT http://community.qnx.com/sf/go/post37327 Robert craig 2009-09-03T20:47:14Z post37265: Re: io-pkt and Asix driver behavior http://community.qnx.com/sf/go/post37265 > Hi Todd, > > I'm not very familiar with USB but I don't think io-pkt should crash. Do > you happen to have a core file from when io-pkt crashes? It sounds like > you did some analysis on it because you say USB is not fully > initialized? Or, by "die", do you mean something else? io-pkt exits via SIGKILL if I just do a waitfor /dev/io-usb/io-usb (instead of sleep), as suggested. The waitfor did work under QNX6.3.2. sloginfo does not provide any clues as to why it exited, except that I see a bunch of io-usb stuff following where io-pkt tries to launch. io-pkt was running OK today and actually did crash with SIGSEGV while I was at lunch (nothing really running on the board). Process 4102 (io-pkt-v4) terminated SIGSEGV code=1 fltno=11 ip=01088cd4 > > You could try maybe "waitfor /dev/io-usb/io-usb" as described here: > http://www.qnx.com/developers/docs/6.4.1/neutrino/user_guide/hardware.html#USB > > scroll down to "Ethernet adapters". > > Cheers! > /P > > Todd Peterson wrote: > > In 6.3.2, I start the USB driver: > > > > io-usb -vvv -dohci ioport=0x31020000,irq=59,verbose=5 > > > > and then waitfor /dev/io-usb/io-usb > > > > and then start io-net > > > > In 6.4.1, if I follow the same steps, except use io-pkt, io-pkt dies, > because the USB is not fully initialized. If I do a sleep 2, and then start io > -pkt, it works fine. But, I hate using a sleep, instead of waiting for some > evidence that the USB is up. > > > > Any suggestions? > > > > working .bsh snippet: > > > > io-usb -vvv -dohci ioport=0x31020000,irq=59,verbose=5 > > sleep 2 > > io-pkt-v4 -d asix -p tcpip > > > > > > > > > > _______________________________________________ > > > > io-net migration > > http://community.qnx.com/sf/go/post37047 > > > > Thu, 03 Sep 2009 15:10:47 GMT http://community.qnx.com/sf/go/post37265 Todd Peterson 2009-09-03T15:10:47Z post37220: Re: io-pkt and Asix driver behavior http://community.qnx.com/sf/go/post37220 Hi Todd, I'm not very familiar with USB but I don't think io-pkt should crash. Do you happen to have a core file from when io-pkt crashes? It sounds like you did some analysis on it because you say USB is not fully initialized? Or, by "die", do you mean something else? You could try maybe "waitfor /dev/io-usb/io-usb" as described here: http://www.qnx.com/developers/docs/6.4.1/neutrino/user_guide/hardware.html#USB scroll down to "Ethernet adapters". Cheers! /P Todd Peterson wrote: > In 6.3.2, I start the USB driver: > > io-usb -vvv -dohci ioport=0x31020000,irq=59,verbose=5 > > and then waitfor /dev/io-usb/io-usb > > and then start io-net > > In 6.4.1, if I follow the same steps, except use io-pkt, io-pkt dies, because the USB is not fully initialized. If I do a sleep 2, and then start io-pkt, it works fine. But, I hate using a sleep, instead of waiting for some evidence that the USB is up. > > Any suggestions? > > working .bsh snippet: > > io-usb -vvv -dohci ioport=0x31020000,irq=59,verbose=5 > sleep 2 > io-pkt-v4 -d asix -p tcpip > > > > > _______________________________________________ > > io-net migration > http://community.qnx.com/sf/go/post37047 > > Wed, 02 Sep 2009 18:55:14 GMT http://community.qnx.com/sf/go/post37220 Patrik Lahti 2009-09-02T18:55:14Z post37047: io-pkt and Asix driver behavior http://community.qnx.com/sf/go/post37047 In 6.3.2, I start the USB driver: io-usb -vvv -dohci ioport=0x31020000,irq=59,verbose=5 and then waitfor /dev/io-usb/io-usb and then start io-net In 6.4.1, if I follow the same steps, except use io-pkt, io-pkt dies, because the USB is not fully initialized. If I do a sleep 2, and then start io-pkt, it works fine. But, I hate using a sleep, instead of waiting for some evidence that the USB is up. Any suggestions? working .bsh snippet: io-usb -vvv -dohci ioport=0x31020000,irq=59,verbose=5 sleep 2 io-pkt-v4 -d asix -p tcpip Tue, 01 Sep 2009 17:37:55 GMT http://community.qnx.com/sf/go/post37047 Todd Peterson 2009-09-01T17:37:55Z post36951: Re: duplicat IP Address http://community.qnx.com/sf/go/post36951 On Mon, Aug 31, 2009 at 01:14:39AM -0400, kaku xing wrote: > Hello > > I know that there is "duplicat IP Address..." information show in sloginfo when my PC's IP address conflict with others. > However, does anybody know what QNX API could provide this facility for our program to detect this situation? > > Because I have many io-net. example: /dev/io-net/en0 (192.168.0.1) ???/dev/io-net2/en0 (192.168.0.1) > How do I point to the "/dev/io-nt2/eno" ? And what do QNX API? > > Thanks for your time. > > > seanb say : > > There is a stat logged: > > # netstat -p arp | grep duplicate > > You could do the equivalent of what netstat does. netstat honours the SOCK envirinmental variable. /dev/io-net* doesn't come into play here. Check out the 'prefix' argument to the stack: # io-pkt -ptcpip # netstat -parp | grep duplicate vs # io-pkt -ptcpip prefix=/alt # SOCK=/alt netstat -parp | grep duplicate The source to netstat is in the networking project on foundry27 -seanb Mon, 31 Aug 2009 13:08:28 GMT http://community.qnx.com/sf/go/post36951 Sean Boudreau(deleted) 2009-08-31T13:08:28Z post36924: duplicat IP Address http://community.qnx.com/sf/go/post36924 Hello I know that there is "duplicat IP Address..." information show in sloginfo when my PC's IP address conflict with others. However, does anybody know what QNX API could provide this facility for our program to detect this situation? Because I have many io-net. example: /dev/io-net/en0 (192.168.0.1) 、/dev/io-net2/en0 (192.168.0.1) How do I point to the "/dev/io-nt2/eno" ? And what do QNX API? Thanks for your time. seanb say : There is a stat logged: # netstat -p arp | grep duplicate You could do the equivalent of what netstat does. Best Regards Formosa Plastics Corp.Electronic Group Ching Hsun Kuo 郭憬勳 TEL : (07)3711411 EXT 6470 FAX : (07)372-7026 E-MAIL: robby0524@fpc.com.tw 100,SueiGuan Road,Jen-Wu Hsiang,Kaohsiung,Taiwan 814高雄縣仁武鄉水管路100號 Mon, 31 Aug 2009 05:14:39 GMT http://community.qnx.com/sf/go/post36924 kaku xing 2009-08-31T05:14:39Z post36436: simultaneous packet sending http://community.qnx.com/sf/go/post36436 I have a quad port network card and I am trying to send one packet with size of 121 byes to each network interface every 250 us. I am using pcap.h for this purpose. Currently I am using a time to create 250usec and I send four packets to four network interfaces consecutively. I have one more similar network card installed in another PC running winxp. These two network cards are connected together through four cross wires. I am using the second PC for monitoring. As I am running four pcap_sendpacket() functions consecutively, there would be about 20us delay between the first and second interface packets and the same for second and third and so on. Is there any way to send packets simultaneously or at least reduce the delay to few us. Do you think if I use for timers and calibrate them I can do the job or not? Regards, Mohammad Fri, 21 Aug 2009 16:18:37 GMT http://community.qnx.com/sf/go/post36436 Mohammad Dadashzadeh(deleted) 2009-08-21T16:18:37Z post35874: Re: RE: RE: QNET over IP on QNX 6.4.0 - automatic population of remote nodes in /net folder http://community.qnx.com/sf/go/post35874 Its definitely an important feature for our project. In our project the total application depends on the "/net" folder. If /net is populated automatically then there will not be an extra stuff to the TDP oeration and make an entry in /net. i mean I need not maintain a lists in /etc/hosts. If a hostname is changed again its a big headache to modify the /etc/hosts file...on all the nodes. Thu, 13 Aug 2009 06:31:55 GMT http://community.qnx.com/sf/go/post35874 soujanya Yelchuri 2009-08-13T06:31:55Z post35815: RE: RE: QNET over IP on QNX 6.4.0 - automatic population of remote nodes in /net folder http://community.qnx.com/sf/go/post35815 > Why this important feature is removed from QNX 6.4.0?? It wasn't removed - it's simply a difference between the resolvers used with ethernet bind, and ip bind. I had no idea that anyone considered the "hints" in /net an important feature! I personally think they're nice to see, but whether or not they are there should not really affect the time it takes to resolve a new host. -- aboyd Wed, 12 Aug 2009 13:30:29 GMT http://community.qnx.com/sf/go/post35815 Andrew Boyd(deleted) 2009-08-12T13:30:29Z post35799: Re: RE: QNET over IP on QNX 6.4.0 - automatic population of remote nodes in /net folder http://community.qnx.com/sf/go/post35799 hi, Does any one let me the status of P.S. 69603 . In future is there any chance that i get auto pop up of /net with QNET over IP.?? in the later versions of QNX 6.4.X??? Any idea..?? Its the major stop issue for me for migration to QNX 6.4.0 Is there any quick fix ?? Why this important feature is removed from QNX 6.4.0?? Wed, 12 Aug 2009 09:49:07 GMT http://community.qnx.com/sf/go/post35799 soujanya Yelchuri 2009-08-12T09:49:07Z post35649: Re: Move from devn-mpc85xx.so to devnp-mpc85xx.so: how to keep the device name http://community.qnx.com/sf/go/post35649 There are still problems with this, even in 6.4.1. If you force the name prefix to "en", probably the most common use of the option, then nicinfo stops working, since it thinks the "en" prefix indicates it's dealing with an io-net driver and it calls doit_ionet() instead of doit(). Calling doit() when doit_ionet() fails almost fixes the problem --- you get info, but you get each driver's name twice, once from the failed doit_ionet() and once from doit(). Murf Tue, 11 Aug 2009 10:37:44 GMT http://community.qnx.com/sf/go/post35649 John Murphy 2009-08-11T10:37:44Z post35138: Re: npm-rawcan ethernet driver http://community.qnx.com/sf/go/post35138 On Mon, Aug 03, 2009 at 12:04:53AM -0400, Brabhu Hansen wrote: > Has any one tried using the ethernet over CAN for io-pkt? > > The existing code which i found is only for io-net. Can this be made run using shim library under ../sys/dev_qnx/shim? or a complete porting of npm-rawcan is needed I'm not familiar with npm-rawcan but 'npm' suggests it's a protocol module, not a driver. The shim handles drivers so it probably won't work without some porting effort. Regards, -seanb Mon, 03 Aug 2009 14:54:42 GMT http://community.qnx.com/sf/go/post35138 Sean Boudreau(deleted) 2009-08-03T14:54:42Z post35127: npm-rawcan ethernet driver http://community.qnx.com/sf/go/post35127 Has any one tried using the ethernet over CAN for io-pkt? The existing code which i found is only for io-net. Can this be made run using shim library under ../sys/dev_qnx/shim? or a complete porting of npm-rawcan is needed Mon, 03 Aug 2009 04:04:52 GMT http://community.qnx.com/sf/go/post35127 Brabhu Hansen 2009-08-03T04:04:52Z post35123: More strange behavior in libpcap http://community.qnx.com/sf/go/post35123 While investigating "strange behavior of using pcap.h", I ran across another bit of strange behavior --- pcap_next (and also pcap_next_ex) frequently returns immediately with a timeout indication. The code in pcap_read_bpf (in pcap-bpf.c) expects the byte count returned by BPF to be word aligned, but BPF inserts the alignment space BEFORE it adds a packet to the buffer, not AFTER it adds the packet. So the end of the buffer may not be word aligned. There are two tests in pcap_read_bpf to check for more data in the buffer: one of them, "if (p->cc == 0) {" tests a counter that gets decremented by the word aligned length of each packet --- a counter that will go negative at the end of the buffer three out of four times on random length data; the other test, "while (bp < ep) {" tests that the packet pointer hasn't been incremented past the end of the data. So, whenever the byte count from BPF is not word aligned, after the last packet is read from the buffer, the next call to pcap_next finds the counter negative, and since the test is for exactly zero, another read is NOT started, and the code goes on to loop through the packet; but the pointer test correctly determines that there are no more packets in the buffer, and returns no data, indicating a timeout. There are several ways to correct this "problem", and the selection may be based more on politics than on technical issues. I would judge pcap_read_bpf, with its two different tests for the same condition, to be broken: a quick fix would be to change the p->cc == 0 test to p->cc <= 0. But I suppose others might argue that BPF should always return a word aligned value, and that should work too. In any case, it's hard to imagine these false timeouts causing a serious problem in any application, but still, it's just not quite right. Murf Sat, 01 Aug 2009 17:02:54 GMT http://community.qnx.com/sf/go/post35123 John Murphy 2009-08-01T17:02:54Z post35109: Re: Move from devn-mpc85xx.so to devnp-mpc85xx.so: how to keep the device name http://community.qnx.com/sf/go/post35109 Hmmm... I seem to remember that this option was added in 6.4.1, so if you're on 6.4.0, it won't work. http://community.qnx.com/integration/viewvc/viewvc.cgi?view=revision&root=core_networking&system=exsy1001&revision=670 Robert. Fri, 31 Jul 2009 20:06:09 GMT http://community.qnx.com/sf/go/post35109 Robert craig 2009-07-31T20:06:09Z post35077: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35077 On Fri, Jul 31, 2009 at 12:40:49PM -0400, Yao Zhao wrote: > > > > Well done. It worked. I really appreciate. I am going to summarize the > > discussion and make it more useful for anyone who may face the same problem. > > Just one thing I wanna confirm, was replacing libpcap.a necessary or not. > > Best Regards, > > Mohammad > > > > libpcap.a modification is not related to your timestamp problem so no. The final I have in mind likely will require a new stack and libpcap. Regards, -seanb Fri, 31 Jul 2009 16:49:09 GMT http://community.qnx.com/sf/go/post35077 Sean Boudreau(deleted) 2009-07-31T16:49:09Z post35076: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35076 > > > Yao Zhao wrote: > > > > > > > > Murf: can you get different timestamp for flood packets? > > > > > > > > > > > > > > > I get timestamps with the normal 8 us. resolution, as expected. The > > > changes that were suggested for mtime will produce ms., not us., > > > resolution, since the hardware clock interrupts (approximately) once per > > > millisecond. > > > > > > Murf > > > > > > You should get 8ms resolution not 8us. as the tick. > > > > Murf is right I forgot qtime is updated by timer so curtime_nto won't get > > better than 1 ms. > > you should write a small program to call ClockPeriod to change system clock > to > > smaller, like 250us. then run your app. > > > Well done. It worked. I really appreciate. I am going to summarize the > discussion and make it more useful for anyone who may face the same problem. > Just one thing I wanna confirm, was replacing libpcap.a necessary or not. > Best Regards, > Mohammad > > > > 12:12:13,165995 len:121 > 12:12:13,165995 len:121 > 12:12:13,165995 len:121 > 12:12:13,166206 len:121 > 12:12:13,166206 len:121 > 12:12:13,166336 len:121 > 12:12:13,166336 len:121 > 12:12:13,166538 len:121 > 12:12:13,166547 len:121 > 12:12:13,166547 len:121 > 12:12:13,166769 len:121 > 12:12:13,166769 len:121 > 12:12:13,166769 len:121 > 12:12:13,166990 len:121 > 12:12:13,166990 len:121 > 12:12:13,166990 len:121 > 12:12:13,166990 len:121 > 12:12:13,167211 len:121 > 12:12:13,167211 len:121 > 12:12:13,167322 len:121 > 12:12:13,167322 len:121 > 12:12:13,167543 len:121 > 12:12:13,167543 len:121 > 12:12:13,167543 len:121 > 12:12:13,167773 len:121 > 12:12:13,167773 len:121 > 12:12:13,167773 len:121 > 12:12:13,167773 len:121 > 12:12:13,167985 len:121 > 12:12:13,168004 len:121 > 12:12:13,168004 len:121 > 12:12:13,168217 len:121 > 12:12:13,168217 len:121 > 12:12:13,168327 len:121 > 12:12:13,168327 len:121 > 12:12:13,168539 len:121 > 12:12:13,168548 len:121 > 12:12:13,168548 len:121 > 12:12:13,168770 len:121 > 12:12:13,168770 len:121 > 12:12:13,168770 len:121 > 12:12:13,168991 len:121 > 12:12:13,168991 len:121 > 12:12:13,169212 len:121 > 12:12:13,169212 len:121 > 12:12:13,169323 len:121 > 12:12:13,169323 len:121 > 12:12:13,169534 len:121 > 12:12:13,169544 len:121 > 12:12:13,169544 len:121 > 12:12:13,169765 len:121 > 12:12:13,169765 len:121 > 12:12:13,169765 len:121 > 12:12:13,169986 len:121 libpcap.a modification is not related to your timestamp problem so no. Fri, 31 Jul 2009 16:40:46 GMT http://community.qnx.com/sf/go/post35076 Yao Zhao(deleted) 2009-07-31T16:40:46Z post35074: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35074 > > Yao Zhao wrote: > > > > > > Murf: can you get different timestamp for flood packets? > > > > > > > > > > > I get timestamps with the normal 8 us. resolution, as expected. The > > changes that were suggested for mtime will produce ms., not us., > > resolution, since the hardware clock interrupts (approximately) once per > > millisecond. > > > > Murf > > > You should get 8ms resolution not 8us. as the tick. > > Murf is right I forgot qtime is updated by timer so curtime_nto won't get > better than 1 ms. > you should write a small program to call ClockPeriod to change system clock to > smaller, like 250us. then run your app. Well done. It worked. I really appreciate. I am going to summarize the discussion and make it more useful for anyone who may face the same problem. Just one thing I wanna confirm, was replacing libpcap.a necessary or not. Best Regards, Mohammad 12:12:13,165995 len:121 12:12:13,165995 len:121 12:12:13,165995 len:121 12:12:13,166206 len:121 12:12:13,166206 len:121 12:12:13,166336 len:121 12:12:13,166336 len:121 12:12:13,166538 len:121 12:12:13,166547 len:121 12:12:13,166547 len:121 12:12:13,166769 len:121 12:12:13,166769 len:121 12:12:13,166769 len:121 12:12:13,166990 len:121 12:12:13,166990 len:121 12:12:13,166990 len:121 12:12:13,166990 len:121 12:12:13,167211 len:121 12:12:13,167211 len:121 12:12:13,167322 len:121 12:12:13,167322 len:121 12:12:13,167543 len:121 12:12:13,167543 len:121 12:12:13,167543 len:121 12:12:13,167773 len:121 12:12:13,167773 len:121 12:12:13,167773 len:121 12:12:13,167773 len:121 12:12:13,167985 len:121 12:12:13,168004 len:121 12:12:13,168004 len:121 12:12:13,168217 len:121 12:12:13,168217 len:121 12:12:13,168327 len:121 12:12:13,168327 len:121 12:12:13,168539 len:121 12:12:13,168548 len:121 12:12:13,168548 len:121 12:12:13,168770 len:121 12:12:13,168770 len:121 12:12:13,168770 len:121 12:12:13,168991 len:121 12:12:13,168991 len:121 12:12:13,169212 len:121 12:12:13,169212 len:121 12:12:13,169323 len:121 12:12:13,169323 len:121 12:12:13,169534 len:121 12:12:13,169544 len:121 12:12:13,169544 len:121 12:12:13,169765 len:121 12:12:13,169765 len:121 12:12:13,169765 len:121 12:12:13,169986 len:121 Fri, 31 Jul 2009 16:14:41 GMT http://community.qnx.com/sf/go/post35074 Mohammad Dadashzadeh(deleted) 2009-07-31T16:14:41Z post35073: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35073 >> I get timestamps with the normal 8 us. resolution, as expected. The >> changes that were suggested for mtime will produce ms., not us., >> resolution, since the hardware clock interrupts (approximately) once per >> millisecond. >> >> Murf >> > > > You should get 8ms resolution not 8us. as the tick. > > Murf is right I forgot qtime is updated by timer so curtime_nto won't get better than 1 ms. > you should write a small program to call ClockPeriod to change system clock to smaller, like 250us. then run your app. > > Yea, of course I meant 8ms., not 8us.! Even when I reread messages two or three times before I hit the send button, I still make mistakes. Guess I need a smarter "spell" checker.... Murf Fri, 31 Jul 2009 16:13:26 GMT http://community.qnx.com/sf/go/post35073 John Murphy 2009-07-31T16:13:26Z post35070: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35070 > Yao Zhao wrote: > > > > Murf: can you get different timestamp for flood packets? > > > > > > > I get timestamps with the normal 8 us. resolution, as expected. The > changes that were suggested for mtime will produce ms., not us., > resolution, since the hardware clock interrupts (approximately) once per > millisecond. > > Murf You should get 8ms resolution not 8us. as the tick. Murf is right I forgot qtime is updated by timer so curtime_nto won't get better than 1 ms. you should write a small program to call ClockPeriod to change system clock to smaller, like 250us. then run your app. Fri, 31 Jul 2009 16:01:58 GMT http://community.qnx.com/sf/go/post35070 Yao Zhao(deleted) 2009-07-31T16:01:58Z post35069: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35069 Yao Zhao wrote: > > Murf: can you get different timestamp for flood packets? > > > I get timestamps with the normal 8 us. resolution, as expected. The changes that were suggested for mtime will produce ms., not us., resolution, since the hardware clock interrupts (approximately) once per millisecond. Murf Fri, 31 Jul 2009 15:51:59 GMT http://community.qnx.com/sf/go/post35069 John Murphy 2009-07-31T15:51:59Z post35068: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35068 I would really appreciate your help and support. Fri, 31 Jul 2009 15:51:08 GMT http://community.qnx.com/sf/go/post35068 Mohammad Dadashzadeh(deleted) 2009-07-31T15:51:08Z post35066: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35066 Mohammad Dadashzadeh wrote: >> Mohammad Dadashzadeh wrote: >> >>>>> I would like to get packets one by one. What should I do? >>>>> >>>>> Mohammad >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> >>>>> >>>>> >>>>> >>>>> >>>> Sean sent you a libpcap.a that lets you enable immediate mode. That >>>> should be all you need. >>>> >>>> Murf >>>> >>>> >>> I did that, didn't work, even when I reboot my target machine it can not >>> >> connect to net anymore. >> >>> Mohammad >>> >>> >> I compiled the code you published on this thread and linked it with >> Sean's libpcap and it worked fine. I don't think we understand what you >> mean by "not working". >> >> Murf >> > > > I replaced linpcap.a which Sean sent with all libpcap.a files in my development and target machine. I recompiled and built the project yet I am getting 8 packets every 1 ms while the packets are transmitted two every 250 usec. > > Regards, > Mohammad > Sean's change was to enable immediate mode in BPF, and had nothing to do with timestamps. You are seeing all the packets that get transmitted, and, as has been explained several times in this thread, the resolution of the timestamps you see on those packets is limited by the resolution of the system clock. If you really think you need greater resolution on the timestamps, it might be better to design you own packet capture system, rather than make fundamental changes to the operating system, especially by hacking the binaries. By the way, please understand that I am in no way associated with QNX other than being a happy user with about 30 years of experience in packet sniffing --- and a little too much time on my hands this week. Murf Fri, 31 Jul 2009 15:47:42 GMT http://community.qnx.com/sf/go/post35066 John Murphy 2009-07-31T15:47:42Z post35065: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35065 > > > Mohammad Dadashzadeh wrote: > > > >>> I would like to get packets one by one. What should I do? > > > >>> > > > >>> Mohammad > > > >>> > > > >>> > > > >>> > > > >>> _______________________________________________ > > > >>> > > > >>> > > > >>> > > > >>> > > > >> Sean sent you a libpcap.a that lets you enable immediate mode. That > > > >> should be all you need. > > > >> > > > >> Murf > > > >> > > > > > > > > > > > > I did that, didn't work, even when I reboot my target machine it can > not > > > > > connect to net anymore. > > > > > > > > Mohammad > > > > > > > I compiled the code you published on this thread and linked it with > > > Sean's libpcap and it worked fine. I don't think we understand what you > > > mean by "not working". > > > > > > Murf > > > > > > I replaced linpcap.a which Sean sent with all libpcap.a files in my > > development and target machine. I recompiled and built the project yet I am > > > getting 8 packets every 1 ms while the packets are transmitted two every 250 > > > usec. > > > > Regards, > > Mohammad > > > You don't need to replace libpcap.a on target, it is only needed when you > linking. > Post the io-pkt-v4-hc you modified here and output of your application, if you > modified correctly it should be stamped with microsecond, not millisecond. > in bpf_deliver it will only call microtime once in a packet loop so that is > another guess. > > Murf: can you get different timestamp for flood packets? I do not know how to change d->bd_immediate to 1 in io-pkt-v4-hc. I attached my io-pkt-v4-hc Regards, Mohammad Fri, 31 Jul 2009 15:45:47 GMT http://community.qnx.com/sf/go/post35065 Mohammad Dadashzadeh(deleted) 2009-07-31T15:45:47Z post35064: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35064 > > Mohammad Dadashzadeh wrote: > > >>> I would like to get packets one by one. What should I do? > > >>> > > >>> Mohammad > > >>> > > >>> > > >>> > > >>> _______________________________________________ > > >>> > > >>> > > >>> > > >>> > > >> Sean sent you a libpcap.a that lets you enable immediate mode. That > > >> should be all you need. > > >> > > >> Murf > > >> > > > > > > > > > I did that, didn't work, even when I reboot my target machine it can not > > > connect to net anymore. > > > > > > Mohammad > > > > > I compiled the code you published on this thread and linked it with > > Sean's libpcap and it worked fine. I don't think we understand what you > > mean by "not working". > > > > Murf > > > I replaced linpcap.a which Sean sent with all libpcap.a files in my > development and target machine. I recompiled and built the project yet I am > getting 8 packets every 1 ms while the packets are transmitted two every 250 > usec. > > Regards, > Mohammad You don't need to replace libpcap.a on target, it is only needed when you linking. Post the io-pkt-v4-hc you modified here and output of your application, if you modified correctly it should be stamped with microsecond, not millisecond. in bpf_deliver it will only call microtime once in a packet loop so that is another guess. Murf: can you get different timestamp for flood packets? Fri, 31 Jul 2009 15:40:35 GMT http://community.qnx.com/sf/go/post35064 Yao Zhao(deleted) 2009-07-31T15:40:35Z post35063: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35063 > > > > > > > I would like to get packets one by one. What should I do? > > > > > > > > Mohammad > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > > Sean sent you a libpcap.a that lets you enable immediate mode. That > > > should be all you need. > > > > > > Murf > > > > > > I did that, didn't work, even when I reboot my target machine it can not > > connect to net anymore. > > > > Mohammad > > > Don't panic. > give me your source code(to make sure I can compile) and I can finish all for > you. that will save all of us time. Source code of packet capturing, it is attached. Fri, 31 Jul 2009 15:40:23 GMT http://community.qnx.com/sf/go/post35063 Mohammad Dadashzadeh(deleted) 2009-07-31T15:40:23Z post35062: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35062 > > Mohammad Dadashzadeh wrote: > > >>> I would like to get packets one by one. What should I do? > > >>> > > >>> Mohammad > > >>> > > >>> > > >>> > > >>> _______________________________________________ > > >>> > > >>> > > >>> > > >>> > > >> Sean sent you a libpcap.a that lets you enable immediate mode. That > > >> should be all you need. > > >> > > >> Murf > > >> > > > > > > > > > I did that, didn't work, even when I reboot my target machine it can not > > > connect to net anymore. > > > > > > Mohammad > > > > > I compiled the code you published on this thread and linked it with > > Sean's libpcap and it worked fine. I don't think we understand what you > > mean by "not working". > > > > Murf > > > I replaced linpcap.a which Sean sent with all libpcap.a files in my > development and target machine. I recompiled and built the project yet I am > getting 8 packets every 1 ms while the packets are transmitted two every 250 > usec. > > Regards, > Mohammad this is part of captured packets, compared to the packets shown in the first post I am getting 1 msec resolution. If I use Wireshark, it captures two packets almost every 250 msec. Thanks Mohammad 11:35:29,160460 len:121 11:35:29,160460 len:121 11:35:29,160460 len:121 11:35:29,160460 len:121 11:35:29,160460 len:121 11:35:29,160460 len:121 11:35:29,160460 len:121 11:35:29,160460 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,161459 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,162460 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,163459 len:121 11:35:29,164460 len:121 11:35:29,164460 len:121 11:35:29,164460 len:121 11:35:29,164460 len:121 Fri, 31 Jul 2009 15:36:29 GMT http://community.qnx.com/sf/go/post35062 Mohammad Dadashzadeh(deleted) 2009-07-31T15:36:29Z post35061: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35061 > Mohammad Dadashzadeh wrote: > >>> I would like to get packets one by one. What should I do? > >>> > >>> Mohammad > >>> > >>> > >>> > >>> _______________________________________________ > >>> > >>> > >>> > >>> > >> Sean sent you a libpcap.a that lets you enable immediate mode. That > >> should be all you need. > >> > >> Murf > >> > > > > > > I did that, didn't work, even when I reboot my target machine it can not > connect to net anymore. > > > > Mohammad > > > I compiled the code you published on this thread and linked it with > Sean's libpcap and it worked fine. I don't think we understand what you > mean by "not working". > > Murf I replaced linpcap.a which Sean sent with all libpcap.a files in my development and target machine. I recompiled and built the project yet I am getting 8 packets every 1 ms while the packets are transmitted two every 250 usec. Regards, Mohammad Fri, 31 Jul 2009 15:28:06 GMT http://community.qnx.com/sf/go/post35061 Mohammad Dadashzadeh(deleted) 2009-07-31T15:28:06Z post35060: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35060 On Fri, Jul 31, 2009 at 10:01:17AM -0400, Yao Zhao wrote: > > I would like to get packets one by one. What should I do? > > > > Mohammad > > > take a look at source of pcap_open_live, in pcap_open_live there is code for AIX how to call if (ioctl(p->fd, BIOCIMMEDIATE, &v) < 0) { > snprintf(ebuf, PCAP_ERRBUF_SIZE, "BIOCIMMEDIATE: %s", > pcap_strerror(errno)); > goto bad; > } > you need to find out how to get fd. > > another way probably you are ok now: still hack io-pkt-v4-hc, > if (d->bd_immediate || d->bd_state == BPF_TIMED_OUT) > /* > * Immediate mode is set, or the read timeout has > * already expired during a select call. A packet > * arrived, so the reader should be woken up. > */ > bpf_wakeup(d); > } > > disassembly io-pkt-v4-hc's catchpacket, change d->bd_immediate to 1 then you will always get packet one by one. > default it won't be set in pcap_open_alive as it is fox AIX. You can get the fd with pcap_fileno(), but I'm not convinced anymore that he want's to get packets one at a time. I think he's worried about the timestamp... -seanb Fri, 31 Jul 2009 15:27:01 GMT http://community.qnx.com/sf/go/post35060 Sean Boudreau(deleted) 2009-07-31T15:27:01Z post35059: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35059 Mohammad Dadashzadeh wrote: >>> I would like to get packets one by one. What should I do? >>> >>> Mohammad >>> >>> >>> >>> _______________________________________________ >>> >>> >>> >>> >> Sean sent you a libpcap.a that lets you enable immediate mode. That >> should be all you need. >> >> Murf >> > > > I did that, didn't work, even when I reboot my target machine it can not connect to net anymore. > > Mohammad > I compiled the code you published on this thread and linked it with Sean's libpcap and it worked fine. I don't think we understand what you mean by "not working". Murf Fri, 31 Jul 2009 15:24:14 GMT http://community.qnx.com/sf/go/post35059 John Murphy 2009-07-31T15:24:14Z post35058: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35058 I just installed QNX few days ago and I have not changed anything, I think the source is untouched and available in the QNX website. Am I right? Thanks alot, Mohammad Fri, 31 Jul 2009 15:23:18 GMT http://community.qnx.com/sf/go/post35058 Mohammad Dadashzadeh(deleted) 2009-07-31T15:23:18Z post35056: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35056 > -----Original Message----- > From: Yao Zhao [mailto:community-noreply@qnx.com] > Sent: Friday, July 31, 2009 11:19 AM > To: ionetmig-networking > Subject: Re: strange behavior of using pcap.h > > > > > > > > I would like to get packets one by one. What should I do? > > > > > > > > Mohammad > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > > Sean sent you a libpcap.a that lets you enable immediate mode. > That > > > should be all you need. > > > > > > Murf > > > > > > I did that, didn't work, even when I reboot my target machine it can > not > > connect to net anymore. > > > > Mohammad > > > Don't panic. > give me your source code(to make sure I can compile) and I can finish > all for you. that will save all of us time. I also have some source code that need fixing, can I send it to you? > > > > _______________________________________________ > > io-net migration > http://community.qnx.com/sf/go/post35055 > Fri, 31 Jul 2009 15:19:35 GMT http://community.qnx.com/sf/go/post35056 Mario Charest 2009-07-31T15:19:35Z post35055: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35055 > > > > > I would like to get packets one by one. What should I do? > > > > > > Mohammad > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > Sean sent you a libpcap.a that lets you enable immediate mode. That > > should be all you need. > > > > Murf > > > I did that, didn't work, even when I reboot my target machine it can not > connect to net anymore. > > Mohammad Don't panic. give me your source code(to make sure I can compile) and I can finish all for you. that will save all of us time. Fri, 31 Jul 2009 15:18:33 GMT http://community.qnx.com/sf/go/post35055 Yao Zhao(deleted) 2009-07-31T15:18:33Z post35050: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35050 > > > I would like to get packets one by one. What should I do? > > > > Mohammad > > > > > > > > _______________________________________________ > > > > > > > Sean sent you a libpcap.a that lets you enable immediate mode. That > should be all you need. > > Murf I did that, didn't work, even when I reboot my target machine it can not connect to net anymore. Mohammad Fri, 31 Jul 2009 15:02:39 GMT http://community.qnx.com/sf/go/post35050 Mohammad Dadashzadeh(deleted) 2009-07-31T15:02:39Z post35044: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35044 In this case I have to recompile io-pkt, am I write, I am not familiar with this procedure, any way to hack io-pkt-v4-hc why this is not optional in QNX, so user can determine what they want. Regards, Mohammad Fri, 31 Jul 2009 14:46:43 GMT http://community.qnx.com/sf/go/post35044 Mohammad Dadashzadeh(deleted) 2009-07-31T14:46:43Z post35043: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35043 On Fri, Jul 31, 2009 at 10:12:06AM -0400, John Murphy wrote: > > > I would like to get packets one by one. What should I do? > > > > Mohammad > > > > > > > > _______________________________________________ > > > > > > > Sean sent you a libpcap.a that lets you enable immediate mode. That > should be all you need. > I think that's the confusion in this thread. I think Mohammad's under the impression that the timestamp in the packet is when he's actually getting it. I'm not convinced anyore that the wait on the read() is the concern. If the timestamp on the packet is the primary sticking point the attached diff will get the resolution of the system clock which by default is 1ms. The system clock can then be changed with ClockPeriod() but I suspect 32us will be too much overhead. Regards, -seanb Fri, 31 Jul 2009 14:41:59 GMT http://community.qnx.com/sf/go/post35043 Sean Boudreau(deleted) 2009-07-31T14:41:59Z post35029: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35029 So the easiest way is to disassemble io-pkt-v4-hc's catchpacket, change d->bd_immediate to 1 then I will always get packet one by one. How can I disassemble io-pkt-v4-hc. Is there any software which can do the job for me. I am attaching my io-pkt-v4-hc. Could you do me a favor and change d->bd_immediate to 1. I think after this I am done and I can verify QNX for may application. Regards Mohammad Fri, 31 Jul 2009 14:13:02 GMT http://community.qnx.com/sf/go/post35029 Mohammad Dadashzadeh(deleted) 2009-07-31T14:13:02Z post35028: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35028 > I would like to get packets one by one. What should I do? > > Mohammad > > > > _______________________________________________ > > > Sean sent you a libpcap.a that lets you enable immediate mode. That should be all you need. Murf Fri, 31 Jul 2009 14:12:03 GMT http://community.qnx.com/sf/go/post35028 John Murphy 2009-07-31T14:12:03Z post35026: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35026 > I would like to get packets one by one. What should I do? > > Mohammad take a look at source of pcap_open_live, in pcap_open_live there is code for AIX how to call if (ioctl(p->fd, BIOCIMMEDIATE, &v) < 0) { snprintf(ebuf, PCAP_ERRBUF_SIZE, "BIOCIMMEDIATE: %s", pcap_strerror(errno)); goto bad; } you need to find out how to get fd. another way probably you are ok now: still hack io-pkt-v4-hc, if (d->bd_immediate || d->bd_state == BPF_TIMED_OUT) /* * Immediate mode is set, or the read timeout has * already expired during a select call. A packet * arrived, so the reader should be woken up. */ bpf_wakeup(d); } disassembly io-pkt-v4-hc's catchpacket, change d->bd_immediate to 1 then you will always get packet one by one. default it won't be set in pcap_open_alive as it is fox AIX. /* * Move the packet data from interface memory (pkt) into the * store buffer. Return 1 if it's time to wakeup a listener (buffer full), * otherwise 0. "copy" is the routine called to do the actual data * transfer. memcpy is passed in to copy contiguous chunks, while * bpf_mcpy is passed in to copy mbuf chains. In the latter case, * pkt is really an mbuf. */ static void catchpacket(struct bpf_d *d, u_char *pkt, u_int pktlen, u_int snaplen, void *(*cpfn)(void *, const void *, size_t), struct timeval *tv) { struct bpf_hdr *hp; int totlen, curlen; int hdrlen = d->bd_bif->bif_hdrlen; ++d->bd_ccount; ++bpf_gstats.bs_capt; /* * Figure out how many bytes to move. If the packet is * greater or equal to the snapshot length, transfer that * much. Otherwise, transfer the whole packet (unless * we hit the buffer size limit). */ totlen = hdrlen + min(snaplen, pktlen); if (totlen > d->bd_bufsize) totlen = d->bd_bufsize; /* * Round up the end of the previous packet to the next longword. */ curlen = BPF_WORDALIGN(d->bd_slen); if (curlen + totlen > d->bd_bufsize) { /* * This packet will overflow the storage buffer. * Rotate the buffers if we can, then wakeup any * pending reads. */ if (d->bd_fbuf == 0) { /* * We haven't completed the previous read yet, * so drop the packet. */ ++d->bd_dcount; ++bpf_gstats.bs_drop; return; } ROTATE_BUFFERS(d); bpf_wakeup(d); curlen = 0; } /* * Append the bpf header. */ hp = (struct bpf_hdr *)(d->bd_sbuf + curlen); hp->bh_tstamp = *tv; hp->bh_datalen = pktlen; hp->bh_hdrlen = hdrlen; /* * Copy the packet data into the store buffer and update its length. */ (*cpfn)((u_char *)hp + hdrlen, pkt, (hp->bh_caplen = totlen - hdrlen)); d->bd_slen = curlen + totlen; /* * Call bpf_wakeup after bd_slen has been updated so that kevent(2) * will cause filt_bpfread() to be called with it adjusted. */ if (d->bd_immediate || d->bd_state == BPF_TIMED_OUT) /* * Immediate mode is set, or the read timeout has * already expired during a select call. A packet * arrived, so the reader should be woken up. */ bpf_wakeup(d); } I suggest you read source as it is not difficult. that is why open source is popular and we publish source code. Fri, 31 Jul 2009 14:01:12 GMT http://community.qnx.com/sf/go/post35026 Yao Zhao(deleted) 2009-07-31T14:01:12Z post35016: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post35016 I would like to get packets one by one. What should I do? Mohammad Fri, 31 Jul 2009 13:30:27 GMT http://community.qnx.com/sf/go/post35016 Mohammad Dadashzadeh(deleted) 2009-07-31T13:30:27Z post34965: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34965 I learned how to hack io-pkt-v4-hc now the accuracy is 1msec, I am getting 8 packets per 1 msec How can I reduce that to 100usec or less Thanks, Mohammad Thu, 30 Jul 2009 20:38:37 GMT http://community.qnx.com/sf/go/post34965 Mohammad Dadashzadeh(deleted) 2009-07-30T20:38:37Z post34962: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34962 when I run pidin arg|grep io-pkt* it responses 114708 io-pkt-v4-hc -ptcpip 1220648 io-pkt* now am I using io-pkt-v4-hc? if yes, should I replace hacked version (io-pkt-v4) with (io-pkt-v4-hc) or with io-pkt-hc or should we hack io-pkt-v4-hc Regards, Mohammad Thu, 30 Jul 2009 19:28:14 GMT http://community.qnx.com/sf/go/post34962 Mohammad Dadashzadeh(deleted) 2009-07-30T19:28:14Z post34960: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34960 it is hacked then run this on your qnx target. run "pidin arg|grep io-pkt*" on your target find which io-pkt you are using and make sure you are replace it with this io-pkt-v4 not others. keep a copy! Thu, 30 Jul 2009 19:11:49 GMT http://community.qnx.com/sf/go/post34960 Yao Zhao(deleted) 2009-07-30T19:11:49Z post34959: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34959 there are two more similar files io-pkt-v4-hc io-pkt-v6-hc I could not find below in these files 0805ca45 <mtime>: 805ca45: 55 push %ebp 805ca46: 89 e5 mov %esp,%ebp 805ca48: 83 ec 28 sub $0x28,%esp 805ca4b: 89 5d f4 mov %ebx,-0xc(%ebp) 805ca4e: 89 75 f8 mov %esi,-0x8(%ebp) 805ca51: 89 7d fc mov %edi,-0x4(%ebp) 805ca54: 89 cf mov %ecx,%edi 805ca56: 85 d2 test %edx,%edx 805ca58: 0f 94 c0 sete %al 805ca5b: 0f b6 c0 movzbl %al,%eax 805ca5e: 89 04 24 mov %eax,(%esp) 805ca61: e8 a0 fe ff ff call 805c906 <currtime_nto> 805ca66: 89 c3 mov %eax,%ebx 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx 805ca6e: 89 d6 mov %edx,%esi 805ca70: 8b 15 4c 63 0c 08 mov 0x80c634c,%edx 805ca76: 31 f2 xor %esi,%edx 805ca78: a1 48 63 0c 08 mov 0x80c6348,%eax 805ca7d: 31 d8 xor %ebx,%eax 805ca7f: 09 c2 or %eax,%edx 805ca81: 74 6a je 805caed <mtime+0xa8> 0805ca45 <mtime>: 805ca45: 55 push %ebp 805ca46: 89 e5 mov %esp,%ebp 805ca48: 83 ec 28 sub $0x28,%esp 805ca4b: 89 5d f4 mov %ebx,-0xc(%ebp) 805ca4e: 89 75 f8 mov %esi,-0x8(%ebp) 805ca51: 89 7d fc mov %edi,-0x4(%ebp) 805ca54: 89 cf mov %ecx,%edi 805ca56: 85 d2 test %edx,%edx 805ca58: 0f 94 c0 sete %al 805ca5b: 0f b6 c0 movzbl %al,%eax 805ca5e: 89 04 24 mov %eax,(%esp) 805ca61: e8 a0 fe ff ff call 805c906 <currtime_nto> 805ca66: 89 c3 mov %eax,%ebx 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx 805ca6e: 89 d6 mov %edx,%esi 805ca70: 8b 15 4c 63 0c 08 mov 0x80c634c,%edx 805ca76: 31 f2 xor %esi,%edx 805ca78: a1 48 63 0c 08 mov 0x80c6348,%eax 805ca7d: 31 d8 xor %ebx,%eax 805ca7f: 09 c2 or %eax,%edx 805ca81: 74 6a je 805caed <mtime+0xa8> Thu, 30 Jul 2009 18:53:02 GMT http://community.qnx.com/sf/go/post34959 Mohammad Dadashzadeh(deleted) 2009-07-30T18:53:02Z post34957: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34957 I am using xvi32 to open the file it finds one mtime but the codes around it is completely different than what you mentioned above. I attached the file. Could you please modify this and send it for me. Regards, Mohammad Thu, 30 Jul 2009 18:31:59 GMT http://community.qnx.com/sf/go/post34957 Mohammad Dadashzadeh(deleted) 2009-07-30T18:31:59Z post34955: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34955 What software can open the file so I can edit it. Thanks Mohammad Thu, 30 Jul 2009 18:21:20 GMT http://community.qnx.com/sf/go/post34955 Mohammad Dadashzadeh(deleted) 2009-07-30T18:21:20Z post34949: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34949 > Should I sreach my QNX nto machine or development machine. In which file > should I exactly search > > Regards, > Mohammad If you mean source code then take a look the source tree: trunk/sys/current_time.c or tags/GA/6.4.0/sys... if you mean binary, I refer io-pkt-v4. On you development machine, ntox86-objdump -d $QNX_TARGET/x86/sbin/io-pkt-v4 to find <mtime>: If you can do this on your nto machine(target?) it would be better. Thu, 30 Jul 2009 17:32:44 GMT http://community.qnx.com/sf/go/post34949 Yao Zhao(deleted) 2009-07-30T17:32:44Z post34944: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34944 Should I sreach my QNX nto machine or development machine. In which file should I exactly search Regards, Mohammad Thu, 30 Jul 2009 17:13:00 GMT http://community.qnx.com/sf/go/post34944 Mohammad Dadashzadeh(deleted) 2009-07-30T17:13:00Z post34942: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34942 > > 0805ca45 <mtime>: > > 805ca45: 55 push %ebp > > 805ca46: 89 e5 mov %esp,%ebp > > 805ca48: 83 ec 28 sub $0x28,%esp > > 805ca4b: 89 5d f4 mov %ebx,-0xc(%ebp) > > 805ca4e: 89 75 f8 mov %esi,-0x8(%ebp) > > 805ca51: 89 7d fc mov %edi,-0x4(%ebp) > > 805ca54: 89 cf mov %ecx,%edi > > 805ca56: 85 d2 test %edx,%edx > > 805ca58: 0f 94 c0 sete %al > > 805ca5b: 0f b6 c0 movzbl %al,%eax > > 805ca5e: 89 04 24 mov %eax,(%esp) > > 805ca61: e8 a0 fe ff ff call 805c906 <currtime_nto> > > 805ca66: 89 c3 mov %eax,%ebx > > 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx > > 805ca6e: 89 d6 mov %edx,%esi > > 805ca70: 8b 15 4c 63 0c 08 mov 0x80c634c,%edx > > 805ca76: 31 f2 xor %esi,%edx > > 805ca78: a1 48 63 0c 08 mov 0x80c6348,%eax > > 805ca7d: 31 d8 xor %ebx,%eax > > 805ca7f: 09 c2 or %eax,%edx > > 805ca81: 74 6a je 805caed <mtime+0xa8> > > 0805ca45 <mtime>: > > 805ca45: 55 push %ebp > > 805ca46: 89 e5 mov %esp,%ebp > > 805ca48: 83 ec 28 sub $0x28,%esp > > 805ca4b: 89 5d f4 mov %ebx,-0xc(%ebp) > > 805ca4e: 89 75 f8 mov %esi,-0x8(%ebp) > > 805ca51: 89 7d fc mov %edi,-0x4(%ebp) > > 805ca54: 89 cf mov %ecx,%edi > > 805ca56: 85 d2 test %edx,%edx > > 805ca58: 0f 94 c0 sete %al > > 805ca5b: 0f b6 c0 movzbl %al,%eax > > 805ca5e: 89 04 24 mov %eax,(%esp) > > 805ca61: e8 a0 fe ff ff call 805c906 <currtime_nto> > > 805ca66: 89 c3 mov %eax,%ebx > > 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx > > 805ca6e: 89 d6 mov %edx,%esi > > 805ca70: 8b 15 4c 63 0c 08 mov 0x80c634c,%edx > > 805ca76: 31 f2 xor %esi,%edx > > 805ca78: a1 48 63 0c 08 mov 0x80c6348,%eax > > 805ca7d: 31 d8 xor %ebx,%eax > > 805ca7f: 09 c2 or %eax,%edx > > 805ca81: 74 6a je 805caed <mtime+0xa8> > > > > Here curtick = cur & ~((1 << NTO_TSHIFT) -1); so it is rounding to tick. > > You can change it to curtick = cur & ~(1024-1) then you will get microsend precision not tick any more. > > so hack io-pkt-*(you don't need to recompile) and find the address > > 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx > > and change 00 00 80 ff to 0xfffffc00(00 fc ff ff) > > > > static void > > mtime(int get, int up, struct timeval *tv) > > { > > static uint64_t mtlast; > > static struct timeval mt_tv; > > uint64_t cur, curtick; > > > > /* > > * See comments in <sys/timevar.h>. 'get' variants > > * are allowed to return a less precise result. > > */ > > > > cur = currtime_nto(!up); > > curtick = cur & ~((1 << NTO_TSHIFT) -1); > > > > if (1 /* get */) { > > /* > > * Try to only do the 64 bit division every tick. > > * Makes microtime() not so micro... > > */ > > if (mtlast != curtick) { > > mtlast = curtick; > > mt_tv.tv_sec = mtlast / 1000000000; > > mt_tv.tv_usec = (mtlast % 1000000000) / 1000; > > } > > } > > else { > > mtlast = curtick; > > mt_tv.tv_sec = cur / 1000000000; > > mt_tv.tv_usec = (cur % 1000000000) / 1000; > > } > > > I am bigginer, In which file I can file this assembly code? > Mohammad > if you want to recompile: it is in io-pkt's source tree: sys/current_time.c:mtime. if you don't know about elf format, then use a hex editor to search machine code, if you only find once then you find it, if not then search longer machine code. > > 805ca5e: 89 04 24 mov %eax,(%esp) > > 805ca61: e8 a0 fe ff ff call 805c906 <currtime_nto> > > 805ca66: 89 c3 mov %eax,%ebx > > 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx > > 805ca6e: 89 d6 mov %edx,%esi > > 805ca70: 8b 15 4c 63 0c 08 mov 0x80c634c,%edx > > 805ca76: 31 f2 xor %esi,%edx > > 805ca78: a1 48 63 0c 08 mov 0x80c6348,%eax Thu, 30 Jul 2009 16:58:52 GMT http://community.qnx.com/sf/go/post34942 Yao Zhao(deleted) 2009-07-30T16:58:52Z post34939: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34939 Where can I find this mtime function to modify it? Mohammad Thu, 30 Jul 2009 16:45:08 GMT http://community.qnx.com/sf/go/post34939 Mohammad Dadashzadeh(deleted) 2009-07-30T16:45:08Z post34936: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34936 > 0805ca45 <mtime>: > 805ca45: 55 push %ebp > 805ca46: 89 e5 mov %esp,%ebp > 805ca48: 83 ec 28 sub $0x28,%esp > 805ca4b: 89 5d f4 mov %ebx,-0xc(%ebp) > 805ca4e: 89 75 f8 mov %esi,-0x8(%ebp) > 805ca51: 89 7d fc mov %edi,-0x4(%ebp) > 805ca54: 89 cf mov %ecx,%edi > 805ca56: 85 d2 test %edx,%edx > 805ca58: 0f 94 c0 sete %al > 805ca5b: 0f b6 c0 movzbl %al,%eax > 805ca5e: 89 04 24 mov %eax,(%esp) > 805ca61: e8 a0 fe ff ff call 805c906 <currtime_nto> > 805ca66: 89 c3 mov %eax,%ebx > 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx > 805ca6e: 89 d6 mov %edx,%esi > 805ca70: 8b 15 4c 63 0c 08 mov 0x80c634c,%edx > 805ca76: 31 f2 xor %esi,%edx > 805ca78: a1 48 63 0c 08 mov 0x80c6348,%eax > 805ca7d: 31 d8 xor %ebx,%eax > 805ca7f: 09 c2 or %eax,%edx > 805ca81: 74 6a je 805caed <mtime+0xa8> > 0805ca45 <mtime>: > 805ca45: 55 push %ebp > 805ca46: 89 e5 mov %esp,%ebp > 805ca48: 83 ec 28 sub $0x28,%esp > 805ca4b: 89 5d f4 mov %ebx,-0xc(%ebp) > 805ca4e: 89 75 f8 mov %esi,-0x8(%ebp) > 805ca51: 89 7d fc mov %edi,-0x4(%ebp) > 805ca54: 89 cf mov %ecx,%edi > 805ca56: 85 d2 test %edx,%edx > 805ca58: 0f 94 c0 sete %al > 805ca5b: 0f b6 c0 movzbl %al,%eax > 805ca5e: 89 04 24 mov %eax,(%esp) > 805ca61: e8 a0 fe ff ff call 805c906 <currtime_nto> > 805ca66: 89 c3 mov %eax,%ebx > 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx > 805ca6e: 89 d6 mov %edx,%esi > 805ca70: 8b 15 4c 63 0c 08 mov 0x80c634c,%edx > 805ca76: 31 f2 xor %esi,%edx > 805ca78: a1 48 63 0c 08 mov 0x80c6348,%eax > 805ca7d: 31 d8 xor %ebx,%eax > 805ca7f: 09 c2 or %eax,%edx > 805ca81: 74 6a je 805caed <mtime+0xa8> > > Here curtick = cur & ~((1 << NTO_TSHIFT) -1); so it is rounding to tick. > You can change it to curtick = cur & ~(1024-1) then you will get microsend precision not tick any more. > so hack io-pkt-*(you don't need to recompile) and find the address > 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx > and change 00 00 80 ff to 0xfffffc00(00 fc ff ff) > > static void > mtime(int get, int up, struct timeval *tv) > { > static uint64_t mtlast; > static struct timeval mt_tv; > uint64_t cur, curtick; > > /* > * See comments in <sys/timevar.h>. 'get' variants > * are allowed to return a less precise result. > */ > > cur = currtime_nto(!up); > curtick = cur & ~((1 << NTO_TSHIFT) -1); > > if (1 /* get */) { > /* > * Try to only do the 64 bit division every tick. > * Makes microtime() not so micro... > */ > if (mtlast != curtick) { > mtlast = curtick; > mt_tv.tv_sec = mtlast / 1000000000; > mt_tv.tv_usec = (mtlast % 1000000000) / 1000; > } > } > else { > mtlast = curtick; > mt_tv.tv_sec = cur / 1000000000; > mt_tv.tv_usec = (cur % 1000000000) / 1000; > } I am bigginer, In which file I can file this assembly code? Mohammad Thu, 30 Jul 2009 16:34:55 GMT http://community.qnx.com/sf/go/post34936 Mohammad Dadashzadeh(deleted) 2009-07-30T16:34:55Z post34935: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34935 Or change the 'if (1 /* get */)' to 'if (get)'. > > Here curtick = cur & ~((1 << NTO_TSHIFT) -1); so it is rounding to tick. > You can change it to curtick = cur & ~(1024-1) then you will get microsend precision not tick any more. > so hack io-pkt-*(you don't need to recompile) and find the address > 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx > and change 00 00 80 ff to 0xfffffc00(00 fc ff ff) > > static void > mtime(int get, int up, struct timeval *tv) > { > static uint64_t mtlast; > static struct timeval mt_tv; > uint64_t cur, curtick; > > /* > * See comments in <sys/timevar.h>. 'get' variants > * are allowed to return a less precise result. > */ > > cur = currtime_nto(!up); > curtick = cur & ~((1 << NTO_TSHIFT) -1); > > if (1 /* get */) { > /* > * Try to only do the 64 bit division every tick. > * Makes microtime() not so micro... > */ > if (mtlast != curtick) { > mtlast = curtick; > mt_tv.tv_sec = mtlast / 1000000000; > mt_tv.tv_usec = (mtlast % 1000000000) / 1000; > } > } > else { > mtlast = curtick; > mt_tv.tv_sec = cur / 1000000000; > mt_tv.tv_usec = (cur % 1000000000) / 1000; > } > > > > > _______________________________________________ > > io-net migration > http://community.qnx.com/sf/go/post34926 > Thu, 30 Jul 2009 16:25:33 GMT http://community.qnx.com/sf/go/post34935 Sean Boudreau(deleted) 2009-07-30T16:25:33Z post34926: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34926 0805ca45 <mtime>: 805ca45: 55 push %ebp 805ca46: 89 e5 mov %esp,%ebp 805ca48: 83 ec 28 sub $0x28,%esp 805ca4b: 89 5d f4 mov %ebx,-0xc(%ebp) 805ca4e: 89 75 f8 mov %esi,-0x8(%ebp) 805ca51: 89 7d fc mov %edi,-0x4(%ebp) 805ca54: 89 cf mov %ecx,%edi 805ca56: 85 d2 test %edx,%edx 805ca58: 0f 94 c0 sete %al 805ca5b: 0f b6 c0 movzbl %al,%eax 805ca5e: 89 04 24 mov %eax,(%esp) 805ca61: e8 a0 fe ff ff call 805c906 <currtime_nto> 805ca66: 89 c3 mov %eax,%ebx 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx 805ca6e: 89 d6 mov %edx,%esi 805ca70: 8b 15 4c 63 0c 08 mov 0x80c634c,%edx 805ca76: 31 f2 xor %esi,%edx 805ca78: a1 48 63 0c 08 mov 0x80c6348,%eax 805ca7d: 31 d8 xor %ebx,%eax 805ca7f: 09 c2 or %eax,%edx 805ca81: 74 6a je 805caed <mtime+0xa8> 0805ca45 <mtime>: 805ca45: 55 push %ebp 805ca46: 89 e5 mov %esp,%ebp 805ca48: 83 ec 28 sub $0x28,%esp 805ca4b: 89 5d f4 mov %ebx,-0xc(%ebp) 805ca4e: 89 75 f8 mov %esi,-0x8(%ebp) 805ca51: 89 7d fc mov %edi,-0x4(%ebp) 805ca54: 89 cf mov %ecx,%edi 805ca56: 85 d2 test %edx,%edx 805ca58: 0f 94 c0 sete %al 805ca5b: 0f b6 c0 movzbl %al,%eax 805ca5e: 89 04 24 mov %eax,(%esp) 805ca61: e8 a0 fe ff ff call 805c906 <currtime_nto> 805ca66: 89 c3 mov %eax,%ebx 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx 805ca6e: 89 d6 mov %edx,%esi 805ca70: 8b 15 4c 63 0c 08 mov 0x80c634c,%edx 805ca76: 31 f2 xor %esi,%edx 805ca78: a1 48 63 0c 08 mov 0x80c6348,%eax 805ca7d: 31 d8 xor %ebx,%eax 805ca7f: 09 c2 or %eax,%edx 805ca81: 74 6a je 805caed <mtime+0xa8> Here curtick = cur & ~((1 << NTO_TSHIFT) -1); so it is rounding to tick. You can change it to curtick = cur & ~(1024-1) then you will get microsend precision not tick any more. so hack io-pkt-*(you don't need to recompile) and find the address 805ca68: 81 e3 00 00 80 ff and $0xff800000,%ebx and change 00 00 80 ff to 0xfffffc00(00 fc ff ff) static void mtime(int get, int up, struct timeval *tv) { static uint64_t mtlast; static struct timeval mt_tv; uint64_t cur, curtick; /* * See comments in <sys/timevar.h>. 'get' variants * are allowed to return a less precise result. */ cur = currtime_nto(!up); curtick = cur & ~((1 << NTO_TSHIFT) -1); if (1 /* get */) { /* * Try to only do the 64 bit division every tick. * Makes microtime() not so micro... */ if (mtlast != curtick) { mtlast = curtick; mt_tv.tv_sec = mtlast / 1000000000; mt_tv.tv_usec = (mtlast % 1000000000) / 1000; } } else { mtlast = curtick; mt_tv.tv_sec = cur / 1000000000; mt_tv.tv_usec = (cur % 1000000000) / 1000; } Thu, 30 Jul 2009 15:44:56 GMT http://community.qnx.com/sf/go/post34926 Yao Zhao(deleted) 2009-07-30T15:44:56Z post34869: Re: Move from devn-mpc85xx.so to devnp-mpc85xx.so: how to keep the device name http://community.qnx.com/sf/go/post34869 Hi Sean, This is how I invoke it # /sbin/io-pkt-v4 -p tcpip rx_prio=250 # mount -T io-pkt -o "mac=04000000002a,verbose=10" /home/schen/devnp-mpc85xx.so I am not sure what I did wrong, I tried both ways, both not work # /sbin/io-pkt-v4 -p tcpip rx_prio=250 name=en => does not work # mount -T io-pkt -o "mac=04000000002a,name=en,verbose=10" /home/schen/devnp-mpc85xx.so mount: Can't mount / (type io-pkt) mount: Possible reason: Invalid argument Regards, Sherry Thu, 30 Jul 2009 03:22:35 GMT http://community.qnx.com/sf/go/post34869 Sherry Chen 2009-07-30T03:22:35Z post34866: Re: Move from devn-mpc85xx.so to devnp-mpc85xx.so: how to keep the device name http://community.qnx.com/sf/go/post34866 On Wed, Jul 29, 2009 at 10:35:20PM -0400, Sherry Chen wrote: > Hi, > > I am migrating from io-net/shim/devn-mpc85xx.so to io-pkt/devnp-mpc85xx.so > > > #1 For io-net the device names en0, en1, en2, en3 > #2 To open device /dev/io-net/en0 ... etc > > #3 For io-pkt the device names tsec0, tsec1, .. > > Question: > #4 how to tell io-pkt to use the same name convention, so that both #1 and #2 will work. > #5 If #4 is not possible, I do I open device for #3 > I could not find /dev/tsec0 or /dev/io-pkt/tsec0 > > You can change the name with the 'name=foo' option to the driver: io-pkt -d tsec name=foo Native drivers don't put entries in the namespace as mentioned here: http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/IoNet_migration What do you want to do on /dev/io-net/foo? There's probably another method. Regards, -seanb Thu, 30 Jul 2009 02:45:54 GMT http://community.qnx.com/sf/go/post34866 Sean Boudreau(deleted) 2009-07-30T02:45:54Z post34865: Move from devn-mpc85xx.so to devnp-mpc85xx.so: how to keep the device name http://community.qnx.com/sf/go/post34865 Hi, I am migrating from io-net/shim/devn-mpc85xx.so to io-pkt/devnp-mpc85xx.so #1 For io-net the device names en0, en1, en2, en3 #2 To open device /dev/io-net/en0 ... etc #3 For io-pkt the device names tsec0, tsec1, .. Question: #4 how to tell io-pkt to use the same name convention, so that both #1 and #2 will work. #5 If #4 is not possible, I do I open device for #3 I could not find /dev/tsec0 or /dev/io-pkt/tsec0 Appreciate a quick answer. Thanks, Sherry Thu, 30 Jul 2009 02:35:19 GMT http://community.qnx.com/sf/go/post34865 Sherry Chen 2009-07-30T02:35:19Z post34855: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34855 > > On Wed, Jul 29, 2009 at 03:46:36PM -0400, Mohammad Dadashzadeh wrote: > > > > On Wed, Jul 29, 2009 at 03:36:31PM -0400, Mohammad Dadashzadeh wrote: > > > > > > > > > > Description Resource Path Location Type > > > > > make[2]: *** [C:/ide-4.6-workspace/newPacketcap/x86/o-g/newPacketcap_g > ] > > > > > > Error 1 newPacketcap line 0 C/C++ Problem > > > > > > > > Hmm, try this one. > > > > > > > > -seanb > > > > > > > > > I tried , no error but I am getting 64-65 packets every 8.3 msec. > > > > > > > You changed the timeout to a negative value? > > > > -seanb > > > yes handle = pcap_open_live(dev, 1000, 1, -1, errbuf); > Whatever I put as to_ms, there is no change in interval of reading packets. Mohammad Wed, 29 Jul 2009 20:14:48 GMT http://community.qnx.com/sf/go/post34855 Mohammad Dadashzadeh(deleted) 2009-07-29T20:14:48Z post34850: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34850 > On Wed, Jul 29, 2009 at 03:46:36PM -0400, Mohammad Dadashzadeh wrote: > > > On Wed, Jul 29, 2009 at 03:36:31PM -0400, Mohammad Dadashzadeh wrote: > > > > > > > > Description Resource Path Location Type > > > > make[2]: *** [C:/ide-4.6-workspace/newPacketcap/x86/o-g/newPacketcap_g] > > > > Error 1 newPacketcap line 0 C/C++ Problem > > > > > > Hmm, try this one. > > > > > > -seanb > > > > > > I tried , no error but I am getting 64-65 packets every 8.3 msec. > > > > You changed the timeout to a negative value? > > -seanb yes handle = pcap_open_live(dev, 1000, 1, -1, errbuf); #include <pcap.h> #include <stdio.h> #include <string.h> #include <time.h> #include <sys/netmgr.h> #include <sys/neutrino.h> int main(int argc, char *argv[]) { pcap_t *handle; /* Session handle */ char *dev; /* The device to sniff on */ pcap_if_t *alldevs; pcap_if_t *d; char errbuf[PCAP_ERRBUF_SIZE]; /* Error string */ struct bpf_program fp; /* The compiled filter */ bpf_u_int32 mask; /* Our netmask */ bpf_u_int32 net; /* Our IP */ struct pcap_pkthdr header; /* The header that pcap gives us */ const u_char *packet; /* The actual packet */ time_t local_tv_sec; struct tm *ltime; int i=0; char timestr[16]; int inum; FILE *stream1; //const u_char *packet; /* Retrieve the device list on the local machine */ if (pcap_findalldevs(&alldevs, errbuf) == -1) { fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); exit(1); } stream1=fopen("test2.txt","w"); /* Print the list */ for(d=alldevs; d; d=d->next) { printf("%d. %s", ++i, d->name); if (d->description) printf(" (%s)\n", d->description); else printf(" (No description available)\n"); } if(i==0) { printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); return -1; } printf("Enter the interface number (1-%d):",i); //scanf("%d", &inum); inum=1; if(inum < 1 || inum > i) { printf("\nInterface number out of range.\n"); /* Free the device list */ pcap_freealldevs(alldevs); return -1; } /* Jump to the selected adapter */ for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); /* Define the device */ dev = pcap_lookupdev(errbuf); strcpy(dev,"wm0"); if (dev == NULL) { fprintf(stderr, "Couldn't find default device: %s\n", errbuf); return(2); } /* Find the properties for the device */ if (pcap_lookupnet(dev, &net, &mask, errbuf) == -1) { fprintf(stderr, "Couldn't get netmask for device %s: %s\n", dev, errbuf); net = 0; mask = 0; } /* Open the session in promiscuous mode */ handle = pcap_open_live(dev, 1000, 1, -1, errbuf); if (handle == NULL) { fprintf(stderr, "Couldn't open device %s: %s\n", errbuf); return(2); } /* Grab a packet */ //packet = pcap_next(handle, &header); for(i=0;i<32000;i++) { packet=pcap_next(handle, &header); local_tv_sec = header.ts.tv_sec; ltime=localtime(&local_tv_sec); strftime( timestr, sizeof(timestr), "%H:%M:%S", ltime); fprintf(stream1,"%s,%.6d len:%d\n", timestr, header.ts.tv_usec, header.len); } /* Print its length */ //printf("Jacked a packet with length of [%d]\n", header.len); /* And close the session */ pcap_close(handle); fclose(stream1); printf("\n done"); return(0); } Wed, 29 Jul 2009 19:53:41 GMT http://community.qnx.com/sf/go/post34850 Mohammad Dadashzadeh(deleted) 2009-07-29T19:53:41Z post34849: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34849 On Wed, Jul 29, 2009 at 03:46:36PM -0400, Mohammad Dadashzadeh wrote: > > On Wed, Jul 29, 2009 at 03:36:31PM -0400, Mohammad Dadashzadeh wrote: > > > > > > Description Resource Path Location Type > > > make[2]: *** [C:/ide-4.6-workspace/newPacketcap/x86/o-g/newPacketcap_g] > > Error 1 newPacketcap line 0 C/C++ Problem > > > > Hmm, try this one. > > > > -seanb > > > I tried , no error but I am getting 64-65 packets every 8.3 msec. > You changed the timeout to a negative value? -seanb Wed, 29 Jul 2009 19:49:24 GMT http://community.qnx.com/sf/go/post34849 Sean Boudreau(deleted) 2009-07-29T19:49:24Z post34848: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34848 > On Wed, Jul 29, 2009 at 03:36:31PM -0400, Mohammad Dadashzadeh wrote: > > > > Description Resource Path Location Type > > make[2]: *** [C:/ide-4.6-workspace/newPacketcap/x86/o-g/newPacketcap_g] > Error 1 newPacketcap line 0 C/C++ Problem > > Hmm, try this one. > > -seanb I tried , no error but I am getting 64-65 packets every 8.3 msec. Mohammad Wed, 29 Jul 2009 19:46:36 GMT http://community.qnx.com/sf/go/post34848 Mohammad Dadashzadeh(deleted) 2009-07-29T19:46:36Z post34845: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34845 On Wed, Jul 29, 2009 at 03:36:31PM -0400, Mohammad Dadashzadeh wrote: > > Description Resource Path Location Type > make[2]: *** [C:/ide-4.6-workspace/newPacketcap/x86/o-g/newPacketcap_g] Error 1 newPacketcap line 0 C/C++ Problem Hmm, try this one. -seanb Wed, 29 Jul 2009 19:40:37 GMT http://community.qnx.com/sf/go/post34845 Sean Boudreau(deleted) 2009-07-29T19:40:37Z post34844: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34844 > On Wed, Jul 29, 2009 at 03:20:29PM -0400, Mohammad Dadashzadeh wrote: > > > On Wed, Jul 29, 2009 at 03:06:56PM -0400, Mohammad Dadashzadeh wrote: > > > > > On Wed, Jul 29, 2009 at 01:12:48PM -0400, Mohammad Dadashzadeh wrote: > > > > > > in which file I can change BIOCIMMEDIATE ? > > > > > > > > > > Please try this libpcap. By default it should > > > > > work the same way, if you pass a negative timeout > > > > > to pcap_open_live() you should get immediate mode. > > > > > If you can verify both I'll check it in. > > > > > > > > > > Regards, > > > > > > > > > > -seanb > > > > > > > > > > > > Should copy libpcap.a into the target machine or Momentics IDE or both? > > > > > > BTW that was an x86 static variant. > > > > > > -seanb > > > > > > Unfortunately I do not understand "BTW that was an x86 static variant" > > > > Could you please explain more? > > > > I copied into C:\QNX641\target\qnx6\x86\usr\lib but code can not ve compiled > . It shows many error. > > What are the errors? > > -seanb Description Resource Path Location Type make[2]: *** [C:/ide-4.6-workspace/newPacketcap/x86/o-g/newPacketcap_g] Error 1 newPacketcap line 0 C/C++ Problem make[2]: *** [C:/ide-4.6-workspace/newPacketcap/x86/o/newPacketcap] Error 1 newPacketcap line 0 C/C++ Problem newPacketcap.c: undefined reference to `pcap_close' newPacketcap line 0 C/C++ Problem newPacketcap.c: undefined reference to `pcap_findalldevs' newPacketcap line 0 C/C++ Problem newPacketcap.c: undefined reference to `pcap_freealldevs' newPacketcap line 0 C/C++ Problem newPacketcap.c: undefined reference to `pcap_lookupdev' newPacketcap line 0 C/C++ Problem newPacketcap.c: undefined reference to `pcap_lookupnet' newPacketcap line 0 C/C++ Problem newPacketcap.c: undefined reference to `pcap_next' newPacketcap line 0 C/C++ Problem newPacketcap.c: undefined reference to `pcap_open_live' newPacketcap line 0 C/C++ Problem undefined reference to `pcap_close' newPacketcap.c newPacketcap line 109 C/C++ Problem undefined reference to `pcap_findalldevs' newPacketcap.c newPacketcap line 32 C/C++ Problem undefined reference to `pcap_freealldevs' newPacketcap.c newPacketcap line 65 C/C++ Problem undefined reference to `pcap_lookupdev' newPacketcap.c newPacketcap line 75 C/C++ Problem undefined reference to `pcap_lookupnet' newPacketcap.c newPacketcap line 82 C/C++ Problem undefined reference to `pcap_next' newPacketcap.c newPacketcap line 100 C/C++ Problem undefined reference to `pcap_open_live' newPacketcap.c newPacketcap line 88 C/C++ Problem Wed, 29 Jul 2009 19:36:31 GMT http://community.qnx.com/sf/go/post34844 Mohammad Dadashzadeh(deleted) 2009-07-29T19:36:31Z post34842: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34842 On Wed, Jul 29, 2009 at 03:20:29PM -0400, Mohammad Dadashzadeh wrote: > > On Wed, Jul 29, 2009 at 03:06:56PM -0400, Mohammad Dadashzadeh wrote: > > > > On Wed, Jul 29, 2009 at 01:12:48PM -0400, Mohammad Dadashzadeh wrote: > > > > > in which file I can change BIOCIMMEDIATE ? > > > > > > > > Please try this libpcap. By default it should > > > > work the same way, if you pass a negative timeout > > > > to pcap_open_live() you should get immediate mode. > > > > If you can verify both I'll check it in. > > > > > > > > Regards, > > > > > > > > -seanb > > > > > > > > > Should copy libpcap.a into the target machine or Momentics IDE or both? > > > > BTW that was an x86 static variant. > > > > -seanb > > > Unfortunately I do not understand "BTW that was an x86 static variant" > > Could you please explain more? > > I copied into C:\QNX641\target\qnx6\x86\usr\lib but code can not ve compiled. It shows many error. What are the errors? -seanb Wed, 29 Jul 2009 19:22:57 GMT http://community.qnx.com/sf/go/post34842 Sean Boudreau(deleted) 2009-07-29T19:22:57Z post34841: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34841 > On Wed, Jul 29, 2009 at 03:06:56PM -0400, Mohammad Dadashzadeh wrote: > > > On Wed, Jul 29, 2009 at 01:12:48PM -0400, Mohammad Dadashzadeh wrote: > > > > in which file I can change BIOCIMMEDIATE ? > > > > > > Please try this libpcap. By default it should > > > work the same way, if you pass a negative timeout > > > to pcap_open_live() you should get immediate mode. > > > If you can verify both I'll check it in. > > > > > > Regards, > > > > > > -seanb > > > > > > Should copy libpcap.a into the target machine or Momentics IDE or both? > > BTW that was an x86 static variant. > > -seanb Unfortunately I do not understand "BTW that was an x86 static variant" Could you please explain more? I copied into C:\QNX641\target\qnx6\x86\usr\lib but code can not ve compiled. It shows many error. Regards, Mohammad Wed, 29 Jul 2009 19:20:27 GMT http://community.qnx.com/sf/go/post34841 Mohammad Dadashzadeh(deleted) 2009-07-29T19:20:27Z post34840: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34840 On Wed, Jul 29, 2009 at 03:06:56PM -0400, Mohammad Dadashzadeh wrote: > > On Wed, Jul 29, 2009 at 01:12:48PM -0400, Mohammad Dadashzadeh wrote: > > > in which file I can change BIOCIMMEDIATE ? > > > > Please try this libpcap. By default it should > > work the same way, if you pass a negative timeout > > to pcap_open_live() you should get immediate mode. > > If you can verify both I'll check it in. > > > > Regards, > > > > -seanb > > > Should copy libpcap.a into the target machine or Momentics IDE or both? BTW that was an x86 static variant. -seanb Wed, 29 Jul 2009 19:14:53 GMT http://community.qnx.com/sf/go/post34840 Sean Boudreau(deleted) 2009-07-29T19:14:53Z post34839: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34839 On Wed, Jul 29, 2009 at 03:06:56PM -0400, Mohammad Dadashzadeh wrote: > > On Wed, Jul 29, 2009 at 01:12:48PM -0400, Mohammad Dadashzadeh wrote: > > > in which file I can change BIOCIMMEDIATE ? > > > > Please try this libpcap. By default it should > > work the same way, if you pass a negative timeout > > to pcap_open_live() you should get immediate mode. > > If you can verify both I'll check it in. > > > > Regards, > > > > -seanb > > > Should copy libpcap.a into the target machine or Momentics IDE or both? Just link against it via your favourite method. It's not needed at runtime as it's a static variant. I'm trying to 'bring the mountain to Mohammad' but as I'm not at your build environment I can't be more specific than that :) -seanb Wed, 29 Jul 2009 19:13:15 GMT http://community.qnx.com/sf/go/post34839 Sean Boudreau(deleted) 2009-07-29T19:13:15Z post34838: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34838 > On Wed, Jul 29, 2009 at 01:12:48PM -0400, Mohammad Dadashzadeh wrote: > > in which file I can change BIOCIMMEDIATE ? > > Please try this libpcap. By default it should > work the same way, if you pass a negative timeout > to pcap_open_live() you should get immediate mode. > If you can verify both I'll check it in. > > Regards, > > -seanb Should copy libpcap.a into the target machine or Momentics IDE or both? Wed, 29 Jul 2009 19:06:55 GMT http://community.qnx.com/sf/go/post34838 Mohammad Dadashzadeh(deleted) 2009-07-29T19:06:55Z post34836: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34836 On Wed, Jul 29, 2009 at 01:12:48PM -0400, Mohammad Dadashzadeh wrote: > in which file I can change BIOCIMMEDIATE ? Please try this libpcap. By default it should work the same way, if you pass a negative timeout to pcap_open_live() you should get immediate mode. If you can verify both I'll check it in. Regards, -seanb Wed, 29 Jul 2009 18:48:26 GMT http://community.qnx.com/sf/go/post34836 Sean Boudreau(deleted) 2009-07-29T18:48:26Z post34829: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34829 > I guess I probably didn't reply on the proper leaf > on the thread. I'm talking about the delay in > replying to the read(). I can't see that the timestamp > here is used for anything but you're right in that > it's not all that granular. > > Regards, > > -seanb I think I may have missed the whole point of this thread! I thought the concern was for the lack of granularity, as evidenced by the printed timestamps. Murf Wed, 29 Jul 2009 18:12:23 GMT http://community.qnx.com/sf/go/post34829 John Murphy 2009-07-29T18:12:23Z post34823: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34823 Where is mtime? how can I change it? Wed, 29 Jul 2009 17:13:39 GMT http://community.qnx.com/sf/go/post34823 Mohammad Dadashzadeh(deleted) 2009-07-29T17:13:39Z post34822: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34822 in which file I can change BIOCIMMEDIATE ? Regards, Mohammad Wed, 29 Jul 2009 17:12:47 GMT http://community.qnx.com/sf/go/post34822 Mohammad Dadashzadeh(deleted) 2009-07-29T17:12:47Z post34821: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34821 On Wed, Jul 29, 2009 at 01:03:04PM -0400, John Murphy wrote: > Sean, are we talking about the resolution of the timestamps, or how often pcap satisfies a read request? I guess I probably didn't reply on the proper leaf on the thread. I'm talking about the delay in replying to the read(). I can't see that the timestamp here is used for anything but you're right in that it's not all that granular. Regards, -seanb Wed, 29 Jul 2009 17:11:47 GMT http://community.qnx.com/sf/go/post34821 Sean Boudreau(deleted) 2009-07-29T17:11:47Z post34819: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34819 Sean, are we talking about the resolution of the timestamps, or how often pcap satisfies a read request? Murf Wed, 29 Jul 2009 17:03:03 GMT http://community.qnx.com/sf/go/post34819 John Murphy 2009-07-29T17:03:03Z post34817: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34817 On Wed, Jul 29, 2009 at 11:58:55AM -0400, John Murphy wrote: > Take a look at sys/net/bpf.c in the networking trunk. I believe it sets the timestamp via a call to microtime, which is in sys/currenttime.c, which calsl mtime in the same file), which get the current time, then maks off a bunch of the least significant digits. > > I may be way off base here, and this might just lead you into another round of "what's going on here?", but I'd sure take a look at the other possibilities before I tried to rebuild all of io-pkt with a rather fundamental change --- but that's just me. It seems to boil down to pcap_open_live() taking a timeout the smallest value of which boils down to HZ in the stack (stack rounds up to that value). A value of zero means wait until the buffer's full. There's a BIOCIMMEDIATE bpf ioctl that would probably help here but libpcap currently only uses it for AIX. Soo... The easier 'fix' would be to set BIOCIMMEDIATE in pcap_open_live() if the timeout is less than a tick which you can get from sysctl() / sysctlbyname(). -seanb Wed, 29 Jul 2009 16:46:59 GMT http://community.qnx.com/sf/go/post34817 Sean Boudreau(deleted) 2009-07-29T16:46:59Z post34816: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34816 in mtime it is using tick not microsecond so I think you can modify it to use microsecond then you should be able to get microsecond precision. if mtime is not local then you should be able to preload to override it but it is static. Wed, 29 Jul 2009 16:36:16 GMT http://community.qnx.com/sf/go/post34816 Yao Zhao(deleted) 2009-07-29T16:36:16Z post34815: Re: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34815 Exactly! But that's a bit different than monkeying with constants that affect all of the networking code. Murf Wed, 29 Jul 2009 16:01:35 GMT http://community.qnx.com/sf/go/post34815 John Murphy 2009-07-29T16:01:35Z post34813: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34813 Take a look at sys/net/bpf.c in the networking trunk. I believe it sets the timestamp via a call to microtime, which is in sys/currenttime.c, which calsl mtime in the same file), which get the current time, then maks off a bunch of the least significant digits. I may be way off base here, and this might just lead you into another round of "what's going on here?", but I'd sure take a look at the other possibilities before I tried to rebuild all of io-pkt with a rather fundamental change --- but that's just me. Murf Wed, 29 Jul 2009 15:58:54 GMT http://community.qnx.com/sf/go/post34813 John Murphy 2009-07-29T15:58:54Z post34812: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34812 > -----Original Message----- > From: John Murphy [mailto:community-noreply@qnx.com] > Sent: Wednesday, July 29, 2009 11:48 AM > To: ionetmig-networking > Subject: Re: strange behavior of using pcap.h > > On an X86 (at least), the clock interrupts happen at a rate close to > one per millisecond, so you can never achieve a pcap timestamp > resolution better than about one millisecond. > Sure you can with ClockCycles() > If what you're after is better resolution, it might be easier to just > build your own bpf.c. > > > Murf > > > > _______________________________________________ > > io-net migration > http://community.qnx.com/sf/go/post34809 > Wed, 29 Jul 2009 15:55:49 GMT http://community.qnx.com/sf/go/post34812 Mario Charest 2009-07-29T15:55:49Z post34810: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34810 > On an X86 (at least), the clock interrupts happen at a rate close to one per > millisecond, so you can never achieve a pcap timestamp resolution better than > about one millisecond. > > If what you're after is better resolution, it might be easier to just build > your own bpf.c. > > > Murf From where should I start to learn how to write my own bpf.c file. I was getting very good resolution in win XP using winpcap. Regards, Mohammad Wed, 29 Jul 2009 15:51:27 GMT http://community.qnx.com/sf/go/post34810 Mohammad Dadashzadeh(deleted) 2009-07-29T15:51:27Z post34809: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34809 On an X86 (at least), the clock interrupts happen at a rate close to one per millisecond, so you can never achieve a pcap timestamp resolution better than about one millisecond. If what you're after is better resolution, it might be easier to just build your own bpf.c. Murf Wed, 29 Jul 2009 15:48:06 GMT http://community.qnx.com/sf/go/post34809 John Murphy 2009-07-29T15:48:06Z post34808: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34808 recompile io-pkt Wed, 29 Jul 2009 15:47:47 GMT http://community.qnx.com/sf/go/post34808 Mohammad Dadashzadeh(deleted) 2009-07-29T15:47:47Z post34807: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34807 what do you want to do? recompile io-pkt or the whole OS? Wed, 29 Jul 2009 15:37:01 GMT http://community.qnx.com/sf/go/post34807 Yao Zhao(deleted) 2009-07-29T15:37:01Z post34806: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34806 I downloaded kernel source from svn checkout --username <username> http://community.qnx.com/svn/repos/coreos_pub/trunk and followed all the instructions and was able to compile and build the OS. Now should I download all the below links or one of the is enough? svn checkout --username <userid> http://community.qnx.com/svn/repos/core_networking/trunk Where <userid> is the email address used to create your account on the QNX site. To check out the 6.4.0 GA release branch source, use svn checkout --username <userid> http://community.qnx.com/svn/repos/core_networking/tags/6.4.0/GA To check out the 6.4.0 maintenance branch source (which includes critical fixes to the GA release), use svn checkout --username <userid> http://community.qnx.com/svn/repos/core_networking/branches/6.4.0/trunk Mohammad Wed, 29 Jul 2009 15:29:19 GMT http://community.qnx.com/sf/go/post34806 Mohammad Dadashzadeh(deleted) 2009-07-29T15:29:19Z post34804: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34804 that is correct but probably it won't work as many places are assuming 1 HZ is 8ms but now it is not. but you could try. Wed, 29 Jul 2009 15:12:10 GMT http://community.qnx.com/sf/go/post34804 Yao Zhao(deleted) 2009-07-29T15:12:10Z post34803: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34803 in order to change the 8.39 msec to 32 usec this is the default * 2^23ns = 2^23ns * (1000ms / 10^9ns) = 8.39ms = 119.209Hz */ #define NTO_TSHIFT 23 #define NTO_HZ 119 #define NTO_mHZ 119209 I am going to change it to * 2^15ns = 2^15ns * (1000ms / 10^9ns) = 32.77us = 30517.578Hz */ #define NTO_TSHIFT 15 #define NTO_HZ 30517 #define NTO_mHZ 30517578 and then compile, is this correct? Mohammad Wed, 29 Jul 2009 15:07:07 GMT http://community.qnx.com/sf/go/post34803 Mohammad Dadashzadeh(deleted) 2009-07-29T15:07:07Z post34798: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34798 On Wed, Jul 29, 2009 at 10:30:40AM -0400, Mohammad Dadashzadeh wrote: > > On Tue, Jul 28, 2009 at 05:13:12PM -0400, Mohammad Dadashzadeh wrote: > > > I am trying to recompile the source based on below document > > > > > > http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.core_os/ > > wiki/BuildKernelWithIDE?id=atch1253 > > > > > > > > > at the end when I run it says: > > > > > > /cygdrive/c/QNX641/workspace not a directory > > > > I'm not sure that applies to the networking source... > > I've never tried building under the IDE but a > > straight 'make' as described here should work. > > > > http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/ > > Source_Guide > > > > Regards, > > > > -seanb > > > Should I do this in QNX machine or in development machine I am really confused. > Should I rebuild the entire OS or just Networking core. > svn command works in QNX machine not in development machine. The development machine (note a QNX machine can also be a development machine). For this particular issue only the io-pkt binary need to be touched but it's often easier to build the entire networking tree as described in the above link. Regards, -seanb Wed, 29 Jul 2009 14:35:11 GMT http://community.qnx.com/sf/go/post34798 Sean Boudreau(deleted) 2009-07-29T14:35:11Z post34796: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34796 > On Tue, Jul 28, 2009 at 05:13:12PM -0400, Mohammad Dadashzadeh wrote: > > I am trying to recompile the source based on below document > > > > http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.core_os/ > wiki/BuildKernelWithIDE?id=atch1253 > > > > > > at the end when I run it says: > > > > /cygdrive/c/QNX641/workspace not a directory > > I'm not sure that applies to the networking source... > I've never tried building under the IDE but a > straight 'make' as described here should work. > > http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/ > Source_Guide > > Regards, > > -seanb Should I do this in QNX machine or in development machine I am really confused. Should I rebuild the entire OS or just Networking core. svn command works in QNX machine not in development machine. Regards, Mohammad Wed, 29 Jul 2009 14:30:40 GMT http://community.qnx.com/sf/go/post34796 Mohammad Dadashzadeh(deleted) 2009-07-29T14:30:40Z post34790: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34790 On Tue, Jul 28, 2009 at 05:13:12PM -0400, Mohammad Dadashzadeh wrote: > I am trying to recompile the source based on below document > > http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.core_os/wiki/BuildKernelWithIDE?id=atch1253 > > > at the end when I run it says: > > /cygdrive/c/QNX641/workspace not a directory I'm not sure that applies to the networking source... I've never tried building under the IDE but a straight 'make' as described here should work. http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Source_Guide Regards, -seanb Wed, 29 Jul 2009 13:59:03 GMT http://community.qnx.com/sf/go/post34790 Sean Boudreau(deleted) 2009-07-29T13:59:03Z post34759: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34759 I am trying to recompile the source based on below document http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.core_os/wiki/BuildKernelWithIDE?id=atch1253 at the end when I run it says: /cygdrive/c/QNX641/workspace not a directory Tue, 28 Jul 2009 21:13:09 GMT http://community.qnx.com/sf/go/post34759 Mohammad Dadashzadeh(deleted) 2009-07-28T21:13:09Z post34752: Re: RE: LSM name shown by pidin http://community.qnx.com/sf/go/post34752 Interesting! The ONLY place we've seen the WRONG name is on 6.4.1. I guess that resolving symbols could easily involve writing to the object, but I don't think I've have ever thought of that one. I'll give up on that one for awhile and concentrate on other issues. Thanks for the response! Murf Tue, 28 Jul 2009 18:08:13 GMT http://community.qnx.com/sf/go/post34752 John Murphy 2009-07-28T18:08:13Z post34751: Re: RE: LSM name shown by pidin http://community.qnx.com/sf/go/post34751 As far as I know, the only way to track a PR's progress is to ask about it periodically. I asked about this one (so I can add it to the release notes), and Brian Stecher says that pidin can get confused if the first page of a memory-mapped object gets written to. You're more likely to see the right name as you move from 6.3.2 to 6.4.0 to 6.4.1, but the underlying problem still exists. There's no workaround. Tue, 28 Jul 2009 17:05:12 GMT http://community.qnx.com/sf/go/post34751 Steve Reid 2009-07-28T17:05:12Z post34750: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34750 > when I use my user name in this command it does not work? > > svn checkout --username <username> http://community.qnx.com/svn/repos/coreos_pub/trunk > > > Mohammad it shows : PRPOFIND request failed on ....... ........... 405 method Not allowed Tue, 28 Jul 2009 17:03:51 GMT http://community.qnx.com/sf/go/post34750 Mohammad Dadashzadeh(deleted) 2009-07-28T17:03:51Z post34748: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34748 when I use my user name in this command it does not work? svn checkout --username <username> http://community.qnx.com/svn/repos/coreos_pub/trunk Mohammad Tue, 28 Jul 2009 17:01:01 GMT http://community.qnx.com/sf/go/post34748 Mohammad Dadashzadeh(deleted) 2009-07-28T17:01:01Z post34746: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34746 > Could I do this in evaluation version where I have QNX Momentics IDE Version 4 > .6.0? > > Mohammad > > > Should I have website downloader to download all the files. http://community.qnx.com/svn/repos/coreos_pub/trunk/ Mohammad Tue, 28 Jul 2009 16:48:40 GMT http://community.qnx.com/sf/go/post34746 Mohammad Dadashzadeh(deleted) 2009-07-28T16:48:40Z post34743: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34743 Could I do this in evaluation version where I have QNX Momentics IDE Version 4.6.0? Mohammad Tue, 28 Jul 2009 16:25:25 GMT http://community.qnx.com/sf/go/post34743 Mohammad Dadashzadeh(deleted) 2009-07-28T16:25:25Z post34735: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34735 On Tue, Jul 28, 2009 at 11:18:22AM -0400, Mohammad Dadashzadeh wrote: > Sorry I did not get it, > > Recompile of what, Could you please let me know How I can do it? You'd need to check out the source from the networking repo and follow the instructions here: http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Source_Guide The defines that control this are in io-pkt/sys/sys/time_bsd.h (look for __QNXNTO__) Regards, -seanb Tue, 28 Jul 2009 15:23:21 GMT http://community.qnx.com/sf/go/post34735 Sean Boudreau(deleted) 2009-07-28T15:23:21Z post34734: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34734 Sorry I did not get it, Recompile of what, Could you please let me know How I can do it? Regards, Mohammad Tue, 28 Jul 2009 15:18:21 GMT http://community.qnx.com/sf/go/post34734 Mohammad Dadashzadeh(deleted) 2009-07-28T15:18:21Z post34732: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34732 On Tue, Jul 28, 2009 at 11:14:11AM -0400, Mohammad Dadashzadeh wrote: > can I change it? It would involve a re-compile. Regards, -seanb Tue, 28 Jul 2009 15:15:38 GMT http://community.qnx.com/sf/go/post34732 Sean Boudreau(deleted) 2009-07-28T15:15:38Z post34731: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34731 can I change it? Tue, 28 Jul 2009 15:14:10 GMT http://community.qnx.com/sf/go/post34731 Mohammad Dadashzadeh(deleted) 2009-07-28T15:14:10Z post34730: Re: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34730 On Tue, Jul 28, 2009 at 10:51:19AM -0400, Mohammad Dadashzadeh wrote: > Dear All, > let's see some part of the captured data. Instead of getting two packets every 250usec I am getting 64 to 65 packets every 8389 usec. Is there anything wrong with the settings or netwrok driver in QNX. I tested the same network card in windows XP embedded with winpcap and it was working very well. I would be very thankful if you help me. That's the clockrate in io-pkt: # sysctl kern.clockrate kern.clockrate: tick = 8403, hz = 119 -seanb Tue, 28 Jul 2009 15:03:34 GMT http://community.qnx.com/sf/go/post34730 Sean Boudreau(deleted) 2009-07-28T15:03:34Z post34723: RE: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34723 > I am getting 64 to 65 packets every 8389 usec. I think the system time which localtime() is fetching is only being updated every 10ms timer tick. I think you want a better timestamp - try clockcycles() or something like that. -- aboyd Tue, 28 Jul 2009 14:54:55 GMT http://community.qnx.com/sf/go/post34723 Andrew Boyd(deleted) 2009-07-28T14:54:55Z post34722: strange behavior of using pcap.h http://community.qnx.com/sf/go/post34722 Dear All, Fortunately I was able to use pcap.h to capture packet in QNX. I am using below command to open a session /* Open the session in promiscuous mode */ handle = pcap_open_live(dev, 65536, 1, 1000, errbuf); I am also using below commands to capture and store packets for(i=0;i<32000;i++) { packet=pcap_next(handle, &header); local_tv_sec = header.ts.tv_sec; ltime=localtime(&local_tv_sec); strftime( timestr, sizeof(timestr), "%H:%M:%S", ltime); fprintf(stream1,"%s,%.6d len:%d\n", timestr, header.ts.tv_usec, header.len); } I have a testing device which sends two packets per 250usec. Therefore, I am expecting to capture packets in the same trend. By the way, two network cards are connected to my QNX target machine and I am using one of them only for data capturing from tester. let's see some part of the captured data. Instead of getting two packets every 250usec I am getting 64 to 65 packets every 8389 usec. Is there anything wrong with the settings or netwrok driver in QNX. I tested the same network card in windows XP embedded with winpcap and it was working very well. I would be very thankful if you help me. 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,599566 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,607955 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,616344 len:121 10:23:11,624732 len:121 Tue, 28 Jul 2009 14:51:18 GMT http://community.qnx.com/sf/go/post34722 Mohammad Dadashzadeh(deleted) 2009-07-28T14:51:18Z post34644: Re: RE: LSM name shown by pidin http://community.qnx.com/sf/go/post34644 Aha, that makes sense! But does that mean there's no way to track progress on a showstopper bug until a new release comes out? Murf Mon, 27 Jul 2009 15:44:15 GMT http://community.qnx.com/sf/go/post34644 John Murphy 2009-07-27T15:44:15Z post34643: RE: LSM name shown by pidin http://community.qnx.com/sf/go/post34643 I'm pretty sure PRs aren't visible outside the company :( They contain customer references, etc. -- aboyd Mon, 27 Jul 2009 15:40:47 GMT http://community.qnx.com/sf/go/post34643 Andrew Boyd(deleted) 2009-07-27T15:40:47Z post34641: Re: LSM name shown by pidin http://community.qnx.com/sf/go/post34641 I've spent another bunch of hours trying to track down this bug and/or find a workaround, with no success. I'm unable to find any reference to PR43050; what's the procedure for tracking the progress on, or even the definition of, a PR? Murf Mon, 27 Jul 2009 15:28:34 GMT http://community.qnx.com/sf/go/post34641 John Murphy 2009-07-27T15:28:34Z post34550: Re: using pcap.h http://community.qnx.com/sf/go/post34550 On Fri, Jul 24, 2009 at 02:25:00PM -0400, Mohammad Dadashzadeh wrote: > I attached the project file maybe you find the problem. I also posted the problem under build section. This isn't really a networking issue, rather a debugging one. IIRC you're using the ide? Maybe try in the ide group: http://community.qnx.com/sf/projects/ide Regards, -seanb Fri, 24 Jul 2009 18:29:30 GMT http://community.qnx.com/sf/go/post34550 Sean Boudreau(deleted) 2009-07-24T18:29:30Z post34549: Re: using pcap.h http://community.qnx.com/sf/go/post34549 I attached the project file maybe you find the problem. I also posted the problem under build section. Regards, Mohammad Fri, 24 Jul 2009 18:24:56 GMT http://community.qnx.com/sf/go/post34549 Mohammad Dadashzadeh(deleted) 2009-07-24T18:24:56Z post34532: Re: using pcap.h http://community.qnx.com/sf/go/post34532 Congratulations, you've now moved onto a tools issue :) I'd check that you've compiled a debug variant and maybe ask for help in the tools project. Regards, -seanb On Fri, Jul 24, 2009 at 12:02:18PM -0400, Mohammad Dadashzadeh wrote: > Thak you for your help. this helped to solve the problem. Now I am using pcap_loop to capture packets. The project compiles and builds but during debugging when I run pcap_loop function the program stops and shows > > No source available for "pcap_loop() " > > > my code > > > #include <stdlib.h> > #include <stdio.h> > #include "pcap.h" > > /* prototype of the packet handler */ > void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); > > int main(int argc, char *argv[]) { > pcap_if_t *alldevs; > pcap_if_t *d; > int inum; > int i=0; > pcap_t *adhandle; > char errbuf[PCAP_ERRBUF_SIZE]; > > /* Retrieve the device list on the local machine */ > if (pcap_findalldevs(&alldevs, errbuf) == -1) > { > fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); > exit(1); > } > > /* Print the list */ > for(d=alldevs; d; d=d->next) > { > printf("%d. %s", ++i, d->name); > if (d->description) > printf(" (%s)\n", d->description); > else > printf(" (No description available)\n"); > } > > if(i==0) > { > printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); > return -1; > } > > printf("Enter the interface number (1-%d):",i); > //scanf("%d", &inum); > inum=1; > > if(inum < 1 || inum > i) > { > printf("\nInterface number out of range.\n"); > /* Free the device list */ > pcap_freealldevs(alldevs); > return -1; > } > > /* Jump to the selected adapter */ > for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); > > /* Open the device */ > > adhandle=pcap_open_live(d->name, 65536, 1, 20, errbuf); > > if (adhandle=NULL) > { > fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); > /* Free the device list */ > pcap_freealldevs(alldevs); > return -1; > } > > //printf("\nlistening on %s...\n", d->description); > > /* At this point, we don't need any more the device list. Free it */ > pcap_freealldevs(alldevs); > > /* start the capture */ > pcap_loop(adhandle, 0, packet_handler, NULL); > > return EXIT_SUCCESS; > } > > /* Callback function invoked by libpcap for every incoming packet */ > void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data) > { > struct tm *ltime; > char timestr[16]; > time_t local_tv_sec; > > /* convert the timestamp to readable format */ > local_tv_sec = header->ts.tv_sec; > ltime=localtime(&local_tv_sec); > strftime( timestr, sizeof timestr, "%H:%M:%S", ltime); > > printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len); > > } > > > > > _______________________________________________ > > io-net migration > http://community.qnx.com/sf/go/post34529 > Fri, 24 Jul 2009 16:20:11 GMT http://community.qnx.com/sf/go/post34532 Sean Boudreau(deleted) 2009-07-24T16:20:11Z post34531: Re: using pcap.h http://community.qnx.com/sf/go/post34531 > > > > You mean I have to add libpcap in Project\linker\Extra library\pcap > > I guess so. However the ide lets you do it :) > > > > > I did that it gives me more error. > > > > > > Description Resource Path Location Type > > undefined reference to `ether_hostton' packetcapture2 line 0 C/C++ Problem > > > undefined reference to `freeaddrinfo' packetcapture2 line 0 C/C++ Problem > > undefined reference to `freeifaddrs' packetcapture2 line 0 C/C++ Problem > > undefined reference to `getaddrinfo' packetcapture2 line 0 C/C++ Problem > > undefined reference to `gethostbyname' packetcapture2 line 0 C/C++ Problem > > > undefined reference to `getifaddrs' packetcapture2 line 0 C/C++ Problem > > undefined reference to `getnetbyname' packetcapture2 line 0 C/C++ Problem > > undefined reference to `getprotobyname' packetcapture2 line 0 C/C++ > Problem > > undefined reference to `getservbyname' packetcapture2 line 0 C/C++ Problem > > > undefined reference to `ioctl_socket' packetcapture2 line 0 C/C++ Problem > > undefined reference to `socket' packetcapture2 line 0 C/C++ Problem > > C:/QNX641/target/qnx6/x86/usr/lib\libpcap.a(pcap-bpf.o): more undefined > references to `ioctl_socket' follow packetcapture2 line 0 C/C++ Problem > > make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o-g/packetcapture2_g] > Error 1 packetcapture2 line 0 C/C++ Problem > > make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o/packetcapture2] > Error 1 packetcapture2 line 0 C/C++ Problem > > > > These are in libsocket. > > -seanb Re: using pcap.h Thak you for your help. this helped to solve the problem. Now I am using pcap_loop to capture packets. The project compiles and builds but during debugging when I run pcap_loop function the program stops and shows No source available for "pcap_loop() " my code #include <stdlib.h> #include <stdio.h> #include "pcap.h" /* prototype of the packet handler */ void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); int main(int argc, char *argv[]) { pcap_if_t *alldevs; pcap_if_t *d; int inum; int i=0; pcap_t *adhandle; char errbuf[PCAP_ERRBUF_SIZE]; /* Retrieve the device list on the local machine */ if (pcap_findalldevs(&alldevs, errbuf) == -1) { fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); exit(1); } /* Print the list */ for(d=alldevs; d; d=d->next) { printf("%d. %s", ++i, d->name); if (d->description) printf(" (%s)\n", d->description); else printf(" (No description available)\n"); } if(i==0) { printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); return -1; } printf("Enter the interface number (1-%d):",i); //scanf("%d", &inum); inum=1; if(inum < 1 || inum > i) { printf("\nInterface number out of range.\n"); /* Free the device list */ pcap_freealldevs(alldevs); return -1; } /* Jump to the selected adapter */ for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); /* Open the device */ adhandle=pcap_open_live(d->name, 65536, 1, 20, errbuf); if (adhandle=NULL) { fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); /* Free the device list */ pcap_freealldevs(alldevs); return -1; } //printf("\nlistening on %s...\n", d->description); /* At this point, we don't need any more the device list. Free it */ pcap_freealldevs(alldevs); /* start the capture */ pcap_loop(adhandle, 0, packet_handler, NULL); return EXIT_SUCCESS; } /* Callback function invoked by libpcap for every incoming packet */ void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data) { struct tm *ltime; char timestr[16]; time_t local_tv_sec; /* convert the timestamp to readable format */ local_tv_sec = header->ts.tv_sec; ltime=localtime(&local_tv_sec); strftime( timestr, sizeof timestr, "%H:%M:%S", ltime); printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len); } Fri, 24 Jul 2009 16:19:04 GMT http://community.qnx.com/sf/go/post34531 Mohammad Dadashzadeh(deleted) 2009-07-24T16:19:04Z post34529: Re: using pcap.h http://community.qnx.com/sf/go/post34529 Thak you for your help. this helped to solve the problem. Now I am using pcap_loop to capture packets. The project compiles and builds but during debugging when I run pcap_loop function the program stops and shows No source available for "pcap_loop() " my code #include <stdlib.h> #include <stdio.h> #include "pcap.h" /* prototype of the packet handler */ void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); int main(int argc, char *argv[]) { pcap_if_t *alldevs; pcap_if_t *d; int inum; int i=0; pcap_t *adhandle; char errbuf[PCAP_ERRBUF_SIZE]; /* Retrieve the device list on the local machine */ if (pcap_findalldevs(&alldevs, errbuf) == -1) { fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); exit(1); } /* Print the list */ for(d=alldevs; d; d=d->next) { printf("%d. %s", ++i, d->name); if (d->description) printf(" (%s)\n", d->description); else printf(" (No description available)\n"); } if(i==0) { printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); return -1; } printf("Enter the interface number (1-%d):",i); //scanf("%d", &inum); inum=1; if(inum < 1 || inum > i) { printf("\nInterface number out of range.\n"); /* Free the device list */ pcap_freealldevs(alldevs); return -1; } /* Jump to the selected adapter */ for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); /* Open the device */ adhandle=pcap_open_live(d->name, 65536, 1, 20, errbuf); if (adhandle=NULL) { fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); /* Free the device list */ pcap_freealldevs(alldevs); return -1; } //printf("\nlistening on %s...\n", d->description); /* At this point, we don't need any more the device list. Free it */ pcap_freealldevs(alldevs); /* start the capture */ pcap_loop(adhandle, 0, packet_handler, NULL); return EXIT_SUCCESS; } /* Callback function invoked by libpcap for every incoming packet */ void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data) { struct tm *ltime; char timestr[16]; time_t local_tv_sec; /* convert the timestamp to readable format */ local_tv_sec = header->ts.tv_sec; ltime=localtime(&local_tv_sec); strftime( timestr, sizeof timestr, "%H:%M:%S", ltime); printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len); } Fri, 24 Jul 2009 16:02:18 GMT http://community.qnx.com/sf/go/post34529 Mohammad Dadashzadeh(deleted) 2009-07-24T16:02:18Z post34525: Re: using pcap.h http://community.qnx.com/sf/go/post34525 > > You mean I have to add libpcap in Project\linker\Extra library\pcap I guess so. However the ide lets you do it :) > > I did that it gives me more error. > > > Description Resource Path Location Type > undefined reference to `ether_hostton' packetcapture2 line 0 C/C++ Problem > undefined reference to `freeaddrinfo' packetcapture2 line 0 C/C++ Problem > undefined reference to `freeifaddrs' packetcapture2 line 0 C/C++ Problem > undefined reference to `getaddrinfo' packetcapture2 line 0 C/C++ Problem > undefined reference to `gethostbyname' packetcapture2 line 0 C/C++ Problem > undefined reference to `getifaddrs' packetcapture2 line 0 C/C++ Problem > undefined reference to `getnetbyname' packetcapture2 line 0 C/C++ Problem > undefined reference to `getprotobyname' packetcapture2 line 0 C/C++ Problem > undefined reference to `getservbyname' packetcapture2 line 0 C/C++ Problem > undefined reference to `ioctl_socket' packetcapture2 line 0 C/C++ Problem > undefined reference to `socket' packetcapture2 line 0 C/C++ Problem > C:/QNX641/target/qnx6/x86/usr/lib\libpcap.a(pcap-bpf.o): more undefined references to `ioctl_socket' follow packetcapture2 line 0 C/C++ Problem > make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o-g/packetcapture2_g] Error 1 packetcapture2 line 0 C/C++ Problem > make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o/packetcapture2] Error 1 packetcapture2 line 0 C/C++ Problem > These are in libsocket. -seanb Fri, 24 Jul 2009 15:27:55 GMT http://community.qnx.com/sf/go/post34525 Sean Boudreau(deleted) 2009-07-24T15:27:55Z post34524: Re: RE: using pcap.h http://community.qnx.com/sf/go/post34524 thanks for yor reply the link does not work Mohammad Fri, 24 Jul 2009 15:26:03 GMT http://community.qnx.com/sf/go/post34524 Mohammad Dadashzadeh(deleted) 2009-07-24T15:26:03Z post34523: Re: using pcap.h http://community.qnx.com/sf/go/post34523 > On Fri, Jul 24, 2009 at 11:09:39AM -0400, Mohammad Dadashzadeh wrote: > > Dear all, > > > > I am a beginner in using QNX. I would like to use pcap.h to capture MAC > packets. I am using bellow code to read all the network devices. Code complies > without any error. However, when I want to build the project it gives me > below error. I would be very thankful if someone helps me. > > > > Description Resource Path Location Type > > make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o-g/packetcapture2_g] > Error 1 packetcapture2 line 0 C/C++ Problem > > make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o/packetcapture2] > Error 1 packetcapture2 line 0 C/C++ Problem > > packetcapture2.c: undefined reference to `pcap_findalldevs' packetcapture2 > line 0 C/C++ Problem > > packetcapture2.c: undefined reference to `pcap_freealldevs' packetcapture2 > line 0 C/C++ Problem > > undefined reference to `pcap_findalldevs' packetcapture2.c packetcapture2 > line 15 C/C++ Problem > > undefined reference to `pcap_freealldevs' packetcapture2.c packetcapture2 > line 38 C/C++ Problem > > You need to link against libpcap. > > Regards, > > -seanb You mean I have to add libpcap in Project\linker\Extra library\pcap I did that it gives me more error. Description Resource Path Location Type undefined reference to `ether_hostton' packetcapture2 line 0 C/C++ Problem undefined reference to `freeaddrinfo' packetcapture2 line 0 C/C++ Problem undefined reference to `freeifaddrs' packetcapture2 line 0 C/C++ Problem undefined reference to `getaddrinfo' packetcapture2 line 0 C/C++ Problem undefined reference to `gethostbyname' packetcapture2 line 0 C/C++ Problem undefined reference to `getifaddrs' packetcapture2 line 0 C/C++ Problem undefined reference to `getnetbyname' packetcapture2 line 0 C/C++ Problem undefined reference to `getprotobyname' packetcapture2 line 0 C/C++ Problem undefined reference to `getservbyname' packetcapture2 line 0 C/C++ Problem undefined reference to `ioctl_socket' packetcapture2 line 0 C/C++ Problem undefined reference to `socket' packetcapture2 line 0 C/C++ Problem C:/QNX641/target/qnx6/x86/usr/lib\libpcap.a(pcap-bpf.o): more undefined references to `ioctl_socket' follow packetcapture2 line 0 C/C++ Problem make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o-g/packetcapture2_g] Error 1 packetcapture2 line 0 C/C++ Problem make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o/packetcapture2] Error 1 packetcapture2 line 0 C/C++ Problem Fri, 24 Jul 2009 15:24:48 GMT http://community.qnx.com/sf/go/post34523 Mohammad Dadashzadeh(deleted) 2009-07-24T15:24:48Z post34522: RE: using pcap.h http://community.qnx.com/sf/go/post34522 For 6.4 (io-pkt) I would probably just start with: http://svn.ott.qnx.com/view/core_networking/trunk/utils/t/tcpdump/ -- aboyd Fri, 24 Jul 2009 15:13:24 GMT http://community.qnx.com/sf/go/post34522 Andrew Boyd(deleted) 2009-07-24T15:13:24Z post34521: Re: using pcap.h http://community.qnx.com/sf/go/post34521 On Fri, Jul 24, 2009 at 11:09:39AM -0400, Mohammad Dadashzadeh wrote: > Dear all, > > I am a beginner in using QNX. I would like to use pcap.h to capture MAC packets. I am using bellow code to read all the network devices. Code complies without any error. However, when I want to build the project it gives me below error. I would be very thankful if someone helps me. > > Description Resource Path Location Type > make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o-g/packetcapture2_g] Error 1 packetcapture2 line 0 C/C++ Problem > make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o/packetcapture2] Error 1 packetcapture2 line 0 C/C++ Problem > packetcapture2.c: undefined reference to `pcap_findalldevs' packetcapture2 line 0 C/C++ Problem > packetcapture2.c: undefined reference to `pcap_freealldevs' packetcapture2 line 0 C/C++ Problem > undefined reference to `pcap_findalldevs' packetcapture2.c packetcapture2 line 15 C/C++ Problem > undefined reference to `pcap_freealldevs' packetcapture2.c packetcapture2 line 38 C/C++ Problem You need to link against libpcap. Regards, -seanb Fri, 24 Jul 2009 15:12:09 GMT http://community.qnx.com/sf/go/post34521 Sean Boudreau(deleted) 2009-07-24T15:12:09Z post34520: using pcap.h http://community.qnx.com/sf/go/post34520 Dear all, I am a beginner in using QNX. I would like to use pcap.h to capture MAC packets. I am using bellow code to read all the network devices. Code complies without any error. However, when I want to build the project it gives me below error. I would be very thankful if someone helps me. Description Resource Path Location Type make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o-g/packetcapture2_g] Error 1 packetcapture2 line 0 C/C++ Problem make[2]: *** [C:/ide-4.6-workspace/packetcapture2/x86/o/packetcapture2] Error 1 packetcapture2 line 0 C/C++ Problem packetcapture2.c: undefined reference to `pcap_findalldevs' packetcapture2 line 0 C/C++ Problem packetcapture2.c: undefined reference to `pcap_freealldevs' packetcapture2 line 0 C/C++ Problem undefined reference to `pcap_findalldevs' packetcapture2.c packetcapture2 line 15 C/C++ Problem undefined reference to `pcap_freealldevs' packetcapture2.c packetcapture2 line 38 C/C++ Problem My code #include <stdlib.h> #include <stdio.h> #include "pcap.h" int main(int argc, char *argv[]) { pcap_if_t *alldevs; pcap_if_t *d; int i=0; char errbuf[PCAP_ERRBUF_SIZE]; printf("Welcome to the QNX Momentics IDE\n"); /* Retrieve the device list from the local machine */ if (pcap_findalldevs(&alldevs, errbuf) == -1) { fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf); exit(1); } /* Print the list */ for(d= alldevs; d != NULL; d= d->next) { printf("%d. %s", ++i, d->name); if (d->description) printf(" (%s)\n", d->description); else printf(" (No description available)\n"); } if (i == 0) { printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); return; } /* We don't need any more the device list. Free it */ pcap_freealldevs(alldevs); return EXIT_SUCCESS; } Fri, 24 Jul 2009 15:09:38 GMT http://community.qnx.com/sf/go/post34520 Mohammad Dadashzadeh(deleted) 2009-07-24T15:09:38Z post33256: RE: localhost issue http://community.qnx.com/sf/go/post33256 > telnetd and ftpd ... used to start with inetd, > but now they do not Really dumb question: have you uncommented them in your /etc/inetd.conf file? What is the output of # hostname and # getconf _CS_DOMAIN PS: as soon as dns starts giving you trouble, immediately switch to using the -n option to ping, -N option to telnet, etc to diagnose what is going on. eg: # ping -n 127.1 Also look at the output of: # arp -an -- aboyd Tue, 07 Jul 2009 13:38:02 GMT http://community.qnx.com/sf/go/post33256 Andrew Boyd(deleted) 2009-07-07T13:38:02Z post33217: localhost issue http://community.qnx.com/sf/go/post33217 I have ported my 6.3 boot script to 6.4. This includes moving to io-pkt. I am now having an issue with telnetd and ftpd. They used to start with inetd, but now they do not. In addition, I cannot even ping localhost. I think the localhost issue may be related to my telnetd and ftpd issues. Here is the contents of my /etc/hosts file: # Host Database # 127.0.0.1 localhost.localdomain localhost And here are the results of pinging localhost: ping: Cannot resolve "localhost" (Host name lookup failure) Does anyone have any ideas? Thank you Mon, 06 Jul 2009 20:14:49 GMT http://community.qnx.com/sf/go/post33217 Paul Trepagnier 2009-07-06T20:14:49Z post32959: RE: QNET over IP on QNX 6.4.0 - automatic population of remote nodes in /net folder http://community.qnx.com/sf/go/post32959 P.S. 69603 created to track this request - add auto-populate to qnet dns resolver. Don't hold your breath on this one, though. -- aboyd www.poweredbyqnx.com/images/gat_t7.jpg Thu, 02 Jul 2009 13:40:57 GMT http://community.qnx.com/sf/go/post32959 Andrew Boyd(deleted) 2009-07-02T13:40:57Z post32957: RE: QNET over IP on QNX 6.4.0 - automatic population of remote nodes in /net folder http://community.qnx.com/sf/go/post32957 > I need a automatic population of remode nodes > list in /net folder with IP option > > Is there any way to do so? I can't think of a good way to do this. > Do i need to create a new resolver ? That's one possibility > Where can i get the code examples for writing > a resolver? Qnet resolvers can be complex because of the multi-threading. I might suggest altering the existing dns resolver to give it the behaviour you want - remember, all the source to qnet is publicly available to anyone! I'm told svn repository viewer links work outside the company, but I am doubtful: http://svn.ott.qnx.com/view/core_networking/trunk/sys/lsm/qnet/nr/nr_dns .c?revision=904&view=markup -- aboyd www.poweredbyqnx.com/images/gat_t12.jpg Thu, 02 Jul 2009 13:35:38 GMT http://community.qnx.com/sf/go/post32957 Andrew Boyd(deleted) 2009-07-02T13:35:38Z post32940: QNET over IP on QNX 6.4.0 - automatic population of remote nodes in /net folder http://community.qnx.com/sf/go/post32940 hi, I am porting my project from QNX 6.3.0 to QNX 6.4.0. I have issues with QNET ovet iP. When i mount QNET over ip with dns option untill and unless i do a TDP operation on remote node,will not get it in /net list. I need a automatic population of remode nodes list in /net folder with IP option. Is there any way to do so? Do i need to create a new resolver ? Where can i get the code examples for writing a resolver? Thu, 02 Jul 2009 06:07:26 GMT http://community.qnx.com/sf/go/post32940 soujanya Yelchuri 2009-07-02T06:07:26Z post32737: Reg - Header length in mbuf http://community.qnx.com/sf/go/post32737 Hi, How to print the header length,header,data using mbuf structure? Regards K.Senthil Mon, 29 Jun 2009 15:10:54 GMT http://community.qnx.com/sf/go/post32737 Senthil K 2009-06-29T15:10:54Z post32696: Re: LSM name shown by pidin http://community.qnx.com/sf/go/post32696 Thanks for the info! I'd pretty well determined that it has something to do with linking in library modules (including the source code of some particular library module in the build "cures" the problem), and that it was beyond my control, but it's nice to hear that someone is (hopefully!) busy working on it. Murf Mon, 29 Jun 2009 12:58:12 GMT http://community.qnx.com/sf/go/post32696 John Murphy 2009-06-29T12:58:12Z post32691: Re: LSM name shown by pidin http://community.qnx.com/sf/go/post32691 > I've written a number of LSM's; when I run "pidin -p io-pkt-v4-hc mem" some of > my modules show up with the expected name (i.e., "lsm-demo.so"), but some of > them show up with the name "zero"). After many tests and experiments, I still > have no idea why some of them lose track of their names and show up as > anonymous memory. Any suggestions as to how I can cure this? > > Murf I believe it is known not yet fixed 'buglet' ->#PR43050. Jeevan Mon, 29 Jun 2009 12:26:02 GMT http://community.qnx.com/sf/go/post32691 Jeevan Mathew(deleted) 2009-06-29T12:26:02Z post32689: Re: Reg- Path for mbuf.h http://community.qnx.com/sf/go/post32689 Thanks a lot Mon, 29 Jun 2009 12:10:51 GMT http://community.qnx.com/sf/go/post32689 Senthil K 2009-06-29T12:10:51Z post32686: Re: Reg- Path for mbuf.h http://community.qnx.com/sf/go/post32686 This one ? : [core_networking] / trunk / lib / socket / public / sys -> mbuf.h Jeevan Mon, 29 Jun 2009 11:57:55 GMT http://community.qnx.com/sf/go/post32686 Jeevan Mathew(deleted) 2009-06-29T11:57:55Z post32680: Reg- Path for mbuf.h http://community.qnx.com/sf/go/post32680 Hi, Any one send the path of mbuf.h file and data structure explanation for struct mbuf. Thanks and Regards K.Senthil Mon, 29 Jun 2009 10:48:24 GMT http://community.qnx.com/sf/go/post32680 Senthil K 2009-06-29T10:48:24Z post32669: RE: Reg - loading lsm-packfil.so problem http://community.qnx.com/sf/go/post32669 Senthil, > if i want to change any coding in packfilter module then > instead of mounting i will reboot the PC after that i m able > to load the lsm-packfil.so. > > No other way to do that... There is no reason that I know of that you would need to restart or reboot the PC. I think you could just slay/kill io-pkt and then restart the service. Regards, Eric Mon, 29 Jun 2009 07:10:26 GMT http://community.qnx.com/sf/go/post32669 Eric Fausett 2009-06-29T07:10:26Z post32666: Re: RE: RE: Reg - loading lsm-packfil.so problem http://community.qnx.com/sf/go/post32666 Hi Eric, if i want to change any coding in packfilter module then instead of mounting i will reboot the PC after that i m able to load the lsm-packfil.so. No other way to do that... Thanks and Regards K.Senthil Mon, 29 Jun 2009 05:53:40 GMT http://community.qnx.com/sf/go/post32666 Senthil K 2009-06-29T05:53:40Z post32665: RE: RE: Reg - loading lsm-packfil.so problem http://community.qnx.com/sf/go/post32665 Senthil, > How to un load the lsm-packfil.so module? I don't think that it's possible. If you look at the io-pkt users guide here: http://www.qnx.com/developers/docs/6.4.1/io-pkt_en/user_guide/overview.h tml You will notice what it says in the following section: ----- # mount and umount capabilities: * Only io-net drivers may be both mounted and unmounted. Other drivers may allow you to detach the driver from the stack, by using the ifconfig iface destroy command (if the driver supports it). * The IP stack is an integral part of io-pkt; you can't start io-pkt without it. This means that you don't need to specify the -ptcpip option to the stack unless there are additional parameters (e.g. prefix=) that you need to pass to it. If you specify the -ptcpip option without additional parameters, io-pkt accepts it with no effect. * Protocols and enhanced stack functionality (e.g. TDP, NAT / IP Filtering) can be mounted, but not unmounted. ----- Specifically the last sentence implies that this packet filter module cannot be unmounted once it has been mounted. Regards, Eric Mon, 29 Jun 2009 05:37:35 GMT http://community.qnx.com/sf/go/post32665 Eric Fausett 2009-06-29T05:37:35Z post32664: Re: RE: Reg - loading lsm-packfil.so problem http://community.qnx.com/sf/go/post32664 Hi Eric, How to un load the lsm-packfil.so module? Thanks and Regards K.Senthil Mon, 29 Jun 2009 05:18:50 GMT http://community.qnx.com/sf/go/post32664 Senthil K 2009-06-29T05:18:50Z post32663: Re: RE: Reg - loading lsm-packfil.so problem http://community.qnx.com/sf/go/post32663 Hi Eric, Thanks now i m able to mount. Can you please tell how to unmount it <any command>. Thanks and Regards K.Senthil Mon, 29 Jun 2009 05:14:26 GMT http://community.qnx.com/sf/go/post32663 Senthil K 2009-06-29T05:14:26Z post32662: RE: Reg - loading lsm-packfil.so problem http://community.qnx.com/sf/go/post32662 Senthil, The first thing I would look at is to make sure that the library in question 'lsm-packfil.so' exists somewhere in the library path 'LD_LIBRARY_PATH' at the time you issued the mount command. The system log indicates it was not found. Regards, Eric > While loading lsm-packfil.so, i m getting error. > > # mount -T io-pkt lsm-packfil.so > mount: Can't mount / (type io-pkt) > mount: Possible reason: No such device or address > > > ---- > sloginfo > > Jun 29 16:13:46 2 14 0 Unable to load > lsm-packfil.so: Library cannot be found Mon, 29 Jun 2009 05:00:29 GMT http://community.qnx.com/sf/go/post32662 Eric Fausett 2009-06-29T05:00:29Z post32661: Reg - loading lsm-packfil.so problem http://community.qnx.com/sf/go/post32661 Hi , While loading lsm-packfil.so, i m getting error. # mount -T io-pkt lsm-packfil.so mount: Can't mount / (type io-pkt) mount: Possible reason: No such device or address ---- sloginfo Jun 29 16:13:46 2 14 0 Unable to load lsm-packfil.so: Library cannot be found Please help on this. Thanks and Regards K.Senthil Mon, 29 Jun 2009 04:32:29 GMT http://community.qnx.com/sf/go/post32661 Senthil K 2009-06-29T04:32:29Z post31413: LSM name shown by pidin http://community.qnx.com/sf/go/post31413 I've written a number of LSM's; when I run "pidin -p io-pkt-v4-hc mem" some of my modules show up with the expected name (i.e., "lsm-demo.so"), but some of them show up with the name "zero"). After many tests and experiments, I still have no idea why some of them lose track of their names and show up as anonymous memory. Any suggestions as to how I can cure this? Murf Wed, 10 Jun 2009 19:33:39 GMT http://community.qnx.com/sf/go/post31413 John Murphy 2009-06-10T19:33:39Z post30310: Re: if_attach return SIGABORT http://community.qnx.com/sf/go/post30310 On Fri, May 29, 2009 at 08:51:05AM -0400, Guillaume Varlet wrote: > I get those messages on slogger : > > Feb 01 06:08:30 1 14 0 if_attach: ex_init: 16 > Feb 01 06:08:30 5 21 0 run fault pid 622635 tid 2 signal 6 code 0 ip 0xb033b879 tmp/io-pkt-v4-hcgvarlet124360136316929 pthread_mutex_init() returned EBUSY: EBUSY The given mutex was previously initialized and hasn't been destroyed. You need to use a separate struct ifnet for each interface. -seanb Fri, 29 May 2009 12:53:17 GMT http://community.qnx.com/sf/go/post30310 Sean Boudreau(deleted) 2009-05-29T12:53:17Z post30309: Re: if_attach return SIGABORT http://community.qnx.com/sf/go/post30309 On Fri, May 29, 2009 at 06:24:30AM -0400, Guillaume Varlet wrote: > Hello All. > > I've some difficulties with if_attach function : > > On my HW, there are several network controlers that shall be initialised at the same time. > > To do such, I dectect each ctrls and puts it's information in linked list. > > To register my driver to the network stack, I need to call if_attach each time there are ctrls on my HW. > > Basicaly, on my develepment system, I have 2 controlers. > > Strange stuff : When I call 1 time with my first controler it register the device without any problem. > > When I do an ifconfig I ca see my device registered. > When the second controler is registered, I'm catching a SIGABORT signal. > Attached, screenshot of debugger when it occurs. > > Do you know why this append ? The stack probably panic()'d. Check the sloginfo for more information. BTW the source for the stack is in the networking repo in this project. Regards, -seanb Fri, 29 May 2009 12:51:32 GMT http://community.qnx.com/sf/go/post30309 Sean Boudreau(deleted) 2009-05-29T12:51:32Z post30308: Re: if_attach return SIGABORT http://community.qnx.com/sf/go/post30308 I get those messages on slogger : Feb 01 06:08:30 1 14 0 if_attach: ex_init: 16 Feb 01 06:08:30 5 21 0 run fault pid 622635 tid 2 signal 6 code 0 ip 0xb033b879 tmp/io-pkt-v4-hcgvarlet124360136316929 Fri, 29 May 2009 12:51:01 GMT http://community.qnx.com/sf/go/post30308 Guillaume Varlet 2009-05-29T12:51:01Z post30305: if_attach return SIGABORT http://community.qnx.com/sf/go/post30305 Hello All. I've some difficulties with if_attach function : On my HW, there are several network controlers that shall be initialised at the same time. To do such, I dectect each ctrls and puts it's information in linked list. To register my driver to the network stack, I need to call if_attach each time there are ctrls on my HW. Basicaly, on my develepment system, I have 2 controlers. Strange stuff : When I call 1 time with my first controler it register the device without any problem. When I do an ifconfig I ca see my device registered. When the second controler is registered, I'm catching a SIGABORT signal. Attached, screenshot of debugger when it occurs. Do you know why this append ? Thank you very much. Fri, 29 May 2009 10:23:29 GMT http://community.qnx.com/sf/go/post30305 Guillaume Varlet 2009-05-29T10:23:29Z post28224: Re: link to shared libraries *.so http://community.qnx.com/sf/go/post28224 Hi, I have this problem since 6.4. If you have a dynamic library xxx.so, you get a dependency to xxx.a file. This is a problem of the current qnx make tree. If you make your project with eclipse, you get a ".qnx_internal.mk" included by common.mk, which solves the problem. A not very nice workaround is to generate a dummy "xxx.a" in the library install path. If you have installed both, "xxx.a" and "xxx.so", your build is also working. But the make run uses the dependency for xxx.a to link against xxx.so. Perhaps one of the gnu make Guru's can fix this pronblem. I am wondering why this hidden strange file ".qnx_install" is used with eclipse. Regards Michael > Hello. > > On my io-net drive, it was easy to ling against shared libs. > In my driver I need to link to a HW specific access shared lib. > > With io-pkt, I do not understand what happends... > > I entrer name of shared libs, with the dynamic parameter set, but it tries to > load a static lib anyway... > > make[2]: *** No rule to make target `libmen-oss.a', needed by `G:/CVS/work/QNX > /src/DRIVERS/devnp/men-z087/x86/dll-g/devnp-men-z087_g.so'. > > And if you specify the LIBS+=-Bdynamic men-oss men-dbg drvrS men-chameleon : > > make[2]: *** No rule to make target `lib-Bdynamic.a', needed by `G:/CVS/work/ > QNX/src/DRIVERS/devnp/men-z087/x86/dll-g/devnp-men-z087_g.so'. > make[2]: *** No rule to make target `libmen-oss.a', needed by `G:/CVS/work/QNX > /src/DRIVERS/devnp/men-z087/x86/dll-g/devnp-men-z087_g.so'. > make[2]: Target `all' not remade because of errors. > > Why ? > > Thank you very much for your help. Tue, 28 Apr 2009 11:36:40 GMT http://community.qnx.com/sf/go/post28224 Michael Tasche 2009-04-28T11:36:40Z post28218: link to shared libraries *.so http://community.qnx.com/sf/go/post28218 Hello. On my io-net drive, it was easy to ling against shared libs. In my driver I need to link to a HW specific access shared lib. With io-pkt, I do not understand what happends... I entrer name of shared libs, with the dynamic parameter set, but it tries to load a static lib anyway... make[2]: *** No rule to make target `libmen-oss.a', needed by `G:/CVS/work/QNX/src/DRIVERS/devnp/men-z087/x86/dll-g/devnp-men-z087_g.so'. And if you specify the LIBS+=-Bdynamic men-oss men-dbg drvrS men-chameleon : make[2]: *** No rule to make target `lib-Bdynamic.a', needed by `G:/CVS/work/QNX/src/DRIVERS/devnp/men-z087/x86/dll-g/devnp-men-z087_g.so'. make[2]: *** No rule to make target `libmen-oss.a', needed by `G:/CVS/work/QNX/src/DRIVERS/devnp/men-z087/x86/dll-g/devnp-men-z087_g.so'. make[2]: Target `all' not remade because of errors. Why ? Thank you very much for your help. Tue, 28 Apr 2009 09:21:00 GMT http://community.qnx.com/sf/go/post28218 Guillaume Varlet 2009-04-28T09:21:00Z post28113: RE: malloc() and free() with more than 1 arg. http://community.qnx.com/sf/go/post28113 Hi Guillaume: One of the goals of the io-pkt design was to re-use as much of the NetBSD code as possible with as few changes as possible. NetBSD being a monolithic kernel design has all of the network stack (and drivers) running in the kernel (and this is why the KERNEL macro is defined). So the short answer is that you should use the malloc and free API in an identical manner to the drivers that are already there. Now, that being said, I believe that the re-defines from the POSIX API to the NetBSD API comes from muf.h (although I can't remember for sure). So if you don't have any mbuf accesses in your file (and you haven't included any of the headers that pull in mbuf.h (which isn't going to be easy... trust me...)) then you might just be able to use straight malloc calls. I wouldn't advise it though. Robert. -----Original Message----- From: Guillaume Varlet [mailto:community-noreply@qnx.com] Sent: Mon 4/27/2009 6:12 AM To: ionetmig-networking Subject: malloc() and free() with more than 1 arg. Hello. I'm writting an iopkt driver based on speedo model. I'm porting a code from io-net. io-pkt drivers expects malloc and free with more than 1 arg such as : free(freeptr, M_TEMP); malloc(strlen(optstring) + 1, M_TEMP, M_NOWAIT); wereas doc is saying : Synopsis: #include <stdlib.h> void* malloc( size_t size ); Arguments: size The number of bytes to allocate. Where does this macro are defined ? Is it possible to do not use them ? Thanks. Guillaume _______________________________________________ io-net migration http://community.qnx.com/sf/go/post28109 Mon, 27 Apr 2009 12:01:10 GMT http://community.qnx.com/sf/go/post28113 Robert Craig 2009-04-27T12:01:10Z post28112: Re: malloc() and free() with more than 1 arg. http://community.qnx.com/sf/go/post28112 I Found the reason : _KERNEL is defined. Is _KERNEL define mandatory to build io-pkt driver? Thanks, Gui. Mon, 27 Apr 2009 11:08:22 GMT http://community.qnx.com/sf/go/post28112 Guillaume Varlet 2009-04-27T11:08:22Z post28109: malloc() and free() with more than 1 arg. http://community.qnx.com/sf/go/post28109 Hello. I'm writting an iopkt driver based on speedo model. I'm porting a code from io-net. io-pkt drivers expects malloc and free with more than 1 arg such as : free(freeptr, M_TEMP); malloc(strlen(optstring) + 1, M_TEMP, M_NOWAIT); wereas doc is saying : Synopsis: #include <stdlib.h> void* malloc( size_t size ); Arguments: size The number of bytes to allocate. Where does this macro are defined ? Is it possible to do not use them ? Thanks. Guillaume Mon, 27 Apr 2009 10:12:28 GMT http://community.qnx.com/sf/go/post28109 Guillaume Varlet 2009-04-27T10:12:28Z post24716: Re: sending data from io-pkt module upon DMA completion http://community.qnx.com/sf/go/post24716 > On Wed, Mar 18, 2009 at 05:38:54AM -0400, Yuri Shchors wrote: > It sounds like you may be able to attach to the interrupt like > other drivers. Maybe check out speedo_attach() in > sys/dev_qnx/speedo/detect.c which sets up an interrupt callout > and ISR. Does this mean that I can use pulse_attach or InterruptAttach in the module init routine? Does the pulse callback block other io-pkt activity? > ifp->if_output() has to be thread safe. For example ether_output() > generally only acts on the packet in question or checks state when > needed. ifp->if_start() is called with the ifp->if_snd_ex mutex > locked. So I should call if_start before calling to if_output? I've used qnet ipv4 driver as a sample and havn't seen if_start there. Wed, 18 Mar 2009 16:30:24 GMT http://community.qnx.com/sf/go/post24716 Yuri Shchors(deleted) 2009-03-18T16:30:24Z post24715: Re: RE: sending data from io-pkt module upon DMA completion http://community.qnx.com/sf/go/post24715 > Hi Yura: > > I'm a bit curious as to what you're trying to accomplish. Do you have a > network card that you're trying to write a driver for or is this some > other sort of application? > > Robert. > Hi, I have a 533 Mhz, MPC8360 chip with DMA block and I need to push large amounts of data through it's 1Gbit ethernet MAC(up to max capacity - 125Mb/sec). The data arrives from external bus which has sufficient bandwidth. I've written standalone program that uses DMA to get the data. Now, I need to send it through the network. Writing a simple test program that sends raw IP packets, yields rather poor result (max speed about 40Mb/s), so I've decided to write io-pkt module to avoid unnecessary copying of data, since I know it's physical location. Using mmap I can access the data brought by DMA. The io-pkt module should make a packets from the data and send them. The problem is in getting notification from external program. The simplest way seem to be in using pulse_attach in module initialization routine and doing all the work in the pulse handler, but I don't know if it'll block rest of the io-pkt activity and in which thread's context it gets called. The thread is other possibility, which seems to be more complicated to me. Any advice is welcome. Yura. Wed, 18 Mar 2009 16:19:56 GMT http://community.qnx.com/sf/go/post24715 Yuri Shchors(deleted) 2009-03-18T16:19:56Z post24696: RE: sending data from io-pkt module upon DMA completion http://community.qnx.com/sf/go/post24696 Hi Yura: I'm a bit curious as to what you're trying to accomplish. Do you have a network card that you're trying to write a driver for or is this some other sort of application? Robert. -----Original Message----- From: Yuri Shchors [mailto:community-noreply@qnx.com] Sent: Wednesday, March 18, 2009 5:39 AM To: ionetmig-networking Subject: sending data from io-pkt module upon DMA completion Hi, I'm using a chip with internal DMA block. When DMA completes I'll get a pulse from DMA ISR. I'm writing io-pkt module that'll send the data upon DMA completion. Can I use pulse_attach() function and send all the data(few megabytes) from inside the pulse handler or should I use nw_pthread_create() to create separate thread ? Can if_output() function be used from multiple threads/pulse handler or some semaphore should be locked? Thanks, Yura _______________________________________________ io-net migration http://community.qnx.com/sf/go/post24654 Wed, 18 Mar 2009 14:44:20 GMT http://community.qnx.com/sf/go/post24696 Robert Craig 2009-03-18T14:44:20Z post24677: Re: sending data from io-pkt module upon DMA completion http://community.qnx.com/sf/go/post24677 On Wed, Mar 18, 2009 at 05:38:54AM -0400, Yuri Shchors wrote: > Hi, > I'm using a chip with internal DMA block. > When DMA completes I'll get a pulse from DMA ISR. > I'm writing io-pkt module that'll send the data upon DMA completion. > Can I use pulse_attach() function and send all the data(few megabytes) > from inside the pulse handler or should I use nw_pthread_create() to create separate thread ? It sounds like you may be able to attach to the interrupt like other drivers. Maybe check out speedo_attach() in sys/dev_qnx/speedo/detect.c which sets up an interrupt callout and ISR. > Can if_output() function be used from multiple threads/pulse handler or > some semaphore should be locked? ifp->if_output() has to be thread safe. For example ether_output() generally only acts on the packet in question or checks state when needed. ifp->if_start() is called with the ifp->if_snd_ex mutex locked. Wed, 18 Mar 2009 13:33:56 GMT http://community.qnx.com/sf/go/post24677 Sean Boudreau(deleted) 2009-03-18T13:33:56Z post24654: sending data from io-pkt module upon DMA completion http://community.qnx.com/sf/go/post24654 Hi, I'm using a chip with internal DMA block. When DMA completes I'll get a pulse from DMA ISR. I'm writing io-pkt module that'll send the data upon DMA completion. Can I use pulse_attach() function and send all the data(few megabytes) from inside the pulse handler or should I use nw_pthread_create() to create separate thread ? Can if_output() function be used from multiple threads/pulse handler or some semaphore should be locked? Thanks, Yura Wed, 18 Mar 2009 09:38:50 GMT http://community.qnx.com/sf/go/post24654 Yuri Shchors(deleted) 2009-03-18T09:38:50Z post22273: RE: io-net VS io-pkt: Unix Domain Sockets http://community.qnx.com/sf/go/post22273 > I'm also curious about the fact that io-pkt and io-net were > run on the same system. > > Was this running io-net binaries compiled on 6.3.2 under > 6.4.0 or was io-net built under 6.4.0? We took the io-net binaries (ifconfig, npm-tcpip.so, devn-whichever.so as well) from the 6.3.2 installation CD. We didn't touch the libsocket libraries on the 6.4.x target before running the tests. -asherk Fri, 13 Feb 2009 20:50:25 GMT http://community.qnx.com/sf/go/post22273 Andrew Sherk 2009-02-13T20:50:25Z