[XML-SIG] something about the socket.

祝顺民 zhusm@neusoft.com
Wed, 19 Sep 2001 16:46:41 +0800


这是 MIME 格式的具有很多部分消息。

--Boundary_(ID_e0v/OGWxJjzERvUaXpMuoQ)
Content-type: text/plain; charset=gb2312
Content-transfer-encoding: QUOTED-PRINTABLE

unsigned long
ip2val(char* ip)
{
 struct in_addr inaddr;

 inet_aton(ip, &inaddr);
 return (ntohl(inaddr.s_addr));=20
}
i konw that python also has that two function.
so i edit the function like this,but it is't work .

def ip2val(ip_string):
    return ntohl(inet_aton(ip_string));
what's wrong with that ,can you tell me.and how to edit it.





--Boundary_(ID_e0v/OGWxJjzERvUaXpMuoQ)
Content-type: text/html; charset=gb2312
Content-transfer-encoding: QUOTED-PRINTABLE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb231=
2">
<META content=3D"MSHTML 6.00.2462.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c0c0c0>
<DIV><FONT size=3D2>unsigned long<BR>ip2val(char* ip)<BR>{<BR>&nbsp;s=
truct in_addr=20
inaddr;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>&nbsp;inet_aton(ip, &amp;inaddr);<BR>&nbsp;return=
=20
(ntohl(inaddr.s_addr));&nbsp;</FONT></DIV>
<DIV><FONT size=3D2>}</FONT></DIV>
<DIV><FONT size=3D2>i konw that python also has that two function.</F=
ONT></DIV>
<DIV><FONT size=3D2>so i edit the function like this,but it is't work=
=20
=2E</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>def ip2val(ip_string):</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT size=3D2>ret=
urn=20
ntohl(inet_aton(ip_string));</FONT></DIV>
<DIV><FONT size=3D2>what's wrong with that ,can you tell me.and how t=
o edit=20
it.</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;</DIV>
<DIV><BR></DIV></FONT></BODY></HTML>


--Boundary_(ID_e0v/OGWxJjzERvUaXpMuoQ)--