<feed xmlns='http://www.w3.org/2005/Atom'>
<title>accel-ppp.git/accel-pppd/utils.h, branch stable</title>
<subtitle>High performance PPTP/L2TP/SSTP/PPPoE/IPoE server for Linux (mirror of https://github.com/accel-ppp/accel-ppp.git)
</subtitle>
<id>https://git.amelek.net/accel-ppp/accel-ppp.git/atom?h=stable</id>
<link rel='self' href='https://git.amelek.net/accel-ppp/accel-ppp.git/atom?h=stable'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/'/>
<updated>2018-12-08T04:51:36+00:00</updated>
<entry>
<title>utils: add IPv4 string parsing helpers</title>
<updated>2018-12-08T04:51:36+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2018-12-07T16:37:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=093baccac54573eed54fa2650c19ecaeed3065a5'/>
<id>urn:sha1:093baccac54573eed54fa2650c19ecaeed3065a5</id>
<content type='text'>
Define the IPv4 counterparts of u_ip6str() and u_parse_ip6cidr().
Also add the special u_parse_ip4range() which will be useful for
parsing the [client-ip-range] section of accel-ppp.conf.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>utils: rework u_parse_ip4addr()</title>
<updated>2018-12-08T04:51:34+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2018-12-07T16:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=0f2f775d644c4cd9007b5816c2cfa9e8d933ef6d'/>
<id>urn:sha1:0f2f775d644c4cd9007b5816c2cfa9e8d933ef6d</id>
<content type='text'>
Redefine u_parse_ip4addr() to match the behaviour of other u_parse_*()
functions:

  * Drop the err_msg parameter.
  * Return the number of bytes parsed instead of an error number.
  * Remove support for fancy IPv4 address notations.

There is currently only one user of u_parse_ip4addr() (in iprange.c).
Dropping the fancy IPv4 address representations is probably not going
to harm anyone (quite the opposite as many users don't realise that
leading 0 means octal and that plain integers can be considered IPv4
addresses).

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>utils: add string parsing helpers</title>
<updated>2018-12-04T03:26:37+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2018-11-30T16:36:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=68475cd0e1bfb30f8391e04ad2ec1770482ff74c'/>
<id>urn:sha1:68475cd0e1bfb30f8391e04ad2ec1770482ff74c</id>
<content type='text'>
Define parsers for IPv6 addresses and CIDR notations, unsigned
integers, separators (variable number of space characters) and end of
strings (variable number of spaces followed by '\0').

All of these functions work on constant string and return the number
bytes parsed. If the input string doesn't have the expected format,
these functions return 0 (no forward progress).

Also implement a convenient wrapper around inet_ntop() that can be used
easily in printf-like functions.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>iprange: rework ip range parsing functions</title>
<updated>2016-05-11T10:25:13+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2016-05-09T19:40:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=7ae7712429737afe72068eec6b76f0632f1d8d55'/>
<id>urn:sha1:7ae7712429737afe72068eec6b76f0632f1d8d55</id>
<content type='text'>
The previous parsing functions had a few problems:

  * They did accept negative numbers in addresses (e.g. 192.0.2.-5).

  * They relied on C undefined behaviour for detecting /0 prefix
    length: "mask = htonl(~((1 &lt;&lt; (32 - m)) - 1)" was wrong for m = 0,
    because that resulted in a left shift of 32 bits, on a 32 bit wide
    value (the right operand of a bitwise shift operator must be
    strictly smaller than the width of the promoted left operand).

  * They misinterpreted /32 prefixes as disable requests. In fact, due
    to the undefined behaviour described above, /0 and /32 prefix
    lengths were represented in the same way by parse1(), that is, with
    an iprange_t structure where -&gt;begin == -&gt;end. Therefore
    load_ranges() had no way to distinguish between them and did
    disable the module in both cases.

This patch fixes these issues and brings the following improvements:

  * It uses getaddrinfo() to parse IP addresses, so it accept (almost)
    all IPv4 representations and is more easily extensible to IPv6 in
    the future.

  * It warns when the IP address used in CIDR notation is not the first
    address in the range (e.g. the first address of 192.0.2.1/24 is
    192.0.2.0, not 192.0.2.1).

  * It doesn't _exit() on parsing failures, thus making the functions
    usable in an EV_CONFIG_RELOAD handler.

While there, the unfinished tunnel_ranges code, which was already
commented, has been removed.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>utils: Add random buffer generation function</title>
<updated>2013-04-17T05:06:35+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2013-04-09T19:43:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=b041db6c60fb80846ad6b6770adc3971e41b2194'/>
<id>urn:sha1:b041db6c60fb80846ad6b6770adc3971e41b2194</id>
<content type='text'>
Define and export the u_randbuf() function that fills a buffer with
random data.
Convert L2TP's challenge generation code for using it.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>utils: Add function for strict str to int conversion</title>
<updated>2013-02-06T17:09:01+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2013-02-06T16:29:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=a068ff609288b61f86b37b02f06755f84c5aaca7'/>
<id>urn:sha1:a068ff609288b61f86b37b02f06755f84c5aaca7</id>
<content type='text'>
Define the u_readlong() function as a wrapper for strtol(). It performs
stricter checks on the input value and let the caller specify an interval
of acceptable values.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>rename accel-pptp to accel-ppp</title>
<updated>2011-01-05T12:18:59+00:00</updated>
<author>
<name>Dmitry Kozlov</name>
<email>xeb@mail.ru</email>
</author>
<published>2011-01-05T12:18:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=f28cb1b0a926f1ea98700b7871537ad1793511fd'/>
<id>urn:sha1:f28cb1b0a926f1ea98700b7871537ad1793511fd</id>
<content type='text'>
</content>
</entry>
</feed>
