I've bound a socket and am accepting connections aplenty, how do i
get the IP of the client? I want to check and see if he is in the
allowed IPs specified.
thanks
-e
--
Evanda Remington
http://www.ater.org
I've bound a socket and am accepting connections aplenty, how do i
get the IP of the client? I want to check and see if he is in the
allowed IPs specified.
thanks
-e
--
Evanda Remington
http://www.ater.org
Check 'man getpeername'Quote:> I've bound a socket and am accepting connections aplenty, how do i
> get the IP of the client? I want to check and see if he is in the
> allowed IPs specified.
Regards,
Pieter
1. Get the details by passing the pointer to a sockaddr_in (or whatever
family you use) structure and a pointer to the size od the strcuture in
accept() function. Dont pass NULL in the second and third argumant of
accept().
2.Use getpeername()
see the man pages
pratik
> thanks
> -e
> --
> Evanda Remington
> http://www.ater.org
1. DHCP Client not getting dhcpc.info data
I am running a RH7.2 firewall/router box with a DHCP client to the ISP and
static IPs for the internal LAN. I was running static from the ISP, but was
forced to change to DHCP and added what I thought to be the proper scripting
to allow the DNS server IPs, my IP address, and the POP/SMTP servers to be
retrieved from the dhcp.info files and resolv.conf files. However, my
system at bootup and when my lease expiures, does not retrieve the new info
and just causes the system to die. What do I need to do to make the box use
the new lease info instead of hard coding it into the firewall script?
2. Which CD Driver for HiVal 45x (HD45A-00R) with Mandrake 7.0?
3. Getting info about the client, without delving into low level RPC
4. Advice needed for Nmber 9 FX Motion 771 video card
5. dhcpcd-0.6 - DHCP client daemon, gets client IP address and more
6. New PC : Compatibility (Compaq Presario)
7. any info about getting on other mail lists
8. Yggdrasil Summer '94 Problems With X!
10. Getting access to system activity info
11. getting peer info on UDP socket?
13. getting process info from netstat ?