IPV6 for mysql support via inet6_aton/varbinary

138 views
Skip to first unread message

Jim Hranicky

unread,
Nov 21, 2017, 5:43:31 PM11/21/17
to barnyard2-users
It looks like it would be fairly easy to support ipv6 on mysql/mariadb
given that later versions now support inet6_aton/inet6_ntoa using a
VARBINARY(16) column type:

https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_inet6-aton
https://mariadb.com/kb/en/library/inet6_aton

I'm working on adding ipv6 support to the latest codebase as well
as incorporating my acid_event patch and my patch that disables
the reference table for those that don't use it.

Any interest in any of these?

Also I noticed that the codebase hasn't been updated in a while. Is
by2 still supported?

--
Jim Hranicky
Data Security Specialist
UF Information Technology
105 NW 16TH ST Room #104 GAINESVILLE FL 32603-1826
352-273-1341

Jim Hranicky

unread,
Dec 1, 2017, 11:39:09 AM12/1/17
to barnyard2-users
FWIW, stock barnyard2 seems to work fine with ip_src and
ip_dst as VARBINARY(16) columns for mariadb/mysql. I think
Postgres moving to type 'inet' would require code changes,
but I haven't tested it.

Jim

Jim Hranicky

unread,
Dec 15, 2017, 5:08:48 PM12/15/17
to barnyard2-users
Attached are the patches. Here are the descriptions:

o by2-ip-as-string.patch : diff with by2 git

This starting patch makes the rest much easier.

+ insert IPs using IP strings in the source code with
inet_aton('ip string') instead of straight INTs

+ change ip_src/ip_dst to VARBINARY(16) (old by2
works fine unmodified with VARBINARY(16) cols)

+ change schema version to 108

o by2-ip-as-string-acid-event.patch : diff with by2-ip-as-string

+ enable acid_event logging with VARBINARY(16)
ip_src/ip_dst columns

+ add modified base sql scripts in /schemas

o by2-ip-as-string-ipv6.patch : diff with by2-ip-as-string

+ enable logging of ipv6 addresses with inet6_aton('ip string'),
works with both 4 and 6 addresses

o by2-ip-as-string-disableref.patch : diff with by2-ip-as-string

+ disable the reference table

o by2-ip-as-string-all.patch : diff with by2 git and all patches
above added

Hope someone finds these useful.

Jim
by2-ip-as-string.patch
by2-ip-as-string-acid-event.patch
by2-ip-as-string-ipv6.patch
by2-ip-as-string-disableref.patch
by2-ip-as-string-all.patch

Jim Hranicky

unread,
Dec 18, 2017, 4:52:32 PM12/18/17
to barnyard2-users
Argh, I goofed up the acid_event patch and was inserting
sig_sid in place of sig_id (signature column in acid_event).

Attached are the -acid-event and the -all patch.

Jim
by2-ip-as-string-all.patch
by2-ip-as-string-acid-event.patch
Reply all
Reply to author
Forward
0 new messages