Programming :: Write A Program In C To Detect The Ethernet Cable?

Mar 11, 2009

write a C program to detect whether the Ethernet cable is plugged or unplugged. I found out by using a command "nm-tool" in Linux terminal will show me whether a Ethernet cable is plugged or not. If Ethernet cable is plugged, in the device part of eth0, the Hardware Link of Wired Settings will indicate a "yes" and "no" if no Ethernet cable. Hence, in my previous code, I use one function called popen to read the state as shown below:

PHP Code:

[code]....

However, now my project wish to not use the NetworkManager (where the "nm-tool" command comes from). And this gives me trouble to detect the Ethernet cable. So is there any other method for me to detect the Ethernet cable in C programming?

View 8 Replies


ADVERTISEMENT

Programming :: Write A Program In C That Can Sniff Packets From Ethernet And Distinguish RTP Packets From Non-RTP Packets?

Aug 30, 2010

i need to write a program in c that can sniff packets from Ethernet and distinguish RTP packets from Non-RTP packets, i have no idea what should i do

View 9 Replies View Related

Ubuntu / Apple :: EMac And IMac File Sharing With Ethernet Cable And Other Cable?

Oct 12, 2010

how I could file share, or make the whole Hard Drive (HDD) accessible to another computer. The two other computers I have are a Toshiba Laptop with Ethernet and USB, and a iMac Intel with Firewire, USB, and Ethernet. Putting these to use along with:

Three Ethernet Cables
Two Printer Peripheral USB Cables
The Two Computers
A 2GB Flash Drive

That is all I can think of right now. I do not want to use CDs. In a way, I would like to do a network boot. So, how do I get the whole HDD visible to the others computers (either/both) and be able to write to it? I want to put Xubuntu on it, and earse the rest of the Hard Drive. The computers getting this are the iMac G3s and the eMac G4. The eMac has 256MB RAM, 40GB HDD, and a 700MHz processor. Two iMacs have 128MB RAM, 40GB HDD, and a 600MHz Processor. The other iMac is the same as the rest but has a 500MHz processor.

View 8 Replies View Related

Programming :: Detect If A File Is Used In Write Mode?

Apr 14, 2011

I have to read files from a linux server. When I copy a file I receivce just a portion of the file I expected if the process generationg ths file is still writing it.

I read the file from a java apllication using SSH/SFTP. How can I detect if the file is still used by the writing process ?

View 4 Replies View Related

Programming :: Detect Port Scanning Without Psad - Write Own IDS

Oct 4, 2010

Is possible to detect port scanning just by using utilities included in linux (netstat, iptables...), Yes there is utility called psad but I would write some scripts for my own and learn something new

writing own Intrusion Detection System? I am not a C++ geeg, so first thing that comes to my mind is that i will use simple BASH SCRIPT that will interact with iptables and monitor user activity, network activity etc. (but I thing that would not be good solution due to performance and capabilities, and also I am not familliar with memory in linux at all). I was reading aboud SNORT HIDS, NIDS... AFAIK some information can be obtainet from /proc but I have no idea which values should be monitored.

View 1 Replies View Related

Programming :: Write A Script That Will Detect All The Unwanted Files In A Particular Directory

Apr 1, 2011

I want to write a script that will detect all the unwanted files in a particular directory and delete them in one fly..

View 11 Replies View Related

Programming :: Detect Pipe From Running C Program?

Jan 24, 2009

I'm looking for a way to detect whether or not a program has been called from pipe, e.g.

Code:

whatever | my_program
versus simply just being exectuated directly:

Code:

my_program

Why? In the first case, I want to run the program non-interactively, and in the latter case I want to print out user-friendly messages. I've been thinking along the lines of some check I haven't yet found, like:

Code:

if( stream_buffer_is_not_empty() )
print_interactive_messages();

View 1 Replies View Related

Programming :: Detect Opening Of A File Using A C Program?

Jul 19, 2011

how to detect if a file is being opened by any application so that i can block it just before opening it... Actually i am working on android and using iNotify in JNI to detect the OPENING of a file...but the file is getting opened before the iNotify detects it..and therefore its displaying the contents of the file unmodified .. The actual requirement is that if anyone is trying to open the file it should be modified by my program and then the modified file should be opened.

View 10 Replies View Related

Programming :: Write A Program (in C)?

Feb 26, 2010

I want to write a program (in C), which does 4 or 6 simultaneous calculation. Is there away of doing something like:

