* Boston, MA 021110-1307, USA.
*
* Authors: Atul Sabharwal
- *
+ *
*/
#include <stdio.h>
+#include <string.h>
+
+#include "chassis_id.h"
#define TABLE_SIZE 100
#define PROVISION_DB "/usr/local/bin/provision.tbl"
/* Initialize the provisioning table by reading the data from special file provision.tbl *
Return error if something does not work appropriately. */
-int table_init()
+int table_init(void)
{
FILE *fp;
char ptr[255];
i = 0;
while (!feof(fp)) {
fgets(ptr, 80, fp);
- sscanf(ptr, "%d %d %d %d %d %s %s", &ptable[i].id,
+ sscanf(ptr, "%d %d %d %d %s %s", &ptable[i].id,
&ptable[i].num_disks,
&ptable[i].chassis_num, &ptable[i].slot_num,
ptable[i].serial_num, ptable[i].name);
/* return -1 when no disk found. Otherwise return index of disk */
-int table_find_disk( char * serialnumber , int * host_num, int * chassis_num, int *slot_num)
+int table_find_disk(const char *serialnumber , int *chassis_num, int *slot_num)
{
int i;
* so that it can create descriptive GDN for it. So, for that we need to output
* this data to stdout.
*/
-int table_select_disk( int diskindex )
+int table_select_disk(int diskindex)
{
printf("%d ", ptable[diskindex].chassis_num);
printf("%d ", ptable[diskindex].slot_num);
printf("%s ", ptable[diskindex].name);
+
+ return 0;
}