This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 89a5b4332c34f3d432fe864b27c05701e9bde96a (commit)
from 7ec7ffe9ddfd787c1a9df94aecf6a7f529bffe91 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 89a5b4332c34f3d432fe864b27c05701e9bde96a
Author: Narasimha Sharoff <nsh...@us...>
Date: Mon Jun 25 14:29:20 2012 -0700
[ 3534977 ] sfcb custom library and hostname
-----------------------------------------------------------------------
Summary of changes:
diff --git a/sfcCustomLib.c b/sfcCustomLib.c
new file mode 100644
index 0000000..f331461
--- /dev/null
+++ b/sfcCustomLib.c
@@ -0,0 +1,70 @@
+
+/*
+ * sfcCustomLib.c
+ *
+ * (C) Copyright IBM Corp. 2012
+ *
+ * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+ *
+ * You can obtain a current copy of the Eclipse Public License from
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * Author: Narasimha Sharoff <nsh...@us...>
+ *
+ * Description:
+ *
+ * These routines are used by sfcb. User can customize the functionality.
+ * Do not remove any function or the function prototype
+ *
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+/*
+ * _sfcGetSlpHostname: by Tyrel Datwyler <ty...@us...>
+ * is from sfcSlpCustomHostname.c - this file will be deprecated
+*/
+
+/** \brief _sfcGetSlpHostname - obtains custom hostname to register with SLP DA
+ *
+ * Obtain custom hostname string to register with SLP DA
+ * This is only a sample of how to write the custom routine
+ * used to provide the hostname. You will need to replace this
+ * with a routine that uses the desired method to obtain the
+ * proper value.
+*/
+extern int _sfcGetSlpHostname(char **hostname)
+{
+ char *sn;
+ sn = (char *) malloc((strlen("mycimom.com") + 1) * sizeof(char));
+ sn = strncpy(sn, "mycimom.com", strlen("mycimom.com") + 1);
+ if (sn == NULL)
+ return 0;
+
+ printf("-#- Request for custom SLP service hostname: (hostname = %s)\n", sn);
+ *hostname = sn;
+
+ /* Return value of 1 for successs and 0 for failure. */
+ return 1;
+}
+
+/** \brief _sfcbGetResponseHostname - obtains custom hostname
+ *
+ * Allows the user to customize the hostname that sfcb will use internally
+ * httphost - hostname as provided in HTTP header
+ * hostname - sfcb allocated buffer
+ * len - size of the hostname buffer
+*/
+extern int _sfcbGetResponseHostname(char *httpHost, char **hostname, unsigned int len)
+{
+ if (gethostname(*hostname, len) != 0) {
+ strcpy(*hostname, "localhost");
+ }
+
+ return 0;
+}
diff --git a/support.c b/support.c
index e9ba2d4..48a17c7 100644
--- a/support.c
+++ b/support.c
@@ -1146,6 +1146,7 @@ int getCustomHostname(char *httpHost, char **hn, unsigned int len)
int getCustomSlpHostname(char **hn)
{
if (sfcbSlpHostname) return(sfcbSlpHostname(hn));
+ return -1;
}
void unloadHostnameLib()
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|