linux/net/openvswitch/meter.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017 Nicira, Inc.
 */

#define pr_fmt(fmt)

#include <linux/if.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
#include <linux/kernel.h>
#include <linux/openvswitch.h>
#include <linux/netlink.h>
#include <linux/rculist.h>

#include <net/netlink.h>
#include <net/genetlink.h>

#include "datapath.h"
#include "meter.h"

static const struct nla_policy meter_policy[OVS_METER_ATTR_MAX + 1] =;

static const struct nla_policy band_policy[OVS_BAND_ATTR_MAX + 1] =;

static u32 meter_hash(struct dp_meter_instance *ti, u32 id)
{}

static void ovs_meter_free(struct dp_meter *meter)
{}

/* Call with ovs_mutex or RCU read lock. */
static struct dp_meter *lookup_meter(const struct dp_meter_table *tbl,
				     u32 meter_id)
{}

static struct dp_meter_instance *dp_meter_instance_alloc(const u32 size)
{}

static void dp_meter_instance_free(struct dp_meter_instance *ti)
{}

static void dp_meter_instance_free_rcu(struct rcu_head *rcu)
{}

static int
dp_meter_instance_realloc(struct dp_meter_table *tbl, u32 size)
{}

static void dp_meter_instance_insert(struct dp_meter_instance *ti,
				     struct dp_meter *meter)
{}

static void dp_meter_instance_remove(struct dp_meter_instance *ti,
				     struct dp_meter *meter)
{}

static int attach_meter(struct dp_meter_table *tbl, struct dp_meter *meter)
{}

static int detach_meter(struct dp_meter_table *tbl, struct dp_meter *meter)
{}

static struct sk_buff *
ovs_meter_cmd_reply_start(struct genl_info *info, u8 cmd,
			  struct ovs_header **ovs_reply_header)
{}

static int ovs_meter_cmd_reply_stats(struct sk_buff *reply, u32 meter_id,
				     struct dp_meter *meter)
{}

static int ovs_meter_cmd_features(struct sk_buff *skb, struct genl_info *info)
{}

static struct dp_meter *dp_meter_create(struct nlattr **a)
{}

static int ovs_meter_cmd_set(struct sk_buff *skb, struct genl_info *info)
{}

static int ovs_meter_cmd_get(struct sk_buff *skb, struct genl_info *info)
{}

static int ovs_meter_cmd_del(struct sk_buff *skb, struct genl_info *info)
{}

/* Meter action execution.
 *
 * Return true 'meter_id' drop band is triggered. The 'skb' should be
 * dropped by the caller'.
 */
bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb,
		       struct sw_flow_key *key, u32 meter_id)
{}

static const struct genl_small_ops dp_meter_genl_ops[] =;

static const struct genl_multicast_group ovs_meter_multicast_group =;

struct genl_family dp_meter_genl_family __ro_after_init =;

int ovs_meters_init(struct datapath *dp)
{}

void ovs_meters_exit(struct datapath *dp)
{}