fixed: better check for sysctl() availability - builds on platforms with sysctl

This commit fixes an build issue on machines which actually still have sysctl.
As of now this is x86{_64} with glibc for example.

As it was mentioned before some Linux ports are dropping sysctl support.
This is intentional move and in future versions of Linux kernel this system
call will eventually go away. As a good alternative one may and should use
procfs (/proc/sys).

Currently we chech if corresponding header "sys/sysctl.h" exists.
But the problem happens if libc in use still installs "sys/sysctl.h" header
while provides no implementation for it.

This is exactly the case with uClibc and probably other implementations of libc.
But if we check for existing "sysctl" symbol in libc we're golden at least in
compile-time because libc provides some stub at least.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
test/check.c: fix -t command line option
gram.y: add search_prefix_list function

This function searches the prefix list for an existing prefix.  It's
use to prevent the same prefix from being added to the list more than
once.
move search_prefix_list from gram.y to interface.c

search_prefix_list will need to be called from netlink.c when an
interfaces gets a new address.  The goal is to prevent duplicate
prefixes in the interface list.
interface.c: split out free_prefix_list

The prefix list from the interface is going to be used to generate
a new list of prefixes to send in an advert.  As such, it makes
since to reuse a common free_prefix_list function to clean up both
the iface->prefix list and the prefix list generated in send.c.
send.c: add build_prefix_list function

This function is currently only coping the prefix list, but is soon
going to be taking over the auto-prefix "::/64" code in gram.y.
gram.y: remove prefix/autoselect code

This code doesn't belong in the config file parse.  It should be
much simpler to configure auto-selected prefixes outside of a parser.
gram.y: add todo comment on linked list
gram.y: move if6to4 code to send.c
gram.y: move if6 code to send.c
gram.y: move get_prefix6 to send.c
gram.y: move ::/64 auto-prefix code to send.c
gram.y: move helper functions to send.c

also sort prototypes in send.c
gram.y: cleanup/indent code
send.c: enable auto-prefix code
send.c: enable 6to4 prefix code
send.c: enable in6 prefix code
send.c: add new_prefix function

This code will be used in each of the three cases in build_prefix_list so
it makes sense to factor it out.
send.c: use new_prefix()
send.c: change while loop to do/while