[netcf-devel] [PATCH 1/5] initial checkin to fix configure and automake/build stuffs on fbsd

Sean Bruno sbruno at freebsd.org
Fri May 18 16:38:50 UTC 2012


---
 src/drv_fbsd.c   |  176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/dutil_fbsd.c |   27 +++++++++
 src/dutil_fbsd.h |   30 ++++++++++
 3 files changed, 233 insertions(+)
 create mode 100644 src/drv_fbsd.c
 create mode 100644 src/dutil_fbsd.c
 create mode 100644 src/dutil_fbsd.h

diff --git a/src/drv_fbsd.c b/src/drv_fbsd.c
new file mode 100644
index 0000000..64b0e98
--- /dev/null
+++ b/src/drv_fbsd.c
@@ -0,0 +1,176 @@
+/*
+ */
+
+#include <config.h>
+#include <internal.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <spawn.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include "safe-alloc.h"
+#include "ref.h"
+#include "list.h"
+#include "dutil.h"
+#include "dutil_fbsd.h"
+
+int drv_init(struct netcf *ncf) {
+    return 0;
+}
+
+
+void drv_close(struct netcf *ncf) {
+    if (ncf == NULL || ncf->driver == NULL)
+        return;
+    FREE(ncf->driver);
+}
+
+
+void drv_entry(struct netcf *ncf ATTRIBUTE_UNUSED) {
+}
+
+static PIP_ADAPTER_ADDRESSES build_adapter_table(struct netcf *ncf) {
+    return NULL;
+}
+
+static int list_interface_ids(struct netcf *ncf,
+                              int maxnames,
+                              char **names, unsigned int flags ATTRIBUTE_UNUSED) {
+    return -1;
+}
+
+int drv_list_interfaces(struct netcf *ncf,
+                        int maxnames, char **names,
+                        unsigned int flags) {
+    return list_interface_ids(ncf, maxnames, names, flags);
+}
+
+
+int drv_num_of_interfaces(struct netcf *ncf, unsigned int flags) {
+    return list_interface_ids(ncf, 0, NULL, flags);
+}
+
+
+struct netcf_if *drv_lookup_by_name(struct netcf *ncf, const char *name) {
+    ERR_THROW(1 == 1, ncf, EOTHER, "not implemented on this platform");
+
+    return nif;
+}
+
+const char *drv_mac_string(struct netcf_if *nif) {
+    struct netcf *ncf = nif->ncf;
+    ERR_THROW(1 == 1, ncf, EOTHER, "not implemented on this platform");
+ error:
+    free(adapter);
+    free(buf);
+    return nif->mac;
+}
+
+int drv_if_down(struct netcf_if *nif) {
+    ERR_THROW(1 == 1, ncf, EOTHER, "not implemented on this platform");
+ error:
+    free(exe_path);
+    return -1;
+}
+
+int drv_if_up(struct netcf_if *nif) {
+    ERR_THROW(1 == 1, ncf, EOTHER, "not implemented on this platform");
+ error:
+    free(exe_path);
+    return -1;
+}
+
+
+struct netcf_if *drv_define(struct netcf *ncf, const char *xml_str ATTRIBUTE_UNUSED) {
+    struct netcf_if *result = NULL;
+
+    ERR_THROW(1 == 1, ncf, EOTHER, "not implemented on this platform");
+
+error:
+    return result;
+}
+
+int drv_undefine(struct netcf_if *nif) {
+    int result = -1;
+
+    ERR_THROW(1 == 1, nif->ncf, EOTHER, "not implemented on this platform");
+    result = 0;
+error:
+    return result;
+}
+
+
+char *drv_xml_desc(struct netcf_if *nif) {
+    char *result = NULL;
+
+    ERR_THROW(1 == 1, nif->ncf, EOTHER, "not implemented on this platform");
+
+error:
+    return result;
+}
+
+char *drv_xml_state(struct netcf_if *nif) {
+    char *result = NULL;
+
+    ERR_THROW(1 == 1, nif->ncf, EOTHER, "not implemented on this platform");
+
+error:
+    return result;
+}
+
+int drv_if_status(struct netcf_if *nif, unsigned int *flags ATTRIBUTE_UNUSED) {
+    int result = -1;
+
+    ERR_THROW(1 == 1, nif->ncf, EOTHER, "not implemented on this platform");
+    result = 0;
+error:
+    return result;
+}
+
+int drv_lookup_by_mac_string(struct netcf *ncf,
+			     const char *mac ATTRIBUTE_UNUSED,
+                             int maxifaces ATTRIBUTE_UNUSED,
+			     struct netcf_if **ifaces ATTRIBUTE_UNUSED)
+{
+    int result = -1;
+
+    ERR_THROW(1 == 1, ncf, EOTHER, "not implemented on this platform");
+    result = 0;
+error:
+    return result;
+}
+
+int
+drv_change_begin(struct netcf *ncf, unsigned int flags ATTRIBUTE_UNUSED)
+{
+    int result = -1;
+
+    ERR_THROW(1 == 1, ncf, EOTHER, "not implemented on this platform");
+    result = 0;
+error:
+    return result;
+}
+
+int
+drv_change_rollback(struct netcf *ncf, unsigned int flags ATTRIBUTE_UNUSED)
+{
+    int result = -1;
+
+    ERR_THROW(1 == 1, ncf, EOTHER, "not implemented on this platform");
+    result = 0;
+error:
+    return result;
+}
+
+int
+drv_change_commit(struct netcf *ncf, unsigned int flags ATTRIBUTE_UNUSED)
+{
+    int result = -1;
+
+    ERR_THROW(1 == 1, ncf, EOTHER, "not implemented on this platform");
+    result = 0;
+error:
+    return result;
+}
diff --git a/src/dutil_fbsd.c b/src/dutil_fbsd.c
new file mode 100644
index 0000000..3f98319
--- /dev/null
+++ b/src/dutil_fbsd.c
@@ -0,0 +1,27 @@
+/*
+ * dutil_mswindows.c: Windows utility functions for driver backends.
+ *
+ * Copyright (C) 2010 Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ *
+ * Author: Adam Stokes <astokes at fedoraproject.org>
+ */
+
+#include <config.h>
+#include <internal.h>
+
+#include "dutil.h"
+#include "dutil_mswindows.h"
diff --git a/src/dutil_fbsd.h b/src/dutil_fbsd.h
new file mode 100644
index 0000000..78295b5
--- /dev/null
+++ b/src/dutil_fbsd.h
@@ -0,0 +1,30 @@
+/*
+ * dutil_mswindows.h: Window utility functions for driver backends.
+ *
+ * Copyright (C) 2010 Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ *
+ * Author: Adam Stokes <astokes at fedoraproject.org>
+ */
+
+#ifndef DUTIL_MSWINDOWS_H_
+#define DUTIL_MSWINDOWS_H_
+
+struct driver {
+    int padding;
+};
+
+#endif /* DUTIL_MSWINDOWS_H_ */
-- 
1.7.10.1



More information about the netcf-devel mailing list