Ignore:
Timestamp:
01/06/06 15:18:02 (13 years ago)
Author:
spascoe
Message:

Implemented full client-server handshake. A version message is now
exchanged client->server then server->client. These messages are logged
in debug mode. Message passing is implemented in Python on the server (at the
moment this is only implemented within test/test_embedded.py).

Location:
TI05-delivery/trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/trunk/src/Makefile

    r1065 r1077  
    11# 
    2 # Top level makefile for the DeliveryService source code. 
     2# Makefile for building bbftp client & server stand alone (without Python API) 
     3# 
    34 
    45PREFIX=$(HOME)/opt/bbftp 
     6# Grab the DeliveryService version from the parent directory. 
     7VERSION:=$(shell cat ../VERSION) 
     8 
     9DEFS="-DNDG_AUTH -DLOCAL_SYSLOG_FACILITY -DNDG_DELIVERY_VERSION=$(VERSION)" 
    510CONFIG_OPTS=--prefix=$(PREFIX) --without-gzip --without-rfio --enable-authentication=private \ 
    6                 CPPFLAGS="-DNDG_AUTH -DLOCAL_SYSLOG_FACILITY" 
     11                CFLAGS=$(DEFS) 
    712 
    813BBFTPD=bbftp-server-3.2.0/bbftpd 
  • TI05-delivery/trunk/src/bbftp-client-3.2.0/bbftpc/bbftp_private_user.c

    r802 r1077  
    3030 
    3131#include <bbftp_private_user.h> 
     32#include <client.h> 
    3233 
    3334/* 
     
    3940*/ 
    4041extern char *privatestr ; 
     42 
     43extern int debug; 
     44 
     45/* From bbftp_util.c */ 
     46void printmessage(FILE *strm , int flag, int errcode, int tok, char *fmt, ...); 
     47 
    4148 
    4249/******************************************************************************* 
     
    118125int bbftp_private_auth(char *logmessage)  
    119126{ 
     127  char msg[NDG_MESSAGE_LEN]; 
     128 
    120129  /* Send version verification message.  */ 
    121   if (bbftp_private_send(NDG_FTP_PROTOCOL, NDG_MESSAGE_LEN, logmessage) == -1) { 
     130  sprintf(msg, "%.*s", NDG_MESSAGE_LEN - 1, NDG_HANDSHAKE); 
     131  if (bbftp_private_send(msg, NDG_MESSAGE_LEN, logmessage) == -1) { 
    122132    return -1; 
     133  } 
     134 
     135  /* Receive response */ 
     136  if (bbftp_private_recv(msg, NDG_MESSAGE_LEN, logmessage) == -1) { 
     137    return -1; 
     138  } 
     139 
     140  if (debug) { 
     141    printmessage(stdout,CASE_NORMAL,0,0,"Received Auth handshake: %s\n", msg) ; 
    123142  } 
    124143 
  • TI05-delivery/trunk/src/bbftp-client-3.2.0/includes/bbftp_private_user.h

    r806 r1077  
    4343 */ 
    4444 
    45 #define NDG_FTP_VERSION "v0.0.1" 
    46 #define NDG_FTP_PROTOCOL ("NDG-bbFTP" NDG_FTP_VERSION) 
     45// Define this in the makefile 
     46// #define NDG_DELIVERY_VERSION "v0.0.1" 
     47#define NDG_STR(s) #s 
     48#define NDG_XSTR(s) NDG_STR(s) 
     49#define NDG_HANDSHAKE ("NDG-Delivery-client " NDG_XSTR(NDG_DELIVERY_VERSION)) 
    4750 
    4851#define NDG_MESSAGE_LEN 256 
     
    5255*/ 
    5356#define NDG_MAX_LOGMESSAGE 1024 
     57 
  • TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_private_user.c

    r1075 r1077  
    3737#include <bbftpd_private_user.h> 
    3838 
     39#ifdef NDG_PYTHON_EMBED 
     40#include <Python.h> 
     41#endif 
     42 
    3943extern char currentusername[MAXLEN] ; 
    4044 
     
    112116 
    113117  char msg[NDG_MESSAGE_LEN]; 
    114   /* Send version verification message.  */ 
     118  /* Receive version verification message.  */ 
    115119  if (bbftpd_private_recv(msg, NDG_MESSAGE_LEN, logmessage) == -1) { 
    116120    return -1; 
     
    118122  else { 
    119123    syslog(LOG_DEBUG, "Received auth message: %s", msg); 
     124  } 
     125 
     126  /* Send response */ 
     127  sprintf(msg, "%.*s", NDG_MESSAGE_LEN - 1, NDG_HANDSHAKE); 
     128  if (bbftpd_private_send(msg, NDG_MESSAGE_LEN, logmessage) == -1) { 
     129    return -1; 
    120130  } 
    121131 
  • TI05-delivery/trunk/src/bbftp-server-3.2.0/includes/bbftp_private_user.h

    r773 r1077  
    3838 
    3939**/ 
     40 
     41#ifdef NDG_AUTH 
     42#define NDG_STR(s) #s 
     43#define NDG_XSTR(s) NDG_STR(s) 
     44#define NDG_HANDSHAKE ("NDG-Delivery-server " NDG_XSTR(NDG_DELIVERY_VERSION)) 
     45#endif 
  • TI05-delivery/trunk/src/bbftp-server-3.2.0/includes/bbftpd_private_user.h

    r1064 r1077  
    2828*****************************************************************************/ 
    2929 
    30 #include <Python.h> 
    31  
    3230/* 
    3331** This include must contain all global variable to be used for private 
     
    4947#define NDG_MAX_LOGMESSAGE 1024 
    5048#define NDG_MESSAGE_LEN 256 
     49 
     50#define NDG_STR(s) #s 
     51#define NDG_XSTR(s) NDG_STR(s) 
     52#define NDG_HANDSHAKE ("NDG-Delivery-server " NDG_XSTR(NDG_DELIVERY_VERSION)) 
Note: See TracChangeset for help on using the changeset viewer.