Data Structures | Files | Defines | Enumerations | Functions | Variables

Tools

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...
struct  COR
 Conversor BMP para C header RAW R1G1B1R2G2B2 comprimido com RLE. More...
struct  RLE8
struct  CABECALHO

Files

file  chat.c
 

comunicação entre dois ambientes com sockets.


file  sft.c
 

Servidor usado peloprotocolo SFT.


file  sft.c
 

Servidor usado peloprotocolo SFT.


file  sft.c
 

Servidor usado peloprotocolo SFT.


Defines

#define TAMMSG   80
#define TAMMSG   1100
#define SFT_PORT   45
#define SFTD_BUFFER_DATA   1000
#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...
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

int main (int argc, char *argv[])
 Funcao que gerencia execucao programa.
struct hostent * gethostbyname ()
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]
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
struct sockaddr_in server
struct hostent * hp

Define Documentation

#define SFT_PORT   45

Definition at line 38 of file sft.c.

#define SFT_PORT   45

Definition at line 37 of file sft_ok.c.

#define SFTD_BUFFER_DATA   1000

Definition at line 39 of file sft.c.

#define SFTD_BUFFER_DATA   1000

Definition at line 38 of file sft_ok.c.

#define TAMMSG   1100

Definition at line 37 of file sft.c.

#define TAMMSG   1100

Definition at line 36 of file sft_ok.c.

#define TAMMSG   80

Definition at line 35 of file chat.c.


Enumeration Type Documentation

enum cmd_sft
Enumerator:
CMD_RECV 
CMD_RECV_ANS 
CMD_STOP 
CMD_RECV_SEQ 
CMD_FINISHED 
CMD_RECV_X 
CMD_RECVU 
CMD_ERROR 
CMD_MSG 
CMD_SEND 
CMD_SEND_WAIT 
CMD_STOP 
CMD_SEND_SEQ 
CMD_FINISHED 
CMD_SEND_X 
CMD_SENDU 
CMD_ERROR 
CMD_SEND 
CMD_SEND_WAIT 
CMD_STOP 
CMD_SEND_SEQ 
CMD_FINISHED 
CMD_SEND_X 
CMD_SENDU 
CMD_ERROR 
CMD_SEND 
CMD_SEND_WAIT 
CMD_STOP 
CMD_SEND_SEQ 
CMD_FINISHED 
CMD_SEND_X 
CMD_SENDU 
CMD_ERROR 
CMD_MSG 

Definition at line 55 of file sft.c.

enum cmd_sft
Enumerator:
CMD_RECV 
CMD_RECV_ANS 
CMD_STOP 
CMD_RECV_SEQ 
CMD_FINISHED 
CMD_RECV_X 
CMD_RECVU 
CMD_ERROR 
CMD_MSG 
CMD_SEND 
CMD_SEND_WAIT 
CMD_STOP 
CMD_SEND_SEQ 
CMD_FINISHED 
CMD_SEND_X 
CMD_SENDU 
CMD_ERROR 
CMD_SEND 
CMD_SEND_WAIT 
CMD_STOP 
CMD_SEND_SEQ 
CMD_FINISHED 
CMD_SEND_X 
CMD_SENDU 
CMD_ERROR 
CMD_SEND 
CMD_SEND_WAIT 
CMD_STOP 
CMD_SEND_SEQ 
CMD_FINISHED 
CMD_SEND_X 
CMD_SENDU 
CMD_ERROR 
CMD_MSG 

Definition at line 54 of file sft_ok.c.


Function Documentation

struct hostent * gethostbyname (  ) 
int main ( int  argc,
char *  argv[] 
)

Funcao principal do Programa.

Programa abre uma conexao com socket TCP entre o host e o UIP.

Deve ser passado por parametro o hostname e a porta de conexao

Cria a socket que fara a comunicacao com o UIP. recebe o comando de entrada e envia para ser interpretado pelo protocolo SFT.

Definition at line 43 of file bmp2h.c.

Here is the call graph for this function:

int send_pkt ( void   ) 

Divide os pacotes em 1000 bytes cada para enviar na rede e aguarda resposta do cliente.

Definition at line 90 of file sft_ok.c.

int send_stop ( void   ) 

Manda um send_stop quando finaliza o envio de arquivos.

Definition at line 268 of file sft_ok.c.

int sft_send ( char *  data  ) 

Abre arquivo com o conteudo, coloca no pacote e solicita envio.

Parameters:
data Nome do arquivo a ser lido

Definition at line 131 of file sft_ok.c.

int sft_send_loop ( char *  data  ) 

Chama a funcao sft_send_seq para envio das imagens da biblioteca. Verifica até que o arquivo chegue ao fim eenvia comando de stop, para poder para de enviar arquivos.

Definition at line 371 of file sft_ok.c.

int sft_send_seq ( char *  data  ) 

Biblioteca de arquivos deve conter imagens numeradas na sequencia 1, 2, 3 ... sem estenção.

struct dirent { long d_ino; //número de inodes off_t d_off; // offset para este dirent unsigned short d_reclen; // tamanho de d_name char d_name[NAME_MAX+1]; // nome do arquivo }

Parameters:
data equivale a bibliotecas de imagens a ser enviada.
Returns:
Retorna 0 se ok e -1 se erro.

Definition at line 304 of file sft_ok.c.

int sft_send_x ( char *  data  ) 

Definition at line 507 of file sft_ok.c.

int sft_sendu ( char *  data  ) 

Abre arquivo com o conteudo, coloca no pacote e solicita envio. Esta funcao nao possui controle de envio nem seguranca na transmissao de arquivos.

Parameters:
data Nome do arquivo a ser lido

Definition at line 624 of file sft_ok.c.

int trata_sft (  ) 

Trata o pedido de tarefa feita pelo agente externo.

Returns:
Retorna -1 em erro e 0 se ok.

Definition at line 397 of file sft_ok.c.


Variable Documentation

char buff[TAMMSG]

Definition at line 48 of file sft.c.

char buff[TAMMSG]

Definition at line 47 of file sft_ok.c.

int gif

Definition at line 41 of file sft.c.

int gif

Definition at line 40 of file sft_ok.c.

struct hostent* hp

Definition at line 43 of file sft.c.

struct hostent* hp

Definition at line 38 of file sft_.c.

struct hostent* hp

Definition at line 42 of file sft_ok.c.

int i

Definition at line 41 of file sft.c.

int i

Definition at line 40 of file sft_ok.c.

int id_stc

Definition at line 43 of file sft_ok.c.

int id_stc

Definition at line 44 of file sft.c.

char msg_rec[TAMMSG]

Definition at line 45 of file sft_ok.c.

char msg_rec[TAMMSG]

Definition at line 46 of file sft.c.

char msg_send[TAMMSG]

Definition at line 46 of file sft_ok.c.

char msg_send[TAMMSG]

Definition at line 47 of file sft.c.

int s1

Definition at line 40 of file sft_ok.c.

int s1

Definition at line 41 of file sft.c.

struct sockaddr_in server

Definition at line 41 of file sft_ok.c.

struct sockaddr_in server

Definition at line 37 of file sft_.c.

struct sockaddr_in server

Definition at line 42 of file sft.c.

struct sft_hdr* sft

Definition at line 48 of file sft_ok.c.