<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    <br>
    I've been experimenting with the idea of adding a new method to
    NiceAgent: a function similar to nice_agent_set_port_range() but
    with a complimentary purpose. While set_port_range() is able to
    define, well, a port range that should be used for local candidates
    during the gathering process, a method such as
    nice_agent_set_port_exclusions() would be able to define a set of
    ports that should be _avoided_.<br>
    <br>
    The method would have a signature such as this:<br>
    <br>
    nice_agent_set_port_exclusions (<br>
        NiceAgent *agent,<br>
        guint stream_id,<br>
        guint component_id,<br>
        gchar* ports);<br>
    <br>
    And 'ports' would be a string such as this:<br>
    <br>
    "1234,5678,2000-4000"<br>
    <br>
    Meaning:<br>
    * Don't use port 1234<br>
    * Don't use port 5678<br>
    * Don't use any port between 2000 and 4000 (inclusive)<br>
    <br>
    The rationale for such feature is that it adapts better to the needs
    that are common in typical cloud deployments, where a specific set
    of control ports should not be made accessible from the outside,
    with no reason whatsoever to prevent such access from all other
    ports in between.<br>
    <br>
    For a concrete example: A quick glance at one test Kubernetes
    deployment shows that these ports are sensitive and shouldn't be
    opened up to the public:<br>
    <br>
    22/tcp<br>
    25/tcp<br>
    67/udp<br>
    68/udp<br>
    111/tcp<br>
    111/udp<br>
    123/udp<br>
    137/udp<br>
    138/udp<br>
    139/tcp<br>
    139/udp<br>
    179/tcp<br>
    445/tcp<br>
    445/udp<br>
    1214/udp<br>
    1900/udp<br>
    4662/tcp<br>
    6346/tcp<br>
    6346/udp<br>
    6699/tcp<br>
    <br>
    These include control ports for Kubernetes itself.<br>
    <br>
    Instead of finding what is the biggest range that can be opened
    without touching any of those ports, it would be just easier (and
    easier to maintain for the Devops guys) to just specify a blacklist
    that includes all these ports, and pass it to libnice:<br>
    <br>
nice_agent_set_port_exclusions("22,25,67,68,111,123,137-139,179,445,1214,1900,4662,6346,6699")<br>
    <br>
    <br>
    I already have code that implements this, and having it in upstream
    is always nicer than maintaining it downstream. Would this feature
    be interesting for libnice? If so, I'd open a Merge Request for
    discussion and code review.<br>
    <br>
    Regards,<br>
    Juan<br>
    <br>
    <div class="moz-signature"><br>
      --<br>
      Juan Navarro<br>
      Kurento maintainer & developer<br>
      j1elo @ <a href="https://twitter.com/j1elo">Twitter</a> / <a
        href="https://github.com/j1elo">GitHub</a><br>
      <br>
    </div>
  </body>
</html>