slist
This commit is contained in:
24
slist.c
24
slist.c
@@ -41,10 +41,6 @@ static unsigned long node_to_number(uint8 *addr)
|
|||||||
|
|
||||||
static void print_net_node_status(uint8 *addr, int is_default)
|
static void print_net_node_status(uint8 *addr, int is_default)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Novell SLIST prints the node address as a right-aligned decimal
|
|
||||||
* number in a 12 character bracketed field.
|
|
||||||
*/
|
|
||||||
fprintf(stdout, "[%08lX][%12lu]%s",
|
fprintf(stdout, "[%08lX][%12lu]%s",
|
||||||
(unsigned long)GET_BE32(addr),
|
(unsigned long)GET_BE32(addr),
|
||||||
node_to_number(addr),
|
node_to_number(addr),
|
||||||
@@ -81,14 +77,14 @@ int func_slist(int argc, char *argv[], int mode)
|
|||||||
upstr(pattern);
|
upstr(pattern);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These two format strings are copied from the official Novell SLIST.EXE
|
* Novell-like layout from the DOS client:
|
||||||
* string table:
|
* Known NetWare File Servers Network Node Address Status
|
||||||
*
|
* ------------------------- -------- -------------------
|
||||||
* "Known NetWare File Servers Network Node Address Status\n"
|
|
||||||
* "-------------------------- ------- ------------ ------\n"
|
|
||||||
*/
|
*/
|
||||||
fprintf(stdout, "Known NetWare File Servers Network Node Address Status\n");
|
fprintf(stdout, "%-44sNetwork Node Address Status\n",
|
||||||
fprintf(stdout, "-------------------------- ------- ------------ ------\n");
|
"Known NetWare File Servers");
|
||||||
|
fprintf(stdout, "%-44s-------- -------------------\n",
|
||||||
|
"-------------------------");
|
||||||
|
|
||||||
while ((result = ncp_17_37(last_id, NCP_BINDERY_FSERVER,
|
while ((result = ncp_17_37(last_id, NCP_BINDERY_FSERVER,
|
||||||
pattern, &obj)) == 0) {
|
pattern, &obj)) == 0) {
|
||||||
@@ -97,11 +93,7 @@ int func_slist(int argc, char *argv[], int mode)
|
|||||||
found++;
|
found++;
|
||||||
last_id = obj.object_id;
|
last_id = obj.object_id;
|
||||||
|
|
||||||
/*
|
fprintf(stdout, "%-44s", obj.object_name);
|
||||||
* The official header puts the Network column at column 53, so the
|
|
||||||
* server name field is 52 characters wide.
|
|
||||||
*/
|
|
||||||
fprintf(stdout, "%-52s", obj.object_name);
|
|
||||||
|
|
||||||
if (!ncp_17_3d(NCP_BINDERY_FSERVER, obj.object_name,
|
if (!ncp_17_3d(NCP_BINDERY_FSERVER, obj.object_name,
|
||||||
1, "NET_ADDRESS", &prop)) {
|
1, "NET_ADDRESS", &prop)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user