Data Structures | Defines | Enumerations | Functions | Variables

sft_ok.c File Reference

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>

Go to the source code of this file.

Data Structures

struct  sft_hdr
 sft_hdr Estrutura do pacote SFT. Todos foram acrescentados 1 caracter para ser o . A struct com o protocolo é enviada por parametro via socket. More...

Defines

#define TAMMSG   1100
#define SFT_PORT   45
#define SFTD_BUFFER_DATA   1000

Enumerations

enum  cmd_sft {
  CMD_RECV = 0, CMD_RECV_ANS, CMD_STOP, CMD_RECV_SEQ,
  CMD_FINISHED, CMD_RECV_X, CMD_RECVU, CMD_ERROR,
  CMD_MSG, CMD_SEND = 0, CMD_SEND_WAIT, CMD_STOP,
  CMD_SEND_SEQ, CMD_FINISHED, CMD_SEND_X, CMD_SENDU,
  CMD_ERROR, CMD_SEND = 0, CMD_SEND_WAIT, CMD_STOP,
  CMD_SEND_SEQ, CMD_FINISHED, CMD_SEND_X, CMD_SENDU,
  CMD_ERROR, CMD_SEND = 0, CMD_SEND_WAIT, CMD_STOP,
  CMD_SEND_SEQ, CMD_FINISHED, CMD_SEND_X, CMD_SENDU,
  CMD_ERROR, CMD_MSG
}
 

cmd_sft Tipos de comandos suportados pelo protocolo SFT.

More...

Functions

struct hostent * gethostbyname ()
int main (int argc, char *argv[])
 Funcao que gerencia execucao programa.
int sft_send_x (char *data)
int sft_sendu (char *data)
 Monta pacotes para ser enviado pelo protocolo SFT.
int sft_send_seq (char *data)
 Envia uma sequencia de imagens.
int sft_send_loop (char *data)
 Chama o envio de imagens sequenciais.
int send_pkt (void)
 Envia um pacote com seguranca.
int sft_send (char *data)
 Monta pacotes para ser enviado pelo protocolo SFT.
int send_stop (void)
 Finaliza arquivo enviado.
int trata_sft ()
 Verifica o que foi digitado pedindo.

Variables

int s1
int i
int gif
struct sockaddr_in server
struct hostent * hp
int id_stc
char msg_rec [TAMMSG]
char msg_send [TAMMSG]
char buff [TAMMSG]
struct sft_hdrsft