Skip to main content

Posts

Developing Microsoft Lync Client with NTLMv2 security

First of all when I studied MS-SIP I was stuck. I don't get enough help from msdsn which is microsoft own social site for lync client developing.I post three post there and don't get any response.But after huge while with lots of efforts I was able to log in lync server by my own client.Now I will share the particular difficulties with everybody , which I have solved. So that no one stuck in this....I will write here slowly with description. The topics will be.. 1. urn:uuid generation 2. NT key generation 3. LM key generation 4. NT response generation 5. LM response generation 6. NTv2 response generation 7. LMv2 response generation 8. RC4K encryption 9. MD5 encryption 10. HMAC MD5 encryption 11. Base64 encoder/decoder 12. Binary to hexa 13. gssapi-data generation 14. Format of gssapi-data 15. response/signature generation . . . more  Developing of Lync-client is complete .Now when I get the free time I will write the procedure here. The link for Description of these part ...

Basic Priority queue in C

The source code of basic priority queue is given : #include<stdio.h> #include<malloc.h> void insert(); void del(); void display(); struct node     {         int priority;         int info;         struct node *next;     }*start, *q, *temp, *new; typedef struct node *N; int main() {     int ch;     do      {             printf( "\n[1] INSERTION\t[2] DELETION\t[3] DISPLAY [4] EXIT\t:" );             scanf( "%d", &ch );             switch ( ch )                 {               ...

Hadoop Simple Indexer source code with Map reduce

/*  * To change this template, choose Tools | Templates  * and open the template in the editor.  */ package lineindexer; /**  *  * @author masteruser  */ import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.filecache.DistributedCache; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.FileInputFormat; import org.apache.hadoop.mapred.FileOutputFormat; import org.apache.hadoop.mapred.FileSplit; import org.apache.hadoop.mapred.JobClient; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.MapReduceBase; import org.apache.hadoop.mapred.Mapper; import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reducer; import org.apache.had...

SCTP server client Code in C

Client.c #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <netinet/sctp.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <errno.h> #define RECVBUFSIZE     4096 #define PPID            1234 int main() {        int SctpScocket, in, flags;        socklen_t opt_len;        char * szAddress;        int iPort;        char * szMsg;        int iMsgSize;        char a[1024];            struct sockaddr_in servaddr = {0};        struct sctp_status status = {0};    ...

Multithreading in C in Different CPU core

# define _GNU_SOURCE # include <stdio.h> # include <math.h> # include <stdlib.h> # include <pthread.h> # include <stdlib.h> pthread_mutex_t mux = PTHREAD_MUTEX_INITIALIZER; struct p2p{ int st; int en; }; void *primeChk(void* val); int main() {   pthread_t thread1,thread2,thread3,thread4;   struct p2p valu1,valu2,valu3,valu4;   int j,ret1,ret2,ret3,ret4;   cpu_set_t cpuset; // pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);   valu1.st = 1;   valu1.en = 5000;   valu2.st = 5001;   valu2.en = 10000;   valu3.st = 10001;   valu3.en = 15000;   valu4.st = 15001;   valu4.en = 20000;    // initialization    CPU_ZERO(&cpuset);    CPU_SET(0,&cpuset);    pthread_setaffinity_np(thread1, sizeof(cpu_set_t), &cpuset);    ret1 = pthread_create(&thread1,NULL,&primeChk,(void*)&valu1);    //CPU_ZERO(&cpuse...

UDP server client in c

Server #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <stdlib.h> int main() {         int sock;         int addr_len, bytes_read;         char recv_data[1024],send_data[1024];         struct sockaddr_in server_addr , client_addr;         if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {             perror("Socket");             exit(1);         }         server_addr.sin_family = AF_INET;         server_addr.sin...

TCP server client in C

Client Code #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <netdb.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> int main() {         int sock, bytes_recieved;         char send_data[1024],recv_data[1024];         struct hostent *host;         struct sockaddr_in server_addr;         host = gethostbyname("127.0.0.1");         sock = socket(AF_INET, SOCK_STREAM,0);         server_addr.sin_family = AF_INET;         server_addr.sin_port = htons(5000);         server_addr.sin_addr = *((struct in_addr *)host->h_addr);   ...