Skip to contentSkip to conversation

Getting src-IP/port from 'struct context'...

Openvpn-devel Vineet Kumar 2 participants 3 messages Dec 14, 2010 – Dec 15, 2010

lore
Share & tools
lore
#0 lore raw

Hi,
Is there a straightforward way to print source IP address and port
given a 'struct context' pointer?

Vineet

#1 lore raw

Hi,

Quoted 2 lines · Vineet Kumar

Is there a straightforward way to print source IP address and port
given a 'struct context' pointer?

If I read code and structures right, it's in

context_pointer->c2->to_link_addr->dest

and there's a number of calls in forward.c that do:

print_link_socket_actual (c->c2.to_link_addr, &gc),

(which doesn't actually *print*, but return a string that can be used in msg() - see the code examples in forward.c)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw

That works. Thanks a lot.

Vineet

Quoted 24 lines · Gert Doering

Hi,

Quoted 2 lines · Vineet Kumar

  Is there a straightforward way to print source IP address and port given a 'struct context' pointer?

If I read code and structures right, it's in

 context_pointer->c2->to_link_addr->dest

and there's a number of calls in forward.c that do:

 print_link_socket_actual (c->c2.to_link_addr, &gc),

(which doesn't actually *print*, but return a string that can be used in msg() - see the code examples in forward.c)

gert
--
USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...