]> git.ipfire.org Git - thirdparty/bird.git/blame - nest/password.h
Filter: Expand testing of large community sets
[thirdparty/bird.git] / nest / password.h
CommitLineData
1a2ded45
PM
1/*
2 * BIRD -- Password handling
3 *
5236fb03
OF
4 * (c) 1999 Pavel Machek <pavel@ucw.cz>
5 * (c) 2004 Ondrej Filip <feela@network.cz>
1a2ded45
PM
6 *
7 * Can be freely distributed and used under the terms of the GNU GPL.
8 */
9
858a7177
PM
10#ifndef PASSWORD_H
11#define PASSWORD_H
900d5470
PM
12#include "lib/timer.h"
13
1a2ded45 14struct password_item {
5236fb03 15 node n;
1a2ded45
PM
16 char *password;
17 int id;
5236fb03 18 bird_clock_t accfrom, accto, genfrom, gento;
1a2ded45
PM
19};
20
21extern struct password_item *last_password_item;
900d5470 22
b21f68b4 23struct password_item *password_find(list *l, int first_fit);
f8fefde3 24struct password_item *password_find_by_id(list *l, int id);
8465dccb 25struct password_item *password_find_by_value(list *l, char *pass, uint size);
f8fefde3
OZ
26
27static inline int password_verify(struct password_item *p1, char *p2, uint size)
28{
29 char buf[size];
30 strncpy(buf, p1->password, size);
31 return !memcmp(buf, p2, size);
32}
900d5470 33
858a7177 34#endif