From: Tom I Helbekkmo <tih@Hamartun.Priv.NO>
Marc G. Fournier <scrappy@hub.org>
From: Tom I Helbekkmo <tih@Hamartun.Priv.NO> PostgreSQL type extensions for IP and MAC addresses. I needed to record IP and MAC level ethernet addresses in a data base, and I really didn't want to store them as plain strings, with no enforced error checking, so I put together the accompanying code as my first experiment with adding a data type to PostgreSQL. I then thought that this might be useful to others, both directly and as a very simple example of how to do this sort of thing, so here it is, in the hope that it will be useful.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/ip_and_mac/ip.c | added | +212 −0 |
| contrib/ip_and_mac/ip.sql | added | +131 −0 |
| contrib/ip_and_mac/mac.c | added | +202 −0 |
| contrib/ip_and_mac/mac.h | added | +130 −0 |
| contrib/ip_and_mac/mac.sql | added | +88 −0 |
| contrib/ip_and_mac/Makefile | added | +20 −0 |
| contrib/ip_and_mac/README | added | +51 −0 |