I am learning about raw sockets. I heard that ping utility is using raw sockets. So I want to study it source. So can somebody help me to find where is the source code of ping utility in the linux-2.6 kernel code.
It's not part of the kernel. It's part of the iputils package.
Its not in kernel. ping is part of "iputils". find an iputils source package and look from there.
As previously mentioned, it's included in iputils, but also inetutils. Therefore you can run either of the following (assuming Debian/Ubuntu Linux) to view the source:
apt-get source iputils
apt-get source inetutils
Related
I am currently trying to write some code for using a remote control with a Raspberry Pi 3.
I installed LIRC according to a tutorial and it does work, but:
In the /etc/lirc/hardware.conf I have a line:
DRIVER="default"
but when I run mode2 -d /dev/lirc0 it says: Using driver devinput on device /dev/lirc0, which is giving wrong me the output.
I suspect this is also the reason why irw shows nothing when I run it and press buttons on my remote.
When I run mode2 -d /dev/lirc0 -H default it works just fine, but I can't specifiy that when running irw. (Or anything else that depends on LIRC)
Why is LIRC ignoring the DRIVER-line?
It depends on the lirc version; the debian packaging is part of the issue.
lirc as of 0.9.0, a really old version, has been part of debian for a (too) long time while the project has advanced. The hardware.conf file is part of the debian packaging of 0.9.0 (it has never been part of the upstream project).
Some years (2?) debian finally took the step to modernize lirc, and as part of this the hardware.conf file is not used, replaced by several files. lirc_options.conf is one of them. This makes lirc on debian work ín the same way as other distributions.
The official guide to lirc configuration is http://lirc.org/html/configuration-guide.html. Please disregard anything involving hardware.conf if your lirc is beyond 0.9.0 - it is by definition docs broken beyond repair.
I found out why the standard driver was not default but devinput:
It seems the driver for LIRC to use isn't actually to be specified in hardware.conf but in /etc/lirc/lirc_options.conf.
If I now run mode2 -d /dev/lirc0 it uses default as driver.
However, this didn't, as I hoped, resolve my issues with irw.
I'm looking for a way to install libmysqlclient on an OpenWRT (ver: Attitude Adjustment) wireless AP.
I've (finally) been able to successfully cross-compile a small C program for the AP, but when trying to install it I get an error indicating that the libmysqlclient dependency for my program cannot be satisfied.
Seems pretty obvious, right? Just install libmysqlclient and be done with it. If only I could figure out how to install the library...
Is it as simple as copying libmysqlclient (which I have on my main box) to the appropriate directory on the AP? OpenWRT uses opkg as a package manager but opkg has no idea what libmysqlclient is.
I'm afraid I'm a little out of my depth here and any guidance the community can provide would be greatly appreciated.
EDIT: Forgot to add that in my research I've found that there are other packages that can be installed on OpenWRT, such as MySQL, that rely on the library in question, so there must be a way to install it. The Makefile for MySQL found here (under libs -> mysql) indicates quite clearly that it is dependent on libmysqlclient.
Turns out it's just buried deep in the bowels of the internet. The following command will install libmysqlclient to your OpenWRT box:
opkg install http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/libmysqlclient_5.1.68-1_ar71xx.ipk
However, this lib depends on a couple others, all of which can be found at OpenWRT's opkg Repository.
I'm trying to use libpcap that was compiled with pf_ring.
I got the sources from ntop, and compiled it.
However, there's something I don't understand (sorry for the newbie linking question):
I wanted to know if my application used the correct pcap version (the one with pfring),
so I typed ldd and didn't see pcap at all, only pfring.
I looked at the output and saw only pfring.so and not pcap, although I dynamically linked to both libs.
I looked at the Makefile of libpcap and saw it linked statically with pfring.a.
I thought I don't have to link with pfring at all, because it's a part of pcap, but got undefined reference.
Does anyone know why I get the undefined reference error and why don't I see libpcap in the ldd output when I link to it dynamically?
Thanks,
Ron
First of all make sure you did all of the following steps:
//Installation
sudo su
cd kernel; make install
cd ../userland/lib; make install
insmod ./kernel/pf_ring.ko
then remove the current libpcap and all of its dependencies from your system.
the pfring enabled libpcap is under /userland/libpcapx as you know.
if you are using pf_ring enabled libpcap in your application simply link libpcap.a to your program.
It's late and I should go to bed and maybe that's why I can't figure this out. I'm on a fedora-13 machine and I just ran
yum install gambit-c
I installed it because I want to follow along in a schemed text book.
but now that it's installed, how do I start the scheme interpreter??
It looks from the RPM listing that the binaries are named gsi, gsix, and gsc, all in /usr/bin. I suspect that gsi is the interpreter.
For more details, there's also the manual entry for gsi.
BTW: I don't know about the Fedora RPM, but I found that the Ubuntu repository's Gambit-C was quite outdated (4.0-ish), with missing features like simple compilation of stand-alone executables. The most recent version is 4.6. If your RPM's version is a few decimal places behind, I'd suggest just installing from source; it's a pretty standard configure -> make -> make install sequence. Just remember the following option when running configure:
./configure --enable-single-host
This speeds things up quite a bit.
I have a project which requires opencl. I have installed CUDA and openCL on my machine but when I 'make' my project the following error occurs:
CL/cl.h: No such file or directory
I know that the i can create a hard link (in my unix (ubuntu) system) to fix the problem:
ln -s /usr/include/nvidia-current/CL
But i consider this a quick fix and not the correct solution. I would like to handle this in my makefile (i guess) so that a simple "make" command would compile. How could I do this?
You need to pass an appropriate -I option to the compiler (by setting CPPFLAGS or CFLAGS, for example). -I/usr/include/nvidia-current sounds like it'd work.
I saw this thread from compile opencl program using CL/cl.h file
I installed 7.5 and added below link in /usr/include, it works for my opencl program. looks like CUDA forget to implement this link after the installation.
ln -s /usr/local/cuda-7.5/include/CL /usr/include
Are you using Ubuntu or Debian distro? Then now you can use this package:
sudo apt-get install opencl-headers