getting client info

getting client info

Post by Evanda Remingt » Tue, 03 Oct 2000 04:00:00



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

 
 
 

getting client info

Post by Pieter Winte » Tue, 03 Oct 2000 04:00:00



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.

Check 'man getpeername'

Regards,
    Pieter

 
 
 

getting client info

Post by pratik khasnabi » Thu, 05 Oct 2000 04:00:00


solution

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


> 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

 
 
 

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!

9. getting process info

10. Getting access to system activity info

11. getting peer info on UDP socket?

12. Getting banner info

13. getting process info from netstat ?