do at the same time{
Core 1 do:
this_thing_1

[code]....

View 3 Replies View Related

Programming :: C++ Program Does Not Write File

Jun 26, 2011

I have the following problem. I call a C++ program from a Java servlet by using Runtime exec. The OS is ubuntu and I use Netbeans 7.0 with Glassfish 3.1 web server.The program executes but it does not open and write into a specified file in a specified folder. The same C++ program compiled under Windows opens and writes this file.How can I solve this problem in Linux?

View 2 Replies View Related

Programming :: Write A Program That Interacts With MySql In C

Mar 28, 2011

Im trying to write a program that interacts with MySql in C . Im using slackware 13.1 64 bit and Ive installed MySql , getting help from this page : [URL] .

This is the program I have ( I know they arent any vars here , i just thought it wasnt necessary )

Code:
#include <stdio.h>
#include <mysql/my_global.h>
#include <mysql/my_sys.h>
#include <mysql/mysql.h>

[Code]....

This program is from the MySql website ( a tutorial they have up there ). When I run this program I get hundreds of lines of errors , nothing related to my program , but the headers, indicating that there are syntax errors and all kinds of other problems in them.

View 8 Replies View Related

Programming :: Write A Customized Program For Business?

Dec 13, 2010

My company manufactures satellite TV receiveing equipment. Out current software is quite long and and a bit of an annoyance for customers. I would like the help of a programmer to create for us a customised, easy to use GUI, built to our specification.

View 2 Replies View Related

Programming :: Write The Value To The Proc Entry In The Program?

May 1, 2011

I have a kernel module program which is used to create a entry in the proc file system. I have to read and write values in the entry. Its taken from a online tutorial stuff.how to write the value to the proc entry in the program ?

View 1 Replies View Related

Programming :: How To Write Simple C Program In RHEL5

Sep 17, 2010

How can i write a simple c program in my RHEL5?I am more concerned about what are toosl i need to install to get a C platfrom running in my RHEL5?

View 14 Replies View Related

Programming :: Select() Call Does Not Detect Data In Pipe Between Parent And Child Program

Sep 23, 2009

i wanted to capture the stdout and stdin of a child process within a parent so that any output of child is sent to the parent and any input taken from the parent. code is simple enough and i have followed all code guidlines on the internet (some guidlines do differ also) my select call either hangs if i do not give a tmeout and with a timeout it returns 0 descriptors to be written to or read from:

below is the simple code for parent:

int main(void)
{
int outfd[2];
int infd[2];

[code].....

why select hangs without a timeout ... why can it not detect that the pipe is write ready i.e parent can write to it ... if it does not detect tha read pipe as having data...

View 5 Replies View Related

Programming :: C - When Write A Program That Gives The Segmentation Fault Error

Jun 9, 2010

I am using Ubuntu 9.04 linux 2.6.28-11-generic. When I write a program that gives the "Segmentation fault" error, or when I send this signal (SIGSEGV) to a program, the "Segmentation fault" is shown and no core dumped. When I look for "core" file in the current directory, I can't find it, too.

View 2 Replies View Related

Programming :: Write A Program In C Which Will Generate A Maze Randomly ?

Oct 8, 2010

I want to write a program in C which will generate a maze randomly and find the solution for it ..

The idea behind is in [url]

How the 16 bit integer is stored in a variable..Earlier I wrote a program on trees and displayed it using dotty.. Is there any such tool to display a maze..I am using ubuntu 10.04.

View 1 Replies View Related

Programming :: Write A Simple Character Printing Program Using NASM?

Jul 27, 2010

i tried a code to accept a character and print the same ! i can accept it with following code but its not working with printing that character i use NASM version 2.07

Code:

segment .data
msg1: db 'Enter a key',10
msg1len: equ $-msg1

[code]....

View 3 Replies View Related

Programming :: Write A Program Which Will Read Input From A Text File

Apr 7, 2010

i am trying to write a program which will read input from a text file, check if each line contains any alphabets and then display a message imforming me if there is an alphabet in each line. My text file is formatted in this way...

[Code]....

View 2 Replies View Related

Programming :: Write A Small Program That Shows Some Stockquotes And Indexes Etc On The Desktop?

Aug 29, 2010

I want to write a small program that shows some stockquotes and indexes etc on the desktop. Does anyone know how to get the quotes from google, yahoo etc? Do I rip it from the webpages or is there some other way?

View 3 Replies View Related

Programming :: Write A Bash Script Program In System Command Terminal?

Mar 22, 2010

I'm trying to write a bash script program in the Linux command terminal that will write to a fellow user and then continue reading down the program. this is what i have (kind of explains the idea too):

#!/bin/sh

clear
echo "this is before the write command"
write jcummins
this message should go to jerry
echo "the message didn't send and this string will not appear"
echo "it appears it has stopped at the write command"

View 5 Replies View Related

Ubuntu :: Can't Get It To Ethernet Cable

Jun 1, 2011

I just purchased an HP Pavilion p6710f desktop with an ralink wireless n card, and 11.04 won't recognize it in 'Additional Drivers'. I can't get it to an ethernet cable, and then check for more additional drivers (did this on an old laptop), so what can I do??

View 4 Replies View Related

Hardware :: Cannot Detect Modem - USB Cable - In Slackware 13.1

Dec 4, 2010

I installed slackware 13.1 a couple of days ago. I am a complete linux newbie..I am able to connect to internet from windows using the USB cable of my modem..but this modem is not detected in linux..is there any option to make linux detect it?

I have a pentium 3, 1 GHz processor 256 RAM..and the info below i got from my terminal..

lsusb output

Code:

Code:

And here is some information about my modem

Code:

Features:
-Complies with IEEE 802.3, IEEE 802.3u standards
-One 10/100Mbps auto-negotiation RJ45 port supporting auto MDI/MDIX, 1 RJ11 port, 1 USB port
-Built-in firewall
-Compatible with major ISP lines
-Fast internet access
-Supports bridge and NAT router mode
-Complies with ADSL protocols (ADSL/ADSL2/ADSL2+)
-Easy configuration
-Quick response semi-conductive surge protect circuit, provides reliable ESD and surge-protect function
-Supports firmware upgrade
-Built-in DHCP server

View 4 Replies View Related

Ubuntu :: No Ethernet Cable - Means Frozen ?

May 24, 2011

I installed Ubuntu 11.04 on my girlfriends laptop a couple days ago...had the Ethernet cable plugged in to do the install...loaded fine the first time after the install. Unplugged the Ethernet cable when I had the wireless network set up and it froze. Restarted and it wouldn't even load the desktop. Didn't make the connection at first...thought there was something wrong with Unity. After about a day and a half worth of searching Unity problems/desktop freezing and solutions, I stumbled across this:

Quote:

Do you have a Broadcom card? You have probably noticed the desktop works when you run Ethernet but it locks up when your wireless connection is active.

You'll need to upgrade the kernel to fix the issue. 2.6.39.0 did it for me.

11.04 just runs fine now.

This solution was to update the kernel, but that didn't work for me. Now I'm stuck.

View 8 Replies View Related

Ubuntu :: Not Getting Network Connectivity Via Ethernet Cable?

Jul 14, 2011

I've just installed Ubuntu Desktop and connected the ethernet cable, but I don't have network connectivity. Why?

View 7 Replies View Related

Ubuntu :: 9.10 - No Internet Connection Via Ethernet Cable

Mar 9, 2010

I just built my first pc, installed ubuntu 9.10 and tried connecting to the net through my ethernet cable and all that happens is it says cannot find server. Do I need to install network settings & if so what & where,or should it automatically detect them? As this is my first build I am a novice but am willing to listen & learn.

View 3 Replies View Related

CentOS 5 Hardware :: Connect Pc To Pc With Ethernet Cable?

Jan 6, 2011

i have two PC (one laptop and other desktop) how to connect both with lan cable?

View 1 Replies View Related

OpenSUSE Install :: Force 80 Pin Cable Detect On Cdrom?

Oct 16, 2010

I need to force 80 pin cable detect on my cdrom. According to the kernel-parameters.txt file you can do this by using libata.force=(port).(device) 80c Here is the actual explanation from the kernel file: libata.force=[LIBATA] Force configurations. The format is comma separated list of "[ID:]VAL" where ID is PORT[.DEVICE]. PORT and DEVICE are decimal numbers matching port, link or device. Basically, it matches the ATA ID string printed on console by libata. If the whole ID part is omitted, the last PORT and DEVICE values are used. If ID hasn't been specified yet, the configuration applies to all ports, links and devices.

My question is where do you find the proper port.device numbers? I'm guessing it's lspci but I'd rather be sure before I do something silly.. An actual working line for a cdrw as master on the first ide channel would be excellent. BTW my cdrw is detected as sr0 so the normal "ide" boot params won't work....

View 9 Replies View Related

OpenSUSE Network :: Internet By WiFi While Using Ethernet Cable ?

Jul 27, 2010

My WiFi can connect to internet without any problem, until I plug my ethernet cable ...then I lose internet.

So the question is : how do I configure my ip/dns and stuff to still have internet when I'm plugged by cable at the same time! it was working on windows ;-)

View 3 Replies View Related

Ubuntu Networking :: No Connection With 75ft Ethernet Cable?

Sep 21, 2010

I am trying to run a cable from my wireless router over a 75ft cat6 cable to my bedroom. I don't get any connection on my end and I don't have any other ideas. I did setup a m0n0wall box just to try. I got the network led on my server to light up in my room but nothing more than that. Lastly, I tried adding a 5 port switch in my room and then connecting that to my server and nada.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved