sscanf question



Hi,

This piece of code returns ip = -1062731404 (192.168.1.116) and port =
5069, when the following buffer is used. Can someone explain me how
"%x.%x" is matching "192.168.1.116:5069"?

int ip,port;
sscanf(buf+tagStart+strlen("branch="),"%x.%x",&ip,&port);

Thanks,

Andre

z9hG4bK8a948468-ee78-db11-9cdf-00112f2f2fed;rport
From: <sip:102@xxxxxxxxxxxxx>;tag=82888468-ee78-db11-9cdf-00112f2f2fed
To: <sip:102@xxxxxxxxxxxxx>;tag=as3a286274
Call-ID: ecdb2bb4-de78-db11-9cdf-00112f2f2fed@dilbert
CSeq: 244 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Expires: 3600
Contact: <sip:102@xxxxxxxxxxxxx:5069;transport=udp>;expires=3600
Date: Wed, 22 Nov 2006 23:23:08 GMT
Content-Length: 0

.



Relevant Pages

  • Re: sscanf question
    ... CSeq: 244 REGISTER ... User-Agent: Asterisk PBX ... Expires: 3600 ...
    (comp.lang.c)
  • Expires headers and windows messenger.
    ... answers to a REGISTER by putting an expires parameter ... the 200 OK or if an Expires header is set. ... for different user identities in the same REGISTER ...
    (microsoft.public.windowsxp.messenger)
  • Regex insertion
    ... I need a regex of sorts that will replace ONLY the line: ... User-Agent: Asterisk PBX ... push @packetData, $line; ...
    (comp.lang.perl.misc)
  • Regex insertion
    ... I need a regex of sorts that will replace ONLY the line: ... User-Agent: Asterisk PBX ... push @packetData, $line; ...
    (comp.lang.perl.misc)
  • Re: Regex insertion
    ... sil wrote: ... User-Agent: Asterisk PBX ...
    (comp.lang.perl.misc)