MCPcopy Index your code
hub / github.com/F-Stack/f-stack / main

Function main

tools/arp/arp.c:136–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134#define ARP_XO_VERSION "1"
135
136int
137main(int argc, char *argv[])
138{
139 int ch, func = 0;
140 int rtn = 0;
141 int aflag = 0; /* do it for all entries */
142
143 argc = xo_parse_args(argc, argv);
144 if (argc < 0)
145 exit(1);
146
147#ifndef FSTACK
148 while ((ch = getopt(argc, argv, "andfsSi:")) != -1)
149#else
150 ff_ipc_init();
151 while ((ch = getopt(argc, argv, "andfsSi:p:")) != -1)
152#endif
153 switch(ch) {
154 case 'a':
155 aflag = 1;
156 break;
157 case 'd':
158 SETFUNC(F_DELETE);
159 break;
160 case 'n':
161 nflag = 1;
162 break;
163 case 'S':
164 SETFUNC(F_REPLACE);
165 break;
166 case 's':
167 SETFUNC(F_SET);
168 break;
169 case 'f' :
170 SETFUNC(F_FILESET);
171 break;
172 case 'i':
173 rifname = optarg;
174 break;
175#ifdef FSTACK
176 case 'p':
177 ff_set_proc_id(atoi(optarg));
178 break;
179#endif
180 case '?':
181 default:
182 usage();
183 }
184 argc -= optind;
185 argv += optind;
186
187 if (!func)
188 func = F_GET;
189 if (rifname) {
190 if (func != F_GET && !(func == F_DELETE && aflag))
191 xo_errx(1, "-i not applicable to this operation");
192 if (if_nametoindex(rifname) == 0) {
193 if (errno == ENXIO)

Callers

nothing calls this directly

Calls 15

xo_parse_argsFunction · 0.85
ff_ipc_initFunction · 0.85
ff_set_proc_idFunction · 0.85
xo_errxFunction · 0.85
if_nametoindexFunction · 0.85
xo_errFunction · 0.85
xo_set_versionFunction · 0.85
xo_open_containerFunction · 0.85
xo_open_listFunction · 0.85
searchFunction · 0.85
xo_close_listFunction · 0.85
xo_close_containerFunction · 0.85

Tested by

no test coverage detected