View | Details | Raw Unified | Return to bug 271508 | Differences between
and this patch

Collapse All | Expand All

(-)src/link.h (+2 lines)
Lines 180-185 Link Here
180
  extern void	LinkDown(Link l);
180
  extern void	LinkDown(Link l);
181
  extern void	LinkOpen(Link l);
181
  extern void	LinkOpen(Link l);
182
  extern void	LinkClose(Link l);
182
  extern void	LinkClose(Link l);
183
  extern void	LinkOpenAdm(Link l);
184
  extern void	LinkCloseAdm(Link l);
183
  extern int	LinkOpenCmd(Context ctx);
185
  extern int	LinkOpenCmd(Context ctx);
184
  extern int	LinkCloseCmd(Context ctx);
186
  extern int	LinkCloseCmd(Context ctx);
185
187
(-)src/link.c (-3 / +25 lines)
Lines 198-203 LinksShutdown(void) Link Here
198
}
198
}
199
199
200
/*
200
/*
201
 * LinkOpenAdm()
202
 */
203
204
void
205
LinkOpenAdm(Link l)
206
{
207
    l->admin_state = LINK_ADMINSTATE_OPERATIONAL;
208
    RecordLinkUpDownReason(NULL, l, 1, STR_MANUALLY, NULL);
209
    LinkOpen(l);
210
}
211
212
/*
201
 * LinkOpenCmd()
213
 * LinkOpenCmd()
202
 */
214
 */
203
215
Lines 206-215 LinkOpenCmd(Context ctx) Link Here
206
{
218
{
207
    if (ctx->lnk->tmpl)
219
    if (ctx->lnk->tmpl)
208
	Error("impossible to open template");
220
	Error("impossible to open template");
209
    ctx->lnk->admin_state = LINK_ADMINSTATE_OPERATIONAL;
221
    LinkOpenAdm(ctx->lnk);
210
    RecordLinkUpDownReason(NULL, ctx->lnk, 1, STR_MANUALLY, NULL);
211
    LinkOpen(ctx->lnk);
212
    return (0);
222
    return (0);
223
}
224
225
/*
226
 * LinkCloseAdm()
227
 */
228
229
void
230
LinkCloseAdm(Link l)
231
{
232
    l->admin_state = LINK_ADMINSTATE_DOWN;
233
    RecordLinkUpDownReason(NULL, l, 0, STR_MANUALLY, NULL);
234
    LinkClose(l);
213
}
235
}
214
236
215
/*
237
/*
(-)src/main.c (-4 / +2 lines)
Lines 563-575 OpenCloseSignal(int sig) Link Here
563
	if (sig == SIGUSR1) {
563
	if (sig == SIGUSR1) {
564
	    Log(LG_ALWAYS, ("[%s] rec'd signal %s, opening",
564
	    Log(LG_ALWAYS, ("[%s] rec'd signal %s, opening",
565
    		l->name, sys_signame[sig]));
565
    		l->name, sys_signame[sig]));
566
	    RecordLinkUpDownReason(NULL, l, 1, STR_MANUALLY, NULL);
566
	    LinkOpenAdm(l);
567
	    LinkOpen(l);
568
	} else {
567
	} else {
569
	    Log(LG_ALWAYS, ("[%s] rec'd signal %s, closing",
568
	    Log(LG_ALWAYS, ("[%s] rec'd signal %s, closing",
570
    		l->name, sys_signame[sig]));
569
    		l->name, sys_signame[sig]));
571
	    RecordLinkUpDownReason(NULL, l, 0, STR_MANUALLY, NULL);
570
	    LinkCloseAdm(l);
572
	    LinkClose(l);
573
	}
571
	}
574
    } else
572
    } else
575
	Log(LG_ALWAYS, ("rec'd signal %s, ignored", sys_signame[sig]));
573
	Log(LG_ALWAYS, ("rec'd signal %s, ignored", sys_signame[sig]));

Return to bug 271508