TFTP Nedir ?

Trivial File Transfer Protocol (TFTP) 1980 yılında tanımlanmış, FTP’ nin temel fonksiyonel şekli olarak ifade edilen basit bir dosya transfer protokolüdür.

Basit yapısından dolayı kullanılması esnasında çok az bellek tüketilmektedir. Bu özelliğinden dolayı, yeterli yığın bellek cihazı (mass storage device) olmayan yönlendirici (router) bilgisayarların önyüklemesinde kullanılırdı. Halen ağ üzerinde bulunan host makinalar arasında küçük dosyaların transferi için kullanılır. TFTP kısmen PUP protokol grubunun eski bir parçası olan EFTP protokolüne dayanır. TCP/IP protokol grubunun geliştirilmesinin ilk safhalarında TFTP basitliğinden dolayı genellikle yeni bir host tipinin üstünde çalıştırılan ilk protokoldü.

TCPCRYPT

Tcpcrypt is a protocol that attempts to encrypt (almost) all of your network traffic. Unlike other security mechanisms, Tcpcrypt works out of the box: it requires no configuration, no changes to applications, and your network connections will continue to work even if the remote end does not support Tcpcrypt, in which case connections will gracefully fall back to standard clear-text TCP.

Tcpcrypt supports Linux, Mac OS X, Windows, and FreeBSD.

For more information, see tcpcrypt.org.

C++ Standard Predefined Macros

Standard Predefined Macros

The standard predefined macros are specified by the relevant language standards, so they are available with all compilers that implement those standards. Older compilers may not provide all of them. Their names all start with double underscores.

__FILE__
This macro expands to the name of the current input file, in the form of a C string constant. This is the path by which the preprocessor opened the file, not the short name specified in ‘#include’ or as the input file name argument. For example, “/usr/local/include/myheader.h” is a possible expansion of this macro.
__LINE__
This macro expands to the current input line number, in the form of a decimal integer constant. While we call it a predefined macro, it’s a pretty strange macro, since its “definition” changes with each new line of source code.
__FILE__ and __LINE__ are useful in generating an error message to report an inconsistency detected by the program; the message can state the source line at which the inconsistency was detected. For example,

fprintf (stderr, “Internal error: ”
“negative string length ”
“%d at %s, line %d.”,
length, __FILE__, __LINE__);
An ‘#include’ directive changes the expansions of __FILE__ and __LINE__ to correspond to the included file. At the end of that file, when processing resumes on the input file that contained the ‘#include’ directive, the expansions of __FILE__ and __LINE__ revert to the values they had before the ‘#include’ (but __LINE__ is then incremented by one as processing moves to the line after the ‘#include’).

A ‘#line’ directive changes __LINE__, and may change __FILE__ as well. See Line Control.

C99 introduces __func__, and GCC has provided __FUNCTION__ for a long time. Both of these are strings containing the name of the current function (there are slight semantic differences; see the GCC manual). Neither of them is a macro; the preprocessor does not know the name of the current function. They tend to be useful in conjunction with __FILE__ and __LINE__, though.

__DATE__
This macro expands to a string constant that describes the date on which the preprocessor is being run. The string constant contains eleven characters and looks like “Feb 12 1996”. If the day of the month is less than 10, it is padded with a space on the left.
If GCC cannot determine the current date, it will emit a warning message (once per compilation) and __DATE__ will expand to “??? ?? ????”.

__TIME__
This macro expands to a string constant that describes the time at which the preprocessor is being run. The string constant contains eight characters and looks like “23:59:01”.
If GCC cannot determine the current time, it will emit a warning message (once per compilation) and __TIME__ will expand to “??:??:??”.

__STDC__
In normal operation, this macro expands to the constant 1, to signify that this compiler conforms to ISO Standard C. If GNU CPP is used with a compiler other than GCC, this is not necessarily true; however, the preprocessor always conforms to the standard unless the -traditional-cpp option is used.
This macro is not defined if the -traditional-cpp option is used.

On some hosts, the system compiler uses a different convention, where __STDC__ is normally 0, but is 1 if the user specifies strict conformance to the C Standard. CPP follows the host convention when processing system header files, but when processing user files __STDC__ is always 1. This has been reported to cause problems; for instance, some versions of Solaris provide X Windows headers that expect __STDC__ to be either undefined or 1. See Invocation.

