diff options
author | Volker Lendecke <vl@samba.org> | 2011-01-27 12:58:22 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-02-01 15:11:06 +0100 |
commit | 80acca1ebf8bd8d0350d63277e3143416372fb83 (patch) | |
tree | 715013c338e29d5566a86f3cf2ee4b36d5f72cca /source3/lib/addrchange.h | |
parent | f9af242886ac014baa3247bfdc1fe8be6cb8366e (diff) | |
download | samba-80acca1ebf8bd8d0350d63277e3143416372fb83.tar.gz |
s3: Add support for AF_NETLINK addr notifications
Via an AF_NETLINK socket, the Linux kernel can inform us when IP addresses are
added or dropped.
This will first be used in winbind, it was triggered by clustering with ctdb.
When winbind is connected to a domain controller and ctdb decides to move away
the IP address that winbind used locally for the connection to the DC, the next
request will run into a timeout. winbind sends out its request, but the
response will never arrive: The IP is gone.
It will also be interesting for more reliable online/offline detection, but
this is something for future winbind refactoring.
Diffstat (limited to 'source3/lib/addrchange.h')
-rw-r--r-- | source3/lib/addrchange.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source3/lib/addrchange.h b/source3/lib/addrchange.h new file mode 100644 index 00000000000..9587be776ed --- /dev/null +++ b/source3/lib/addrchange.h @@ -0,0 +1,45 @@ +/* + * Samba Unix/Linux SMB client library + * Copyright (C) Volker Lendecke 2011 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __ADDRCHANGE_H__ +#define __ADDRCHANGE_H__ + +#include "lib/talloc/talloc.h" +#include "lib/tevent/tevent.h" +#include "libcli/util/ntstatus.h" +#include "lib/replace/replace.h" +#include "lib/replace/system/network.h" + +struct addrchange_context; + +NTSTATUS addrchange_context_create(TALLOC_CTX *mem_ctx, + struct addrchange_context **pctx); + +struct tevent_req *addrchange_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct addrchange_context *ctx); + +enum addrchange_type { + ADDRCHANGE_ADD, + ADDRCHANGE_DEL +}; + +NTSTATUS addrchange_recv(struct tevent_req *req, enum addrchange_type *type, + struct sockaddr_storage *addr); + +#endif |