From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id C03D17EE49 for ; Fri, 20 Sep 2013 15:00:03 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of kosmo.zb@gmail.com) identity=pra; client-ip=74.125.82.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kosmo.zb@gmail.com"; x-sender="kosmo.zb@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of kosmo.zb@gmail.com designates 74.125.82.176 as permitted sender) identity=mailfrom; client-ip=74.125.82.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kosmo.zb@gmail.com"; x-sender="kosmo.zb@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-we0-f176.google.com) identity=helo; client-ip=74.125.82.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kosmo.zb@gmail.com"; x-sender="postmaster@mail-we0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmUBAGNGPFJKfVKwm2dsb2JhbABagz9MBq5qk2MIFg4BAQEBAQYLCwkUKIIlAQEEAUABOAEDAQsBBQULDS4iEgEFARwGEwiHawMJBgcFnDSPWIRDJw1XiQ0BBQyTfgOXfIEvixeDRxgpgWGCbDs X-IPAS-Result: AmUBAGNGPFJKfVKwm2dsb2JhbABagz9MBq5qk2MIFg4BAQEBAQYLCwkUKIIlAQEEAUABOAEDAQsBBQULDS4iEgEFARwGEwiHawMJBgcFnDSPWIRDJw1XiQ0BBQyTfgOXfIEvixeDRxgpgWGCbDs X-IronPort-AV: E=Sophos;i="4.90,944,1371074400"; d="scan'208";a="33689323" Received: from mail-we0-f176.google.com ([74.125.82.176]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Sep 2013 15:00:02 +0200 Received: by mail-we0-f176.google.com with SMTP id u56so452230wes.21 for ; Fri, 20 Sep 2013 06:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=X3bK+ZwlQs9IxaWbq1VjQDe4/DuIBnE4RhgAFApDnE8=; b=O73WwtnFMTkoyrp/JbBsnzqPTADfeLUZFQXUQKxf2TxH5ne8KHUcU7slvnnFAHGMVa owtb+NtX8g5VpLj8EDQN3J4+FA6ygMDI58njDF9jM2IlDsjR8cMjKCrpkKb6CaXyuwN8 XodiZxUMeRq46fLGvRAW+bR7+WiKHpm0iKqUdDs401Cg7ubNj/s94jdQWKw90MD32T/k 9yEAhtI2+H97f2pWcZAWz0js7gsTpw9QElz/TFdTMFQZWx7Epr9+XLJQXzA/iz/nX8XD 7keoJI71md7uF8vInZnLRdq65hLPuytvr0cbumPmbSSc0DefzEJU9LS4z4HDj2Wbo2nd TfJQ== MIME-Version: 1.0 X-Received: by 10.180.210.243 with SMTP id mx19mr2642307wic.35.1379682002961; Fri, 20 Sep 2013 06:00:02 -0700 (PDT) Sender: kosmo.zb@gmail.com Received: by 10.217.90.195 with HTTP; Fri, 20 Sep 2013 06:00:02 -0700 (PDT) In-Reply-To: References: <523C369F.5060200@rktmb.org> Date: Fri, 20 Sep 2013 14:00:02 +0100 X-Google-Sender-Auth: Uef0awHDY8NwSIY53Zm-lsm1Nm0 Message-ID: From: David Sheets To: Mihamina Rakotomandimby Cc: O Caml Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] exercice with subnets union On Fri, Sep 20, 2013 at 1:20 PM, David Sheets wrote: > On Fri, Sep 20, 2013 at 12:50 PM, Mihamina Rakotomandimby > wrote: >> Hi all, >> >> I have a list of subnet: http://pastebin.com/e9LPv55K >> (These are Google IP ranges lokked up from his AS#) >> >> Some consecutive/adjacent "/24" could be "/23"'d and even multple >> consecutive "/24" coudl be "/18"'d and so on... >> >> Have you got in your bookmarks or notes some IP adresses manipulation >> functions, so that I could shorten that list? > > Hi Mihamina, > > You may be interested in ipaddr > , a very small OCaml library > for manipulation of IP address representations. > > You can install ipaddr with > > $ opam install ipaddr I've just released 0.2.3 of ipaddr with a subnet prefix bits accessor. I would be very happy to collaborate on modifying the library to incorporate common operations that you may need. Patches and feature requests welcome on the GitHub issue tracker. Best regards, David > Hope this helps, > > David > >> I would like to make that exercice in OCaml. >> >> Thank you. >> >> -- >> RMA.