<commit_before>============
vmod_ipcast
============

----------------------
Varnish ipcast Module
----------------------

:Author: <NAME>
:Date: 2014-04-04
:Version: 1.1
:Manual section: 3

SYNOPSIS
========

import ipcast;

DESCRIPTION
===========

This is a Varnish 3.0 VMOD for inserting a VCL string into
the client.ip internal variable.

In Varnish >= 4.0 this has been incorporated into VCL itself::

    # For Varnish 4.0, use this instead of this VMOD:
    import std;
    sub vcl_recv {
        if (std.ip(req.http.X-forwarded-for, "0.0.0.0") ~ my_acl) { ... }
    }


FUNCTIONS
=========

clientip
--------

Prototype
        ::

                clientip(STRING S)
Return value
	INT

Description
	Parse the IPv4/IPv6 address in S, and set that to client.ip. If
	successfull a value of 0 is returned.

	If parsing the IP address with getaddrinfo() fails, the error
	message will be logged to varnishlog and client.ip is left untouched.
	A non-zero return code will be set.


        ::

                ipcast.clientip("192.168.0.10");
                ipcast.clientip("2001:db8::1");

INSTALLATION
============

The source tree is based on autotools to configure the building, and
does also have the necessary bits in place to do functional unit tests
using the varnishtest tool.

Usage::

 # only if you are building from a git clone.
 ./autogen.sh
 ./configure VARNISHSRC=DIR [VMODDIR=DIR]

`VARNISHSRC` is the directory of the Varnish source tree for which to
compile your vmod. Both the `VARNISHSRC` and `VARNISHSRC/include`
will be added to the include search paths for your module.

Optionally you can also set the vmod install directory by adding
`VMODDIR=DIR` (defaults to the pkg-config discovered directory from your
Varnish installation).<commit_msg>Fix typo.<commit_after>============
vmod_ipcast
============

----------------------
Varnish ipcast Module
----------------------

:Author: <NAME>
:Date: 2014-04-04
:Version: 1.1
:Manual section: 3

SYNOPSIS
========

import ipcast;

DESCRIPTION
===========

This is a Varnish 3.0 VMOD for inserting a VCL string into
the client.ip internal variable.

In Varnish >= 4.0 this has been incorporated into VCL itself::

    # For Varnish 4.0, use this instead of this VMOD:
    import std;
    sub vcl_recv {
        if (std.ip(req.http.X-forwarded-for, "0.0.0.0") ~ my_acl) { ... }
    }


FUNCTIONS
=========

clientip
--------

Prototype
        ::

                clientip(STRING S)
Return value
	INT

Description
	Parse the IPv4/IPv6 address in S, and set that to client.ip. If
	successful a value of 0 is returned.

	If parsing the IP address with getaddrinfo() fails, the error
	message will be logged to varnishlog and client.ip is left untouched.
	A non-zero return code will be set.


        ::

                ipcast.clientip("192.168.0.10");
                ipcast.clientip("2001:db8::1");

INSTALLATION
============

The source tree is based on autotools to configure the building, and
does also have the necessary bits in place to do functional unit tests
using the varnishtest tool.

Usage::

 # only if you are building from a git clone.
 ./autogen.sh
 ./configure VARNISHSRC=DIR [VMODDIR=DIR]

`VARNISHSRC` is the directory of the Varnish source tree for which to
compile your vmod. Both the `VARNISHSRC` and `VARNISHSRC/include`
will be added to the include search paths for your module.

Optionally you can also set the vmod install directory by adding
`VMODDIR=DIR` (defaults to the pkg-config discovered directory from your
Varnish installation).
{'fraction_non_alphanumeric': 0.13372914899632457, 'fraction_numerical': 0.02205258693808312, 'mean_word_length': 2.9093922651933704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '40229', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1062, 'n_words': 432}