Active
Project:
CCK IP Address
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
14 Nov 2007 at 19:05 UTC
Updated:
31 Oct 2011 at 17:18 UTC
Hi, there is some reason that why default octet column type is set to char ?
I think that octet data is a integer.
Thanks.
Comments
Comment #1
firebus commentedin order to make it easy to encode and display octets with leading zeros.
i know that's dumb. i was being lazy about something else, where i didn't want to right pad the int and cast it as a string. i can't remember exactly what it was.
i regret the decision to have one field per octet, and i'm planning an upgrade to a single field that using ip2long and long2ip to encode and decode.
Comment #2
firebus commentedComment #3
jthorson commentedFirebus,
To share my experience with the 'IP Address Entity' module, be aware that while the 'Schema' API supports 'unsigned' data columns in the database, the DB API itself doesn't actually allow the full range of unsigned integers ... so storing of a value such as ip2long(255.255.255.255) requires you to use a 'signed' column in the database. (PHP uses signed integers by default, so this shouldn't be a big deal ... but I had initially set 'unsigned' to TRUE in my db schema, which led to a couple hours of research and frustration before finally resolving the issue.)
Comment #4
firebus commented