How to specify source address for source-specific multicasting in Gstreamer - gstreamer

I'm trying to set up a gstreamer1.0 client to receive a source specific multicast. It's clear how to set the group ip for the multicast, but I don't see any properties to set the source address. http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-udpsrc.html

Just found it. Set the uri property in the following format:
udp://172.22.200.54#239.130.110.108:10108'
http://lists.freedesktop.org/archives/gstreamer-bugs/2011-June/079642.html

Related

Is it possible to disable reading hosts file by libCurl

There is a detection in VirusTotal: remote System Discovery T1018: Reads the hosts file. For testing I want to get rid of this detection. I suppose that it is libCurl, who reading this file.
Is it possible to disable libCurl from reading hosts and what are consequenses of that?
You can set the CURLOPT_RESOLVE option to explicitly specify the IP address of the remote host in the request. This will bypass the need for libCurl to resolve the hostname using the hosts file.

How to get the TFTP server address from the DHCP configuration

I need to find out the address of the TFTP server that is specified in the DHCP configuration.
When the PC is started on, the computer receives the IP address via DHCP, then downloads the image from the PXE server. During the download of the distribution, I need to run a utility that accesses the Database to the server from which this image was downloaded (where the TFTP server is running).
In theory, it would be possible to register the necessary address of the TFTP server in the downloadable image of the distribution. But the bottom line is that such a scheme exists in various subnets. And specifying its TFTP server for each subnet is an irrational approach. It would be more convenient to get the address of the TFTP server from the DHCP server, which is listed there as next-server
I found something similar at Busybox.
Is it possible to implement something like this in C/C++ and how can it be done? I don't have any ideas.
Some example of the code of contacting the DHCP server to get an address or parameter. Open a socket and make a request or something like that... At least I haven't found any similar examples on the Internet.
P.S. I will put a dislike and send it to read man, than I will answer the question constructively. Nice!
If you are using the ISC dhcp-client then
man dhclient-script
If you are using some other dhcp client then it might have support for calling scripts too. Or it might store the dhcp lease somewhere in a parseable format, like /var/lib/dhcp/dhclient.leases. You can extract the dhcp options from that.

Connecting mq client to mq server with encrypted channel using C++ API

I have a legacy app accessing MQ Server from an MQ Client using the C++ API. How is this API used to add encryption over the Server Connection Channel? I can't find a location where the certificate is provided to the imqChannel object.
You don't provide any code that is not working to help you with so I can provide only some general direction.
You specify the cipher like this:
pchannel->setSslCipherSpecification("TLS_RSA_WITH_AES_256_CBC_SHA256");
You can specify the location of the kdb and sth file like this:
(note in this example it would expect to find two files, /tmp/key.kdb and /tmp/key.sth)
manager.setKeyRepository("/tmp/key");
You can also specify the location of the key repository non-programmatically using the mqclient.ini or setting the MQSSLKEYR environment variable, if you are interested in these options comment and I'll expand this answer.

How to connect to a Wifi that requests for a network security key using Windows Native Wifi Functions?

I'm developing a way to connect to a Wifi using VS2010 and currently stuck on how to make it connect with a network security key. I am able to enumerate all the Wifi hotspot in my area and get their SSID, MAC addresses, etc using Windows Native Wifi Functions (WlanOpenHandle, WlanEnumInterfaces, WlanQueryInterface, WlanGetNetworkBssList). I've already read about WlanConnect() on MSDN but I'm still clueless. Can you give me some hints that would make the code connect to a Wifi that asks for a network security key?
Assuming you have at least one saved Wifi connection run the command
netsh wlan export profile
This will export all your Wifi profiles as XML files in the current directory.
When you call WlanConnect you can supply a literal XML profile string in the WLAN_CONNECTION_PARAMETERS structure if wLanConnectionMode is set to wlan_connection_mode_temporary_profile.
If you can use the XML from one of your exported profiles to connect successfully to a secured network, then presumably you should be able to alter the XML and use the same technique to connect to new networks.
I've never tried this, and I've no idea what encoding is used for the key stored in the XML, but it seems like a possible way of solving your problem.
You will need an example profile to start with, as arx had suggested.
When exporting a profile, add the key=clear arg. This will export the profile with the key in it. You can than see the setup that you would need to adjust.
Example : netsh wlan export profile name=”<profileName>” folder=”<SaveLocation>” key=clear
The resulting xml will contain a section with:
<MSM>
<security>
<authEncryption>
<authentication>WPA2PSK</authentication>
<encryption>AES</encryption>
<useOneX>false</useOneX>
</authEncryption>
<sharedKey>
<keyType>passPhrase</keyType>
<protected>false</protected>
<keyMaterial>YourPaswordTextHERE</keyMaterial>
</sharedKey>
</security>
</MSM>
So once you have your profile string, update the keyMaterial element with your programmatically obtained password. Once this is done you should be able to call wlanConnect.

Listing all Network Connections, then managing one

I'm developing an application in C++ for Windows 7, that sets up a TFTP server to communicate to an embedded device. The device is supposed to be connected directly to the Ethernet port, and it expects a TFTP server on 192.168.1.19 static address.
To simplify user experience, I want the following scenario:
present a list of all network connections registered in the system to the user (same list as in "Control Panel\Network and Internet\Network Connections")
allow to choose one connection
memorize its IPv4 configuration
set IPv4 configuration to 192.168.1.19 and 255.255.255.0
after TFTP job done, restore original IPv4 configuration
The problem I encountered is a mix of the following:
when no Ethernet cable plugged, neither of GetAdaptersInfo, GetInterfaceInfo, GetAdaptersAddresses list the connection I'm interested in;
even if I get that connection, I'm not sure which API to use to set DHCP on/off, static IP, network mask.
I tried using netsh, and it works fine, but I don't want to run it from my app, because I don't want to deal with non-English characters in the connection names.
Suggestions welcome,
Thanks!
===== edit #1
Tried WMI query "Select * From Win32_NetworkAdapter Where NetConnectionID = 'Local Area Connection'" -- no IP address in the feedback, although I can see it in the Control Panel connection properties.
Queries involving Win32_NetworkConnection don't return anything at all.
I ended up using:
"Select * From Win32_NetworkAdapter Where PhysicalAdapter='True' AND AdapterTypeID=0" query to list adapters/connection names/guid - works pretty good
registry to read configuration via guid
netsh to do configuration via connection name. Yes, I had much fun with locales.
I frankly didn't find a more reliable way to work with disconnected connections. Hope this helps. If anyone has better solutions - I'd be glad to see them!