Beispiel #1
0
int
handle_vFile (char *own_buf, int packet_len, int *new_packet_len)
{
  if (strncmp (own_buf, "vFile:open:", 11) == 0)
    handle_open (own_buf);
  else if (strncmp (own_buf, "vFile:pread:", 11) == 0)
    handle_pread (own_buf, new_packet_len);
  else if (strncmp (own_buf, "vFile:pwrite:", 12) == 0)
    handle_pwrite (own_buf, packet_len);
  else if (strncmp (own_buf, "vFile:close:", 12) == 0)
    handle_close (own_buf);
  else if (strncmp (own_buf, "vFile:unlink:", 13) == 0)
    handle_unlink (own_buf);
  else
    return 0;

  return 1;
}
Beispiel #2
0
int
handle_vFile (char *own_buf, int packet_len, int *new_packet_len)
{
  if (startswith (own_buf, "vFile:open:"))
    handle_open (own_buf);
  else if (startswith (own_buf, "vFile:pread:"))
    handle_pread (own_buf, new_packet_len);
  else if (startswith (own_buf, "vFile:pwrite:"))
    handle_pwrite (own_buf, packet_len);
  else if (startswith (own_buf, "vFile:fstat:"))
    handle_fstat (own_buf, new_packet_len);
  else if (startswith (own_buf, "vFile:close:"))
    handle_close (own_buf);
  else if (startswith (own_buf, "vFile:unlink:"))
    handle_unlink (own_buf);
  else if (startswith (own_buf, "vFile:readlink:"))
    handle_readlink (own_buf, new_packet_len);
  else
    return 0;

  return 1;
}