version 1.1.1.1, 2012/02/21 16:42:02
|
version 1.1.1.2, 2012/10/09 09:13:23
|
Line 1
|
Line 1
|
/* |
/* |
* Copyright (C) 2008-2011 Daisuke Aoyama <aoyama@peach.ne.jp>. | * Copyright (C) 2008-2012 Daisuke Aoyama <aoyama@peach.ne.jp>. |
* All rights reserved. |
* All rights reserved. |
* |
* |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
Line 53
|
Line 53
|
#include "istgt_iscsi.h" |
#include "istgt_iscsi.h" |
#include "istgt_proto.h" |
#include "istgt_proto.h" |
|
|
|
#if !defined(__GNUC__) |
|
#undef __attribute__ |
|
#define __attribute__(x) |
|
#endif |
|
|
#define TIMEOUT_RW 60 |
#define TIMEOUT_RW 60 |
#define MAX_LINEBUF 4096 |
#define MAX_LINEBUF 4096 |
|
|
Line 139 istgt_uctl_writeline(UCTL_Ptr uctl)
|
Line 144 istgt_uctl_writeline(UCTL_Ptr uctl)
|
return UCTL_CMD_OK; |
return UCTL_CMD_OK; |
} |
} |
|
|
|
static int istgt_uctl_snprintf(UCTL_Ptr uctl, const char *format, ...) __attribute__((__format__(__printf__, 2, 3))); |
|
|
static int |
static int |
istgt_uctl_snprintf(UCTL_Ptr uctl, const char *format, ...) |
istgt_uctl_snprintf(UCTL_Ptr uctl, const char *format, ...) |
{ |
{ |
Line 1010 istgt_uctl_cmd_reset(UCTL_Ptr uctl)
|
Line 1017 istgt_uctl_cmd_reset(UCTL_Ptr uctl)
|
goto error_return; |
goto error_return; |
} |
} |
llp = &lu->lun[lun_i]; |
llp = &lu->lun[lun_i]; |
|
if (llp->type == ISTGT_LU_LUN_TYPE_NONE) { |
|
istgt_uctl_snprintf(uctl, "ERR no LUN\n"); |
|
goto error_return; |
|
} |
|
|
/* reset lun */ |
/* reset lun */ |
switch (lu->type) { |
switch (lu->type) { |
Line 1317 istgt_free_uctl(UCTL_Ptr uctl)
|
Line 1328 istgt_free_uctl(UCTL_Ptr uctl)
|
} |
} |
|
|
int |
int |
istgt_create_uctl(ISTGT_Ptr istgt, PORTAL_Ptr portal, int sock, struct sockaddr *sa, socklen_t salen) | istgt_create_uctl(ISTGT_Ptr istgt, PORTAL_Ptr portal, int sock, struct sockaddr *sa, socklen_t salen __attribute__((__unused__))) |
{ |
{ |
char buf[MAX_TMPBUF]; |
char buf[MAX_TMPBUF]; |
UCTL_Ptr uctl; |
UCTL_Ptr uctl; |
Line 1466 istgt_create_uctl(ISTGT_Ptr istgt, PORTAL_Ptr portal,
|
Line 1477 istgt_create_uctl(ISTGT_Ptr istgt, PORTAL_Ptr portal,
|
} |
} |
|
|
int |
int |
istgt_init_uctl(ISTGT_Ptr istgt) | istgt_uctl_init(ISTGT_Ptr istgt) |
{ |
{ |
CF_SECTION *sp; |
CF_SECTION *sp; |
const char *val; |
const char *val; |
Line 1573 istgt_init_uctl(ISTGT_Ptr istgt)
|
Line 1584 istgt_init_uctl(ISTGT_Ptr istgt)
|
istgt->uctl_auth_group); |
istgt->uctl_auth_group); |
} |
} |
|
|
|
return 0; |
|
} |
|
|
|
int |
|
istgt_uctl_shutdown(ISTGT_Ptr istgt) |
|
{ |
|
int i; |
|
|
|
for (i = 0; i < istgt->nuctl_netmasks; i++) { |
|
xfree(istgt->uctl_netmasks[i]); |
|
} |
|
xfree(istgt->uctl_netmasks); |
return 0; |
return 0; |
} |
} |