]> git.proxmox.com Git - mirror_ovs.git/commit
Add general-purpose IP/port parsing function.
authorMark Michelson <mmichels@redhat.com>
Thu, 2 Nov 2017 16:13:56 +0000 (11:13 -0500)
committerBen Pfaff <blp@ovn.org>
Thu, 2 Nov 2017 17:48:56 +0000 (10:48 -0700)
commite463f310b17d7dda864c33c8c3e6f19bd8f66c67
tree90870dc5e0e803d9574a0a1f59472406887af618
parent7b997d4f3d9996773537476d31a0643f96ed15c9
Add general-purpose IP/port parsing function.

OVS has functions for parsing IPv4 addresses, parsing IPv4 addresses
with a port, and parsing IPv6 addresses. What is lacking though is a
function that can take an IPv4 or IPv6 address, with or without a port.

This commit adds ipv46_parse(), which breaks the given input string into
its component parts and stores them in a sockaddr_storage structure. The
function accepts flags that determine how it should behave if a port is
present in the input string.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/packets.c
lib/packets.h