~ubuntu-branches/ubuntu/saucy/s390-tools/saucy

« back to all changes in this revision

Viewing changes to osasnmpd/osasnmpd-2.4/ibmOSAMibUtil.c

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2008-07-15 23:55:41 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080715235541-r79vu6eqh4qim413
Tags: 1.6.2-1
* New upstream version.
* Install udev rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * File...........: ibmOSAMibUtil.c
3
3
 * Author(s)......: Thomas Weber <tweber@de.ibm.com>
4
 
 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2002
 
4
 * Copyright IBM Corp. 2002,2007
5
5
 *
6
6
 * History of changes:
7
7
 * 07/29 added '-x agentx_socket' parm to usage message
1536
1536
  snmp_sess_init( &session );                                           
1537
1537
  session.peername  = NET_SNMP_PEERNAME;       
1538
1538
  session.version   = SNMP_VERSION_2c;      /* use SNMPv2c */
1539
 
  session.community = NET_SNMP_COMMUNITY;   /* SNMPv2c community name */
1540
 
  session.community_len = strlen(session.community);
 
1539
  /* SNMPv2c community name */
 
1540
  session.community = (unsigned char*)NET_SNMP_COMMUNITY;
 
1541
  session.community_len = strlen((char*)session.community);
1541
1542
  session.timeout = 300 * 1000000L;
1542
1543
   
1543
1544
  /* Open the session */
1620
1621
                  {
1621
1622
                    if ( if_Number == 0 )
1622
1623
                      {    
1623
 
                         strncpy( (*ifList)[0].if_Name, vars->val.string, vars->val_len );
 
1624
                         strncpy((*ifList)[0].if_Name,
 
1625
                                 (const char*)vars->val.string, vars->val_len);
1624
1626
                         (*ifList)[0].if_Name[vars->val_len] = '\0';
1625
1627
                      }
1626
1628
                    else
1627
1629
                      {
1628
 
                        if ( strncmp( (*ifList)[if_Number-1].if_Name, vars->val.string,
1629
 
                                     vars->val_len ) !=0 )
 
1630
                        if(strncmp((const char*)(*ifList)[if_Number-1].if_Name,
 
1631
                                    (const char*)vars->val.string,
 
1632
                                    vars->val_len ) !=0)
1630
1633
                          {
1631
 
                            strncpy( (*ifList)[if_Number].if_Name, vars->val.string, 
1632
 
                                     vars->val_len );
 
1634
                            strncpy((*ifList)[if_Number].if_Name,
 
1635
                                    (const char*)vars->val.string,
 
1636
                                    vars->val_len);
1633
1637
                            (*ifList)[if_Number].if_Name[vars->val_len] = '\0';
1634
1638
                            valid = TRUE;
1635
1639
                          }
1772
1776
  
1773
1777
} /* end get_time () */
1774
1778
 
1775
 
static const char contact_information[] = "linux390@de.ibm.com";
1776
 
 
1777
1779
static const char* usage_text[] = {
1778
1780
"Usage:  osasnmpd [-h] [-v] [-l LOGFILE] [-A] [-f] [-L] [-P PIDFILE]",
1779
1781
"                 [-x SOCKADDR]",
1801
1803
 
1802
1804
        for (i=0; i < sizeof(usage_text) / sizeof(usage_text[0]); i++)
1803
1805
                printf("%s\n", usage_text[i]);
1804
 
        printf("Please report bugs to: %s\n", contact_information);
1805
1806
        exit(0);
1806
1807
} /* end usage() */