8th Sem VTU Project For Computer Science On LINUX
8th Sem VTU Project For Computer Science On LINUX
Chapter 1
Introduction
1.1. Aim
Our project enables the system administrator to control and monitor the intra-network setup of
the organization. Lin-Net Tool Kit is an application software that enables the administrator to
control and monitor the intra network setup by the organization, by making use of the various
tools. Our project intends to give the admin complete control over the client systems. Through
this tool, the admin will be able to see the current status, programs running, state of that program
and hardware and software description of client’s terminal. Not only this, the admin will be able
to close any program or even deny a user from using a client system by shutting it off.
1.2. Modules
In this project, we are making use of five modules which itself will describe what we intent to do
in this project. The modules are-
1.3. Basics
The rlogin starts a terminal session on the remote host specified as host. The remote host must be
running a rlogin service (daemon) for rlogin to connect to. Remote login is nothing but to have
an access on the remote machine. Here we refer to a system we initially login to as either the
local system or client system. The system that you initially login to is the remote system or
server system. The code contained within this document was compiled on a Linux PC using
Gnu’s gcc compiler. It should, however, build on just about any platform that uses gcc.
Naturally, this doesn’t apply if you’re programming for Windows.
There are various modules in the system;
The first one is a strict authentication system – consisting of username and password.
The second module gives us the status of the client systems in the network, wherein we can find
which systems are in on/off state, the programs that are currently being run by the client system
etc.
The third module is the data transfer, where client-client or client-server communication takes
place, a simple online chat application is built for transferring the request and service to and fro
the server system.
The fourth module gives the complete hardware description of the client systems such as the
processor, memory and other peripherals that are used in the system.
The Last module provides the advantage of getting online help, ie we can get information about
any unknown lib file by the cached copy present.
The aim of this project is more than one client programs running on different terminals (client)
can get connected to server and hence remotely logging into the server.
1.6. Scope
Logs on to remote computer host connected to the network. User shall provide his name and his
preferred password. Once connection is established and user validation is done, user can access
his/her account on the system. User shall press exit to exit the remote login.
Chapter 2
Literature Survey
Client: It is an Application program that requests for establishing connections for the purpose of
data communication.
User Agent: It is a client that initiates a request. These are often browsers, editors, spiders (web-
traversing robots) or other end user tools. Computer networks are the communication systems for
connecting end systems. The computers in a network use well defined protocols to communicate.
Since the networks are complex, they are organized as a series of layers. Most networks follow
ISO OSI 7- layer model. The various layers are shown in the next page.
The Physical Layer defines the electrical and physical specifications for devices. In particular,
it defines the relationship between a device and a physical medium. This includes the layout
of pins, voltages, cable specifications, hubs, repeaters, network adapters, host bus
adapters (HBAs used in storage area networks) and more.
To understand the function of the Physical Layer, contrast it with the functions of the Data Link
Layer. Think of the Physical Layer as concerned primarily with the interaction of a single device
with a medium, whereas the Data Link Layer is concerned more with the interactions of multiple
devices (i.e., at least two) with a shared medium. Standards such as RS-232 do use physical
wires to control access to the medium.
The major functions and services performed by the Physical Layer are:
Careful analysis of the Network Layer indicated that the Network Layer could have at least 3
sublayers: 1.Subnetwork Access - that considers protocols that deal with the interface to
networks, such as X.25; 2.Subnetwork Dependent Convergence - when it is necessary to bring
the level of a transit network up to the level of networks on either side; 3.Subnetwork
Independent Convergence - which handles transfer across multiple networks. The best example
Dept CSE. EPCET Shashank Page 6
Lin-Net Tool Kit 2009-10
of this latter case is CLNP, or IPv7 ISO 8473. It manages the connectionless transfer of data one
hop at a time, from end system to ingress router, router to router, and from egress router to
destination end system. It is not responsible for reliable delivery to a next hop, but only for the
detection of error packets so they may be discarded. In this scheme, IPv4 and IPv6 would have to
be classed with X.25 as Subnet Access protocols because they carry interface addresses rather
than node addresses.
A number of layer management protocols, a function defined in the Management Annex, ISO
7498/4, belong to the Network Layer. These include routing protocols, multicast group
management, Network Layer information and error, and Network Layer address assignment. It is
the function of the payload that makes these belong to the Network Layer, not the protocol that
carries them.
This model lacks the formalism of the OSI reference model and associated documents, but the
IETF does not use a formal model and does not consider this a limitation, as in the comment
by David D. Clark, "We reject: kings, presidents and voting. We believe in: rough consensus and
running code." Criticisms of this model, which have been made with respect to the OSI
Reference Model, often do not consider ISO's later extensions to that model.
UDP uses a simple transmission model without implicit hand-shaking dialogues for guaranteeing
reliability, ordering, or data integrity. Thus, UDP provides an unreliable service and datagram
may arrive out of order, appear duplicated, or go missing without notice. UDP assumes that error
checking and correction is either not necessary or performed in the application, avoiding the
overhead of such processing at the network interface level. Time-sensitive applications often use
UDP because dropping packets is preferable to waiting for delayed packets, which may not be an
option in a real-time system.[1] If error correction facilities are needed at the network interface
level, an application may use the Transmission Control Protocol (TCP) or Stream Control
Transmission Protocol (SCTP) which are designed for this purpose.
UDP's stateless nature is also useful for servers that answer small queries from huge numbers of
clients. Unlike TCP, UDP is compatible with packet broadcast (sending to all on local network)
and multicasting (send to all subscribers).
Each process that wants to communicate with another process identifies itself to the TCP/IP
protocol suite by one or more ports. A port is a 16-bit number, used by the host-to-host protocol
to identify to which higher-level protocol or application program (process) it must deliver
incoming messages.
As some higher-level programs are themselves protocols, standardized in the TCP/IP protocol
suite, such as TELNET and FTP, they use the same port number in all TCP/IP implementations.
Those "assigned" port numbers are called well-known ports and the standard applications well-
known services.
The "well-known" ports are controlled and assigned by the Internet Assigned Numbers Authority
(IANA) and on most systems can only be used by system processes or by programs executed by
privileged users. The assigned "well-known" ports occupy port numbers in the range 0 to 1023.
The ports with numbers in the range 1024-65535 are not controlled by the IANA and on most
systems can be used by ordinary user-developed programs.
Confusion due to two different applications trying to use the same port numbers on one host is
avoided by writing those applications to request an available port from TCP/IP. Because this port
number is dynamically assigned, it may differ from one invocation of an application to the next.
UDP, TCP and ISO TP-4 all use the same "port principle". To the extent possible, the same port
numbers are used for the same services on top of UDP, TCP and ISO TP-4.
2.5.2. Sockets
A socket is a network communications endpoint. The analogy is to a wire (the network data
connection) being plugged into a socket. Sockets come in two primary flavors. An active
socket is connected to a remote active socket via an open data connection. Closing the
connection destroys the active sockets at each endpoint. A passive socket is not connected, but
rather awaits an incoming connection, which will spawn a new active socket.
A socket is not a port, though there is a close relationship between them. A socket is associated
with a port, though this is a many-to-one relationship. Each port can have a single passive socket,
awaiting incoming connections, and multiple active sockets, each corresponding to an open
connection on the port.
Apart from the fact that it's freely distributed, Linux's functionality, adaptability and robustness,
has made it the main alternative for proprietary Unix and Microsoft operating systems. IBM,
Hewlett-Packard and other giants of the computing world have embraced Linux and support its
ongoing development. Well into its second decade of existence, Linux has been adopted
worldwide primarily as a server platform. Its use as a home and office desktop operating system
is also on the rise. The operating system can also be incorporated directly into microchips in a
process called "embedding" and is increasingly being used this way in appliances and devices.
Throughout most of the 1990's, tech pundits, largely unaware of Linux's potential, dismissed it as
a computer hobbyist project, unsuitable for the general public's computing needs. Through the
efforts of developers of desktop management systems such as KDE and GNOME, office suite
project OpenOffice.org and the Mozilla web browser project, to name only a few, there are now
a wide range of applications that run on Linux and it can be used by anyone regardless of his/her
knowledge of computers. Those curious to see the capabilities of Linux can download a live CD
version called Knoppix . It comes with everything you might need to carry out day-to-day tasks
on the computer and it needs no installation. It will run from a CD in a computer capable of
booting from the CD drive. Those choosing to continue using Linux can find a variety of
versions or "distributions" of Linux that are easy to install, configure and use. Information on
these products is available in our distribution section and can be found by selecting
the mainstream/general public category.
Project's mission is to lead the advancement of free and open source software and content as a
collaborative community.
One of Fedora's main objectives is not only to contain software distributed under a free and open
source license, but also to be on the leading edge of such technologies.[4][5]Fedora developers
prefer to make upstream changes instead of applying fixes specifically for Fedora—this ensures
that their updates are available to all GNU/Linux distributions.
Fedora has a comparatively short life cycle: version X is maintained until one month after
version X+2 is released. With 6 months between releases, the maintenance period is about 13
months for each version.[7]
Linus Torvalds, author of the Linux kernel, says he uses Fedora because it had fairly good
support for PowerPC when he used that processor architecture. He became accustomed to the
operating system and continues to use it (as of 2008).
Red Hat, Inc. (NYSE: RHT) is an S&P 500 company in the free and open source software
sector, and a major Linux distribution vendor. Founded in 1993, Red Hat has its corporate
headquarters in Raleigh, North Carolina with satellite offices worldwide.[5]
Red Hat has become associated to a large extent with its enterprise operating system Red Hat
Enterprise Linux and with the acquisition of open-source enterprise middleware vendor JBoss.
Red Hat provides operating-system platforms along with middleware, applications, and
management products, as well as support, training, and consulting services.
addition to providing the niceties of command resolution, wildcard handling, and piping, Bash
has its own powerful built-in programming language.
A shell script is a program written for Bash. The simplest shell script is a sequence of Linux
commands, but when you add the power of variables and flow control, you can do a lot more
with it. Shell scripts are similar to DOS batch files (those files that end in .bat), but shell scripts
are more powerful and actually easier to create.
Shell scripts are interpreted, which means that the shell reads each line and acts on it
immediately. This process differs from that of a formal programming language like C or C++,
where the program is compiled and optimized for faster execution. So there's a tradeoff--it's
easier to create quick little shell scripts, but if the task at hand requires serious number crunching
or complicated logic, a compiled language is better.
Note: All of the shell script syntax and examples in this section will work in both the Bash and
Korn (pdksh) shells. The C shell (tcsh) has subtle differences in many areas, so scripts written
for one shell may not work in another. If you decide to use the C shell instead of Bash, use
the man tcsh command for more information on writing shell scripts for that environment.
The following example, although extremely simple, provides a useful introduction to creating
and using shell scripts. The script clears the monitor screen of all previous lines and then writes
the text Good morning, world. on it.
All that is necessary to create this script is to open a text editor (but not a word processor), such
as gedit or vi, and type the following three lines exactly as shown on a new, blank page:
#!/bin/bash
clear
echo "Good morning, world."
Alternatively, the above code could be copied from this page and pasted to a blank page opened
by the text editor page using the standard keyboard or mouse copy and paste functions.
After saving this plain text file, with a file name such as morning (or anything else desired), the
script is complete and almost ready to run. Scripts are typically run by typing a dot, a forward
slash and the file name (with no spaces in between) and then pressing the ENTER key. Thus, for
example, if the above script were saved with the name morning, an attempt could be made to
execute it by issuing the following command:
./morning
However, the script probably will not run, in which case an error message will appear on the
screen such as bash: ./morning: Permission denied. This is because the permissions for the file
first have to be set to executable. (By default, the permissions for new files are set
Now the script is ready to run by typing the following, again while in the same directory, and
then pressing the ENTER key:
./morning
Fig: 2.6
2.8.1. Overview
Socket interfaces are accessible at three different levels, most powerfully and fundamentally at
the raw socket level. Very few applications need the degree of control over outgoing
communications that this provides, so raw sockets support was intended to be available only on
computers used for developing Internet-related technologies. In recent years, most operating
systems have implemented support for it anyway, including Fedora and RedHat.
Some of the API used for some of the system call are
Socket()
Bind()
Accept()
Listen()
Connect()
Sendto()
Recvfrom()
Socket API:
domain, which specifies the protocol family of the created socket. For example:
PF_INET for network protocol IPv4 or
PF_INET6 for IPv6.
PF_UNIX for local socket (using a file).
type, one of:
SOCK_STREAM (reliable stream-oriented service or Stream Sockets)
SOCK_DGRAM (datagram service or Datagram Sockets)
SOCK_SEQPACKET (reliable sequenced packet service), or
SOCK_RAW (raw protocols atop the network layer).
protocol specifying the actual transport protocol to use. The most common
are IPPROTO_TCP, IPPROTO_SCTP, IPPROTO_UDP,IPPROTO_DCCP. These protocols
are specified in <netinet/in.h>. The value “0” may be used to select a default protocol from
the selecteddomain and type.
The function returns -1 if an error occurred. Otherwise, it returns an integer representing the
newly-assigned descriptor.
Prototype
int socket(int domain, int type, int protocol);
Bind API:
Listen API:
After a socket has been associated with an address, listen() prepares it for incoming connections.
However, this is only necessary for the stream-oriented (connection-oriented) data modes, i.e.,
for socket types (SOCK_STREAM, SOCK_SEQPACKET). listen() requires two arguments:
Accept API:
When an application is listening for stream-oriented connections from other hosts, it is notified
of such events (cf. select() function) and must initialize the connection using
the accept() function. Accept() creates a new socket for each connection and removes the
connection from the listen queue. It takes the following arguments:
sockfd, the descriptor of the listening socket that has the connection queued.
cliaddr, a pointer to a sockaddr structure to receive the client's address information.
addrlen, a pointer to a socklen_t location that specifies the size of the client address
structure passed to accept(). When accept() returns, this location indicates how many bytes of
the structure were actually used.
The accept() function returns the new socket descriptor for the accepted connection, or -1 if an
error occurs. All further communication with the remote host now occurs via this new socket.
Datagram sockets do not require processing by accept() since the receiver may immediately
respond to the request using the listening socket.
Prototype
int accept(int sockfd, struct sockaddr *cliaddr, socklen_t *addrlen);
Connect API:
connect() returns an integer representing the error code: 0 represents success, while -1 represents
an error.
Prototype
int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen);
Chapter 3
System Analysis
3.1. Overview
The terms analysis and synthesis come from classical Greek where they mean respectively "to
take apart" and "to put together". These terms are used in scientific disciplines from mathematics
and logic to economy and psychology to denote similar investigative procedures. Analysis is
defined as the procedure by which we break down an intellectual or substantial whole into parts
or components. Synthesis is defined as the opposite: to combine separate elements or
components in order to form a coherent whole. Systems analysis researchers apply methodology
to the analysis of the systems involved to form an overall picture.
Fig 3.2:
Requirement Analysis
Our project has a very important role to play in educational institutions, where students
hoodwink the lecturers pretending that they are working but instead utilize the lab resources for
their own amusement. By implementing our code in the all lab systems the lecturer, sitting in the
server can ensure that all students are doing the intended work which they are supposed to do.
Chapter 4
System Design
Systems design is the process or art of defining the architecture, components, modules,
interfaces, and data for a system to satisfy specified requirements. One could see it as the
application of systems theory to product development. There is some overlap with the disciplines
of systems analysis, systems architecture and systems engineering.
4.1. Overview
If the broader topic of product development "blends the perspective of marketing, design, and
manufacturing into a single approach to product development, then design is the act of taking the
marketing information and creating the design of the product to be manufactured. Systems
design is therefore the process of defining and developing a systems to satisfy
specified requirements of the user. Until the 1990s systems design had a crucial and respected
role in the data processing industry. In the 1990s standardization of hardware and software
resulted in the ability to build modular systems. The increasing importance of software running
on generic platforms has enhanced the discipline of software engineering.
Object-oriented analysis and design methods are becoming the most widely used methods for
computer system design. The UML has become the standard language used in Object-oriented
analysis and design. It is widely used for modeling software systems and is increasingly used for
high designing non-software systems and organization.
Physical design, in this context, does not refer to the tangible physical design of an information
system. To use an analogy, a personal computer's physical design involves input via a keyboard,
processing within the CPU, and output via a monitor, printer, etc. It would not concern the actual
layout of the tangible hardware, which for a PC would be a monitor, CPU, motherboard, hard
drive, modems, video/graphics cards, USB slots, etc.
On a DFD, data items flow from an external data source or an internal data store to an internal
data store or an external data sink, via an internal process.
A DFD provides no information about the timing of processes, or about whether processes will
operate in sequence or in parallel. It is therefore quite different from a flowchart, which shows
the flow of control through an algorithm, allowing a reader to determine what operations will be
performed, in what order, and under what circumstances, but not what kinds of data will be input
to and output from the system, nor where the data will come from and go to, nor where the data
will be stored (all of which are shown on a DFD)
Chapter 5
Implementation
The Implementation involves the actual coding for the system based on the design which has
been developed from the requirements specification.
5.2. Coding
5.2.1. Server program
/*server.c */
#include<stdio.h>
#include<errno.h>
#include<fcntl.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<strings.h>
#include<string.h>
#include<arpa/inet.h>
#include<netinet/in.h>
#include<time.h>
#define LISTENQ 1024
for(; ;)
{
confd=accept(lisfd,(struct sockaddr*)NULL,NULL);
printf("connected to client");
check=read(confd,buf,200);
buf[check]='\0';
printf("%d bytes read\n",check);
strcpy(name,buf);
printf("filename:%s\n",name);
if(strcmp(name,"shut")==0)
system("init 0");
else if(strcmp(name,"res")==0)
system("init 6");
else if(strcmp(name,"cfiles")==0)
{
system("find . -name \"*.c\" -print > cfiles.txt");
fd=open("cfiles.txt",O_RDONLY);
printf("transferring files started");
while(n=read(fd,buf,1200))
write(confd,buf,n);
buf[n]='\0';
close(fd);
}
else if(strcmp(name,"txtfiles")==0)
{
system("find . -name \"*.txt\" -print > txtfiles.txt");
fd=open("txtfiles.txt",O_RDONLY);
printf("transferring files started");
while(n=read(fd,buf,1200))
write(confd,buf,n);
buf[n]='\0';
close(fd);
}
else if(strcmp(name,"hidfiles")==0)
{
system("find . -name \".*\" -print > hidfiles.txt");
fd=open("hidfiles.txt",O_RDONLY);
printf("transferring files started");
while(n=read(fd,buf,1200))
write(confd,buf,n);
buf[n]='\0';
close(fd);
}
else if(strcmp(name,"dirfiles")==0)
{
system("find . -name \"*.c\" -print > dirfiles.txt");
fd=open("dirfiles.txt",O_RDONLY);
printf("transferring files started");
while(n=read(fd,buf,1200))
write(confd,buf,n);
buf[n]='\0';
close(fd);
}
else if(strcmp(name,"shfiles")==0)
{
system("find . -name \"*.sh\" -print > shfiles.txt");
fd=open("shfiles.txt",O_RDONLY);
printf("transferring files started");
while(n=read(fd,buf,1200))
write(confd,buf,n);
buf[n]='\0';
close(fd);
}
else if(strcmp(name,"cra")==0)
{
system("ps -e | sed -n '/bash/,/ps/p' > cra.txt");
//system("sh mem $name");
fd=open("cra.txt",O_RDONLY);
printf("transfering file started\n");
while(n=read(fd,buf,1200))
write(confd,buf,n);
printf("file transfered successfully\n");
buf[n]='\0';
close(fd);
}
else if(strcmp(name,"warn")==0)
{
system("dialog --infobox \" NOT TO OPEN UNNECESSARY PROGRAMS \" 15 45");
}
close(confd);
}
}
/* chatserver.c */
#include "sock.h"
int main(void)
{
server_address.sin_addr.s_addr = inet_addr("127.0.0.1");
server_address.sin_port = 9734;
server_len = sizeof(server_address);
bind(server_sockfd, (struct sockaddr*)&server_address, server_len);
listen(server_sockfd, 5);
while(1)
{ struct val value,value1; system("sh smsg");
client_len = sizeof(client_address);
if(flag == 0)
{
system("Interface/Out Connection Established");
sleep(5);
system("clear");
flag = 1;
}
fp=fopen("tem1","w");
ln=strlen(server);
fwrite("\n",1,1,fp);
fwrite(server,ln,1,fp);
fwrite(" ",1,1,fp);
fwrite("Received from:",14,1,fp);
fwrite(value.name,strlen(value.name),1,fp);
fwrite("\n",1,1,fp);fwrite(value.tmp,strlen(value.tmp)-1,1,fp);
fclose(fp);
system("sh sview");
//fflush(stdin);
//printf("Send : ");
system("sh ssend");
fp=fopen("tem2","r");
while(!feof(fp))
{
fscanf(fp,"%c",&ptr);
value.tmp[c++]=ptr[0];
}
fclose(fp);
value.tmp[c]='\0';
if(value.tmp[0]<1)
exit(0);
write(client_sockfd, &value, sizeof(struct val))-1; strcpy(value.tmp,"");
close(client_sockfd);
c = 0;
}
}
/*client.c */
#include<stdio.h>
#include<errno.h>
#include<fcntl.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<arpa/inet.h>
#include<netinet/in.h>
#include<signal.h>
#include<strings.h>
#include<string.h>
#include<stdlib.h>
#define LISTENQ 1024
if(inet_pton(AF_INET,argv[1],&serveraddr.sin_addr)<=0)
perror("init pton error");
if (connect(sockfd,(struct sockaddr *)&serveraddr,sizeof(serveraddr))<0)
perror("\n connect error");
char file[256];
write(sockfd,argv[2],strlen(argv[2]));
/*while((n=read(sockfd,buf,120))<=0);
printf("\n initial bytes:%d\n",n);
buf[n]='\0';
printf("buf=%s",buf);*/
while(n=read(sockfd,buf,1200))
{
buf[n]='\0';
printf("%s",buf);
}
printf("buffer =%s",buf);
sprintf(cmd,"%s%s%s%s%s",cmd1,cmd3,buf,cmd3,cmd2);
printf("COMMAND=%s\n",cmd);
printf("*************************\n");
system(cmd);
printf("******************************************\n");
system("dialog --textbox temp 20 55");
system("dialog --inputbox \"Enter the pid to terminate\" 20 45 2>term.txt");
system("kill `cat term.txt`");
if(n<0)
printf("server sleping");
exit(0);
}
/* chatclient.c */
#include"sock.h"
int main(void)
{
int sockfd, len, i;
struct sockaddr_in address;
int result, len1, c = 0,ln;
struct val value,value1;
char ch, client[20],ptr[0];
FILE *fp;
system("clear");
system("rm -f temp2");
fp=fopen("temp2","w");
fclose(fp);
fp=fopen("try","w");
fclose(fp);
system("sh In Enter Your user Name: 2>try");
fp=fopen("try","r");
fscanf(fp,"%s",client);
len=strlen(client);
client[len]='\0';
system("clear");
fclose(fp);
while(1)
{
Dept CSE. EPCET Shashank Page 35
Lin-Net Tool Kit 2009-10
system("sh msg");
fp=fopen("temp1","r");
//fflush(stdin);
c=0;
while(!feof(fp))
{
fscanf(fp,"%c",&ptr);
value.tmp[c++]=ptr[0];
}
fclose(fp);
value.tmp[c]='\0';
strcpy(value.name,client);
if(value.tmp[0]<1)
exit(0);
sockfd = socket(AF_INET, SOCK_STREAM, 0);
address.sin_family = AF_INET;
// address.sin_addr.s_addr = inet_addr("192.168.0.36");
address.sin_addr.s_addr = inet_addr("127.0.0.1");
address.sin_port = 9734;
len = sizeof(address);
result = connect(sockfd, (struct sockaddr*)&address, len);
if(result == -1)
{
perror("client2");
exit(1);
}
//fprintf(fp,"%c",value1.tmp[c++]);
//fprintf(fp,"%c",value1.tmp[c]);
fclose(fp);
system("sh view");
c=0;
//value1.tmp[0]='\0';
strcpy(value.tmp,"");
}
close(sockfd);
exit(0);
}
#include<stdlib.h>
main()
{
int k;
k=system("sh loginscr.sh");
system("sh main.sh");
getchar();
system("sh ping1.sh");
}
/* main.sh */
/* chatmen.sh */
/*chatmenu.sh */
name="`cat stry`"
tt="Welcome to ONLINE chatting .......................`date`"
dialog --backtitle "$tt"\
--title "Chatt now"\
--inputbox "Reply from $name" 10 35 2>tem2
/*chatscreen.sh */
/* framechoice.sh */
x=`cat $1`
echo "x=$x"
sleep 2
dialog --menu "Select your choice" 25 55 10 "1" "List C files" "2" "List Text files " "3" "List
Shell Files" "4" "List all hidden files" "5" "List all directories" "6" "Main Menu" 2>file.txt
f="`cat file.txt`"
echo "you have selected option $f"
case $f in
1) ./cracli $x "cfiles" ;;
2) ./cracli $x "txtfiles" ;;
3) ./cracli $x "shfiles" ;;
4) ./cracli $x "hidfiles" ;;
5) ./cracli $x "dirfiles" ;;
6) echo $x > ip1 ;
sh mainmenu.sh ip1 ;;
esac
echo"iam here with x=$x"
echo $x > ip
sh fr.sh ip
/* mainmenu.sh */
*/ ping.sh */
rm -f pout.txt
rm -f ipadr
for i in `cat ping.txt`
do
ping -c 1 $i
if [ $? = 0 ] ;then
echo $i >> pout.txt
fi
done
dialog --backtitle "Active Systems on LAN `date `" \
--title "IP Addresses" \
--textbox pout.txt 20 45
dialog --inputbox "Enter the IP Address of client " 15 30 2>ipadr
ping -c 1 `cat ipadr`
if [ $? -eq 0 ] ; then
sh mainmenu.sh ipadr
else
dialog --msgbox "Invalid IP Address " 10 40
fi
/* loginauthenticate.sh */
y=`cat tmpass`
if [ $y = "sarvoshashi" ] ; then
dialog --infobox "AUTHENTICATED" 6 30
exit 1
fi
fi
dialog --infobox "INVALID USER" 6 25
sleep 1
#ifndef _SOCK_H_
#define _SOCK_H_
#include <stdio.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<signal.h>
struct val
{
char tmp[99];
char name[30];
};
#endif
Chapter 6
Testing
Software testing is critical element of software quality assurance and represents ultimate review
of specification, design and coding. Test case design focuses on a set of technique for the
creation of test cases that meet overall testing objectives. Planning and testing of a
programming system involve formulating a set of test cases, which are similar to the real data
that the system is intended to manipulate. Test castes consist of input specifications, a
description of the system functions exercised by the input and a statement of the extended
output. Through testing involves producing cases to ensure that the program responds, as
expected, to both valid and invalid inputs, that the program perform to specification and that it
does not corrupt other programs or data in the system.
In principle, testing of a program must be extensive. Every statement in the program should be
exercised and every possible path combination through the program should be executed at least
once. Thus, it is necessary to select a subset of the possible test cases and conjecture that this
subset will adequately test the program.
It involves the testing of the order in which the different modules are combined to produce the
functioning whole. Integration testing generally throws light on the order of arrangement of
units, modules, systems, subsystems and the entire product.
The proposed system, “ the client server architecture “ inherits a bottom-up integration
strategy in which all the subsystem and the modules involved in it are independently tested and
integrated to from the entire system, which is then tested as a whole.
For the testing of this system it was required that the software be tested for performing its basic
functions that are as follows: -
Dept CSE. EPCET Shashank Page 41
Lin-Net Tool Kit 2009-10
Start the server first and then client, then there is no error. Start the server and client, and then
stop the server and a send a message from client. The error is no server connection. Start client
first, then the error is client is not connected to the server.
Validation testing is used to validate the correct user name and password and card number and
pin number and if person gives the invalid username and password, at that time the card
validation does not execute.
It is sometimes said that validation can be expressed by the query "Are you building the right
thing?" and verification by "Are you building it right?" "Building the right thing" refers back to
the user's needs, while "building it right" checks that the specifications be correctly implemented
by the system. In some contexts, it is required to have written requirements for both as well as
formal procedures or protocols for determining compliance.
Performance testing determines the amount of execution time spent in various parts of the unit,
program throughput, response time and device utilization by the program unit.
The tests were carried out in order to verify that the encryption and the decryption needs for the
below stated algorithm is met to the full extent.
Performance testing can refer to the assessment of the performance of a human examinee. For
example, a behind-the-wheel driving test is a performance test of whether a person is able to
perform the functions of a competent driver of an automobile.
Fig: 6.1
Testing Process
6.5 Screenshots
The first being the authentication, we need to provide the correct user name and password.
After authentication there’s a small screen showing the names of the developers in this case is
the names of the team members along with the name of the team guide.
Fig 6.5: dialog box prompting to enter the IP address of the client.
Chapter 7
Conclusion and Future Enhancements
It was an interesting experience to build an application that can be used in our college labs to
counter our mischief’s. The experience gave us tremendous confidence in facing the industry
also.
We are happy to say that our project i.e LIN-NET-TOOLKIT is successfully completed. As
specified in the beginning of the report we develop four modules they are
These modules were developed with great care using technical support like shell programming.
The application provides you the facility to user authentication and the server get the client status
and send the necessary information and it also provides the chatting between server and the
clients.
This module is functioning properly once the application is launched first it authenticates the
users. The server gets the clients information and chat with clients and send the necessary
information.
Future Enhancement
As an extension to this project we would like to build an application that would run on one
different type of OS like one running in Windows and one running in LINUX and some way
connect them to the network to communicate. Also we can add some additional features like one
mentioned below
2. We develop a module to display the things going on in the client system’s monitor.
BIBLIOGRAPHY