Skip to content

Commit

Permalink
datapath: Provide simple version of if_ether.h on non-Linux systems.
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Gross <jesse@nicira.com>
  • Loading branch information
jessegross committed Mar 30, 2013
1 parent e297c6b commit 8773132
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ OVS_CHECK_STRTOK_R
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec],
[], [], [[#include <sys/stat.h>]])
AC_CHECK_FUNCS([mlockall strnlen strsignal getloadavg statvfs setmntent])
AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h execinfo.h])
AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h linux/if_ether.h execinfo.h])

OVS_CHECK_PKIDIR
OVS_CHECK_RUNDIR
Expand Down
1 change: 1 addition & 0 deletions include/linux/automake.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
noinst_HEADERS += \
include/linux/if_ether.h \
include/linux/openvswitch.h \
include/linux/types.h
31 changes: 31 additions & 0 deletions include/linux/if_ether.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2013 Nicira, Inc.
*
* 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.
*/

#ifndef LINUX_IF_ETHER_H
#define LINUX_IF_ETHER_H 1

/* On Linux, this header file just includes <linux/if_ether.h>.
*
* On other platforms, this header file implements just enough of
* <linux/if_ether.h> to allow <linux/openvswitch.h> to work. */

#if defined(HAVE_LINUX_IF_ETHER_H) || defined(__KERNEL__)
#include_next <linux/if_ether.h>
#else /* no <linux/if_ether.h> */
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#endif

#endif /* <linux/if_ether.h> */

0 comments on commit 8773132

Please sign in to comment.