From 877313268521544c2da238b34ee810c5359ef9d7 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 29 Mar 2013 18:41:13 -0700 Subject: [PATCH] datapath: Provide simple version of if_ether.h on non-Linux systems. Signed-off-by: Jesse Gross --- configure.ac | 2 +- include/linux/automake.mk | 1 + include/linux/if_ether.h | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 include/linux/if_ether.h diff --git a/configure.ac b/configure.ac index bd491796c..79fb46ea9 100644 --- a/configure.ac +++ b/configure.ac @@ -61,7 +61,7 @@ OVS_CHECK_STRTOK_R AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec], [], [], [[#include ]]) 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 diff --git a/include/linux/automake.mk b/include/linux/automake.mk index 6fba5075a..6ca0e4017 100644 --- a/include/linux/automake.mk +++ b/include/linux/automake.mk @@ -1,3 +1,4 @@ noinst_HEADERS += \ + include/linux/if_ether.h \ include/linux/openvswitch.h \ include/linux/types.h diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h new file mode 100644 index 000000000..a3cc9bc44 --- /dev/null +++ b/include/linux/if_ether.h @@ -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 . + * + * On other platforms, this header file implements just enough of + * to allow to work. */ + +#if defined(HAVE_LINUX_IF_ETHER_H) || defined(__KERNEL__) +#include_next +#else /* no */ +#define ETH_ALEN 6 /* Octets in one ethernet addr */ +#endif + +#endif /* */ -- 2.43.0