Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I called rte_eth_dev_stop() on my Ethernet Controller 10G X550T card , after this when I make a call to rte_eth_get_link_nowait() on same device , the link read from link register of the device still shows as UP!
But when I bring the device link down by bringing the other end of the connection physically down, the rte_eth_get_link_nowait() call shows the link as DOWN!
The server is running on a bare metal architecture.
The DPDK PMD is ixgbe.
DPDK version 18.05
why is this so ? any idea?
DPDK API rte_eth_dev_set_link_down is responsible for Link state down. While DPDK API rte_eth_dev_stop is responsible for internally stopping rx-tx queues and thereby making rte_eth_rx_burst and rte_eth_tx_burst` as 0 always.
Hence the expectation rte_eth_dev_stop to bring link state down for X550 is not true with DPDK PMD ixgbe.
Note:
unlike Linux ifconfig up and ifconfig down, the user space PMD dev_configure, start and stop are different. Please feel free to check the details in code.
with DPDK 20.11 return value is updated from void to int https://doc.dpdk.org/guides/rel_notes/release_20_11.html?highlight=rte_eth_dev_stop
Since link state is governed by HW registers in the ASIC, different PMD may work differently. Hence please check the code for other PMD for more details.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm trying to find a proper way how to reuse existing implementations of wifi tools(iw) in own code(c\c++). I need to get information about available AccessPoints in range(signal strength, mac addr., etc). I found couple example codes(WEXT and others) that uses ioctl approach, but it makes passive scans(and i get new information only once in two minutes in my network)[UPDATE1: Thanks to #fluter, i know that WEXT can do active scanning, too.]. I found that iw makes an active scan and that is what i need. So my question:
Is there a way to use iw code in my own app without parsing its source code in chunks, or, maybe, there is an Wireless API for such purpose?
(UPDATE1: with basic code examples to start with.)
Similar question
UPDATE2: I have reviewed my task and found that AP information is not enough for me, i need to capture clients data, too. That leads me to wifi packet sniffing and the best tool i have found to do that is Horst. So, i'm trying to reuse its code in my app, now.
You might wish to start with cfg80211.
cfg80211 replaces Wireless-Extensions and it is suggested that :
All new Linux wireless drivers should be written targeting either cfg80211 for fullmac devices or mac80211 for softmac devices.
Also, it is written:
Instead of writing wext ioctls you now write cfg80211 operation
callbacks and fill in the wiphy struct to indicate to cfg80211 its
device capabilities.
To start with active scanning start here
You can use the wext api provided by kernel, basically, call ioctl with SIOCSIWSCAN, and get the scanned result with SIOCGIWSCAN.
You can set to scan all by using flag IW_SCAN_ALL_ESSID, and choose scan type with flag IW_SCAN_TYPE_ACTIVE or IW_SCAN_TYPE_PASSIVE.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm using C++ and libusb-win32 to try and communicate with a commercial USB device ... I don't know much about USB programming, but I want to send some commands to the device that I know from using a sniffer program. Libusb-win32 seemed OK, but it looks like it can only be used on a device that uses the libusb driver for the device.
I want to use it on a device with a driver "USB Composite Device" driver provided by windows usbccgp.sys ... is it even possible? If not, how can I do this?
I just need to send some Control Transfers
This is currently not possible. libusb is designed around the Linux driver model where composite devices are treated as a single device by the system. Windows treats composite devices as multiple separate ones - a parent composite device and child devices for each interface.
As such libusb cannot access the child devices without first changing the parent driver to a libusb supported one. It can be done but then the device won't work with the vendor supplied software.
If you want to talk to a commercial device you need to contact the manufacturer and find out if there is an interface to that device that is published through their driver. Most manufacturers won't have a way to interface with generic control requests in a product. There may be an undocumented IOCTL, but again you'll need to work with them to get this information.
If you just want to hook the device and send it a control request then you need to replace the manufacturer's driver with the libusb driver. The problem here is that while you can get at the device it may not function the way you want unless you spoof what the manufacturer does (for example, the device might expect some vendor specific communication to get the device ready to interact with the host). If you do see problems then you can reverse engineer the vendor specific protocol by looking at the USB line through some hardware analyzer.
Read USB Complete, it's a great introduction to the USB protocol and will help you understand more of what's going on between a USB device and your host PC.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm trying to build a program in c++ to see what game servers a client is connected to for a gaming site. For the program we need to be able to see if a client is connected to a specific server or not. I've tested using wireshark and this program can see the incoming/outgoing connections to and from the server - which is the exact thing I need but i'm just not sure how to do it. I understand you can see which port connections are going in and out through using command prompt using netstat, but netstat doesnt give the details i'm after. All I need to be able to do is basically scan through their outgoing connections and compare it to an IP, and if the IP matches then they're connected to the server.
Is this possible through c++? If not, does anyone know how wireshark does it?
Cheers.
This depends on your operating system and is different in Windows and Linux.
In Linux you can get all of the information about a program's sockets using lsof -p [PID] where PID is the program's PID.
To do this in your own program look up the lsof source code and see how it is done. As I recall, it is done by reading files in /proc.
In Windows you could try C++ Get Handle of Open Sockets of a Program
Check out libpcap http://www.tcpdump.org/
You may need to deconstruct the UDP/TCP packets themselves.
If you want a simpler solution you could pipe the output of tcpdump as stdin. You can give tcpdump filter to ensure your application isn't spammed with useless content.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm looking to create a mobile app on IOS devices before I started I just needed to check up on one thing. How can I detect other IOS mobile devices within local rage e.g same room, same train, etc..
I want to be able to do it while the phone is locked, so bluetooth wouldn't be a great example as most people have it turned off.
Thanks!
The application has to send its location to the server.
Then the server knows where every devices that shared its location are.
Then your application can ask "who is around?" to your server... and your server calculates (let's suppose within a radius of 2 miles) who is around... and sends back to you.
It doesn't have anything to do with bluetooth. It's done via regular internet.
For other users of your app who want to be discovered you could use Bluetooth LE and the new iBeacon support added in iOS 7. Each user would have to launch your app and give it permission to start "advertising" their presence. However, the range of Bluetooth LE is like 10-20 meters (I forget the exact figure) and that will go down in "RF hostile" environments.
If everybody's connected to the same WiFi network you could use Bonjour.
Another option, as suggested by Wagner, above, is to have the devices send their locations to a central server.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Hi I am trying to write a windows virtual com port driver which will divert the data to a IP address. any pointers, best practice will be of help?
I know of a Open source project called com0com which is virtual com port redirector. there is a subproject called com2tcp in that which you can look atcom0com. otherwise for windows I am not sure you have any open source available
Between there are commercially available software such as the one from Eltima and tactical software. there are few freewares too, you can search by the name comport redirector.
Check out this example of a User Mode Driver from Microsoft:
Archive.org -> Microsoft.com: Virtual serial driver sample (FakeModem)
Github.com/Microsoft : Virtual serial driver sample (FakeModem)
You can take a look at the open source project Null-modem emulator (com0com) which includes a COM port to TCP redirector.
you can look at the software development kit from Constellation Data Systems, Inc.