Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****************************************************************************
- ringneckparrot (c)
- License: http://creativecommons.org/licenses/by-nc-sa/3.0/
- Contact Me:
- Email: ringneckparrot@hotmail.com
- Facebook: http://www.facebook.com/ringneckparrot
- Twitter ID: pp4rr0t
- SecurityTube: http://www.securitytube.net/user/ringneckparrot
- ****************************************************************************/
- #include <stdio.h>
- #include <stdlib.h>
- #include <errno.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <strings.h>
- #define ErrorValue -1
- main()
- {
- int sock;
- int bind_sock;
- struct sockaddr_in bindsock;
- sock = socket(AF_INET, SOCK_STREAM, 0);
- if ( sock == ErrorValue)
- {
- perror("Socket Error: ");
- exit(-1);
- }
- bzero(&bindsock, sizeof(bindsock));
- bindsock.sin_family = AF_INET;
- bindsock.sin_addr.s_addr = INADDR_ANY;
- bindsock.sin_port = htons(1234);
- bind_sock = bind(sock, (struct sockaddr *)&bindsock, sizeof(bindsock));
- if ( bind_sock == ErrorValue)
- {
- perror("Bind Error: ");
- exit(-1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement