File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / freevrrpd / test.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Jun 14 12:01:53 2017 UTC (6 years, 11 months ago) by misho
Branches: freevrrpd, MAIN
CVS tags: v1_1, HEAD
freevrrpd 1.1

    1: #include <stdio.h>
    2: #include <stdlib.h>
    3: #include <netgraph.h>
    4: 
    5: int main(int argc, char **argv) {
    6: 	struct ngm_connect ngc;
    7: 	int ngs;
    8: 	int csp, dsp;
    9: 	char path[256];
   10: 	
   11: 	ngs = NgMkSockNode("prout", &csp, &dsp);
   12: 	snprintf(path, sizeof(path), "fv_vrid1_eiface:");
   13: 	snprintf(ngc.path, sizeof(ngc.path), "em0bridge:");
   14: 	snprintf(ngc.ourhook, sizeof(ngc.ourhook), "ether");
   15: 	snprintf(ngc.peerhook, sizeof(ngc.peerhook), "link2");
   16: 	if (NgSendMsg(csp, path, NGM_GENERIC_COOKIE, NGM_CONNECT, &ngc, sizeof(ngc)) < 0)
   17: 		perror("NgSendMsg");
   18: 
   19: 	return 0;
   20: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>