__STDC_VERSION__
This macro expands to the C Standard’s version number, a long integer constant of the form yyyymmL where yyyy and mm are the year and month of the Standard version. This signifies which version of the C Standard the compiler conforms to. Like __STDC__, this is not necessarily accurate for the entire implementation, unless GNU CPP is being used with GCC.
The value 199409L signifies the 1989 C standard as amended in 1994, which is the current default; the value 199901L signifies the 1999 revision of the C standard. Support for the 1999 revision is not yet complete.

This macro is not defined if the -traditional-cpp option is used, nor when compiling C++ or Objective-C.

__STDC_HOSTED__
This macro is defined, with value 1, if the compiler’s target is a hosted environment. A hosted environment has the complete facilities of the standard C library available.
__cplusplus
This macro is defined when the C++ compiler is in use. You can use __cplusplus to test whether a header is compiled by a C compiler or a C++ compiler. This macro is similar to __STDC_VERSION__, in that it expands to a version number. Depending on the language standard selected, the value of the macro is 199711L for the 1998 C++ standard, 201103L for the 2011 C++ standard, 201402L for the 2014 C++ standard, or an unspecified value strictly larger than 201402L for the experimental languages enabled by -std=c++1z and -std=gnu++1z.
__OBJC__
This macro is defined, with value 1, when the Objective-C compiler is in use. You can use __OBJC__ to test whether a header is compiled by a C compiler or an Objective-C compiler.
__ASSEMBLER__
This macro is defined with value 1 when preprocessing assembly language.

C++ ‘da __DATE__ ne demektir ?

This macro expands to a string constant that describes the date on which the preprocessor is being run. The string constant contains eleven characters and looks like “Feb 12 1996”. If the day of the month is less than 10, it is padded with a space on the left.

If GCC cannot determine the current date, it will emit a warning message (once per compilation) and __DATE__ will expand to “??? ?? ????”.

C String ‘i Ondalıklı Sayıya Çevirmek

Standart C kütüphanesinden double atof(const char *str) ile bir metini ondalıklı sayıya çevirebiliriz.

#include
#include
#include

int main()
{
float val;
char str[20];

strcpy(str, “98993489”);
val = atof(str);
printf(“String value = %s, Float value = %f\n”, str, val);

strcpy(str, “tutorialspoint.com”);
val = atof(str);
printf(“String value = %s, Float value = %f\n”, str, val);

return(0);
}

C library function – strcat()

strcat iki string ‘i bitişik olarak ekler.

#include
#include

int main ()
{
char src[50], dest[50];

strcpy(src, “This is source”);
strcpy(dest, “This is destination”);

strcat(dest, src);

printf(“Final destination string : |%s|”, dest);

return(0);
}

C Dili Öğreniyorum

Understanding the C Language Skeleton
Most coding starts with a C language structure. This skeleton includes the basic bones upon which most programs are written. Use this simple skeleton to get started:

#include
int main()
{
return(0);
}
Traditionally, the program begins with preprocessor directives plus prototypes. The #include statements bring in header files, such as stdio.h, the standard input/output header file.

The primary function in all C code is main(), which is the first function that’s run when the program starts. The main() function is an int function, so it must return an integer value. All the function’s statements are enclosed in curly brackets, or braces.

C Language Keywords
The C language keywords represent the core of the language. With the C11 revision to the language, several new keywords have been added. They’re shown with leading underscores in the following table:

_Alignas break float signed
_Alignof case for sizeof
_Atomic char goto static
_Bool const if struct
_Complex continue inline switch
_Generic default int typedef
_Imaginary do long union
_Noreturn double register unsigned
_Static_assert else restrict void
_Thread_local enum return volatile
auto extern short while
Keep the following points in mind as you start programming in C:

Do not name any function or variable the same as a keyword.

You use only a few of the C language keywords in your code. Some of them, you’ll probably never use.

Most of the work in your code is done by functions, not by keywords.

C Language Variable Types
Rather than make all your variables floats, it’s more efficient to examine the type of data that’s stored and then choose an appropriate C variable type.

Type Value Range
_Bool 0 to 1
char –28 to 127
unsigned char 0 to255
short int –32,768 to 32,767
unsigned short int 0 to 65,535
int –2,147,483,648 to 2,147,483,647
unsigned int 0 to 4,294,967,295
long int –2,147,483,648 to 2,147,483,647
unsigned long int 0 to 4,294,967,295
float 1.17×10–38 to 3.40×1038
double 2.22×10–308 to 1.79×10308
Keep these C language variable type points in mind:

Ensure that you choose the proper variable type for the values you need to store.

