Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

header file included

  • Loading branch information...
commit d2128600f711936d8efef59b0f71c669d3c7a883 1 parent c47f70d
Robert A authored
Showing with 43 additions and 1 deletion.
  1. +1 −1  duoit.c
  2. +42 −0 duoit.h
View
2  duoit.c
@@ -884,7 +884,7 @@ int main(int argc, char *argv[]) {
handle_data_connection(i, head);
continue;
}
-
+ //???
printf(" \n");
if ((nbytes = recv(i, buf, sizeof buf, 0)) <= 0) {
// got error or connection closed by client
View
42 duoit.h
@@ -0,0 +1,42 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <time.h>
+
+//self defined
+//#include "helper.h"
+
+#define LISTENIP "127.0.0.1"
+#define CPORT "3021" // the port users will be connecting to
+#define DPORT "3020" // the default port for data transfering
+#define BACKLOG 10 // how many pending connections queue will hold
+#define PATHLENGTH 256 //default pathlength for pwd-command - may be dynamically increased later
+#define IMAGE 1 //type image/binary
+#define ASCII 2 //type ascii
+
+//struct for command and parameter pointers
+typedef struct {
+ char *command;
+ char *params;
+} instruc;
+
+// user struct
+typedef struct usr {
+ int c_socket;
+ int d_socket;
+ char d_address[INET6_ADDRSTRLEN];
+ int d_port;
+ int passv;
+ int type;
+ char *pwd;
+ int pwd_len;
+ struct usr *next;
+} usr;
Please sign in to comment.
Something went wrong with that request. Please try again.