[go: up one dir, main page]

File: vmcp.h

package info (click to toggle)
s390-tools 2.3.0-2~deb10u1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 6,188 kB
  • sloc: ansic: 87,755; sh: 8,398; cpp: 8,384; perl: 3,783; makefile: 1,476; asm: 654
file content (59 lines) | stat: -rw-r--r-- 1,609 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * vmcp - Send commands to the z/VM control program
 *
 * Definitions used by vmcp
 *
 * Copyright IBM Corp. 2005, 2017
 *
 * s390-tools is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#ifndef __vmcp_h__
#define __vmcp_h__

#include <getopt.h>
#include <sys/ioctl.h>

#include "lib/zt_common.h"

#define DEVICE_NODE "/dev/vmcp"

#define VMCP_GETCODE _IOR(0x10, 1, int)
#define VMCP_SETBUF _IOW(0x10, 2, int)
#define VMCP_GETSIZE _IOR(0x10, 3, int)

#define MAXBUFFER 1048576
#define MINBUFFER 4096
#define MAXCMDLEN 240

#define VMCP_OK 0
#define VMCP_CP 1
#define VMCP_BUF 2
#define VMCP_LIN 3
#define VMCP_OPT 4

static struct option options[] = {
	{"help", no_argument, NULL, 'h'},
	{"version", no_argument, NULL, 'v'},
	{"keepcase", no_argument, NULL, 'k'},
	{"buffer", required_argument, NULL, 'b'},
	{NULL, 0, NULL, 0}
};

static const char opt_string[] = "+hvkb:";

static const char help_text[] =
    "Usage:\n"
    "vmcp [-k] [-b <size>] command\n"
    "vmcp [-h|-v]\n\n"
    "Options:\n"
    "-h or --help     :Print usage information, then exit\n"
    "-v or --version  :Print version information, then exit\n"
    "-k or --keepcase :Using this option, vmcp does not convert the command\n"
    "                  to uppercase. The default is to translate the command\n"
    "                  string.\n"
    "-b <size> or     :defines the buffer size for the response\n"
    "--buffer=<size>   valid values are from 4096 to 1048576 bytes\n"
    "                  the k and M suffixes are also supported\n";
#endif