Development of a unix peer-to-peer file transfer application

Assignment Help C/C++ Programming
Reference no: EM131491009

Assignment Phase

Background

This assignment aims to assess your C programming skills and forms the second phase of the development of a UNIX peer-to-peer file transfer application. The second phase of the assignment will build on from phase 1 to add network communications through sockets and the ability to handle multiple peers connecting simultaneously and will require asynchronous programming techniques.

You will be expected to submit not only the source code to your program but also a complete design for your program. The design can use pseudocode, flowcharts, functional decomposition, or another form of design and will be assessed on usefulness, correctness and coverage.

Objectives

Design and develop a program that does the following:

Loads and uses a configuration file, called settings.conf;

-set (at minimum) the following internal variables

  • Username
  • Port
  • IP address
  • Logfile filename

-If the configuration file doesn't exist, your program should create one with default values and log the event.

-If the configuration file is not readable, your program should continue with default settings and log an appropriate message.

-Any line beginning with a '#' character should be ignored as a comment.

Loads and uses a "sharing list" file that contains a list of records containing the following data:

  • Filename of the file to be shared
  • Full path of the file to be shared
  • Sharing permissions for the file (Either shared with all or shared with individual users)
  • If the sharing list file itself does not exist, it should be created.
  • When the program starts it should check that each listed file exists and is readable. If it does not exist or is not readable, the file should be removed from the sharing list file.

Maintains a sharing list and allows the user to add or remove files (with appropriate sharing permissions) to/from the sharing list

  • Add/remove individual file
  • Add/remove all files within a directory

Loads and uses a "friends list" file that contains a list of known peer records containing the following data:

  • IP address/hostname
  • Port
  • Username
  • If the friends list file itself does not exist, it should be created

Maintains a friends list and allows the user to add or remove friends to/from the friends list

Allows the user to connect to a peer in the friends list and receive a listing of files shared by that peer (those that the user has permission to access)

Allows the user to request a file to be downloaded from that peer.

  • Downloaded files should be saved in a "downloads" folder.

Allows multiple peers to connect and download files simultaneously from a single peer

If the SIGQUIT (3) or SIGTERM (15) signals are received, your program should:

  • Signal any children still active to terminate (if appropriate): If the children do not respond in a timely manner, your program should KILL (9) them
  • Log an appropriate message to the log file
  • Close all open files

If the SIGHUP (1) signal is received (you will have to trap this signal) then

  • Record the request in the log file
  • open your programs configuration file
  • read in the configuration file
  • reset your programs parameters based on the configuration you read in
  • open your log file
  • record the final status of the SIGHUP process
  • All current socket connections will need to be migrated over to any new network settings

Contains a logging facility that logs at leastthe following information to a file:

  • Program started (on IP:port)
  • Program exited
  • Sharing list created
  • Friend list created
  • File added to sharing list
  • File removed from sharing list
  • Friend added to friends list
  • Friend removed from friends list
  • Peer connected
  • Peer disconnected
  • File upload
  • File download

The logger should run asa separate process and allow asynchronous requests to log information.

GNU Make should be used to build the application from source and your makefile should contain at least "make" and "make clean" build targets.

Functions should be loosely coupled and highly cohesive wherever possible.Your program source should be well structured and make use of multiple .c files and appropriate header files with clear separation of concerns.

Your submission should include, at minimum, the following files:

files.cand files.h

This should contain your main() program and code associated with your programs main logic such as reading and loading your configuration, maintaining file lists, taking input for instructions.

io.cand io.h

This should contain your code to do with input and output in general. This will be mainly File and screen i/o for phase one.

logger.cand logger.h

This should contain all your code associated with logging.

networking.cand networking.h

This should contain all your code associated with establishing connections to peers or sending data over a network.

settings.conf

makefile

So you think you're done:

Does your program compile and run?

Is your program in multiple files and is then linked together? Using #include to copy .c files into your main program file is NOT appropriate!

Does your program load and use a friends list save file?

Can you edit the friends list? (Add/remove/view file and user entries)

Does your program deal with bad input?

Can a peer select a file from your sharing list and download it?

Can multiple instances of your program download files from you simultaneously?

Can you select a file from a peer's sharing list and download it?

Do you use fgets(), fputs() and/or fprintf() and avoid scanf() and printf()?

Does your program create a logfile if one doesn't exist?

Does your logger actually record the required events in the logfile?

Does your logger run in a separate process?

Do you handle the SIGQUIT, SIGTERM and SIGHUP signals?

Does each of your functions do only one thing?

Need it as per the guidelines.

Attachment:- Assignment File.rar

Reference no: EM131491009

Questions Cloud

Calculate core return of net operating assets : Analyzing a Change in Core Operating Profitability (Easy) The following numbers were calculated from the financial statements for a firm for 2012 and 2011.
Economic break-even point : he BowGus Archery Company management estimates that its new Galactically Flexible Bow project will have to generate EBIT of $20,000 each year to be viable.
Describe how apple achieved business success : Assignment: Management Information System- Explain how Apple achieved business success through the use of information, information technology, and people.
Fixed costs or the variable cost per unit increase : How much can either the fixed costs or the variable cost per unit increase before the company has a negative EBIT.
Development of a unix peer-to-peer file transfer application : This assignment aims to assess your C programming skills and forms the second phase of the development of a UNIX peer-to-peer file transfer application
What is the molar mass : 2.00 moles of a gas occupies 62.2 L at a par- ticular temperature and pressure. Its density is 0.900 g/L. What is the molar mass?
Analyze a change in return on common equity : Analyzing a Change in Return on Common Equity (Easy) The following numbers were calculated from the financial statements for a firm for 2012 and 2011.
First half of the nineteenth century : Explain how and why was democracy expanded and/or restricted in the first half of the nineteenth century.
Protestant reformations so aggressively : Why did the Western Christian Church choose to combat the protestant reformations so aggressively? (Around 150 words)

Reviews

len1491009

5/10/2017 6:24:30 AM

These are some of the things we will be looking for when we mark your assignment. These are testing guidelines and do not entail all of the testing you will need to do to ensure you meet all of the assignment requirements. You should look to make your program as robust as possible. You will be expected to submit not only the source code to your program but also a complete design for your program. The design can use pseudocode, flowcharts, functional decomposition, or another form of design and will be assessed on usefulness, correctness and coverage.

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd