~ubuntu-branches/ubuntu/trusty/sblim-sfcb/trusty-proposed

« back to all changes in this revision

Viewing changes to sfcSlpHostname.c

  • Committer: Bazaar Package Importer
  • Author(s): Thierry Carrez
  • Date: 2009-06-08 12:04:49 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090608120449-byfplk09rqz8rtg6
Tags: 1.3.3-0ubuntu1
* New upstream release.
* debian/rules: Removed rpath hacks, SFCB default build handles that now.
* Removed 1934753-remove-assignment.diff, now upstream.
* Refreshed patch cim-schema-location.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * sfcSlpHostname.c
 
4
 *
 
5
 * (C) Copyright IBM Corp. 2008
 
6
 *
 
7
 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
 
8
 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
 
9
 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
 
10
 *
 
11
 * You can obtain a current copy of the Eclipse Public License from
 
12
 * http://www.opensource.org/licenses/eclipse-1.0.php
 
13
 *
 
14
 * Author:        Tyrel Datwyler <tyreld@us.ibm.com>
 
15
 *
 
16
 * Description:
 
17
 *
 
18
 * Obtain custom hostname string to register with SLP DA
 
19
 * This is only a sample of how to write the custom routine
 
20
 * used to provide the hostname. You will need to replace this
 
21
 * with a routine that uses the desired method to obtain the 
 
22
 * proper value. 
 
23
 *
 
24
*/
 
25
 
 
26
 
 
27
#include <stdio.h>
 
28
#include <string.h>
 
29
#include <stdlib.h>
 
30
 
 
31
extern int _sfcGetSlpHostname(char **hostname)
 
32
{
 
33
   char *sn;
 
34
   sn = (char *) malloc((strlen("mycimom.com") + 1) * sizeof(char));
 
35
   sn = strncpy(sn, "mycimom.com", strlen("mycimom.com") + 1);
 
36
   if (sn == NULL)
 
37
      return 0;
 
38
   
 
39
   printf("-#- Request for custom SLP service hostname: (hostname = %s)\n", sn);
 
40
   *hostname = sn;
 
41
 
 
42
   /* Return value of 1 for successs and 0 for failure. */
 
43
   return 1;
 
44
}
 
45