The _Bool type stores only two values, 0 and 1, which can represent TRUE or FALSE or On or Off or any binary condition.

The char variable type stores character values, though it can also be used to store tiny integers.

Integers, or whole numbers, are stored in the int variable types.

Any type of value, from the very large to the very small, and any fractional values are stored in the float and double types.

Remember to use int values for functions that generate integers, such as getchar(). It’s easy to assume that the function returns a char value because of the function’s name.

C lacks a string variable type. Instead, an array of char variables is used.

Other variable types include structures and pointers.

Common C Escape Sequences
When you cannot type characters into your string, use the escape sequences to insert nonprintable characters into text strings, char variables, and arrays. Here are common C escape sequences:

Characters What It Represents or Displays
\a Bell (“beep!”)
\b Backspace, non-erasing
\f Form feed or clear the screen
\n Newline
\r Carriage return
\t Tab
\v Vertical tab
\\ Backslash character
\? Question mark
\’ Single quote
\” Double quote
\xnn Hexadecimal character code nn
\onn Octal character code nn
\nn Octal character code nn
Using escape sequences is the secret way to embed characters you cannot type into a string, or to test for those characters in a conditional statement or for regular input. Even printable characters can be coded by using an escape sequence. The \x hexadecimal and \nn sequences can represent any ASCII character.

Common C Conversion Characters
The printf() and scanf() functions use conversion characters as placeholders for various values. Conversion characters are used to indicate a value when the function runs in the final program.

Conversion Character What It Displays
%% The percent character (%)
%c A single character (char)
%d Integer value (short, int)
%e Floating-point value in scientific notation using a little E (float, double)
%E Floating-point value in scientific notation using a big E (float, double)
%f Floating-point value in decimal notation (float, double)
%g Substitutes %f or %e, whichever is shorter (float, double)
%G Substitutes %f or %E, whichever is shorter (float, double)
%i Integer value (short, int)
%ld Long integer value (long int)
%o Unsigned octal value, no leading zero
%p Memory location in hexadecimal (*pointer)
%s String (char *)
%u Unsigned integer (unsigned short, unsigned int, unsigned long)
%x Unsigned hexadecimal value, lower case (short, int, long)
%X Unsigned hexadecimal value, capital letters (short, int long)
The Order of Precedence in C
The order of precedence determines which operators act upon a value first. When crafting statements, know the order of precedence to ensure that the program does what you intend.

Operator(s) Category Description
! Unary Logical not; associativity goes right to left
++ — Unary Increment, decrement, read from right to left
* / % Math Multiplication, division, modulo
+ – Math Addition, subtraction
<< >> Binary Shift left, shift right
< > <= >= Comparison Less than, greater than, less than or equal to, greater than or equal to
== != Comparison Is equal to, not equal to
& Binary And
^ Binary Exclusive or (XOR)
| Binary Or
&& Logical And
|| Logical Or
?: Comparison Weird if thing; associativity goes right to left
= Assignment Variable assignment operator, including the +=, *=, and all assignment operators
, (None) The comma separates items in a for statement; precedence from left to right
The order of precedence can be overridden by using parentheses. Simply enclose within a set of parentheses the part of the equation that you want executed first. That part is executed first no matter what the priority is.

C ‘de String Fonksiyonları

S.no
String functions
Description
1 strcat ( )  Concatenates str2 at the end of str1.
2 strncat ( )  appends a portion of string to another
3 strcpy ( )  Copies str2 into str1
4 strncpy ( )  copies given number of characters of one string to another
5 strlen ( )  gives the length of str1.
6 strcmp ( )  Returns 0 if str1 is same as str2. Returns <0 if strl < str2. Returns >0 if str1 > str2.
7 strcmpi_(.)  Same as strcmp() function. But, this function negotiates case.  “A” and “a” are treated as same.
8 strchr ( )  Returns pointer to first occurrence of char in str1.
9 strrchr ( )  last occurrence of given character in a string is found
10 strstr ( )  Returns pointer to first occurrence of str2 in str1.
11 strrstr ( )  Returns pointer to last occurrence of str2 in str1.
12 strdup ( )  duplicates the string
13 strlwr ( )  converts string to lowercase
14 strupr ( )  converts string to uppercase
15 strrev ( )  reverses the given string
16 strset ( )  sets all character in a string to given character
17 strnset ( )  It sets the portion of characters in a string to given character
18 strtok ( )  tokenizing given string using delimiter