Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Enumerations | Functions
pktccops.h File Reference

PacketCable COPS. More...

#include "asterisk/optional_api.h"
Include dependency graph for pktccops.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cops_gate
 

Enumerations

enum  { GATE_SET, GATE_INFO, GATE_SET_HAVE_GATEID, GATE_DEL }
 
enum  {
  GATE_ALLOC_FAILED, GATE_ALLOC_PROGRESS, GATE_ALLOCATED, GATE_CLOSED,
  GATE_CLOSED_ERR, GATE_OPEN, GATE_DELETED, GATE_TIMEOUT
}
 

Functions

struct cops_gateast_pktccops_gate_alloc (int cmd, struct cops_gate *gate, uint32_t mta, uint32_t actcount, float bitrate, uint32_t psize, uint32_t ssip, uint16_t ssport, int(*const got_dq_gi)(struct cops_gate *gate), int(*const gate_remove)(struct cops_gate *gate))
 

Detailed Description

PacketCable COPS.

Author
Attila Domjan attil.nosp@m.a.do.nosp@m.mjan..nosp@m.hu@g.nosp@m.mail..nosp@m.com

Definition in file pktccops.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GATE_SET 
GATE_INFO 
GATE_SET_HAVE_GATEID 
GATE_DEL 

Definition at line 35 of file pktccops.h.

◆ anonymous enum

anonymous enum
Enumerator
GATE_ALLOC_FAILED 
GATE_ALLOC_PROGRESS 
GATE_ALLOCATED 
GATE_CLOSED 
GATE_CLOSED_ERR 
GATE_OPEN 
GATE_DELETED 
GATE_TIMEOUT 

Definition at line 42 of file pktccops.h.

Function Documentation

◆ ast_pktccops_gate_alloc()

struct cops_gate* ast_pktccops_gate_alloc ( int  cmd,
struct cops_gate gate,
uint32_t  mta,
uint32_t  actcount,
float  bitrate,
uint32_t  psize,
uint32_t  ssip,
uint16_t  ssport,
int(*)(struct cops_gate *gate)  got_dq_gi,
int(*)(struct cops_gate *gate)  gate_remove 
)

Definition at line 468 of file res_pktccops.c.

References ast_debug, ast_log, cops_gate_cmd(), cops_trid, cops_gate::gate_remove, GATE_SET_HAVE_GATEID, cops_gate::gateid, cops_gate::got_dq_gi, LOG_WARNING, cops_gate::mta, NULL, and pktcreload.

Referenced by mgcp_alloc_pktcgate(), and mgcp_hangup().

473 {
474  while (pktcreload) {
475  sched_yield();
476  }
477 
478  if (cmd == GATE_SET_HAVE_GATEID && gate) {
479  ast_debug(3, "------- gate modify gateid 0x%x ssip: 0x%x\n", gate->gateid, ssip);
480  /* TODO implement it */
481  ast_log(LOG_WARNING, "Modify GateID not implemented\n");
482  }
483 
484  if ((gate = cops_gate_cmd(cmd, NULL, cops_trid++, mta, actcount, bitrate, psize, ssip, ssport, gate))) {
485  ast_debug(3, "COPS: Allocating gate for mta: 0x%x\n", mta);
486  gate->got_dq_gi = got_dq_gi;
487  gate->gate_remove = gate_remove;
488  return(gate);
489  } else {
490  ast_debug(3, "COPS: Couldn't allocate gate for mta: 0x%x\n", mta);
491  return NULL;
492  }
493 }
#define LOG_WARNING
Definition: logger.h:274
#define NULL
Definition: resample.c:96
static struct cops_gate * cops_gate_cmd(int cmd, struct cops_cmts *cmts, uint16_t trid, uint32_t mta, uint32_t actcount, float bitrate, uint32_t psize, uint32_t ssip, uint16_t ssport, struct cops_gate *gate)
Definition: res_pktccops.c:495
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:452
#define ast_log
Definition: astobj2.c:42
uint32_t gateid
Definition: pktccops.h:55
static int pktcreload
Definition: res_pktccops.c:162
static uint16_t cops_trid
Definition: res_pktccops.c:90
int(* gate_remove)(struct cops_gate *gate)
Definition: pktccops.h:65
int(* got_dq_gi)(struct cops_gate *gate)
Definition: pktccops.h:64