Tiny IP stack, small enough to fit in a "tweet"
sics.se
sics.se
This does not merely lack completeness. This is an entirely different project that has nothing to do with making an IP stack. It does not even do the first thing an IP stack might do.
I do not get to claim my side project making a compact sandwich is a restaurant either. The author is making sandwiches and should be proud of that because a good sandwich is a great thing, the author should not be telling us he has built a restaurant.
Quit being a douche. The author even bolds it just in case you read the article.
short s[70];*l=s;t;main(){for(;;){read(0,s,140);if((s[4]>>8)==1&s[10]==8)s[10]=0,s[11]+=8,t=l[4],l[4]=l[3],l[3]=t,write(1,s,140);}}
I feel so dirty now.
short s[70];*l=s+6;t;main(){for(;;){read(0,s,140);if((s[4]>>8)==1&s[10]==8)s[10]=0,s[11]+=8,t=*l,*l=l[1],l[1]=t,write(1,s,140);}}
And 3 less (if I didn't make a mistake with precedence...): short s[70];*l=s+6;t;main(){for(;;){read(0,s,140);s[4]>>8==1&s[10]==8?s[10]=0,s[11]+=8,t=*l,*l=l[1],l[1]=t,write(1,s,140):0;}}
1 less for t in main declaration: short s[70];*l=s+6;main(t){for(;;){read(0,s,140);s[4]>>8==1&s[10]==8?s[10]=0,s[11]+=8,t=*l,*l=l[1],l[1]=t,write(1,s,140):0;}}
3 less since blocking read returns > 0 (also no reason for braces now) short s[70];*l=s+6;main(t){for(;read(0,s,140);)s[4]>>8==1&s[10]==8?s[10]=0,s[11]+=8,t=*l,*l=l[1],l[1]=t,write(1,s,140):0;} short s[70];*l=s;t;main(){read(0,s,140);s[4]>>8==1&s[10]==8?s[10]=0,s[11]+=8,t=l[4],l[4]=l[3],l[3]=t,write(1,s,140):0;main();}
8 less now, thanks to viraptor: short s[70];*l=s+6;main(t){read(0,s,140);s[4]>>8==1&s[10]==8?s[10]=0,s[11]+=8,t=*l,*l=l[1],l[1]=t,write(1,s,140):0;main();}Also, this program is vulnerable to the classic Ping of Death attack. ;)
Ok, so it is very far away from a real IP stack,
It's sad how often posters here miss the point and jump to semantics as if it matters at all.