Index: /vtcross/branches/bhilburn/src/include/vtcross/Makefile.am
===================================================================
--- /vtcross/branches/bhilburn/src/include/vtcross/Makefile.am	(revision 139)
+++ /vtcross/branches/bhilburn/src/include/vtcross/Makefile.am	(revision 142)
@@ -1,1 +1,2 @@
-include_HEADERS = error.h debug.h cbr.h components.h containers.h libvtcross.h common.h config.h
+include_HEADERS = error.h debug.h socket_comm.h cbr.h components.h \
+				  containers.h libvtcross.h common.h config.h
Index: /vtcross/branches/bhilburn/src/include/vtcross/socket_comm.h
===================================================================
--- /vtcross/branches/bhilburn/src/include/vtcross/socket_comm.h	(revision 142)
+++ /vtcross/branches/bhilburn/src/include/vtcross/socket_comm.h	(revision 142)
@@ -0,0 +1,155 @@
+/* Virginia Tech Cognitive Radio Open Source Systems
+ * Virginia Tech, 2009
+ *
+ * LICENSE INFORMATION GOES HERE
+ */
+
+/* DESCRIPTION OF FILE.
+ */
+
+#include <cstdlib>
+#include <cstdio>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <string>
+#include <string.h>
+
+#include "vtcross/common.h"
+#include "vtcross/debug.h"
+#include "vtcross/error.h"
+
+void ReadMessage(int socket,char * buffer) {
+    int i,n;
+
+    n = recv(socket,buffer,256,MSG_PEEK);
+    for(i=0;i<256;i++){
+	    if(strcmp(&buffer[i],"\0") == 0) break;
+    }
+    n = recv(socket,buffer,i+1,0);
+    if (n < 0) 
+         error("ERROR reading from socket");
+    //printf("ReadMessage:%s %d\n",buffer,n);
+}
+
+// setup client socket connection
+int ClientSocket(int argc, char** argv)
+{
+    int sockfd;
+    int portno;
+    struct sockaddr_in serv_addr;
+    struct hostent *server;
+    
+    // server name
+    server = gethostbyname(argv[1]);
+    if (server == NULL) {
+        fprintf(stderr,"ERROR, no such host\n");
+        exit(0);
+    }
+    // port no.
+    portno = atoi(argv[2]);
+    // socket file descriptor
+    sockfd = socket(AF_INET, SOCK_STREAM, 0);
+    if (sockfd < 0) 
+        error("ERROR opening socket");
+    // initiate struct socketaddr_in
+    bzero((char *) &serv_addr, sizeof(serv_addr));
+    serv_addr.sin_family = AF_INET;
+    serv_addr.sin_port = htons(portno);
+    bcopy((char *)server->h_addr, 
+         (char *)&serv_addr.sin_addr.s_addr,
+         server->h_length);
+    // cast sockaddr_in to sockaddr
+    if (connect(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0) 
+        error("ERROR connecting");
+
+    return sockfd;
+}
+
+    
+int SendMessage(int socketfd, char *message) 
+{
+    int n;
+     
+    strcat(message, "\0000");
+    n = send(socketfd,message,(strlen(message)+1),0);
+    if (n<0)
+        error("Error sending to server\n");
+    else if(n == 0)
+        printf("Server closed the socket.\n");
+   
+    return n;
+}
+
+int GetParameter(int sockfd, struct Parameter pList[], struct CE_Info *ce_info)
+{
+    char buffer[256];
+    int i;
+
+    // numParameters
+    bzero(buffer,256);
+    ReadMessage(sockfd,buffer);
+    ce_info->numParameters = atoi(buffer);
+    printf("number of parameters: %d\n", ce_info->numParameters);
+    
+    for (i = 0; i < ce_info->numParameters; i++){
+        bzero(buffer,256);
+        ReadMessage(sockfd,buffer);
+        printf("Name: %s\n", buffer);
+        pList[i].name = std::string(buffer);
+//        strcpy(pList[i].name.c_str(), buffer);
+    
+        bzero(buffer,256);
+        ReadMessage(sockfd,buffer);
+        printf("Units: %s\n", buffer);
+        pList[i].units = std::string(buffer);
+ //       strcpy(pList[i].units.c_str(), buffer);
+
+        bzero(buffer,256);
+        ReadMessage(sockfd,buffer);
+        printf("Min: %s\n", buffer);
+        pList[i].min = atof(buffer);
+    
+        bzero(buffer,256);
+        ReadMessage(sockfd,buffer);
+        printf("Max: %s\n", buffer);
+        pList[i].max = atof(buffer);
+    
+        bzero(buffer,256);
+        ReadMessage(sockfd,buffer);
+        printf("Step: %s\n", buffer);
+        pList[i].step = atof(buffer);
+    
+        bzero(buffer,256);
+        ReadMessage(sockfd,buffer);
+        printf("Value: %s\n", buffer);
+        pList[i].value = atof(buffer);
+    
+    }
+    return 1;
+}
+
+
+int GetRequest(int sockfd, struct Parameter pList[], struct CE_Info *ce_info)
+{
+    char buffer[256];
+   
+    // Get control identifier
+    // Possibly could implement some sort of authentication here
+    bzero(buffer,256);
+    ReadMessage(sockfd,buffer);
+
+    if(strcmp(buffer,"val") != 0) {
+            printf("Policy Engine:: Unexpected control data received.\n\n");
+        return 0;
+    }
+
+    printf("Policy Engine:: Getting parameters.\n\n");
+    // Get potenial transmission parameter values
+    GetParameter(sockfd, pList, ce_info);
+
+    return 1;
+}
+
+
