udftools

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Functions | Variables
pktsetup.c File Reference
`#include "config.h"`
`#include <stdio.h>`
`#include <fcntl.h>`
`#include <sys/ioctl.h>`
`#include <sys/stat.h>`
`#include <unistd.h>`
`#include <getopt.h>`
`#include <bits/types.h>`
`#include <sys/types.h>`
`#include <string.h>`
`#include <limits.h>`
`#include <stdlib.h>`
`#include <errno.h>`
`#include <linux/cdrom.h>`
Include dependency graph for pktsetup.c:

Go to the source code of this file.

## Classes
struct | pkt_ctrl_command

## Macros
#define | PACKET_SETUP_DEV _IOW('X', 1, unsigned int)
#define | PACKET_TEARDOWN_DEV _IOW('X', 2, unsigned int)
#define | PACKET_CTRL_CMD _IOWR('X', 1, struct pkt_ctrl_command)
#define | MAJOR(dev) ((dev & 0xfff00) >> 8)
#define | MINOR(dev) ((dev & 0xff) | ((dev >> 12) & 0xfff00))
#define | MKDEV(ma, mi) ((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12))
#define | MISC_MAJOR 10
#define | CTL_DIR "/dev/pktcdvd"
#define | CTL_DEV "control"
#define | PKT_CTRL_CMD_SETUP 0
#define | PKT_CTRL_CMD_TEARDOWN 1
#define | PKT_CTRL_CMD_STATUS 2

## Functions
static int | init_cdrom (int fd)
static int | setup_dev (char *pkt_device, char *device, int rem)
static int | usage (void)
static int | get_misc_minor (void)
static const char * | pkt_dev_name (const char *dev)
static int | create_ctl_dev (void)
static int | remove_stale_dev_node (int ctl_fd, char *devname)
static int | setup_dev_chardev (char *pkt_device, char *device, int rem)
static void | show_mappings (void)
int | main (int argc, char **argv)

## Variables
struct pkt_ctrl_command | __attribute__

## Macro Definition Documentation

#define CTL_DEV "control"

Definition at line 55 of file pktsetup.c.

#define CTL_DIR "/dev/pktcdvd"

Definition at line 54 of file pktsetup.c.

#define MAJOR | ( |  | dev | ) | ((dev & 0xfff00) >> 8)

Definition at line 49 of file pktsetup.c.

#define MINOR | ( |  | dev | ) | ((dev & 0xff) | ((dev >> 12) & 0xfff00))

Definition at line 50 of file pktsetup.c.

#define MISC_MAJOR 10

Definition at line 53 of file pktsetup.c.

#define MKDEV | ( |  | ma,
|  |  | mi
| ) |  | ((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12))

Definition at line 51 of file pktsetup.c.

#define PACKET_CTRL_CMD _IOWR('X', 1, struct pkt_ctrl_command)

Definition at line 46 of file pktsetup.c.

#define PACKET_SETUP_DEV _IOW('X', 1, unsigned int)

Definition at line 42 of file pktsetup.c.

#define PACKET_TEARDOWN_DEV _IOW('X', 2, unsigned int)

Definition at line 43 of file pktsetup.c.

#define PKT_CTRL_CMD_SETUP 0

Definition at line 57 of file pktsetup.c.

#define PKT_CTRL_CMD_STATUS 2

Definition at line 59 of file pktsetup.c.

#define PKT_CTRL_CMD_TEARDOWN 1

Definition at line 58 of file pktsetup.c.

## Function Documentation

static int create_ctl_dev | ( | void |  | ) |
| static

Definition at line 176 of file pktsetup.c.

static int get_misc_minor | ( | void |  | ) |
| static

Definition at line 151 of file pktsetup.c.

static int init_cdrom | ( | int | fd | ) |
| static

Definition at line 71 of file pktsetup.c.

int main | ( | int | argc,
|  | char ** | argv
| ) |  |

Definition at line 360 of file pktsetup.c.

static const char* pkt_dev_name | ( | const char * | dev | ) |
| static

Definition at line 169 of file pktsetup.c.

static int remove_stale_dev_node | ( | int | ctl_fd,
|  | char * | devname
| ) |  |
| static

Definition at line 209 of file pktsetup.c.

static int setup_dev | ( | char * | pkt_device,
|  | char * | device,
|  | int | rem
| ) |  |
| static

Definition at line 91 of file pktsetup.c.

static int setup_dev_chardev | ( | char * | pkt_device,
|  | char * | device,
|  | int | rem
| ) |  |
| static

Definition at line 238 of file pktsetup.c.

static void show_mappings | ( | void |  | ) |
| static

Definition at line 324 of file pktsetup.c.

static int usage | ( | void |  | ) |
| static

Definition at line 133 of file pktsetup.c.

## Variable Documentation

struct pkt_ctrl_command __attribute__