MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ConnectCmd

Function ConnectCmd

tools/ngctl/connect.c:60–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58};
59
60static int
61ConnectCmd(int ac, char **av)
62{
63 struct ngm_connect con;
64 const char *path = ".";
65
66 /* Get arguments */
67 switch (ac) {
68 case 5:
69 path = av[1];
70 ac--;
71 av++;
72 /* FALLTHROUGH */
73 case 4:
74 snprintf(con.path, sizeof(con.path), "%s", av[1]);
75 snprintf(con.ourhook, sizeof(con.ourhook), "%s", av[2]);
76 snprintf(con.peerhook, sizeof(con.peerhook), "%s", av[3]);
77 break;
78 default:
79 return (CMDRTN_USAGE);
80 }
81
82 /* Send message */
83 if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE,
84 NGM_CONNECT, &con, sizeof(con)) < 0) {
85 warn("send msg");
86 return (CMDRTN_ERROR);
87 }
88 return (CMDRTN_OK);
89}
90

Callers

nothing calls this directly

Calls 2

snprintfFunction · 0.85
NgSendMsgFunction · 0.85

Tested by

no test coverage detected