|
|
how to split an IP address into octets ?
Hi,
which unix function allows me to split an ip address
returned from gethostbyname into octets ?
Thank you,
--
Bye,
Colossus
Mizio, a proxy scanner tool with GUI for Linux
http://mizio.sourceforge.net
|
|
0
|
|
|
|
Reply
|
colossusNO_SPAM (7)
|
5/25/2004 12:36:28 PM |
|
Colossus <colossusNO_SPAM@freemail.it> writes:
> Hi,
>
> which unix function allows me to split an ip address
> returned from gethostbyname into octets ?
What exactly do you want to do?
--
M�ns Rullg�rd
mru@kth.se
|
|
0
|
|
|
|
Reply
|
iso
|
5/25/2004 12:52:50 PM
|
|
M�ns Rullg�rd wrote:
> What exactly do you want to do?
struct hostent *k = gethostbyname("www.google.com");
char packet[10];
packet[0] = 5;
packet[1] = 1;
packet[2] = 0;
packet[3] = 1;
packet[4] =
packet[5] =
packet[6] =
packet[7] =
packet[8] = 0;
packet[9] = 80;
In packet[4] 5,6 and 7 I have to put the octets of the ip
address of google to form a socks5 request as stated in the
rfc section 4:
http://rfc.net/rfc1928.html
Thank you for replying,
--
Bye,
Colossus
Mizio, a proxy scanner tool with GUI for Linux
http://mizio.sourceforge.net
|
|
0
|
|
|
|
Reply
|
Colossus
|
5/25/2004 12:59:59 PM
|
|
Colossus <colossusNO_SPAM@freemail.it> writes:
> M�ns Rullg�rd wrote:
>
>> What exactly do you want to do?
> struct hostent *k = gethostbyname("www.google.com");
>
> char packet[10];
> packet[0] = 5;
> packet[1] = 1;
> packet[2] = 0;
> packet[3] = 1;
> packet[4] =
> packet[5] =
> packet[6] =
> packet[7] =
> packet[8] = 0;
> packet[9] = 80;
>
> In packet[4] 5,6 and 7 I have to put the octets of the ip
> address of google to form a socks5 request as stated in the
> rfc section 4:
> http://rfc.net/rfc1928.html
Why not memcpy(packet + 4, k->h_addr, 4)?
--
M�ns Rullg�rd
mru@kth.se
|
|
0
|
|
|
|
Reply
|
iso
|
5/25/2004 1:49:22 PM
|
|
M�ns Rullg�rd wrote:
> Why not memcpy(packet + 4, k->h_addr, 4)?
Really many many thanks !
--
Bye,
Colossus
Mizio, a proxy scanner tool with GUI for Linux
http://mizio.sourceforge.net
|
|
0
|
|
|
|
Reply
|
Colossus
|
5/26/2004 6:54:56 AM
|
|
Colossus <colossusNO_SPAM@freemail.it> writes:
> M�ns Rullg�rd wrote:
>
>> Why not memcpy(packet + 4, k->h_addr, 4)?
>
> Really many many thanks !
Of course, you should make sure that 4 is actually the size of the
address. It could be an IPv6 address. Multiple addresses should also
be handled properly. Just using the first is normally reasonable, but
there may be situations where this isn't the right thing.
--
M�ns Rullg�rd
mru@kth.se
|
|
0
|
|
|
|
Reply
|
iso
|
5/26/2004 7:28:26 AM
|
|
|
5 Replies
563 Views
(page loaded in 0.077 seconds)
Similiar Articles: how to split an IP address into octets ? - comp.unix.programmer ...Hi, which unix function allows me to split an ip address returned from gethostbyname into octets ? Thank you, -- Bye, Colossus Mizio, a proxy scann... How to get IP address using jpcap? - comp.lang.java.programmer ...how to split an IP address into octets ? - comp.unix.programmer ... Hi, which unix function allows me to split an ip address returned from gethostbyname into octets ? How to get all IP Addresses on AIX using C++ - comp.unix ...how to split an IP address into octets ? - comp.unix.programmer ... Hi, which unix function allows me to split an ip address returned from gethostbyname into octets ? Split mailbox into individual mails - comp.unix.solarishow to split an IP address into octets ? - comp.unix.programmer ... Hi, which unix function allows me to split an ip address returned from gethostbyname into octets ? ... how to code extract Ip address - comp.unix.solarishow to split an IP address into octets ? - comp.unix.programmer ... The document is made up of multiple pages, I want to split it into individual ... how to ping to multiple ip address - comp.unix.solarishow to split an IP address into octets ? - comp.unix.programmer ..... allows me to split an ip address ... the size of the address. It could be an IPv6 address. ASA split tunnel problems - comp.dcom.sys.ciscohow to split an IP address into octets ? - comp.unix.programmer ... ASA split tunnel problems - comp.dcom.sys.cisco how to split an IP address into octets ? - comp.unix ... Access Oracle Database using NAT IP Address - comp.dcom.sys.cisco ...how to split an IP address into octets ? - comp.unix.programmer ... Access Oracle Database using NAT IP Address - comp.dcom.sys.cisco ... how to split an IP address into ... Re: Put to split a string into two lines ? - comp.soft-sys.sas ...how to split an IP address into octets ? - comp.unix.programmer ... How to get a String? - comp.soft-sys.matlab Re: How to get county name from address - comp.soft-sys.sas ... How to divide a line in equal section? - comp.soft-sys.matlab ...how to split an IP address into octets ? - comp.unix.programmer ..... ip address of google to form a socks5 request as stated in the rfc section ... how to split an IP address into octets ? - comp.unix.programmer ...Hi, which unix function allows me to split an ip address returned from gethostbyname into octets ? Thank you, -- Bye, Colossus Mizio, a proxy scann... Brain Of Dave: T-SQL IP octet splitT-SQL IP octet split ... SQL that can be used to separate the octets of an IP address: ... try using "ParseName" - it is built into ... 7/20/2012 2:49:15 PM
|
|
|
|
|
|
|
|
|