473,385 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DHCP and RAW socket and C

Hi
This is my first post and am a newbie to network programming.
My currrent assignment is concerned with DHCP client server
programming and need some help with that.

I need to request two IP addresses on the client side from the server.
I have a single LAN card and the request is sent from client on the
same LAN card. The first request contains the preffered IP address and
the MAc address and is sent using sendto() function inside another
function send_packet(). The second request contains a preffered IP
address and a third parth MAC address(not the same address on which
the client is working). In sendto() function i get a message "such a
device does not exist". Not surprised by that, but i need to get this
working. Ne ideas from ne one.
I heard i can use RAW sockets instead of Datagram. Will this put the
card in promiscous mode? Is this a solution?

http://www.isc.org/index.pl?/sw/dhcp/

This is the code im using at the client and server side to run the
daemons.

Pls help

Thanks in advance

Apr 22 '07 #1
1 5093
In article <11**********************@e65g2000hsc.googlegroups .com>,
yannifan <su******@gmail.comwrote:
>This is my first post and am a newbie to network programming.
My currrent assignment is concerned with DHCP client server
programming and need some help with that.
Sorry, network programming is not part of the standard C language,
and is not considered topical here. You will need to consult a
newsgroup that deals with the operating system you are using, as
different operating systems handle network programming in different ways.
>I heard i can use RAW sockets instead of Datagram. Will this put the
card in promiscous mode? Is this a solution?
[OT]
RAW sockets do -not- put cards into promiscous mode in any OS I am
aware of, but programming with RAW sockets is decidedly less standardized
than programming for TCP or UDP. I know of at least four different
methods of handling RAW sockets just in "Unix" OS's alone. If
you aren't using RAW sockets then the tcp/ip newsgroup might be able
to help you, if you are using an OS that supports POSIX compliant
sockets, but when you get into RAW sockets, POSIX just basically says,
"They exist, and they are system specific."
--
There are some ideas so wrong that only a very intelligent person
could believe in them. -- George Orwell
Apr 22 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: RosalieM | last post by:
How can i know the nic adress from an incoming socket ? I can easily know the ip adress and port number but how do i have some information about arp level ? Thanks
2
by: Naveen Mukkelli | last post by:
Hi, I'm writing a client/server app. I want to run my server on "Windows Server 2003" PC. This PC has two network cards. 1 for Internet and other is plugged into a switch. My plan is that...
6
by: Luis P. Mendes | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I've developed a program that uses a socket to receive information 24h a ~ day. The problem is that the socket seems to freeze. By that I...
5
by: Richard | last post by:
Hello, I'm working on an application to allow our network team to use a small application to make DHCP reservations on our Microsoft DHCP Server. The problem is you have to use P/Invoke to do...
1
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. ...
0
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes,...
11
by: weird0 | last post by:
I am a beginner to socket programming to in c#. I know the concepts as to how to program them. I get the above exception when i tried writing the code for the server side on the line...
7
by: =?Utf-8?B?VGhlTWFkSGF0dGVy?= | last post by:
Quick q: If I open a socket on my computer and eventualy the dhcp changes the address of my computer, what happens? Will it drop the connection? Thanks in advance for any help on the topic.
1
by: Mat | last post by:
Hi, I'm trying to use raw sockets in python for a dhcp client. I write this code : soc = socket.socket(socket.PF_PACKET, socket.SOCK_RAW) soc.bind(("eth0",0x0800)) data = soc.recv(1024)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.