randomid.h revision 1.2 1 1.2 perry /* $NetBSD: randomid.h,v 1.2 2005/12/26 19:01:47 perry Exp $ */
2 1.1 itojun /* $KAME: ip6_id.c,v 1.8 2003/09/06 13:41:06 itojun Exp $ */
3 1.1 itojun /* $OpenBSD: ip_id.c,v 1.6 2002/03/15 18:19:52 millert Exp $ */
4 1.1 itojun
5 1.1 itojun /*
6 1.1 itojun * Copyright (C) 2003 WIDE Project.
7 1.1 itojun * All rights reserved.
8 1.1 itojun *
9 1.1 itojun * Redistribution and use in source and binary forms, with or without
10 1.1 itojun * modification, are permitted provided that the following conditions
11 1.1 itojun * are met:
12 1.1 itojun * 1. Redistributions of source code must retain the above copyright
13 1.1 itojun * notice, this list of conditions and the following disclaimer.
14 1.1 itojun * 2. Redistributions in binary form must reproduce the above copyright
15 1.1 itojun * notice, this list of conditions and the following disclaimer in the
16 1.1 itojun * documentation and/or other materials provided with the distribution.
17 1.1 itojun * 3. Neither the name of the project nor the names of its contributors
18 1.1 itojun * may be used to endorse or promote products derived from this software
19 1.1 itojun * without specific prior written permission.
20 1.1 itojun *
21 1.1 itojun * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 1.1 itojun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.1 itojun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.1 itojun * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 1.1 itojun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.1 itojun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.1 itojun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.1 itojun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.1 itojun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.1 itojun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.1 itojun * SUCH DAMAGE.
32 1.1 itojun */
33 1.1 itojun
34 1.1 itojun /*
35 1.1 itojun * Copyright 1998 Niels Provos <provos (at) citi.umich.edu>
36 1.1 itojun * All rights reserved.
37 1.1 itojun *
38 1.1 itojun * Theo de Raadt <deraadt (at) openbsd.org> came up with the idea of using
39 1.1 itojun * such a mathematical system to generate more random (yet non-repeating)
40 1.1 itojun * ids to solve the resolver/named problem. But Niels designed the
41 1.1 itojun * actual system based on the constraints.
42 1.1 itojun *
43 1.1 itojun * Redistribution and use in source and binary forms, with or without
44 1.1 itojun * modification, are permitted provided that the following conditions
45 1.1 itojun * are met:
46 1.1 itojun * 1. Redistributions of source code must retain the above copyright
47 1.1 itojun * notice, this list of conditions and the following disclaimer.
48 1.1 itojun * 2. Redistributions in binary form must reproduce the above copyright
49 1.1 itojun * notice, this list of conditions and the following disclaimer in the
50 1.1 itojun * documentation and/or other materials provided with the distribution.
51 1.1 itojun * 3. All advertising materials mentioning features or use of this software
52 1.1 itojun * must display the following acknowledgement:
53 1.1 itojun * This product includes software developed by Niels Provos.
54 1.1 itojun * 4. The name of the author may not be used to endorse or promote products
55 1.1 itojun * derived from this software without specific prior written permission.
56 1.1 itojun *
57 1.1 itojun * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
58 1.1 itojun * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
59 1.1 itojun * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
60 1.1 itojun * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
61 1.1 itojun * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
62 1.1 itojun * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
63 1.1 itojun * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
64 1.1 itojun * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
65 1.1 itojun * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
66 1.1 itojun * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67 1.1 itojun */
68 1.1 itojun
69 1.1 itojun #ifndef _RANDOMID_H_
70 1.1 itojun #define _RANDOMID_H_
71 1.1 itojun
72 1.1 itojun struct randomid_ctx;
73 1.1 itojun
74 1.1 itojun typedef struct randomid_ctx *randomid_t;
75 1.1 itojun
76 1.2 perry extern uint32_t randomid(randomid_t);
77 1.1 itojun extern randomid_t randomid_new(int, long);
78 1.1 itojun extern void randomid_delete(randomid_t);
79 1.1 itojun
80 1.1 itojun #define RANDOMID_TIMEO_MIN ((long)60)
81 1.1 itojun #define RANDOMID_TIMEO_DEFAULT ((long)180)
82 1.1 itojun
83 1.1 itojun #endif /*_RANDOMID_H_*/
84