MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / gprsList

Function gprsList

GPRS/GPRSCLI.cpp:64–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62//}
63
64static CLIStatus gprsList(int argc, char **argv, int argi, ostream&os)
65{
66 bool xflag=0, aflag=0, listms=0, listtbf=0, listch=0;
67 int options = 0;
68 int id = -1;
69 while (argi < argc) {
70 if (strmatch(argv[argi],"ch")) { listch = 1; argi++; continue; }
71 if (strmatch(argv[argi],"tbf")) { listtbf = 1; argi++; continue; }
72 if (strmatch(argv[argi],"ms")) { listms = 1; argi++; continue; }
73 if (strmatch(argv[argi],"-v")) { options |= printVerbose; argi++; continue; }
74 if (strmatch(argv[argi],"-c")) { options |= printCaps; argi++; continue; }
75 if (strmatch(argv[argi],"-x")) { xflag = 1; argi++; continue; }
76 if (strmatch(argv[argi],"-a")) { aflag = 1; argi++; continue; }
77 if (isdigit(argv[argi][0])) {
78 if (id >= 0) goto oops; // already found a number
79 id = atoi(argv[argi]);
80 argi++;
81 continue;
82 }
83 oops:
84 os << "oops! unrecognized arg:" << argv[argi] << "\n";
85 return SUCCESS;
86 }
87
88 bool all = !(listch|listtbf|listms);
89
90 if (all|listms) {
91 MSInfo *ms;
92 for (RListIterator<MSInfo*> itr(xflag ? gL2MAC.macExpiredMSs : gL2MAC.macMSs); itr.next(ms); ) {
93 if (id>=0 && (int)ms->msDebugId != id) continue;
94 if (aflag || ! ms->msDeprecated) { ms->msDump(os,(PrintOptions)options); }
95 }
96 }
97 if (all|listtbf) {
98 TBF *tbf;
99 //RN_MAC_FOR_ALL_TBF(tbf) { os << tbf->tbfDump(verbose); }
100 for (RListIterator<TBF*> itr(xflag ? gL2MAC.macExpiredTBFs : gL2MAC.macTBFs); itr.next(tbf); ) {
101 // If the id matches a MS, print the TBFs associated with that MS.
102 if (id>=0 && (int)tbf->mtDebugId != id && (int)tbf->mtMS->msDebugId != id) continue;
103 os << tbf->tbfDump(options&printVerbose) << endl;
104 }
105 }
106 if (all|listch) {
107 printChans(options&printVerbose,os);
108 }
109 return SUCCESS;
110}
111
112static CLIStatus gprsFree(int argc, char **argv, int argi, ostream&os)
113{

Callers

nothing calls this directly

Calls 4

printChansFunction · 0.85
msDumpMethod · 0.80
tbfDumpMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected