2009-06-24 10:24:09 -07:00
|
|
|
/*
|
2012-05-02 15:21:36 -07:00
|
|
|
* Copyright (c) 2009 Nicira, Inc.
|
2009-06-24 10:24:09 -07:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at:
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2011-08-24 15:17:32 -07:00
|
|
|
#ifndef NETLINK_NOTIFIER_H
|
|
|
|
#define NETLINK_NOTIFIER_H 1
|
2009-06-24 10:24:09 -07:00
|
|
|
|
2009-07-28 13:05:20 -07:00
|
|
|
/* These functions are Linux specific, so they should be used directly only by
|
|
|
|
* Linux-specific code. */
|
2009-06-24 10:24:09 -07:00
|
|
|
|
2016-03-25 14:10:21 -07:00
|
|
|
#include "openvswitch/list.h"
|
2009-06-24 10:24:09 -07:00
|
|
|
|
2011-08-24 15:17:32 -07:00
|
|
|
struct nln;
|
2011-09-15 11:21:23 -07:00
|
|
|
struct nln_notifier;
|
|
|
|
|
2010-12-21 13:44:37 -08:00
|
|
|
struct nlattr;
|
|
|
|
struct ofpbuf;
|
|
|
|
|
2011-08-24 15:17:32 -07:00
|
|
|
/* Function called to report netlink notifications. 'change' describes the
|
|
|
|
* specific change filled out by an nln_parse_func. It may be null if the
|
|
|
|
* buffer of change information overflowed, in which case the function must
|
2010-12-21 13:44:37 -08:00
|
|
|
* assume that everything may have changed. 'aux' is as specified in
|
2011-08-24 15:17:32 -07:00
|
|
|
* nln_notifier_register(). */
|
|
|
|
typedef void nln_notify_func(const void *change, void *aux);
|
2009-06-24 10:24:09 -07:00
|
|
|
|
2011-08-24 15:17:32 -07:00
|
|
|
/* Function called to parse incoming nln notifications. The 'buf' message
|
2016-06-13 14:22:32 -07:00
|
|
|
* should be parsed into 'change' as specified in nln_create().
|
|
|
|
* Returns the multicast_group the change belongs to, or 0 for a parse error.
|
|
|
|
*/
|
|
|
|
typedef int nln_parse_func(struct ofpbuf *buf, void *change);
|
2009-06-24 10:24:09 -07:00
|
|
|
|
2016-06-13 14:22:32 -07:00
|
|
|
struct nln *nln_create(int protocol, nln_parse_func *, void *change);
|
2011-08-24 15:17:32 -07:00
|
|
|
void nln_destroy(struct nln *);
|
2016-06-13 14:22:32 -07:00
|
|
|
struct nln_notifier *nln_notifier_create(struct nln *, int multicast_group,
|
|
|
|
nln_notify_func *, void *aux);
|
2011-09-15 11:21:23 -07:00
|
|
|
void nln_notifier_destroy(struct nln_notifier *);
|
2011-09-15 11:23:08 -07:00
|
|
|
void nln_run(struct nln *);
|
|
|
|
void nln_wait(struct nln *);
|
2018-02-04 06:45:38 -08:00
|
|
|
void nln_report(const struct nln *nln, void *change, int group);
|
2011-08-24 15:17:32 -07:00
|
|
|
#endif /* netlink-notifier.h */
|