/*
- * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "hash.h"
#include "hmap.h"
#include "netdev.h"
+#include "ovs-atomic.h"
#include "packets.h"
#include "poll-loop.h"
#include "random.h"
#define CFM_MAX_RMPS 256
/* Ethernet destination address of CCM packets. */
-static const uint8_t eth_addr_ccm[ETH_ADDR_LEN] = {
- 0x01, 0x80, 0xC2, 0x00, 0x00, 0x30 };
-static const uint8_t eth_addr_ccm_x[ETH_ADDR_LEN] = {
- 0x01, 0x23, 0x20, 0x00, 0x00, 0x30
-};
+static const struct eth_addr eth_addr_ccm = {
+ { { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x30 } } };
+static const struct eth_addr eth_addr_ccm_x = {
+ { { 0x01, 0x23, 0x20, 0x00, 0x00, 0x30 } } };
#define ETH_TYPE_CFM 0x8902
}
}
-static const uint8_t *
+static struct eth_addr
cfm_ccm_addr(struct cfm *cfm)
{
bool extended;
* should be sent whenever cfm_should_send_ccm() indicates. */
void
cfm_compose_ccm(struct cfm *cfm, struct dp_packet *packet,
- uint8_t eth_src[ETH_ADDR_LEN]) OVS_EXCLUDED(mutex)
+ const struct eth_addr eth_src) OVS_EXCLUDED(mutex)
{
uint16_t ccm_vlan;
struct ccm *ccm;
ovs_mutex_unlock(&mutex);
}
-void
+long long int
cfm_wait(struct cfm *cfm) OVS_EXCLUDED(mutex)
{
- poll_timer_wait_until(cfm_wake_time(cfm));
+ long long int wake_time = cfm_wake_time(cfm);
+ poll_timer_wait_until(wake_time);
+ return wake_time;
}